这是indexloc提供的服务,不要输入任何密码
Skip to content

Compat: maxStorageBuffersPerShaderStage doesn't need to be lowered #5103

@kainino0x

Description

@kainino0x

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIapi resolvedResolved - waiting for a change to the API specificationcompatWebGPU Compatibility Modeproposal

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions