Closed roeas closed 10 months ago
Can you have a look at where 8 limitation comes from? The opengl driver or just bgfx limitation? 8 is not reasonable nowadays as mobile device can also samples 16 texture.
https://stackoverflow.com/questions/72514919/max-image-units-in-glsl https://stackoverflow.com/questions/18242009/glsl-error-c3012-invalid-value-8-for-layout-specifier-binding-in-compute-shad
It does look like OpenGL's limit of the number of image uniforms is 8, but that makes it even stranger, since none of the slots in the compute shader at the time of this crash were greater than 7.
https://stackoverflow.com/questions/72514919/max-image-units-in-glsl https://stackoverflow.com/questions/18242009/glsl-error-c3012-invalid-value-8-for-layout-specifier-binding-in-compute-shad
It does look like OpenGL's limit of the number of image uniforms is 8, but that makes it even stranger, since none of the slots in the compute shader at the time of this crash were greater than 7.
The min number is 8. New graphics card can use 16~32.
Can you have a look at bgfx init log? It should log the int number GL_MAX_TEXTURE_IMAGE_UNITS
queried from OpenGL driver.
BGFX GL_MAX_TEXTURE_IMAGE_UNITS 32 (min: 8)
See https://github.com/godotengine/godot/blob/f82bf35a03502b33e0b3a5987573e3c6987912ce/drivers/gles3/rasterizer_scene_gles3.cpp#L2474. Godot queries the max texture count and decide actual texture slot by it. Not use a fixed int number. @Hinageshi01
So we can have a look at bgfx if it supports similar operations? Dynamic texture slot index rather than fixed index.
Another question is that FS uses more than actual hardware texture count. It doesn't have a good solution. Just decided by game project which is the lowest device it wants to support. Then project should enable/disable features for every device level.
Close it as we have enough findings about this issue. The solution is recorded in #425. Reopen it if you have new thoughts.
Crash when compute shader dispatch. Some outputs that might be useful: