-
Notifications
You must be signed in to change notification settings - Fork 345
Description
Found by @greggman.
Currently the Compat doc says maxStorageBuffersPerShaderStage defaults to 4 in compat, instead of the Core default of 8, because it's computed as min(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS).
But this is no longer true since we have separate limits for InVertexStage and InFragmentStage. Because of that, the computation is actually min(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS). This is 8, which is the same as the base limit in Core. (GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS is guaranteed to be 8, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS is only guaranteed to be 4, but is always 8 in practice.)
Alternatively, we could keep maxStorageBuffersPerShaderStage at 4 but remove maxStorageBuffersInFragmentStage (default 4) entirely. However this would be artificially limiting, preventing people from using 8 in compute on devices that have only 4 in fragment.