From fe9699dcb491d07f5b629828fd0d3dad5a213318 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 15 May 2017 16:15:13 -0700 Subject: [PATCH] genxml: Make 3DSTATE_CONSTANT_BODY on Gen7+ use arrays. This will let us initialize the constant buffers with loops. Reviewed-by: Lionel Landwerlin --- src/intel/genxml/gen7.xml | 14 ++++++-------- src/intel/genxml/gen75.xml | 14 ++++++-------- src/intel/genxml/gen8.xml | 14 ++++++-------- src/intel/genxml/gen9.xml | 14 ++++++-------- src/intel/vulkan/genX_cmd_buffer.c | 8 ++++---- src/mesa/drivers/dri/i965/genX_state_upload.c | 10 ++++------ 6 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/intel/genxml/gen7.xml b/src/intel/genxml/gen7.xml index c98327a..2c297f3 100644 --- a/src/intel/genxml/gen7.xml +++ b/src/intel/genxml/gen7.xml @@ -378,15 +378,13 @@ - - - - - + + + - - - + + + diff --git a/src/intel/genxml/gen75.xml b/src/intel/genxml/gen75.xml index 11f1462..e7c06dc 100644 --- a/src/intel/genxml/gen75.xml +++ b/src/intel/genxml/gen75.xml @@ -377,15 +377,13 @@ - - - - - + + + - - - + + + diff --git a/src/intel/genxml/gen8.xml b/src/intel/genxml/gen8.xml index 541a788..2fd796a 100644 --- a/src/intel/genxml/gen8.xml +++ b/src/intel/genxml/gen8.xml @@ -403,14 +403,12 @@ - - - - - - - - + + + + + + diff --git a/src/intel/genxml/gen9.xml b/src/intel/genxml/gen9.xml index 3e9e88e..af40e66 100644 --- a/src/intel/genxml/gen9.xml +++ b/src/intel/genxml/gen9.xml @@ -424,14 +424,12 @@ - - - - - - - - + + + + + + diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 0bb6d8e..072d0d5 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1482,11 +1482,11 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer) c._3DCommandSubOpcode = push_constant_opcodes[stage], c.ConstantBody = (struct GENX(3DSTATE_CONSTANT_BODY)) { #if GEN_GEN >= 9 - .PointerToConstantBuffer2 = { &cmd_buffer->device->dynamic_state_pool.block_pool.bo, state.offset }, - .ConstantBuffer2ReadLength = DIV_ROUND_UP(state.alloc_size, 32), + .Buffer[2] = { &cmd_buffer->device->dynamic_state_pool.block_pool.bo, state.offset }, + .ReadLength[2] = DIV_ROUND_UP(state.alloc_size, 32), #else - .PointerToConstantBuffer0 = { .offset = state.offset }, - .ConstantBuffer0ReadLength = DIV_ROUND_UP(state.alloc_size, 32), + .Buffer[0] = { .offset = state.offset }, + .ReadLength[0] = DIV_ROUND_UP(state.alloc_size, 32), #endif }; } diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 1f05eea..cc65421 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -2674,14 +2674,12 @@ upload_constant_state(struct brw_context *brw, pkt._3DCommandSubOpcode = push_constant_opcodes[stage]; if (active) { #if GEN_GEN >= 8 || GEN_IS_HASWELL - pkt.ConstantBody.ConstantBuffer2ReadLength = - stage_state->push_const_size; - pkt.ConstantBody.PointerToConstantBuffer2 = + pkt.ConstantBody.ReadLength[2] = stage_state->push_const_size; + pkt.ConstantBody.Buffer[2] = render_ro_bo(brw->curbe.curbe_bo, stage_state->push_const_offset); #else - pkt.ConstantBody.ConstantBuffer0ReadLength = - stage_state->push_const_size; - pkt.ConstantBody.PointerToConstantBuffer0.offset = + pkt.ConstantBody.ReadLength[0] = stage_state->push_const_size; + pkt.ConstantBody.Buffer[0].offset = stage_state->push_const_offset | mocs; #endif } -- 2.7.4