OGL: Don't generate a geometry shader if the backend doesn't support it.

This commit repurposes the bSupportsStereoscopy flag as the bSupportsGeometryShaders flag.
This commit is contained in:
Jules Blok 2014-12-17 00:26:03 +01:00
parent 782a5adb94
commit 7e8f96f0d3
7 changed files with 11 additions and 11 deletions

View File

@ -449,7 +449,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
// - stereoscopy
if (vconfig.backend_info.bSupportsStereoscopy && vconfig.iStereoMode > 0)
if (vconfig.backend_info.bSupportsGeometryShaders && vconfig.iStereoMode > 0)
{
wxFlexGridSizer* const szr_stereo = new wxFlexGridSizer(2, 5, 5);

View File

@ -80,7 +80,7 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsDualSourceBlend = true;
g_Config.backend_info.bSupportsPrimitiveRestart = true;
g_Config.backend_info.bSupportsOversizedViewports = false;
g_Config.backend_info.bSupportsStereoscopy = true;
g_Config.backend_info.bSupportsGeometryShaders = true;
g_Config.backend_info.bSupports3DVision = true;
IDXGIFactory* factory;

View File

@ -211,7 +211,7 @@ SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components
ShaderCode gcode;
GenerateVertexShaderCode(vcode, components, API_OPENGL);
GeneratePixelShaderCode(pcode, dstAlphaMode, API_OPENGL, components);
if (!IsPassthroughGeometryShader(uid.guid))
if (g_ActiveConfig.backend_info.bSupportsGeometryShaders && !IsPassthroughGeometryShader(uid.guid))
GenerateGeometryShaderCode(gcode, primitive_type, API_OPENGL);
if (g_ActiveConfig.bEnableShaderDebugging)

View File

@ -498,7 +498,7 @@ Renderer::Renderer()
{
g_ogl_config.eSupportedGLSLVersion = GLSLES_300;
g_ogl_config.bSupportsAEP = false;
g_Config.backend_info.bSupportsStereoscopy = false;
g_Config.backend_info.bSupportsGeometryShaders = false;
}
else
{
@ -506,7 +506,7 @@ Renderer::Renderer()
g_ogl_config.bSupportsAEP = GLExtensions::Supports("GL_ANDROID_extension_pack_es31a");
g_Config.backend_info.bSupportsBindingLayout = true;
g_Config.backend_info.bSupportsEarlyZ = true;
g_Config.backend_info.bSupportsStereoscopy = g_ogl_config.bSupportsAEP;
g_Config.backend_info.bSupportsGeometryShaders = g_ogl_config.bSupportsAEP;
}
}
else
@ -522,13 +522,13 @@ Renderer::Renderer()
{
g_ogl_config.eSupportedGLSLVersion = GLSL_130;
g_Config.backend_info.bSupportsEarlyZ = false; // layout keyword is only supported on glsl150+
g_Config.backend_info.bSupportsStereoscopy = false; // geometry shaders are 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_Config.backend_info.bSupportsStereoscopy = false; // geometry shaders are only supported on glsl150+
g_Config.backend_info.bSupportsGeometryShaders = false; // geometry shaders are only supported on glsl150+
}
else
{
@ -565,7 +565,7 @@ Renderer::Renderer()
bSuccess = false;
}
if (g_Config.iStereoMode > 0 && !g_Config.backend_info.bSupportsStereoscopy)
if (g_Config.iStereoMode > 0 && !g_Config.backend_info.bSupportsGeometryShaders)
OSD::AddMessage("Stereoscopic 3D isn't supported by your GPU, support for OpenGL 3.2 is required.", 10000);
if (!bSuccess)

View File

@ -139,7 +139,7 @@ static void InitBackendInfo()
//g_Config.backend_info.bSupportsDualSourceBlend = true; // is gpu dependent and must be set in renderer
//g_Config.backend_info.bSupportsEarlyZ = true; // is gpu dependent and must be set in renderer
g_Config.backend_info.bSupportsOversizedViewports = true;
g_Config.backend_info.bSupportsStereoscopy = true;
g_Config.backend_info.bSupportsGeometryShaders = true;
g_Config.backend_info.bSupports3DVision = false;
g_Config.backend_info.Adapters.clear();

View File

@ -214,7 +214,7 @@ void VideoConfig::VerifyValidity()
// TODO: Check iMaxAnisotropy value
if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0;
if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0;
if (!backend_info.bSupportsStereoscopy) iStereoMode = 0;
if (!backend_info.bSupportsGeometryShaders) iStereoMode = 0;
}
void VideoConfig::Save(const std::string& ini_file)

View File

@ -151,7 +151,7 @@ struct VideoConfig final
bool bSupportsDualSourceBlend;
bool bSupportsPrimitiveRestart;
bool bSupportsOversizedViewports;
bool bSupportsStereoscopy;
bool bSupportsGeometryShaders;
bool bSupports3DVision;
bool bSupportsEarlyZ; // needed by PixelShaderGen, so must stay in VideoCommon
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon