[Mesa-dev] [PATCH 07/20] i965: Assign hw-binding table index for uniform constant buffer block

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Fri Sep 11 01:33:21 PDT 2015


Assign the uploaded uniform block with hardware binding table indices.
This is indexed by the resource streamer to fetch the constant buffers
referred to by our gather table entries.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/mesa/drivers/dri/i965/gen6_vs_state.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index 843df94..d43af5b 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -72,9 +72,18 @@ gen6_upload_push_constants(struct brw_context *brw,
       gl_constant_value *param;
       unsigned i;
 
-      param = brw_state_batch(brw, type,
-			      prog_data->nr_params * sizeof(gl_constant_value),
+      const uint32_t size = prog_data->nr_params * sizeof(gl_constant_value);
+      param = brw_state_batch(brw, type, size,
 			      32, &stage_state->push_const_offset);
+      if (brw->gather_pool.bo != NULL) {
+         uint32_t surf_offset = 0;
+         brw_create_constant_surface(brw, brw->batch.bo,
+                                     stage_state->push_const_offset,
+                                     size, &surf_offset, false);
+         gen7_edit_hw_binding_table_entry(brw, stage_state->stage,
+                                          BRW_UNIFORM_GATHER_INDEX_START,
+                                          surf_offset);
+      }
 
       STATIC_ASSERT(sizeof(gl_constant_value) == sizeof(float));
 
-- 
1.9.1



More information about the mesa-dev mailing list