diff options
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 16 | ||||
-rw-r--r-- | src/amd/vulkan/radv_private.h | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 1d552e265ae..a2ad9fa460e 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -669,6 +669,17 @@ radv_emit_prefetch_TC_L2_async(struct radv_cmd_buffer *cmd_buffer, uint64_t va, } static void +radv_emit_VBO_descriptors_prefetch(struct radv_cmd_buffer *cmd_buffer) +{ + if (cmd_buffer->state.vb_prefetch_dirty) { + radv_emit_prefetch_TC_L2_async(cmd_buffer, + cmd_buffer->state.vb_va, + cmd_buffer->state.vb_size); + cmd_buffer->state.vb_prefetch_dirty = false; + } +} + +static void radv_emit_shader_prefetch(struct radv_cmd_buffer *cmd_buffer, struct radv_shader_variant *shader) { @@ -691,6 +702,7 @@ radv_emit_prefetch(struct radv_cmd_buffer *cmd_buffer, { radv_emit_shader_prefetch(cmd_buffer, pipeline->shaders[MESA_SHADER_VERTEX]); + radv_emit_VBO_descriptors_prefetch(cmd_buffer); radv_emit_shader_prefetch(cmd_buffer, pipeline->shaders[MESA_SHADER_TESS_CTRL]); radv_emit_shader_prefetch(cmd_buffer, @@ -1814,6 +1826,10 @@ radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, bo radv_emit_userdata_address(cmd_buffer, cmd_buffer->state.pipeline, MESA_SHADER_VERTEX, AC_UD_VS_VERTEX_BUFFERS, va); + + cmd_buffer->state.vb_va = va; + cmd_buffer->state.vb_size = count * 16; + cmd_buffer->state.vb_prefetch_dirty = true; } cmd_buffer->state.vb_dirty = false; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 58b9f469048..79f52c61e0b 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -809,7 +809,12 @@ struct radv_attachment_state { }; struct radv_cmd_state { + /* Vertex descriptors */ bool vb_dirty; + bool vb_prefetch_dirty; + uint64_t vb_va; + unsigned vb_size; + bool push_descriptors_dirty; bool predicating; radv_cmd_dirty_mask_t dirty; |