[Mesa-dev] [PATCH] i965/gen8/cs: fix constant push buffer

Iago Toral Quiroga itoral at igalia.com
Tue Dec 15 03:55:15 PST 2015


Page 502 of the Command Reference Broadwell PRM says that CURBE Total
Data Length must be 64-bit aligned.

Fixes the following CTS tests:
ES31-CTS.shader_storage_buffer_object.basic-atomic-case1-cs
ES31-CTS.shader_storage_buffer_object.basic-operations-case1-cs
ES31-CTS.shader_storage_buffer_object.basic-operations-case2-cs
ES31-CTS.shader_storage_buffer_object.basic-stdLayout_UBO_SSBO-case2-cs
ES31-CTS.shader_storage_buffer_object.advanced-write-fragment-cs
ES31-CTS.shader_storage_buffer_object.advanced-indirectAddressing-case2-cs
ES31-CTS.shader_storage_buffer_object.advanced-matrix-cs
---
 src/mesa/drivers/dri/i965/gen7_cs_state.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_cs_state.c b/src/mesa/drivers/dri/i965/gen7_cs_state.c
index 1fde69c..dbd1967 100644
--- a/src/mesa/drivers/dri/i965/gen7_cs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_cs_state.c
@@ -77,7 +77,8 @@ brw_upload_cs_state(struct brw_context *brw)
 
    unsigned push_constant_data_size =
       (prog_data->nr_params + local_id_dwords) * sizeof(gl_constant_value);
-   unsigned reg_aligned_constant_size = ALIGN(push_constant_data_size, 32);
+   unsigned reg_aligned_constant_size =
+      ALIGN(push_constant_data_size, brw->gen < 8 ? 32 : 64);
    unsigned push_constant_regs = reg_aligned_constant_size / 32;
    unsigned threads = get_cs_thread_count(cs_prog_data);
 
@@ -241,7 +242,8 @@ brw_upload_cs_push_constants(struct brw_context *brw,
 
       const unsigned push_constant_data_size =
          (local_id_dwords + prog_data->nr_params) * sizeof(gl_constant_value);
-      const unsigned reg_aligned_constant_size = ALIGN(push_constant_data_size, 32);
+      const unsigned reg_aligned_constant_size =
+         ALIGN(push_constant_data_size, brw->gen < 8 ? 32 : 64);
       const unsigned param_aligned_count =
          reg_aligned_constant_size / sizeof(*param);
 
-- 
1.9.1



More information about the mesa-dev mailing list