anv/push constants: Use constant buffer #2
authorBen Widawsky <benjamin.widawsky@intel.com>
Wed, 27 Jan 2016 19:37:23 +0000 (11:37 -0800)
committerBen Widawsky <benjamin.widawsky@intel.com>
Thu, 28 Jan 2016 01:09:36 +0000 (17:09 -0800)
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.

src/vulkan/gen8_cmd_buffer.c

index 560608fe346a700683f820451edcdfca2379877e..daa049e98e07766ef0751205a412feb43f335be5 100644 (file)
@@ -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);