From 9ffc1bed154807316d12fba7970261918fc22538 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 28 May 2015 15:34:08 -0700 Subject: [PATCH] vk/device: Split state base address emit into its own function --- src/vulkan/device.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 0a6f0c6e6b9..ed2b8d14b7f 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -2386,17 +2386,11 @@ VkResult anv_CreateCommandBuffer( return result; } -VkResult anv_BeginCommandBuffer( - VkCmdBuffer cmdBuffer, - const VkCmdBufferBeginInfo* pBeginInfo) +static void +anv_cmd_buffer_emit_state_base_address(struct anv_cmd_buffer *cmd_buffer) { - struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *) cmdBuffer; struct anv_device *device = cmd_buffer->device; - anv_batch_emit(&cmd_buffer->batch, GEN8_PIPELINE_SELECT, - .PipelineSelection = _3D); - anv_batch_emit(&cmd_buffer->batch, GEN8_STATE_SIP); - anv_batch_emit(&cmd_buffer->batch, GEN8_STATE_BASE_ADDRESS, .GeneralStateBaseAddress = { NULL, 0 }, .GeneralStateMemoryObjectControlState = GEN8_MOCS, @@ -2419,12 +2413,25 @@ VkResult anv_BeginCommandBuffer( .IndirectObjectBaseAddressModifyEnable = true, .IndirectObjectBufferSize = 0xfffff, .IndirectObjectBufferSizeModifyEnable = true, - + .InstructionBaseAddress = { &device->instruction_block_pool.bo, 0 }, .InstructionMemoryObjectControlState = GEN8_MOCS, .InstructionBaseAddressModifyEnable = true, .InstructionBufferSize = 0xfffff, .InstructionBuffersizeModifyEnable = true); +} + +VkResult anv_BeginCommandBuffer( + VkCmdBuffer cmdBuffer, + const VkCmdBufferBeginInfo* pBeginInfo) +{ + struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *) cmdBuffer; + + anv_batch_emit(&cmd_buffer->batch, GEN8_PIPELINE_SELECT, + .PipelineSelection = _3D); + anv_batch_emit(&cmd_buffer->batch, GEN8_STATE_SIP); + + anv_cmd_buffer_emit_state_base_address(cmd_buffer); anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_VF_STATISTICS, .StatisticsEnable = true); -- 2.30.2