[Mesa-dev] [PATCH 2/7] st/mesa: implement GL_ATI_fragment_shader

Brian Paul brianp at vmware.com
Thu Feb 25 15:40:33 UTC 2016


On 02/25/2016 08:20 AM, Miklós Máté wrote:
> On 02/25/2016 02:37 AM, Brian Paul wrote:

>>> +   if (texinst->Opcode == ATI_FRAGMENT_SHADER_SAMPLE_OP) {
>>> +      /* use the current texture target for the sample operation
>>> +       * note: this implementation doesn't support re-using an ATI_fs
>>> +       *    with different texture targets
>>> +       */
>>> +      gl_texture_index index =
>>> _mesa_get_texture_target_index(t->ctx, r);
>>> +      unsigned target = translate_texture_target(index);
>>
>> So, the result of compiling the shader happens to depend upon the
>> currently active texture for unit 'r'?  That seems funny/fragile.
>>
>> I've never really looked too closely at ATI_fragment_shader so I don't
>> know.
> Yes, the shader code doesn't supply the texture target, it has to be
> deduced in the draw call, and a separate variant has to be created if
> the shader is re-used with different texture targets. AFAICT the r200
> driver avoids this by translating the shader on every draw call.

That would be good info to have in a comment somewhere, if it's not 
already stated somewhere else.

-Brian



More information about the mesa-dev mailing list