Fix number of pipelines/framebuffers/renderpasses created in dynamic offset tests
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Fri, 3 Apr 2020 08:10:29 +0000 (10:10 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 16 Apr 2020 12:18:42 +0000 (08:18 -0400)
Tests need a pipeline/framebuffer/renderpass per command buffer to be
executed. For the single command buffer case, we were creating an extra
one that is unused.

However, it will produce crashes if we ever add tests with more than
two command buffers, as it is using the command buffer index to get
the respective pipeline/framebuffer/renderpass element to bind.

Components: Vulkan
VK-GL-CTS issue: 2293

Affected tests:

  dEQP-VK.pipeline.dynamic_offset.*

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Change-Id: Ie1b2fb80f4fdff56c9e7879c9b1382f61c4ee622

external/vulkancts/modules/vulkan/pipeline/vktPipelineDynamicOffsetTests.cpp

index 1de0fa5..4151bf7 100644 (file)
@@ -242,7 +242,7 @@ void DynamicOffsetGraphicsTestInstance::init (void)
        }
 
        // Create render passes
-       for (deUint32 renderPassIdx = 0; renderPassIdx < 2; renderPassIdx++)
+       for (deUint32 renderPassIdx = 0; renderPassIdx < m_params.numCmdBuffers; renderPassIdx++)
        {
                // The first pass clears the output image, and the second one draws on top of the first pass.
                const VkAttachmentLoadOp                loadOps[]                               =
@@ -307,7 +307,7 @@ void DynamicOffsetGraphicsTestInstance::init (void)
        }
 
        // Create framebuffers
-       for (deUint32 framebufferIdx = 0; framebufferIdx < 2; framebufferIdx++)
+       for (deUint32 framebufferIdx = 0; framebufferIdx < m_params.numCmdBuffers; framebufferIdx++)
        {
                const VkImageView                               attachmentBindInfos[]   =
                {
@@ -523,7 +523,7 @@ void DynamicOffsetGraphicsTestInstance::init (void)
        }
 
        // Create pipelines
-       for (deUint32 pipelineIdx = 0; pipelineIdx < 2; pipelineIdx++)
+       for (deUint32 pipelineIdx = 0; pipelineIdx < m_params.numCmdBuffers; pipelineIdx++)
        {
                const VkVertexInputBindingDescription           vertexInputBindingDescription           =
                {