summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/Render.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2015-10-18 00:43:22 +1300
committerScott Mansell <phiren@gmail.com>2015-10-18 01:46:54 +1300
commite7b2a22225b7d11f38dd045c990370df1daac61e (patch)
treea6cacaaa04f238fb1b260b326e399418a68c058f /Source/Core/VideoBackends/OGL/Render.cpp
parent4d3d947efc505fb91d9b4efe6ac137d4590cb655 (diff)
Support Conservative Depth as a fallback for EarlyZ
Allows Mesa based drivers to support ZCompLoc
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/Render.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp
index 12f98691b3..f59f527354 100644
--- a/Source/Core/VideoBackends/OGL/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Render.cpp
@@ -434,7 +434,6 @@ Renderer::Renderer()
GLExtensions::Supports("GL_EXT_blend_func_extended");
g_Config.backend_info.bSupportsPrimitiveRestart = !DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVERESTART) &&
((GLExtensions::Version() >= 310) || GLExtensions::Supports("GL_NV_primitive_restart"));
- g_Config.backend_info.bSupportsEarlyZ = GLExtensions::Supports("GL_ARB_shader_image_load_store");
g_Config.backend_info.bSupportsBBox = 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");
@@ -469,6 +468,8 @@ Renderer::Renderer()
g_ogl_config.bSupports3DTextureStorage = GLExtensions::Supports("GL_ARB_texture_storage_multisample") ||
GLExtensions::Supports("GL_OES_texture_storage_multisample_2d_array");
g_ogl_config.bSupports2DTextureStorage = GLExtensions::Supports("GL_ARB_texture_storage_multisample");
+ g_ogl_config.bSupportsEarlyFragmentTests = GLExtensions::Supports("GL_ARB_shader_image_load_store");
+ g_ogl_config.bSupportsConservativeDepth = GLExtensions::Supports("GL_ARB_conservative_depth");
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
{
@@ -488,7 +489,7 @@ Renderer::Renderer()
g_ogl_config.eSupportedGLSLVersion = GLSLES_310;
g_ogl_config.bSupportsAEP = GLExtensions::Supports("GL_ANDROID_extension_pack_es31a");
g_Config.backend_info.bSupportsBindingLayout = true;
- g_Config.backend_info.bSupportsEarlyZ = true;
+ g_ogl_config.bSupportsEarlyFragmentTests = true;
g_Config.backend_info.bSupportsGeometryShaders = g_ogl_config.bSupportsAEP;
g_Config.backend_info.bSupportsGSInstancing = g_Config.backend_info.bSupportsGeometryShaders && g_ogl_config.SupportedESPointSize > 0;
g_Config.backend_info.bSupportsSSAA = g_ogl_config.bSupportsAEP;
@@ -507,7 +508,7 @@ Renderer::Renderer()
g_ogl_config.eSupportedGLSLVersion = GLSLES_320;
g_ogl_config.bSupportsAEP = GLExtensions::Supports("GL_ANDROID_extension_pack_es31a");
g_Config.backend_info.bSupportsBindingLayout = true;
- g_Config.backend_info.bSupportsEarlyZ = true;
+ g_ogl_config.bSupportsEarlyFragmentTests = true;
g_Config.backend_info.bSupportsGeometryShaders = true;
g_Config.backend_info.bSupportsGSInstancing = g_ogl_config.SupportedESPointSize > 0;
g_Config.backend_info.bSupportsPaletteConversion = true;
@@ -533,13 +534,15 @@ Renderer::Renderer()
else if (strstr(g_ogl_config.glsl_version, "1.30"))
{
g_ogl_config.eSupportedGLSLVersion = GLSL_130;
- g_Config.backend_info.bSupportsEarlyZ = false; // layout keyword is only supported on glsl150+
+ g_ogl_config.bSupportsEarlyFragmentTests = false; // layout keyword is only supported on glsl150+
+ g_ogl_config.bSupportsConservativeDepth = false; // layout keyword is only supported on glsl150+
g_Config.backend_info.bSupportsGeometryShaders = false; // geometry shaders are only supported on glsl150+
}
else if (strstr(g_ogl_config.glsl_version, "1.40"))
{
g_ogl_config.eSupportedGLSLVersion = GLSL_140;
- g_Config.backend_info.bSupportsEarlyZ = false; // layout keyword is only supported on glsl150+
+ g_ogl_config.bSupportsEarlyFragmentTests = false; // layout keyword is only supported on glsl150+
+ g_ogl_config.bSupportsConservativeDepth = false; // layout keyword is only supported on glsl150+
g_Config.backend_info.bSupportsGeometryShaders = false; // geometry shaders are only supported on glsl150+
}
else if (strstr(g_ogl_config.glsl_version, "1.50"))
@@ -560,6 +563,9 @@ Renderer::Renderer()
g_ogl_config.bSupportsAEP = false;
}
+ // Either method can do early-z tests. See PixelShaderGen for details.
+ g_Config.backend_info.bSupportsEarlyZ = g_ogl_config.bSupportsEarlyFragmentTests || g_ogl_config.bSupportsConservativeDepth;
+
if (g_ogl_config.bSupportsDebug)
{
if (GLExtensions::Supports("GL_KHR_debug"))