Enable random writes for storage texel buffers
authorRicardo Garcia <rgarcia@igalia.com>
Fri, 27 Nov 2020 09:55:04 +0000 (10:55 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 3 Dec 2020 08:17:13 +0000 (03:17 -0500)
In the descriptor set random tests, enable random writes when the
descriptor type is a storage texel buffer.

In addition, this commit fixes a problem with storage image barriers.

Affected tests with random writes:
dEQP-VK.binding_model.descriptorset_random.*outimgtexlow*
dEQP-VK.binding_model.descriptorset_random.*lowimgsingletex*
dEQP-VK.binding_model.descriptorset_random.*storageimghigh*

Affected tests:
dEQP-VK.binding_model.descriptorset_random.*

VK-GL-CTS issue: 1973
Components: Vulkan

Change-Id: I5a407ebc239cca48cee56c5901f45bd4118b3c3b

external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorSetRandomTests.cpp

index f51c575..bf0e4e5 100644 (file)
@@ -397,12 +397,16 @@ deInt32 randRange(deRandom *rnd, deInt32 min, deInt32 max)
 
 void chooseWritesRandomly(vk::VkDescriptorType type, RandomLayout& randomLayout, deRandom& rnd, deUint32 set, deUint32 binding, deUint32 count)
 {
+       // Make sure the type supports writes.
        switch (type)
        {
+       case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+       case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
        case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
-               // Disable writes for these descriptor types.
-               return;
+       case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+               break;
        default:
+               DE_ASSERT(false);
                break;
        }
 
@@ -1777,7 +1781,7 @@ tcu::TestStatus DescriptorSetRandomTestInstance::iterate (void)
 
                                        vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &preStorageImageBarrier);
                                        vk.cmdClearColorImage(*cmdBuffer, img, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &clearValue, 1, &clearRange);
-                                       vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, m_data.allShaderStages, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postStorageImageBarrier);
+                                       vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, m_data.allPipelineStages, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postStorageImageBarrier);
 
                                        ++storageImgIndex;
                                }