summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-07-06 11:55:39 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-07-07 20:35:05 +0200
commit471e4fcb226c4523efe93b1bdaf0db026495da94 (patch)
treebb963937b2446eb32d7632568433083a386f2c68 /src/gui/rhi
parent7f400522c39f6a1abf083dc1af49ea3109635cc8 (diff)
Use QList instead of QVector in gui implementation
Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r--src/gui/rhi/qrhi.cpp6
-rw-r--r--src/gui/rhi/qrhid3d11.cpp2
-rw-r--r--src/gui/rhi/qrhigles2.cpp4
-rw-r--r--src/gui/rhi/qrhinull.cpp2
-rw-r--r--src/gui/rhi/qrhiprofiler.cpp2
-rw-r--r--src/gui/rhi/qrhivulkan.cpp16
-rw-r--r--src/gui/rhi/qshader.cpp2
-rw-r--r--src/gui/rhi/qshaderdescription.cpp14
8 files changed, 24 insertions, 24 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index 1ad275e768..c5fac634be 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -1632,7 +1632,7 @@ QRhiTextureUploadEntry::QRhiTextureUploadEntry(int layer, int level,
\badcode
QImage faces[6];
...
- QVector<QRhiTextureUploadEntry> entries;
+ QList<QRhiTextureUploadEntry> entries;
for (int i = 0; i < 6; ++i)
entries.append(QRhiTextureUploadEntry(i, 0, faces[i]));
QRhiTextureUploadDescription desc(entries);
@@ -3337,7 +3337,7 @@ QDebug operator<<(QDebug dbg, const QRhiShaderResourceBindings &srb)
*/
/*!
- \fn void QRhiGraphicsPipeline::setTargetBlends(const QVector<TargetBlend> &blends)
+ \fn void QRhiGraphicsPipeline::setTargetBlends(const QList<TargetBlend> &blends)
Sets the blend specification for color attachments. Each element in \a
blends corresponds to a color attachment of the render target.
@@ -5850,7 +5850,7 @@ QRhi::FrameOpResult QRhi::finish()
with some others the (physical) device properties indicate what is
supported at run time.
*/
-QVector<int> QRhi::supportedSampleCounts() const
+QList<int> QRhi::supportedSampleCounts() const
{
return d->supportedSampleCounts();
}
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 7015ca664e..0ebd190ca6 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -395,7 +395,7 @@ void QRhiD3D11::reportLiveObjects(ID3D11Device *device)
}
}
-QVector<int> QRhiD3D11::supportedSampleCounts() const
+QList<int> QRhiD3D11::supportedSampleCounts() const
{
return { 1, 2, 4, 8 };
}
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
index db131c12b0..fc339878e7 100644
--- a/src/gui/rhi/qrhigles2.cpp
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -594,7 +594,7 @@ void QRhiGles2::executeDeferredReleases()
}
}
-QVector<int> QRhiGles2::supportedSampleCounts() const
+QList<int> QRhiGles2::supportedSampleCounts() const
{
if (supportedSampleCountList.isEmpty()) {
// 1, 2, 4, 8, ...
@@ -3294,7 +3294,7 @@ static inline GLenum toGlShaderType(QRhiShaderStage::Type type)
QByteArray QRhiGles2::shaderSource(const QRhiShaderStage &shaderStage, int *glslVersion)
{
const QShader bakedShader = shaderStage.shader();
- QVector<int> versionsToTry;
+ QList<int> versionsToTry;
QByteArray source;
if (caps.gles) {
if (caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 2)) {
diff --git a/src/gui/rhi/qrhinull.cpp b/src/gui/rhi/qrhinull.cpp
index a541ecee28..a81f885d5a 100644
--- a/src/gui/rhi/qrhinull.cpp
+++ b/src/gui/rhi/qrhinull.cpp
@@ -83,7 +83,7 @@ void QRhiNull::destroy()
{
}
-QVector<int> QRhiNull::supportedSampleCounts() const
+QList<int> QRhiNull::supportedSampleCounts() const
{
return { 1 };
}
diff --git a/src/gui/rhi/qrhiprofiler.cpp b/src/gui/rhi/qrhiprofiler.cpp
index 1521c0f36e..d2fbc6158b 100644
--- a/src/gui/rhi/qrhiprofiler.cpp
+++ b/src/gui/rhi/qrhiprofiler.cpp
@@ -489,7 +489,7 @@ void QRhiProfilerPrivate::releaseSwapChain(QRhiSwapChain *sc)
}
template<typename T>
-void calcTiming(QVector<T> *vec, T *minDelta, T *maxDelta, float *avgDelta)
+void calcTiming(QList<T> *vec, T *minDelta, T *maxDelta, float *avgDelta)
{
if (vec->isEmpty())
return;
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 32515ea31a..4bf859a716 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -376,7 +376,7 @@ bool QRhiVulkan::create(QRhi::Flags flags)
f = inst->functions();
- QVector<VkQueueFamilyProperties> queueFamilyProps;
+ QList<VkQueueFamilyProperties> queueFamilyProps;
auto queryQueueFamilyProps = [this, &queueFamilyProps] {
uint32_t queueCount = 0;
f->vkGetPhysicalDeviceQueueFamilyProperties(physDev, &queueCount, nullptr);
@@ -492,7 +492,7 @@ bool QRhiVulkan::create(QRhi::Flags flags)
queueInfo[0].queueCount = 1;
queueInfo[0].pQueuePriorities = prio;
- QVector<const char *> devLayers;
+ QList<const char *> devLayers;
if (inst->layers().contains("VK_LAYER_LUNARG_standard_validation"))
devLayers.append("VK_LAYER_LUNARG_standard_validation");
@@ -500,14 +500,14 @@ bool QRhiVulkan::create(QRhi::Flags flags)
uint32_t devExtCount = 0;
f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &devExtCount, nullptr);
if (devExtCount) {
- QVector<VkExtensionProperties> extProps(devExtCount);
+ QList<VkExtensionProperties> extProps(devExtCount);
f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &devExtCount, extProps.data());
for (const VkExtensionProperties &p : qAsConst(extProps))
devExts.append({ p.extensionName, p.specVersion });
}
qCDebug(QRHI_LOG_INFO, "%d device extensions available", int(devExts.count()));
- QVector<const char *> requestedDevExts;
+ QList<const char *> requestedDevExts;
requestedDevExts.append("VK_KHR_swapchain");
debugMarkersAvailable = false;
@@ -3101,7 +3101,7 @@ void QRhiVulkan::enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdat
for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
- const QVector<QRhiTextureSubresourceUploadDescription> &srd(u.subresDesc[layer][level]);
+ const QList<QRhiTextureSubresourceUploadDescription> &srd(u.subresDesc[layer][level]);
if (srd.isEmpty())
continue;
for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(srd)) {
@@ -3581,13 +3581,13 @@ static struct {
{ VK_SAMPLE_COUNT_64_BIT, 64 }
};
-QVector<int> QRhiVulkan::supportedSampleCounts() const
+QList<int> QRhiVulkan::supportedSampleCounts() const
{
const VkPhysicalDeviceLimits *limits = &physDevProperties.limits;
VkSampleCountFlags color = limits->framebufferColorSampleCounts;
VkSampleCountFlags depth = limits->framebufferDepthSampleCounts;
VkSampleCountFlags stencil = limits->framebufferStencilSampleCounts;
- QVector<int> result;
+ QList<int> result;
for (const auto &qvk_sampleCount : qvk_sampleCounts) {
if ((color & qvk_sampleCount.mask)
@@ -6711,7 +6711,7 @@ bool QVkSwapChain::ensureSurface()
quint32 formatCount = 0;
rhiD->vkGetPhysicalDeviceSurfaceFormatsKHR(rhiD->physDev, surface, &formatCount, nullptr);
- QVector<VkSurfaceFormatKHR> formats(formatCount);
+ QList<VkSurfaceFormatKHR> formats(formatCount);
if (formatCount)
rhiD->vkGetPhysicalDeviceSurfaceFormatsKHR(rhiD->physDev, surface, &formatCount, formats.data());
diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp
index 2c1b333259..fc72985b76 100644
--- a/src/gui/rhi/qshader.cpp
+++ b/src/gui/rhi/qshader.cpp
@@ -304,7 +304,7 @@ void QShader::setDescription(const QShaderDescription &desc)
/*!
\return the list of available shader versions
*/
-QVector<QShaderKey> QShader::availableShaders() const
+QList<QShaderKey> QShader::availableShaders() const
{
return d->shaders.keys().toVector();
}
diff --git a/src/gui/rhi/qshaderdescription.cpp b/src/gui/rhi/qshaderdescription.cpp
index 23772f4765..c159a25340 100644
--- a/src/gui/rhi/qshaderdescription.cpp
+++ b/src/gui/rhi/qshaderdescription.cpp
@@ -417,7 +417,7 @@ QShaderDescription QShaderDescription::deserialize(QDataStream *stream, int vers
called attributes) for the vertex stage, and inputs for other stages
(sometimes called varyings).
*/
-QVector<QShaderDescription::InOutVariable> QShaderDescription::inputVariables() const
+QList<QShaderDescription::InOutVariable> QShaderDescription::inputVariables() const
{
return d->inVars;
}
@@ -425,7 +425,7 @@ QVector<QShaderDescription::InOutVariable> QShaderDescription::inputVariables()
/*!
\return the list of output variables.
*/
-QVector<QShaderDescription::InOutVariable> QShaderDescription::outputVariables() const
+QList<QShaderDescription::InOutVariable> QShaderDescription::outputVariables() const
{
return d->outVars;
}
@@ -433,7 +433,7 @@ QVector<QShaderDescription::InOutVariable> QShaderDescription::outputVariables()
/*!
\return the list of uniform blocks.
*/
-QVector<QShaderDescription::UniformBlock> QShaderDescription::uniformBlocks() const
+QList<QShaderDescription::UniformBlock> QShaderDescription::uniformBlocks() const
{
return d->uniformBlocks;
}
@@ -445,7 +445,7 @@ QVector<QShaderDescription::UniformBlock> QShaderDescription::uniformBlocks() co
in combination with the Qt Rendering Hardware Interface since that
currently has no support for them.
*/
-QVector<QShaderDescription::PushConstantBlock> QShaderDescription::pushConstantBlocks() const
+QList<QShaderDescription::PushConstantBlock> QShaderDescription::pushConstantBlocks() const
{
return d->pushConstantBlocks;
}
@@ -516,7 +516,7 @@ QVector<QShaderDescription::PushConstantBlock> QShaderDescription::pushConstantB
\note SSBOs are not available with some graphics APIs, such as, OpenGL 2.x or
OpenGL ES older than 3.1.
*/
-QVector<QShaderDescription::StorageBlock> QShaderDescription::storageBlocks() const
+QList<QShaderDescription::StorageBlock> QShaderDescription::storageBlocks() const
{
return d->storageBlocks;
}
@@ -543,7 +543,7 @@ QVector<QShaderDescription::StorageBlock> QShaderDescription::storageBlocks() co
exist everywhere. For instance, a HLSL version will likely just use a
Texture2D and SamplerState object with registers t1 and s1, respectively.
*/
-QVector<QShaderDescription::InOutVariable> QShaderDescription::combinedImageSamplers() const
+QList<QShaderDescription::InOutVariable> QShaderDescription::combinedImageSamplers() const
{
return d->combinedImageSamplers;
}
@@ -570,7 +570,7 @@ QVector<QShaderDescription::InOutVariable> QShaderDescription::combinedImageSamp
\note Separate image objects are not compatible with some graphics APIs,
such as, OpenGL 2.x or OpenGL ES older than 3.1.
*/
-QVector<QShaderDescription::InOutVariable> QShaderDescription::storageImages() const
+QList<QShaderDescription::InOutVariable> QShaderDescription::storageImages() const
{
return d->storageImages;
}