[Mesa-dev] [PATCH 1/2] tgsi: add texture-type info to texture instructions

Jose Fonseca jfonseca at vmware.com
Thu Jun 4 12:11:12 PDT 2015


On 04/06/15 19:50, Rob Clark wrote:
> On Thu, Jun 4, 2015 at 2:14 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
>> I think we had a discussion about this on mesa3d-dev a while ago.  I don't
>> recall the conclusions but I wish I did.
>>
>> We have tgsi_return_type.  Why isn't this enough?  Or better, why isn't
>> being used for this?
>
> mostly arbitrary reasons.. the unorm/snorm values don't really make
> sense here, so it didn't quite seem to fit (plus would have needed
> another bit, although I guess that isn't really an issue)
>
> Or if the question was, why not include the type information in the
> decl rather than the instr?  Well.. that at least is more awkward for
> the implementation, since the information is part of the instruction
> for both GLSL IR and NIR (and at the end of the day, that is also
> where I need the info in my compiler)

IIUC, GLSL also has this information readily available in the sampler 
declaration:

   uniform  sampler2D ftex;
   uniform isampler2D itex;
   uniform usampler2D utex;

So isn't this a double standard?  After all, if the argument here is

   "GLSL IR / NIR has this info readily available, so let's pass it to 
the TGSI",

then the same rationale should apply to

   "GLSL has this info readily available on the sampler declaration, so 
lets' pass it to GLSL IR/NIR 's declarations."


I want to avoid having two places for this info in TGSI: in decl and in 
instruction, as that's a recipe for bugs and complexity.  _Specially_ 
when the decl is imposed for D3D10 support, while the inst is mere a 
matter of internal Mesa convention...


In short, I'm fine in in principle with piping this info through, but 
lets come up a decent generalization.  In particular, lets try get this 
in the decls so it's consistent.


Jose



More information about the mesa-dev mailing list