[Mesa-dev] GLSL vs TGSI fp64/double roadblock number 1

Dave Airlie airlied at gmail.com
Tue Jun 17 17:19:53 PDT 2014

Okay I've been writing this in the background, but I've hit a point I
think I'd like to seek advice on,

So doubles in all SM5 hardware appear to be done using two channels of
floats to store the double value in, the SM5 assembly opcodes all take
xy, zw swizzles etc.

However at the GLSL level I just added a new type double, and just
plumbed that through everywhere,

Now I'm hitting a problem with constants,

currently the mesa state tracker just passes params->ParameterValues
into gallium as a user buffer or uploads it, params->ParameterValues
is an array of gl_constant_value.

Now the GLSL work I did meant adding a double to gl_constant_value,
which means we can no longer pass it to gallium as-is, we need to
iterate and extract things,

So just looking for opinions on how this could be dealt with,

a) fix state tracker to iterate and extract and shove into a gallium
const buffer, this introduces overheads we don't have now

b) fix GLSL/mesa to store double constants as 2xfloats, however I
expect this might make the GLSL code a bit more messy and it might
limit us in the future,


More information about the mesa-dev mailing list