summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2021-01-28 08:39:21 +0200
committerTapani Pälli <tapani.palli@intel.com>2021-01-28 13:28:43 +0200
commitbda78247abeb2352bf201194c8805d33d8ba928c (patch)
tree2a2e5b26c5fca1bdee1d6bb8f66486e8bb83f2c7
parent7c9e9c9f895e8ad7f3bdca210214203c143a6aad (diff)
ext_external_objects: fix validation error on vertex binding descriptions
This fixes validation error VUID-vkCmdDraw-None-04007 thrown when running tests with validation layer. Error is thrown because pipeline is setup with a binding description but vkCmdBindVertexBuffers is not called. Fix is to skip setting up binding description when vbo is not being used by the test. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Eleni Maria Stea <estea@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/464>
-rw-r--r--tests/spec/ext_external_objects/vk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/spec/ext_external_objects/vk.c b/tests/spec/ext_external_objects/vk.c
index 5124387e4..3694f7774 100644
--- a/tests/spec/ext_external_objects/vk.c
+++ b/tests/spec/ext_external_objects/vk.c
@@ -539,12 +539,15 @@ create_pipeline(struct vk_ctx *ctx,
vert_bind_dsc[0].stride = stride;
vert_bind_dsc[0].inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
+ /* If using vbo, we have setup vertex_info in the renderer. */
+ bool use_vbo = renderer->vertex_info.num_verts > 0;
+
/* VkPipelineVertexInputStateCreateInfo */
memset(&vert_input_info, 0, sizeof vert_input_info);
vert_input_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
- vert_input_info.vertexBindingDescriptionCount = 1;
+ vert_input_info.vertexBindingDescriptionCount = use_vbo ? 1 : 0;
vert_input_info.pVertexBindingDescriptions = vert_bind_dsc;
- vert_input_info.vertexAttributeDescriptionCount = 1;
+ vert_input_info.vertexAttributeDescriptionCount = use_vbo ? 1 : 0;
vert_input_info.pVertexAttributeDescriptions = vert_att_dsc;
/* VkPipelineInputAssemblyStateCreateInfo */