[Mesa-dev] [PATCH 6/6] i965: Push everything if pull_param == NULL

Kenneth Graunke kenneth at whitecape.org
Thu Apr 7 00:39:31 UTC 2016


On Tuesday, April 5, 2016 9:11:13 PM PDT Jason Ekstrand wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp           | 10 ++++++++--
>  src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |  6 ++++++
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/
i965/brw_fs.cpp
> index fe1bf97..91cd00f 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2019,8 +2019,14 @@ fs_visitor::assign_constant_locations()
>        if (!contiguous[u]) {
>           unsigned chunk_size = u - chunk_start + 1;
>  
> -         if (num_push_constants + chunk_size <= max_push_components &&
> -             chunk_size <= max_chunk_size) {
> +         /* Decide whether we should push or pull this parameter.  In the
> +          * Vulkan driver, push constants are explicitly exposed via the 
API
> +          * so we push everything.  In GL, we only push small arrays.
> +          */
> +         if (stage_prog_data->pull_param == NULL ||
> +             (num_push_constants + chunk_size <= max_push_components &&
> +              chunk_size <= max_chunk_size)) {
> +            assert(num_push_constants + chunk_size <= max_push_components);
>              for (unsigned j = chunk_start; j <= u; j++)
>                 push_constant_loc[j] = num_push_constants++;
>           } else {
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/
drivers/dri/i965/brw_vec4_visitor.cpp
> index 33c5f07..5ef9500 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> @@ -1629,6 +1629,12 @@ vec4_visitor::emit_pull_constant_load(bblock_t 
*block, vec4_instruction *inst,
>  void
>  vec4_visitor::move_uniform_array_access_to_pull_constants()
>  {
> +   /* The vulkan dirver doesn't support pull constants other than UBOs so
> +    * everything has to be pushed regardless.
> +    */
> +   if (stage_prog_data->pull_param == NULL)
> +      return;
> +
>     int pull_constant_loc[this->uniforms];
>     memset(pull_constant_loc, -1, sizeof(pull_constant_loc));

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160406/67747ef1/attachment-0001.sig>


More information about the mesa-dev mailing list