[Piglit] [PATCH 7/8] cru/func.desc.dynamic: Fix the subtests

Nanley Chery nanleychery at gmail.com
Wed Jul 13 19:58:15 UTC 2016


The uniform buffer test is fixed by updating the right DescriptorSet binding.

The storage test failed, at least, because of the following bugs:
 * It assigned uint array indices float color values
 * It provided 1 dynamic offset instead of 3
 * It did not specify the dynamic variant of
   VkDescriptorSetLayoutBinding::descriptorType

This patch removes these bugs by simply making the storage buffer test
parallel to that of the uniform buffer test.

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
 src/tests/func/desc/dynamic.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/src/tests/func/desc/dynamic.c b/src/tests/func/desc/dynamic.c
index 238eb8f..d44fc70 100644
--- a/src/tests/func/desc/dynamic.c
+++ b/src/tests/func/desc/dynamic.c
@@ -50,18 +50,15 @@ create_pipeline(VkDevice device,
     } else {
         vs = qoCreateShaderModuleGLSL(t_device, VERTEX,
             layout(location = 0) in vec4 a_position;
-            layout(std140, set = 0, binding = 0) uniform block2 {
-                uint i;
-            } u1;
-            layout(std140, set = 0, binding = 1) buffer block1 {
+            layout(std140, set = 0, binding = 0) buffer block1 {
                 vec4 color;
                 vec4 offset;
-            } s1[2];
+            } s1;
             layout(location = 0) flat out vec4 v_color;
             void main()
             {
-                gl_Position = a_position + s1[u1.i].offset;
-                v_color = s1[u1.i].color;
+                gl_Position = a_position + s1.offset;
+                v_color = s1.color;
             });
     }
 
@@ -148,19 +145,12 @@ test(void)
     const struct params *params = t_user_data;
 
     VkDescriptorSetLayout set_layout = qoCreateDescriptorSetLayout(t_device,
-            .bindingCount = 2,
+            .bindingCount = 1,
             .pBindings = (VkDescriptorSetLayoutBinding[]) {
                 {
                     .binding = 0,
-                    .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
-                    .descriptorCount = 1,
-                    .stageFlags = VK_SHADER_STAGE_VERTEX_BIT,
-                    .pImmutableSamplers = NULL,
-                },
-                {
-                    .binding = 1,
                     .descriptorType = params->descriptor_type,
-                    .descriptorCount = 2,
+                    .descriptorCount = 1,
                     .stageFlags = VK_SHADER_STAGE_VERTEX_BIT,
                     .pImmutableSamplers = NULL,
                 },
@@ -218,7 +208,7 @@ test(void)
             {
                 .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
                 .dstSet = set,
-                .dstBinding = 1,
+                .dstBinding = 0,
                 .dstArrayElement = 0,
                 .descriptorCount = 1,
                 .descriptorType = params->descriptor_type,
-- 
2.9.0



More information about the Piglit mailing list