diff options
author | Nanley Chery <nanley.g.chery@intel.com> | 2016-07-12 16:14:34 -0700 |
---|---|---|
committer | Nanley Chery <nanley.g.chery@intel.com> | 2016-07-15 14:54:29 -0700 |
commit | 8c83a76dee80abf48487e7ee48a8949c0659a1a4 (patch) | |
tree | 9b5926d9ae6bc99f71595fe42626cbbe33b4918e | |
parent | 609b58b01c8f8df45a1d7b1cbb3842d809f036f1 (diff) |
func.desc.dynamic: Fix the subtests
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@intel.com>
-rw-r--r-- | src/tests/func/desc/dynamic.c | 24 |
1 files 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, |