Mesa (master): anv/cmd_buffer: Use the new emit macro for 3DSTATE_CONSTANT

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Apr 20 21:54:29 UTC 2016


Module: Mesa
Branch: master
Commit: 06fc7fa6842a5b36ed2a16d5a7ca72e516d5b245
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=06fc7fa6842a5b36ed2a16d5a7ca72e516d5b245

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Mon Apr 18 14:55:10 2016 -0700

anv/cmd_buffer: Use the new emit macro for 3DSTATE_CONSTANT

Acked-by: Kristian Høgsberg <krh at bitplanet.net>

---

 src/intel/vulkan/genX_cmd_buffer.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 713de82..45b009b 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -295,20 +295,21 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer)
       struct anv_state state = anv_cmd_buffer_push_constants(cmd_buffer, stage);
 
       if (state.offset == 0) {
-         anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CONSTANT_VS),
-                        ._3DCommandSubOpcode = push_constant_opcodes[stage]);
+         anv_batch_emit_blk(&cmd_buffer->batch, GENX(3DSTATE_CONSTANT_VS), c)
+            c._3DCommandSubOpcode = push_constant_opcodes[stage];
       } else {
-         anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CONSTANT_VS),
-                        ._3DCommandSubOpcode = push_constant_opcodes[stage],
-                        .ConstantBody = {
+         anv_batch_emit_blk(&cmd_buffer->batch, GENX(3DSTATE_CONSTANT_VS), c) {
+            c._3DCommandSubOpcode = push_constant_opcodes[stage],
+            c.ConstantBody = (struct GENX(3DSTATE_CONSTANT_BODY)) {
 #if GEN_GEN >= 9
-                           .PointerToConstantBuffer2 = { &cmd_buffer->device->dynamic_state_block_pool.bo, state.offset },
-                           .ConstantBuffer2ReadLength = 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),
 #else
-                           .PointerToConstantBuffer0 = { .offset = state.offset },
-                           .ConstantBuffer0ReadLength = DIV_ROUND_UP(state.alloc_size, 32),
+               .PointerToConstantBuffer0 = { .offset = state.offset },
+               .ConstantBuffer0ReadLength = DIV_ROUND_UP(state.alloc_size, 32),
 #endif
-                        });
+            };
+         }
       }
 
       flushed |= mesa_to_vk_shader_stage(stage);




More information about the mesa-commit mailing list