summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorTellowKrinkle <tellowkrinkle@gmail.com>2023-10-24 23:18:26 -0500
committerTellowKrinkle <tellowkrinkle@gmail.com>2023-10-25 17:47:04 +0200
commit4f2a79058a35a51e549c0ad5416cd5709fc35df4 (patch)
tree721faeb71e07eb3c54747dd48dd8e49d8686b482 /Source/Core/VideoBackends
parent323aea60d6cad5ef0799c46675a3872e2aeaf96e (diff)
VideoBackends:OGL: Handle when SSBOs are only supported in some shader stages
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLConfig.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLConfig.cpp b/Source/Core/VideoBackends/OGL/OGLConfig.cpp
index 2695402b63..b51c43aa89 100644
--- a/Source/Core/VideoBackends/OGL/OGLConfig.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLConfig.cpp
@@ -287,10 +287,6 @@ bool PopulateConfig(GLContext* m_main_gl_context)
g_Config.backend_info.bSupportsPrimitiveRestart =
!DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVE_RESTART) &&
((GLExtensions::Version() >= 310) || GLExtensions::Supports("GL_NV_primitive_restart"));
- g_Config.backend_info.bSupportsFragmentStoresAndAtomics =
- GLExtensions::Supports("GL_ARB_shader_storage_buffer_object");
- g_Config.backend_info.bSupportsVSLinePointExpand =
- GLExtensions::Supports("GL_ARB_shader_storage_buffer_object");
g_Config.backend_info.bSupportsGSInstancing = GLExtensions::Supports("GL_ARB_gpu_shader5");
g_Config.backend_info.bSupportsSSAA = GLExtensions::Supports("GL_ARB_gpu_shader5") &&
GLExtensions::Supports("GL_ARB_sample_shading");
@@ -351,6 +347,21 @@ bool PopulateConfig(GLContext* m_main_gl_context)
g_Config.backend_info.bSupportsTextureQueryLevels =
GLExtensions::Supports("GL_ARB_texture_query_levels") || GLExtensions::Version() >= 430;
+ if (GLExtensions::Supports("GL_ARB_shader_storage_buffer_object"))
+ {
+ GLint fs = 0;
+ GLint vs = 0;
+ glGetIntegerv(GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, &fs);
+ glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, &vs);
+ g_Config.backend_info.bSupportsFragmentStoresAndAtomics = fs >= 1;
+ g_Config.backend_info.bSupportsVSLinePointExpand = vs >= 1;
+ }
+ else
+ {
+ g_Config.backend_info.bSupportsFragmentStoresAndAtomics = false;
+ g_Config.backend_info.bSupportsVSLinePointExpand = false;
+ }
+
if (GLExtensions::Supports("GL_EXT_shader_framebuffer_fetch"))
{
g_ogl_config.SupportedFramebufferFetch = EsFbFetchType::FbFetchExt;