[Piglit] [PATCH 2/5] shader_runner: Use integers for GL and GLSL versions
Ian Romanick
idr at freedesktop.org
Wed Nov 14 16:28:00 PST 2012
On 11/14/2012 01:18 PM, Eric Anholt wrote:
> Ian Romanick <idr at freedesktop.org> writes:
>
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> In floating point, 3.1 is actually 3.0999999999, and that's just
>> awsome for comparing GL versions.
>
>> + sscanf(line, "%u.%u", &major, &minor);
>> +
>> + /* This hack is so that we can tell the difference between GL versions
>> + * and GLSL versions. All GL versions increment by ".1", and all GLSL
>> + * versions increment by ".10".
>> + */
>> + if (minor >= 10) {
>> + *version = (major * 10) + (minor / 10);
>> + } else {
>> + *version = (major * 10) + minor;
>> + }
>> }
>
> Could glsl versions please be stored as a number like "110"? It's what
> we use in Mesa, and it's what #version wants.
Yes. I used two digit versions because the places in shader_runner that
used a version only had two digits. I also prefer the X.YY format.
More information about the Piglit
mailing list