KhronosGroup / GLSL

GLSL Shading Language Specification and Extensions
Other
337 stars 98 forks source link

fmin / fmax don't match GLSL.std.460 behavior #80

Closed ianromanick closed 1 week ago

ianromanick commented 5 years ago

The GLSL 4.60 (and also earlier) spec says for min:

Returns y if y < x; otherwise it returns x.

The GLSL.std.460 spec says for FMin:

Result is y if x < y; otherwise result is x. Which operand is the result is undefined if one of the operands is a NaN.

It seems like when GLSL.std.460 adopted this sensible behavior that the GLSL 4.60 (and possibly earlier) spec should have been updated to match. I suspect that most drivers and hardware have been implementing the GLSL.std.460 behavior for years.

gnl21 commented 5 years ago

This is certainly true of our implementation. I agree that the GLSL and ESSL specs should be updated to match the SPIR-V extended instruction behaviour.

pdaniell-nv commented 5 years ago

Assigned to @ianromanick to make an internal MR against the GLSL spec.