diff options
author | Dave Airlie <[email protected]> | 2017-02-13 04:00:24 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-02-13 20:02:45 +0000 |
commit | 592069c1fbccf55e26d2822337dfab40edf6948e (patch) | |
tree | 1dcc156dba67e9f0fb250a506b0ca3161baab948 /src/amd/vulkan/radv_cmd_buffer.c | |
parent | b26253b34d53a7b8235bf301b68889ba6c3a19a6 (diff) |
radv: use indirect buffer for initial gfx state.
This puts the common gfx state for the device into an
indirect buffer, and just calls out to it, on CIK and above.
This is taken from what radeonsi does.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 93bcd0a9218..8f2e98476e5 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1605,6 +1605,20 @@ VkResult radv_ResetCommandBuffer( return VK_SUCCESS; } +static void emit_gfx_buffer_state(struct radv_cmd_buffer *cmd_buffer) +{ + struct radv_device *device = cmd_buffer->device; + if (device->gfx_init) { + uint64_t va = device->ws->buffer_get_va(device->gfx_init); + device->ws->cs_add_buffer(cmd_buffer->cs, device->gfx_init, 8); + radeon_emit(cmd_buffer->cs, PKT3(PKT3_INDIRECT_BUFFER_CIK, 2, 0)); + radeon_emit(cmd_buffer->cs, va); + radeon_emit(cmd_buffer->cs, (va >> 32) & 0xffff); + radeon_emit(cmd_buffer->cs, device->gfx_init_size_dw & 0xffff); + } else + si_init_config(cmd_buffer); +} + VkResult radv_BeginCommandBuffer( VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) @@ -1626,7 +1640,7 @@ VkResult radv_BeginCommandBuffer( RADV_CMD_FLAG_INV_SMEM_L1 | RADV_CMD_FLUSH_AND_INV_FRAMEBUFFER | RADV_CMD_FLAG_INV_GLOBAL_L2; - si_init_config(cmd_buffer); + emit_gfx_buffer_state(cmd_buffer); radv_set_db_count_control(cmd_buffer); si_emit_cache_flush(cmd_buffer); break; |