glDrawPixels with GL_FLOAT data

Is there a defined behaviour for using floating poin t data with glDrawPixels, where some of the values fall outside of the range [0.0, 1.0]?

Should it automatically clamp the values to this range, should it just overflow and (effectively) wrap around, or is it undefined what the behaviour should be?

On a similar point, what is the behaviour for the same data when using as the source for glTexImage2D? Again, should it wrap, clamp or is it undefined?

Values outside the range [0, 1] are clamped. Check the diagram on page 103 in the latest specification for the operation of pixel values transfered to OpenGL.

I seem to recall that the spec states that floating-point values are not clamped.

Originally posted by Korval:
I seem to recall that the spec states that floating-point values are not clamped.
… if the destination buffer is a floating point buffer. Color buffers with integer representations always clamp irrespectively of the glDrawPixels input format.

In that case, then it looks like a buggy Mac OS X implementation…

The behaviour I get on Linux is that the values are clamped. So, an image which is just a linear gradient from left to right, with values -1.0 on the left and 2.0 on the right gives an output which is black for the left third, white on the right third, and a greyscale ramp in the middle third.

On OSX, I seem to get the unclamped behaviour so the left third and right third are exactly the same as the central third (e.g. a greyscale ramp).