[Mesa-dev] [PATCH] glsl: uniform sampler should occupy 1 location

Micael kam1kaz3 at gmail.com
Fri Aug 22 07:58:40 PDT 2014


Is this because of the 64 bit handles? If so, I think I agree with you.
According to the ARB_bindless_texture spec changes:
"When used as shader inputs, outputs, uniform block members, or
temporaries, the value of the sampler is a 64-bit unsigned integer handle
and never refers to a texture image unit."

However, should we consume 2 locs only if ARB_bindless_texture is present,
or always?


On Fri, Aug 22, 2014 at 8:36 AM, Dave Airlie <airlied at gmail.com> wrote:

> In the future for ARB_bindless_texture we might want this to be 2, I'm
> not sure if we should just do that now.
>
> Dave.
>
> On 22 August 2014 09:25, Micael Dias <kam1kaz3 at gmail.com> wrote:
> > ---
> > If samplers occupy zero locations we can run into a lot of issues. See
> #82921.
> > I briefly tested this with my own code (which was previously crashing and
> > misbehaving) and also ran other apps and everything seems to work fine.
> > I'm not used to contributing code in this fashion, so please forgive me
> if I'm
> > making some mistake. Thanks.
> >
> >  src/glsl/glsl_types.cpp | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
> > index 66e9b13..cc05193 100644
> > --- a/src/glsl/glsl_types.cpp
> > +++ b/src/glsl/glsl_types.cpp
> > @@ -691,6 +691,8 @@ glsl_type::uniform_locations() const
> >        return size;
> >     case GLSL_TYPE_ARRAY:
> >        return this->length * this->fields.array->uniform_locations();
> > +   case GLSL_TYPE_SAMPLER:
> > +      return 1;
> >     default:
> >        break;
> >     }
> > --
> > 2.1.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>



-- 
Micael Dias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140822/374a7b98/attachment.html>


More information about the mesa-dev mailing list