Re:Don't "optimize" conditional moves in shaders with mix()+...
by dahart on Tuesday February 11, 2025 @08:27PM
(#43020708)
What shaders (presumably GLSL & HLSL) do precision wise isn’t an IEEE compliance issue, it’s either a DX/Vulkan spec issue, OR a user compiler settings issue. Dropping compliance is and should be allowed when the code asks for it. This is why GLSL has lowp, mediump, and highp settings. I think all GPUs are IEEE compliant and have been for a long time.
[ Parent
| on HN ]
Re:Don't "optimize" conditional moves in shaders with mix()+...
by Cieric on Thursday February 13, 2025 @11:10AM
(#43037387)
I agree on the dropping compliance when asked for aspect, the problem I'm referring to more is the driver dropping compliance without the game asking for it. If the underlying system can randomly drop compliance when ever it thinks it's fine without telling the user and without the user asking, I would not consider that compliant.
Re:Don't "optimize" conditional moves in shaders with mix()+...
by dahart on Friday February 14, 2025 @10:24AM
(#43049249)
That is fair, if true. But I’m very skeptical any modern drivers are dropping compliance without being asked. The one possibility I could buy is that you ran into a case of someone having dropped precision intentionally in a specific game in order to “optimize” a shader. Otherwise, precision and IEEE compliance is the prerogative of the compiler. The compiler is sometimes in the driver, but it never decides on it’s own what precision to use, it uses either default or explicit precision settings. The only reason it would not produce IEEE compliant code is if it was being asked to.