summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-01-18 15:35:11 +0100
committerBas Nieuwenhuizen <[email protected]>2018-01-19 01:54:59 +0100
commitbd5c942cefc9f58aa6e8f6a9452f65e9d0d9d93a (patch)
treeba6116e7ac4a1218da432a42e7c9d36df102d747
parentb1444c9ccb06661d932969302d19166df442818c (diff)
radv: Use correct bindings for inputRate in key generation.
The bindings also have an index field. Fixes: 49d035122e "radv: Add single pipeline cache key." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104677 Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r--src/amd/vulkan/radv_pipeline.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index c3c17af8500..5f824796fe5 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1726,10 +1726,16 @@ radv_generate_graphics_pipeline_key(struct radv_pipeline *pipeline,
key.has_multiview_view_index = has_view_index;
+ uint32_t binding_input_rate = 0;
+ for (unsigned i = 0; i < input_state->vertexBindingDescriptionCount; ++i) {
+ if (input_state->pVertexBindingDescriptions[i].inputRate)
+ binding_input_rate |= 1u << input_state->pVertexBindingDescriptions[i].binding;
+ }
+
for (unsigned i = 0; i < input_state->vertexAttributeDescriptionCount; ++i) {
unsigned binding;
binding = input_state->pVertexAttributeDescriptions[i].binding;
- if (input_state->pVertexBindingDescriptions[binding].inputRate)
+ if (binding_input_rate & (1u << binding))
key.instance_rate_inputs |= 1u << input_state->pVertexAttributeDescriptions[i].location;
}