From: Ben Widawsky Date: Wed, 27 Jan 2016 19:37:23 +0000 (-0800) Subject: anv/push constants: Use constant buffer #2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2af3281fee16eda128b85c62062608687bd4c548;p=mesa.git anv/push constants: Use constant buffer #2 SKL has a workaround which requires either some weird programming of buffer 3, OR, just never using buffer 0. Since we don't actually use multiple constant buffers, it's easier to just not use 0. Only SKL requires this workaround, but there is no harm in applying it to all platforms. The big change here is that buffer #0 is relative to dynamic state base normally (depending upon ISTPM), where buffer 1-3 is a GPU virtual address. --- diff --git a/src/vulkan/gen8_cmd_buffer.c b/src/vulkan/gen8_cmd_buffer.c index 560608fe346..daa049e98e0 100644 --- a/src/vulkan/gen8_cmd_buffer.c +++ b/src/vulkan/gen8_cmd_buffer.c @@ -58,8 +58,8 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer) anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CONSTANT_VS), ._3DCommandSubOpcode = push_constant_opcodes[stage], .ConstantBody = { - .PointerToConstantBuffer0 = { .offset = state.offset }, - .ConstantBuffer0ReadLength = DIV_ROUND_UP(state.alloc_size, 32), + .PointerToConstantBuffer2 = { &cmd_buffer->device->dynamic_state_block_pool.bo, state.offset }, + .ConstantBuffer2ReadLength = DIV_ROUND_UP(state.alloc_size, 32), }); flushed |= mesa_to_vk_shader_stage(stage);