diff options
author | Samuel Pitoiset <[email protected]> | 2017-11-08 12:12:31 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-11-13 11:03:16 +0100 |
commit | f87c58dde38902d9bfb5a046b4bf1b5e56c55fcf (patch) | |
tree | 6e8021da325c5a001a569525b776109b2e1e8a53 /src/amd/vulkan | |
parent | 9444a34f4a3b7d954f4a009861a677aca1eaf4af (diff) |
radv: prefetch VBO descriptors at the right place
Just after the vertex shader.
This seems to give a minor boost for, at least, Serious Sam
Fusion 2017 and Dawn of War 3. I don't see any real impacts
with The Talos Principle.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-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; |