mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.
authorEric Anholt <eric@anholt.net>
Wed, 26 Oct 2011 23:09:16 +0000 (16:09 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 28 Oct 2011 19:10:01 +0000 (12:10 -0700)
commitb4d988bc9f36fddbe0cc92ea6e267d307f6d1112
treeea21ed6038fcf6fcfba5f79e44848448859d9976
parent3d7477206d7a345eb53df5c1288a5b34e83bc2d8
mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.

From the GL_EXT_packed_float spec:

    For an RGBA color, if <type> is not one of FLOAT,
    UNSIGNED_INT_5_9_9_9_REV_EXT, or UNSIGNED_INT_10F_11F_11F_REV_EXT,
    or if the CLAMP_READ_COLOR_ARB is TRUE, or CLAMP_READ_COLOR_ARB
    is FIXED_ONLY_ARB and the selected color (or texture) buffer is
    a fixed-point buffer, each component is first clamped to [0,1].
    Then the appropriate conversion formula from table 4.7 is applied
    the component."

(but we previously resolved that the CLAMP_READ_COLOR bit is not
relevant to glGetTexImage())

This fixes most of the cases in piglit GL_EXT_packed_float/pack.

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/texgetimage.c