summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_cmd_buffer.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-10-21 18:16:15 +0200
committerBas Nieuwenhuizen <[email protected]>2017-10-21 19:59:44 +0200
commitfb55477990e417f3a5e80d91e9e0dbb7bf2f71a6 (patch)
tree22b3c241b2aa70673ff16f5bba24f9d65cce9714 /src/amd/vulkan/radv_cmd_buffer.c
parent24fe4e6143aa06a8aaa1b2cabaee84064a0efbd9 (diff)
radv: Correctly detect changed shaders for vertex descriptors.
As they were emitted after the new pipeline, the changed pipeline detection was not working anymore. Fixes: 341529dbee5 'radv: use optimal packet order for draws' Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index d511659d02d..887b789df87 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1719,11 +1719,11 @@ radv_flush_constants(struct radv_cmd_buffer *cmd_buffer,
}
static bool
-radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer)
+radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, bool pipeline_is_dirty)
{
struct radv_device *device = cmd_buffer->device;
- if ((cmd_buffer->state.pipeline != cmd_buffer->state.emitted_pipeline || cmd_buffer->state.vb_dirty) &&
+ if ((pipeline_is_dirty || cmd_buffer->state.vb_dirty) &&
cmd_buffer->state.pipeline->vertex_elements.count &&
radv_get_vertex_shader(cmd_buffer->state.pipeline)->info.info.vs.has_vertex_buffers) {
struct radv_vertex_elements_info *velems = &cmd_buffer->state.pipeline->vertex_elements;
@@ -1771,9 +1771,9 @@ radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer)
}
static bool
-radv_upload_graphics_shader_descriptors(struct radv_cmd_buffer *cmd_buffer)
+radv_upload_graphics_shader_descriptors(struct radv_cmd_buffer *cmd_buffer, bool pipeline_is_dirty)
{
- if (!radv_cmd_buffer_update_vertex_descriptors(cmd_buffer))
+ if (!radv_cmd_buffer_update_vertex_descriptors(cmd_buffer, pipeline_is_dirty))
return false;
radv_flush_descriptors(cmd_buffer, VK_SHADER_STAGE_ALL_GRAPHICS);
@@ -3186,7 +3186,7 @@ radv_draw(struct radv_cmd_buffer *cmd_buffer,
si_emit_cache_flush(cmd_buffer);
/* <-- CUs are idle here --> */
- if (!radv_upload_graphics_shader_descriptors(cmd_buffer))
+ if (!radv_upload_graphics_shader_descriptors(cmd_buffer, pipeline_is_dirty))
return;
radv_emit_draw_packets(cmd_buffer, info);
@@ -3211,7 +3211,7 @@ radv_draw(struct radv_cmd_buffer *cmd_buffer,
cmd_buffer->state.pipeline);
}
- if (!radv_upload_graphics_shader_descriptors(cmd_buffer))
+ if (!radv_upload_graphics_shader_descriptors(cmd_buffer, pipeline_is_dirty))
return;
radv_emit_all_graphics_states(cmd_buffer, info);