vk: Support descriptor sets and bindings in vec4 ubo loads
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Tue, 25 Aug 2015 22:57:12 +0000 (15:57 -0700)
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Tue, 25 Aug 2015 22:57:12 +0000 (15:57 -0700)
Still incomplete, but at least we get the simplest case working.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index 923e2d30a4ca3c808b0261d0bf7081c37a547179..ee353b22330d5f8a82299d89ccf23421f77ab9ba 100644 (file)
@@ -612,17 +612,19 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
       has_indirect = true;
       /* fallthrough */
    case nir_intrinsic_load_ubo: {
+      const uint32_t set = instr->const_index[0];
       nir_const_value *const_block_index = nir_src_as_const_value(instr->src[0]);
       src_reg surf_index;
 
       dest = get_nir_dest(instr->dest);
 
       if (const_block_index) {
+         uint32_t binding = const_block_index->u[0];
+
          /* The block index is a constant, so just emit the binding table entry
           * as an immediate.
           */
-         surf_index = src_reg(prog_data->base.binding_table.ubo_start +
-                              const_block_index->u[0]);
+         surf_index = src_reg(stage_prog_data->bind_map[set].index[binding]);
       } else {
          /* The block index is not a constant. Evaluate the index expression
           * per-channel and add the base UBO index; we have to select a value