[Mesa-dev] sampler types in tgsi

Marek Olšák maraeo at gmail.com
Sat Nov 29 04:42:54 PST 2014


GLSL allows specifying sampler formats in shaders too, but it only
appears to be allowed for GL_ARB_shader_image_load_store and it must
match the sample view format, so that drivers can ignore it if they
want. The format specification is complete except for component
ordering. e.g. a shader can declare "rgba16_snorm", but it cannot
declare "bgra16_snorm".

Marek

On Sat, Nov 29, 2014 at 8:43 AM, Jose Fonseca <jfonseca at vmware.com> wrote:
> On 29/11/14 06:07, Roland Scheidegger wrote:
>>
>> Am 29.11.2014 um 06:12 schrieb Ilia Mirkin:
>>>
>>> Hello,
>>>
>>> It appears that the A3XX ISA (freedreno) requires the texture
>>> instruction to properly specify its output type (or at least f32 vs
>>> u32). Now I could stick this into a driver-local shader key, but it
>>> seems unfortunate since in glsl, it knows whether it's an int or float
>>> sampler.
>>>
>>> Would there be any objections to being able to specify an int property
>>> on the SAMP declaration? Or some alternate approach?
>>>
>>
>> Hmm I guess the return type of the sampler_view decl was intended for
>> something along these lines (it's a d3d10-ism but not really used right
>> now, and it is per channel too).
>
>
> Right --
> http://msdn.microsoft.com/en-us/library/windows/desktop/bb943976.aspx
>
>> If you make some return type in sampler
>> this is thus not very nice as now you've got it both in sampler and
>> sampler_view. Not sure what a good solution of that would be...
>
>
> I think a good compromise would be to force separate declarations of
> sampler_view and sampler, like we need to do for D3D10 sample opcodes
>
>
>   DCL SVIEW[0], 2D, UINT
>   DCL SAMP[0]
>   TEX OUT[1], IN[1], SAMP[0]
>
> at least for the UINT resources.
>
>
> I also think that eventually we should have TGSI to drop the opcodes that
> take combined sampler and sampler_views, have only the D3D10 like opcodes
> with seperate operands for sampler and sampler_view, and have a
> PIPE_CAP_SEPARATE just for those drivers that can handle the combination.
> But this can wait.
>
>
> Jose
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list