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

Francisco Jerez currojerez at riseup.net
Fri Oct 23 10:35:58 PDT 2015


Abdiel Janulgue <abdiel.janulgue at linux.intel.com> writes:

> 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);
> +      }

Same question as in the last patch: Why don't you use the normal
infrastructure for uploading binding tables?

>  
>        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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151023/ac66f966/attachment-0001.sig>


More information about the mesa-dev mailing list