On Friday, September 29, 2017 2:25:15 PM PDT Jason Ekstrand wrote:
> This way any image uniforms end up having locations higher than
> MAX_PUSH_CONSTANT_SIZE.  There's no bug here at the moment, but this
> consistency will make the next commit easier.  Also, because
> nir_apply_pipeline_layout properly increments nir->num_uniforms when
> it expands the param array, we no longer need to stomp it to match
> prog_data::nr_params because it already does.
> ---
>  src/intel/vulkan/anv_pipeline.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
> index 191ae55..691cdf8 100644
> --- a/src/intel/vulkan/anv_pipeline.c
> +++ b/src/intel/vulkan/anv_pipeline.c
> @@ -399,6 +399,7 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
>         * them the maximum possible number
>         */
>        assert(nir->num_uniforms <= MAX_PUSH_CONSTANTS_SIZE);
> +      nir->num_uniforms = MAX_PUSH_CONSTANTS_SIZE;
>        prog_data->nr_params += MAX_PUSH_CONSTANTS_SIZE / sizeof(float);
>     }
>  
> @@ -431,10 +432,7 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
>     if (pipeline->layout)
>        anv_nir_apply_pipeline_layout(pipeline, nir, prog_data, map);
>  
> -   /* nir_lower_io will only handle the push constants; we need to set this
> -    * to the full number of possible uniforms.
> -    */
> -   nir->num_uniforms = prog_data->nr_params * 4;
> +   assert(nir->num_uniforms == prog_data->nr_params * 4);
>  
>     return nir;
>  }
> 

I don't like this.  There are a bunch of places in the compiler that
assume that nir->num_uniforms / 4 is the number of uniforms...which
is already pretty bogus, to be honest, but...now it's like we've given
up all pretense of having units or having a meaningful value here...

Maybe we should just get rid of it altogether...

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to