[Mesa-dev] [PATCH 1/4] st/mesa: handle indirect samplers in arrays/structs properly (v3)

Dave Airlie airlied at gmail.com
Fri Feb 5 04:35:37 UTC 2016


On 5 February 2016 at 14:28, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Thu, Feb 4, 2016 at 11:25 PM, Dave Airlie <airlied at 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,

pulling it from var->data.location means going via the UniformRemapTable.

Dave.


More information about the mesa-dev mailing list