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

Pohjolainen, Topi topi.pohjolainen at intel.com
Thu May 7 08:23:51 PDT 2015


On Tue, Apr 28, 2015 at 11:08:10PM +0300, Abdiel Janulgue wrote:
> 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 | 11 +++++++++--
>  1 file changed, 9 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 7325c6e..bce597f 100644
> --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
> +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
> @@ -72,9 +72,16 @@ gen6_upload_push_constants(struct brw_context *brw,
>        gl_constant_value *param;
>        int i;
>  
> -      param = brw_state_batch(brw, type,
> -			      prog_data->nr_params * sizeof(gl_constant_value),
> +      uint32_t size = prog_data->nr_params * sizeof(gl_constant_value);

Const would be nice here.

> +      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_update_binding_table(brw, stage_state->stage, BRW_UNIFORM_GATHER_INDEX_START,

Two lines overflowing 80 columns.

> +                                   surf_offset);
> +      }
>  
>        STATIC_ASSERT(sizeof(gl_constant_value) == sizeof(float));
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list