On Fri, 2016-02-05 at 14:35 +1000, Dave Airlie wrote: > On 5 February 2016 at 14:28, Ilia Mirkin <imir...@alum.mit.edu> > wrote: > > On Thu, Feb 4, 2016 at 11:25 PM, Dave Airlie <airl...@gmail.com> > > wrote: > > > > + > > > > + *base = this->shader_program- > > > > >UniformStorage[location].opaque[shader].index; > > > > > > self-review: this needs to use UniformRemapTable here, so it > > > picks up > > > the correct uniforms > > > (fixes fs-texelFetch-2D). > > > > So... _mesa_get_sampler_uniform_value does: > > > > get_sampler_name getname(sampler, shader_program); > > unsigned location; > > shader_program->UniformHash->get(location, getname.name) > > return shader_program- > > >UniformStorage[location].opaque[shader].index + > > getname.offset > > > > Was it wrong before? Or are you getting the location incorrectly? > > Looking up the value in the UniformHash with the name gives you the > correct answer,
Looking up the name in UniformHash will give you the base location of the array you are looking at so the offset is just the array offset. > > pulling it from var->data.location means going via the > UniformRemapTable. var->data.location Is the base location of the entire structure/array, if the offset is calculated correctly I'm not sure why you would need UniformRemapTable > > Dave. > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev