[Mesa-dev] gallium scaled types

Roland Scheidegger sroland at vmware.com
Tue Sep 13 09:51:35 PDT 2011


Am 13.09.2011 18:31, schrieb Jose Fonseca:
> 
> 
> ----- Original Message -----
>> Am 13.09.2011 00:33, schrieb Jose Fonseca:
>>> I admit I'm not very familiar how hardware currently supports 
>>> native double formats.  Or how likely it is for hardware to have
>>> native 4 x double register support in the future.  But even if we
>>> ignore the 4 x double case, there's still the 2 x double and 1 x
>>> double vertex attributes, which can be converted to float or
>>> double depending on the VertexAttrib call.
>> 
>> FWIW it's interesting to note that d3d11 does not seem to support
>> any native double (or 64bit for that matter) formats. From the HSLS
>> docs 
>> (http://msdn.microsoft.com/de-de/library/bb509646%28v=vs.85%29.aspx).
>>
>> 
"You cannot use double precision values as inputs and outputs for a
>> stream. To pass double precision values between shaders, declare
>> each double as a pair of uint data types. Then, use the asdouble
>> function to pack each double into the pair of uints and the asuint
>> function to unpack the pair of uints back into the double." That
>> probably implies hw doesn't support it neither.
> 
> That's weird.
> 
> I've looked into GL 4.2's specs, it looks they support passing dvec
> attributes. They actually mention specifically that dvec3/dvec4
> vertex attributes take two consecutive locations, so it looks like
> the concept that dvec4 alias 2x vec4 registers prevails everywhere.
> 
> There doesn't seem to be double/dvec texture sampling support in the
> language however.

Yes I've noticed that as well, there's also a couple of extensions for
64bit ints (which support 4x64bit too).
d3d11 approach looks a bit ugly to me, it seems to have 64bit formats in
the interface is a cleaner way. Maybe it's a bit more complicated for
current hw, e.g. d3d11 approach might map better to current hw.
I don't know though what we should do in gallium for that, since I would
expect even future hw to really have half as many components for
double/64bit formats (heck it's the same for sse too).

Roland


More information about the mesa-dev mailing list