[Mesa-dev] [PATCH 1/5] mesa: Have validate_uniform_parameters return the gl_uniform_storage pointer

Ian Romanick idr at freedesktop.org
Thu Sep 11 11:35:13 PDT 2014


On 09/11/2014 05:09 AM, Erik Faye-Lund wrote:
> On Thu, Sep 11, 2014 at 2:00 PM, Tapani Pälli <tapani.palli at intel.com> wrote:
>> On 09/11/2014 02:27 PM, Erik Faye-Lund wrote:
>>> On Sat, Aug 2, 2014 at 4:09 AM, Ian Romanick <idr at freedesktop.org> wrote:
>>>> diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
>>>> index 609d94b..7b089fa 100644
>>>> --- a/src/mesa/main/uniform_query.cpp
>>>> +++ b/src/mesa/main/uniform_query.cpp
>>>> @@ -266,30 +265,32 @@ validate_uniform_parameters(struct gl_context *ctx,
>>>>      */
>>>>     if (shProg->UniformRemapTable[location] ==
>>>>         INACTIVE_UNIFORM_EXPLICIT_LOCATION)
>>>> -      return false;
>>>> +      return NULL;
>>>>
>>>> -   _mesa_uniform_split_location_offset(shProg, location, loc, array_index);
>>>> +   unsigned loc;
>>>> +   _mesa_uniform_split_location_offset(shProg, location, &loc, array_index);
>>>> +   struct gl_uniform_storage *const uni = &shProg->UniformStorage[loc];
>>>>
>>>> -   if (shProg->UniformStorage[*loc].array_elements == 0 && count > 1) {
>>>> +   if (uni->array_elements == 0 && count > 1) {
>>> I'm getting a NULL-pointer deference here when running piglit's
>>> spec/ARB_explicit_uniform_location/arb_explicit_uniform_location-use-of-unused-loc
>>> on yesterday's master. A quick git-log doesn't seem to contain a fix
>>> in today's master either.
>>>
>>> Perhaps something like this is in order?
>>>
>>> -   if (uni->array_elements == 0 && count > 1) {
>>> +   if (uni && uni->array_elements == 0 && count > 1) {
>>
>> fix is here:
>>
>> http://lists.freedesktop.org/archives/mesa-dev/2014-August/066752.html
>>
>> remaptable contains entries that are set NULL for inactive uniforms
> 
> Thanks.

Does Tapani's patch fix the problem for you?  If so, can we call that a
Tested-by? :)



More information about the mesa-dev mailing list