[Mesa-dev] [PATCH] compiler/glsl: Fix uniform location counting.

Manolova, Plamena plamena.manolova at intel.com
Wed Feb 17 12:49:10 UTC 2016


You're right, changing the if statement to a > b would be less confusing,
I'll go ahead and do that.

On Wed, Feb 17, 2016 at 2:35 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> On Wed, Feb 17, 2016 at 6:29 AM, Manolova, Plamena
> <plamena.manolova at intel.com> wrote:
> >>> > +   if (entries_total > 0)
> >>> > +      entries_total -= 1;
> >>>
> >>> This seems weird... why are you doing that?
> >
> >
> > According to the spec:
> > https://www.opengl.org/registry/specs/ARB/explicit_uniform_location.txt:
> > "The explicitly defined locations
> >     and the generated locations must be in the range of 0 to
> > MAX_UNIFORM_LOCATIONS minus one.", which means that the uniforms must fit
> > between array slots 0 - 98303, however if we use total_entries without
> > subtracting 1 we will be comparing to the range 1 - 98304 which will
> trigger
> > an error.
>
> But that's just a question of changing a >= into a > right? As it is,
> you're saying that entries_total == 0 and entries_total == 1 are the
> same thing (by subtracting 1). This is very odd.
>
>   -ilia
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160217/bfa1c7ad/attachment.html>


More information about the mesa-dev mailing list