Open danilw opened 3 years ago
My guess: That a return value is undefined, does not mean, that it is INF or NAN. To use some 'c' jargon slightly out of context 'it could even contain nasal demons', which means: The implementation may return whatever it wants even in inconsistent ways.
That a return value is undefined, does not mean, that it is INF or NAN.
on the GPU GLSL is NAN or INF and many people include me expect NAN or INF in many cases as a result
without NAN and INF any my own shader that longer than 100 lines of code will just work completely wrong
this fact makes it impossible to use SPIRV-VM to actually "debug" anything because behavior of emulation completely different to real GPU shaders result
maybe im wrong, but
https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html
And others where the result should be inf or nan in SPIRV-VM its not.
Also dFd https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/dFdx.xhtml
and dFd in the SPIRV-VM just does not work the same as on GPU (SPIRV-VM result incorrect): shader code for test:
Correct/expected result (screenshot from Vulkan application, but it same in Browser in OpenGL mode):
Result from SPIRV-VM: