diff options
author | Samuel Pitoiset <[email protected]> | 2018-09-12 15:40:08 +0200 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2018-09-17 16:46:47 +0200 |
commit | a103bc9b1f17eee7a9bb3490f13ebbb5c14a8326 (patch) | |
tree | b587742a20dfb9dad39251f94aa72b2bc789e6d6 | |
parent | 0d2527c944bcea2adb4cd1b31a2784e50ef06090 (diff) |
radv: fix flushing indirect descriptors
Let say, we first bind a graphics pipeline that needs indirect
descriptors sets. The userdata pointers will be emitted at draw
time. Then if we bind a compute pipeline that doesn't need any
indirect descriptors, the driver will re-emit them for all
grpahics stages.
To avoid this to happen, just check the bind point type.
CC: 18.2 <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
(cherry picked from commit 748f4cce183007587a6688ef25ad5f9dbea5c33c)
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 97a49f3dcc3..8b7691eda01 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1716,6 +1716,8 @@ radv_flush_descriptors(struct radv_cmd_buffer *cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS; struct radv_descriptor_state *descriptors_state = radv_get_descriptors_state(cmd_buffer, bind_point); + struct radv_cmd_state *state = &cmd_buffer->state; + bool flush_indirect_descriptors; if (!descriptors_state->dirty) return; @@ -1723,10 +1725,14 @@ radv_flush_descriptors(struct radv_cmd_buffer *cmd_buffer, if (descriptors_state->push_dirty) radv_flush_push_descriptors(cmd_buffer, bind_point); - if ((cmd_buffer->state.pipeline && cmd_buffer->state.pipeline->need_indirect_descriptor_sets) || - (cmd_buffer->state.compute_pipeline && cmd_buffer->state.compute_pipeline->need_indirect_descriptor_sets)) { + flush_indirect_descriptors = + (bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS && + state->pipeline && state->pipeline->need_indirect_descriptor_sets) || + (bind_point == VK_PIPELINE_BIND_POINT_COMPUTE && + state->compute_pipeline && state->compute_pipeline->need_indirect_descriptor_sets); + + if (flush_indirect_descriptors) radv_flush_indirect_descriptor_sets(cmd_buffer, bind_point); - } MAYBE_UNUSED unsigned cdw_max = radeon_check_space(cmd_buffer->device->ws, cmd_buffer->cs, |