From 5fe3def64cb21908239f2e6644507ec5b2e9e632 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 14 Jan 2013 20:00:33 +0100 Subject: [PATCH] videoConfig cleanup --- Source/Core/VideoCommon/Src/VideoConfig.cpp | 2 +- Source/Core/VideoCommon/Src/VideoConfig.h | 2 -- .../Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 10 +++++----- Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/main.cpp | 1 - 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index 128a05177c..0e43904ab0 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -43,7 +43,6 @@ VideoConfig::VideoConfig() backend_info.APIType = API_NONE; backend_info.bUseRGBATextures = false; backend_info.bSupports3DVision = false; - backend_info.bSupportsGLSL = false; } void VideoConfig::Load(const char *ini_file) @@ -174,6 +173,7 @@ void VideoConfig::VerifyValidity() if (!backend_info.bSupports3DVision) b3DVision = false; if (!backend_info.bSupportsFormatReinterpretation) bEFBEmulateFormatChanges = false; if (!backend_info.bSupportsPixelLighting) bEnablePixelLighting = false; + if (backend_info.APIType != API_OPENGL) backend_info.bSupportsGLSLUBO = false; } void VideoConfig::Save(const char *ini_file) diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index 15f148b613..7b141d442a 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -163,8 +163,6 @@ struct VideoConfig bool bSupportsFormatReinterpretation; bool bSupportsPixelLighting; - bool bSupportsGLSL; - bool bSupportsGLSLBlend; bool bSupportsGLSLUBO; bool bSupportsGLSLCache; } backend_info; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index ba9049aec3..4a2fc131a7 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -100,7 +100,7 @@ void ProgramShaderCache::SetProgramVariables(PCacheEntry &entry) void ProgramShaderCache::SetProgramBindings ( ProgramShaderCache::PCacheEntry& entry ) { - if (g_ActiveConfig.backend_info.bSupportsGLSLBlend) + if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend) { // So we do support extended blending // So we need to set a few more things here. diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 168fee7e9f..71a5edbc51 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -300,7 +300,7 @@ Renderer::Renderer() s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL; if (glewIsSupported("GL_ARB_blend_func_extended")) - g_Config.backend_info.bSupportsGLSLBlend = true; + g_Config.backend_info.bSupportsDualSourceBlend = true; if (glewIsSupported("GL_ARB_uniform_buffer_object")) g_Config.backend_info.bSupportsGLSLUBO = true; if (glewIsSupported("GL_ARB_get_program_binary")) @@ -308,7 +308,7 @@ Renderer::Renderer() UpdateActiveConfig(); OSD::AddMessage(StringFromFormat("Supports Blending: %s UBOs: %s Cache: %s", - g_ActiveConfig.backend_info.bSupportsGLSLBlend ? "True" : "False", + g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "True" : "False", g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "True" : "False", g_ActiveConfig.backend_info.bSupportsGLSLCache ? "True" : "False").c_str(), 5000); @@ -973,7 +973,7 @@ void Renderer::SetBlendMode(bool forceUpdate) bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; - bool useDualSource = useDstAlpha && g_ActiveConfig.backend_info.bSupportsGLSLBlend; + bool useDualSource = useDstAlpha && g_ActiveConfig.backend_info.bSupportsDualSourceBlend; if (changes & 1) // blend enable change @@ -985,7 +985,7 @@ void Renderer::SetBlendMode(bool forceUpdate) GLenum equation = newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD; GLenum equationAlpha = useDualSource ? GL_FUNC_ADD : equation; - if (g_ActiveConfig.backend_info.bSupportsGLSLBlend) + if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend) glBlendEquationSeparate(equation, equationAlpha); else glBlendEquation(newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD); @@ -993,7 +993,7 @@ void Renderer::SetBlendMode(bool forceUpdate) if (changes & 0x1F8) { - if (g_ActiveConfig.backend_info.bSupportsGLSLBlend) + if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend) { GLenum srcFactor = glSrcFactors[(newval >> 3) & 7]; GLenum srcFactorAlpha = srcFactor; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp index bcb7698def..038792a380 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp @@ -177,7 +177,7 @@ void VertexManager::vFlush() && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; // Makes sure we can actually do Dual source blending - bool dualSourcePossible = g_ActiveConfig.backend_info.bSupportsGLSLBlend; + bool dualSourcePossible = g_ActiveConfig.backend_info.bSupportsDualSourceBlend; // finally bind FRAGMENTSHADER* ps; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 58d6226608..66f8281745 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -135,7 +135,6 @@ void InitBackendInfo() g_Config.backend_info.bSupportsDualSourceBlend = false; // supported, but broken g_Config.backend_info.bSupportsFormatReinterpretation = false; g_Config.backend_info.bSupportsPixelLighting = true; - g_Config.backend_info.bSupportsGLSL = true; // aamodes const char* caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};