-
Notifications
You must be signed in to change notification settings - Fork 343
Compat: fix GL computation of storage limits #5029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Previews, as seen when this build job started (42219e5): |
|
Revised! |
|
@greggman review bump now that I'm back |
greggman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh.... I can't remember what we look at before. Re-checking.
min(MAX_SHADER_STORAGE_BUFFER_BINDINGS, MAX_COMPUTE_SHADER_STORAGE_BLOCKS)
min(MAX_SHADER_STORAGE_BUFFER_BINDINGS, MAX_FRAGMENT_SHADER_STORAGE_BLOCKS)
min(MAX_SHADER_STORAGE_BUFFER_BINDINGS, MAX_VERTEX_SHADER_STORAGE_BLOCKS)
is okay but it's not complete.
There's the issue of MAX_COMBINED_SHADER_STORAGE_BLOCKS and there are devices for which would affect any render pipeline and there are several devices that support less than vertex+fragment limits.
GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS vs
GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS
GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS
total valid entries: 3365
num entries where GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS+
GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS > COMBINED: 403
Combos where COMBINED < GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS +
GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS
MAX MAX total MAX count
FRAGMENT VERTEX of COMBINED of
SHADER SHADER limits SHADER opengles.gpuinfo.org
STORAGE STORAGE <--- STORAGE entries
BLOCKS BLOCKS BLOCKS
------- ------ ----- ------- -------------------
8 8 16 8 359
64 64 128 64 21
35 35 70 35 15
60 60 120 60 4
32 32 64 32 2
16 16 32 16 1
8192 2048 10240 8192 1
Those include
Adreno (TM) 510
Adreno (TM) 540
Adreno (TM) 640
PowerVR Rogue G6200
PowerVR Rogue GE8320
...etc...
Do you want those details here? To include these devices, it seems like the best a implementation can do this this.
min(MAX_SHADER_STORAGE_BUFFER_BINDINGS, MAX_COMPUTE_SHADER_STORAGE_BLOCKS, MAX_COMBINED_SHADER_STORAGE_BLOCKS)
min(MAX_SHADER_STORAGE_BUFFER_BINDINGS, MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, MAX_COMBINED_SHADER_STORAGE_BLOCKS / 2)
min(MAX_SHADER_STORAGE_BUFFER_BINDINGS, MAX_VERTEX_SHADER_STORAGE_BLOCKS, MAX_COMBINED_SHADER_STORAGE_BLOCKS / 2)
On the majority of devices, MAX_COMBINED_SHADER_STORAGE_BLOCKS will be > the sum of both
I noticed the formula for
maxStorageBuffersPerShaderStagewas outdated. I also wanted to add the formula for the new limits, but I'm not sure what they all are.