OpenGL ES 2 version 3.0 for Warp3D Nova / AmigaOS4 has been finalized.It's available on my FTP for testers and A-Eon devs, as usual, for a last check.
- new aglSetParamTags / aglCreateContextTags2 parameter
OGLES2_CCT_DEBUG_SHADER_LOG. If set to TRUE then the library asks Nova for extra shader compiler info. A detailed log will be returned even on successful shader compilation. If this flag is set to FALSE (default) then only the usual standard error log will be returned.
- extended the extensions string by
GL_ARB_texture_non_power_of_two and
GL_OES_texture_npot. The lib implicitely supported those since day one but not mentioning them explicitely in the ext-string could cause some progs to execute internal pot-scale workarounds or to fails needlessly.
- Fix:
design flaw. Every shader had its own internal variable-cache. Which at first glance seems to be all good and which most often works. But actually it's wrong because that cache also handles the mapping of uniform locations. But those can vary for the very same shader if it's being used by multiple programs! So, this
bug could cause all sorts of hard to track issues if the client used shared shader objects for multiple programs. Now the variable-caches have been moved into the program objects (simply spoken, in fact the shaders still have their own cache but the programs get their own autarkic set of dedicated variable-representations).
- while I was at it I
trashed all the old program
introspection code and
rewrote it from scratch. As a result the lib now also supports uniform arrays. Sometimes trashing your old broken stuff is way better than trying to fix it - only to probably add more sideeffects. No,
better accept your failure and start over - extended the extensions string by
GL_ARB_arrays_of_arrays. This is because the new introspection system didn't just add array support but multidimensional array support too.
- new aglSetParamTags / aglCreateContextTags2 parameter
OGLES2_CCT_DETECT_UNINITIALIZED_GLSL_VARS. If set to 1 or 2 (default 0) then the library will analyze the generated SPIR-V code and look for uninitialized shader variables. If set to 1 then it will only put a warning in the log and continue, if set to 2 then glCompileShader will return with an error if something suspicious is being detected.
Note that the scanner is considered "good enough for us", it's certainly
not perfect (well, it cannot possibly be without simulating all possible inputs and fully emulating the shader, so...
it's just a ~200 liner ;) ). While it does analyze all different code-paths (branches, conditional branches, function calls, loops) it will not detect stuff like a vector variable being only partially initialized (e.g. a vec4 whose .xyz are initialized but not its .a won't be detected) or structs that are only partially initialized (e.g. struct s {vec2 a; vec2;b} won't be reported if a is being set but b is not). Other than that it gives pretty good results with only a minimal, practically
not measurable, performance impact on glCompileShader (depends on shader size / complexity / num variables, but even checking real big ones didn't hit performance measurably so far).
Thanks to kas1e for requesting!
-
glslangvalidator_redux shell tool extended by an equivalent -varcheck option to enable scanning for uninitialized shader variables.
- Fix:
standard violation. If you attached a texture to an FBO then a resize of said texture using glTexture2D should be enough to trigger a resize of the whole FBO. Before that fix this led to gfx coruption because Nova doesn't automatically handle that case neither. The necessary workaround until now was to unattach and reattach the texture to force ogles2 lib into updating the FBO. Now all you need is glTexture2D.
Thanks to Capehill for reporting!
- new aglCreateContext / aglSetParam parameters
OGLES2_CCT_SPIRV_OPLINES (bool) and
OGLES2_CCT_SPIRV_OPLINES_OFFSET (int) which extend the uninitialized-variables-detector by optionally telling you the source-code's line where the shite happened. For that it tells the integrated glslangvalidator to generate SPIR-V which contains OpLine opcodes, which in turn is now handled by the detector. OGLES2_CCT_SPIRV_OPLINES_OFFSET is useful to e.g. make the output 0 or 1 relative or to compensate for any eventual prefix (e.g. ShaderJoy adds a static prefix and should therefore adjust the offset).
Note that this feature is being disabled if you don't have installed the
latest Nova 1.76+. Reason is that among some others it didn't correctly handle the OpLine opcode, which in turn resulted in the whole shader not being compiled at all.
- !don't forget to download the
new include-folder too!
- version set to 3.0 (14.9.2020) (yep, it's that much of an improvement ;) )
Thanks to
kas1e and
Capehill for testing!
Cheers,
Daniel