From: Jason Ekstrand Date: Thu, 28 May 2015 22:34:08 +0000 (-0700) Subject: vk/device: Split state base address emit into its own function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ffc1bed154807316d12fba7970261918fc22538;p=mesa.git vk/device: Split state base address emit into its own function --- 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);