[Mesa-dev] [RFC PATCH 16/40] i965: Allocate space on the gather pool for every push constant state

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Sun Jan 4 06:04:30 PST 2015


Reserve space in the gather pool where the resource streamer will flush
its gather constant data.

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

diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index c1950d1..4fd3ea2 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -123,6 +123,14 @@ gen6_upload_push_constants(struct brw_context *brw,
        */
       assert(stage_state->push_const_size <= 32);
    }
+   /* Allocate gather pool space for uniform and UBO entries in 512-bit chunks*/
+   if (brw->gather_pool.bo != NULL) {
+      if (prog_data->nr_params > 0) {
+         int num_consts = ALIGN(prog_data->nr_params, 4) / 4;
+         stage_state->push_const_offset = brw->gather_pool.next_offset;
+         brw->gather_pool.next_offset += (ALIGN(num_consts, 4) / 4) * 64;
+      }
+   }
 }
 
 static void
-- 
1.9.1



More information about the mesa-dev mailing list