diff options
author | Jason Ekstrand <[email protected]> | 2015-11-16 16:29:33 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-11-17 08:27:51 -0800 |
commit | 0508046dc839a2ebd2800f169b45f2d3243dcda6 (patch) | |
tree | 3925f1b3df67f70b7d2205e7ec13f7ce464feee1 /src/vulkan/gen8_cmd_buffer.c | |
parent | 34d55d69cfe592068a72ed7a5ca9adc1ee080976 (diff) |
anv/cmd_buffer: Pack the 3DSTATE_VF packet on-demand
Diffstat (limited to 'src/vulkan/gen8_cmd_buffer.c')
-rw-r--r-- | src/vulkan/gen8_cmd_buffer.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/vulkan/gen8_cmd_buffer.c b/src/vulkan/gen8_cmd_buffer.c index 2e4a618bad1..9a3e3b5e061 100644 --- a/src/vulkan/gen8_cmd_buffer.c +++ b/src/vulkan/gen8_cmd_buffer.c @@ -283,8 +283,10 @@ gen8_cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer) if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE | ANV_CMD_DIRTY_INDEX_BUFFER)) { - anv_batch_emit_merge(&cmd_buffer->batch, - cmd_buffer->state.state_vf, pipeline->gen8.vf); + anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_VF, + .IndexedDrawCutIndexEnable = pipeline->primitive_restart, + .CutIndex = cmd_buffer->state.restart_index, + ); } cmd_buffer->state.vb_dirty &= ~vb_emit; @@ -396,19 +398,20 @@ void gen8_CmdBindIndexBuffer( [VK_INDEX_TYPE_UINT32] = INDEX_DWORD, }; - struct GEN8_3DSTATE_VF vf = { - GEN8_3DSTATE_VF_header, - .CutIndex = (indexType == VK_INDEX_TYPE_UINT16) ? UINT16_MAX : UINT32_MAX, + static const uint32_t restart_index_for_type[] = { + [VK_INDEX_TYPE_UINT16] = UINT16_MAX, + [VK_INDEX_TYPE_UINT32] = UINT32_MAX, }; - GEN8_3DSTATE_VF_pack(NULL, cmd_buffer->state.state_vf, &vf); - cmd_buffer->state.dirty |= ANV_CMD_DIRTY_INDEX_BUFFER; + cmd_buffer->state.restart_index = restart_index_for_type[indexType]; anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_INDEX_BUFFER, .IndexFormat = vk_to_gen_index_type[indexType], .MemoryObjectControlState = GEN8_MOCS, .BufferStartingAddress = { buffer->bo, buffer->offset + offset }, .BufferSize = buffer->size - offset); + + cmd_buffer->state.dirty |= ANV_CMD_DIRTY_INDEX_BUFFER; } static VkResult |