-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix postprocessing shader support on macOS #11823
Conversation
Check GL_ARB_shading_language_420pack availability, which SPIRV-Cross assumes present by default, causing explicit binding location generation during shader translation.
@@ -335,6 +335,7 @@ void CheckGLExtensions() { | |||
gl_extensions.EXT_blend_func_extended = g_set_gl_extensions.count("GL_EXT_blend_func_extended") != 0; | |||
gl_extensions.ARB_conservative_depth = g_set_gl_extensions.count("GL_ARB_conservative_depth") != 0; | |||
gl_extensions.ARB_shader_image_load_store = (g_set_gl_extensions.count("GL_ARB_shader_image_load_store") != 0) || (g_set_gl_extensions.count("GL_EXT_shader_image_load_store") != 0); | |||
gl_extensions.ARB_shading_language_420pack = (g_set_gl_extensions.count("GL_ARB_shading_language_420pack") != 0); |
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.
We should also set this to true down lower, see here:
ppsspp/ext/native/gfx_es2/gpu_features.cpp
Line 516 in 27d216e
// ARB_texture_storage = true; |
Since AFAIK, this extension can be elided in the extensions string on 4.2+.
-[Unknown]
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.
I am not sure if it is intended. Since 4.2 it is the core functionality indeed, yet the extension support has nothing to do to it. For instance, SPIR-V cross has the following code, and it makes good sense to me:
can_use_binding = options.enable_420pack_extension || (options.version >= 420);
I am fine to change it if gl_extensions
is just mislabeled and does not mean extension availability but rather OpenGL features. However, I would suggest to rename it to gl_features
in this case.
I think it's ok but not 100% sure of the semantics either of enabling it on post-420 versions. But let's find out I guess. |
If we want to move the checks to every usage for every extension that's built into core, we should do that consistently. I don't agree with not doing it only in this case. Although, really, it seems like we might as well just always use false since we probably get no benefit from this extension for post shaders. -[Unknown] |
@unknownbrackets just in case, as I did not mention it explicitly in my previous message. Changing This will not result in generation of non conformant shaders, but will just break on implementations that do not support ARB_shading_language_420pack (which is fine) and do disable OpenGL 4.2 features when targeting OpenGL 4.1. Consequentially it seems to me that the current design may be no good in several other places you, where you took the route of checking OpenGL version. If you are concerned about consistency, I would suggest making a PR renaming |
Whether it's called gl_features, gl_extensions, gl_extension_names_of_features_we_use, or anything else - gl_extensions is mostly a historic name. I'm not a huge fan of changing all the code on ruining blame history in this case. We of course support anything from OpenGL 2.0 to OpenGL 4.6. So you could say we're "targeting" OpenGL 2.0. We check that various OpenGL functionality, exposed via extensions, is usable in many places across many operating systems. SPRIV cross and post-render shaders are a fraction of this usage. For example, we check if the things exposed by ARB_copy_image are usable to know if we can use To be clear, the larger % of OpenGL implementations we deal with expose I'm chiefly concerned with the runtime shaders we generate, which don't run through the spriv-cross code (although perhaps they might eventually - #11412.) -[Unknown] |
Mh, but basically the same issue happens here, when 10% of the drivers behave differently from the rest. Not sure what is the correct approach. |
Check GL_ARB_shading_language_420pack availability, which SPIRV-Cross assumes
present by default, causing explicit binding location generation during shader
translation.