[Mesa-dev] [PATCH] i965/fs: Do not set the size for zero-size uniforms
Jason Ekstrand
jason at jlekstrand.net
Fri Aug 28 09:46:07 PDT 2015
On Fri, Aug 28, 2015 at 2:08 AM, Francisco Jerez <currojerez at riseup.net> wrote:
> Marta Lofstedt <marta.lofstedt at linux.intel.com> writes:
>
>> From: Marta Lofstedt <marta.lofstedt at intel.com>
>>
>> Zero sized uniforms can exist in the list, but they
>> don't get get any space allocated in
>> prog_data->params or in the param_size array, so
>> the size should not be set for them.
>> This was previously fixed in:
>> commit: 781dc7c0e1f41502f18e07c0940af949a78d2792.
>> However,
>> commit: 259f7291de2387aa3ac5f856b39b7b934a1d8e7d
>> removed the fix.
>>
>> Signed-off-by: Marta Lofstedt <marta.lofstedt at intel.com>
>
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
I also pushed it. Thanks Marta!
--Jason
>> ---
>> src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
>> index 430efb3..9d14d1f 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
>> @@ -190,8 +190,8 @@ fs_visitor::nir_setup_uniforms(nir_shader *shader)
>> nir_setup_builtin_uniform(var);
>> else
>> nir_setup_uniform(var);
>> -
>> - param_size[var->data.driver_location] = type_size_scalar(var->type);
>> + if(type_size_scalar(var->type) > 0)
>> + param_size[var->data.driver_location] = type_size_scalar(var->type);
>> }
>> } else {
>> /* prog_to_nir only creates a single giant uniform variable so we can
>> @@ -202,7 +202,8 @@ fs_visitor::nir_setup_uniforms(nir_shader *shader)
>> &prog->Parameters->ParameterValues[p][i];
>> }
>> }
>> - param_size[0] = prog->Parameters->NumParameters * 4;
>> + if(prog->Parameters->NumParameters > 0)
>> + param_size[0] = prog->Parameters->NumParameters * 4;
>> }
>> }
>>
>> --
>> 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