videoConfig cleanup
This commit is contained in:
parent
4c2dd093a3
commit
5fe3def64c
|
@ -43,7 +43,6 @@ VideoConfig::VideoConfig()
|
||||||
backend_info.APIType = API_NONE;
|
backend_info.APIType = API_NONE;
|
||||||
backend_info.bUseRGBATextures = false;
|
backend_info.bUseRGBATextures = false;
|
||||||
backend_info.bSupports3DVision = false;
|
backend_info.bSupports3DVision = false;
|
||||||
backend_info.bSupportsGLSL = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoConfig::Load(const char *ini_file)
|
void VideoConfig::Load(const char *ini_file)
|
||||||
|
@ -174,6 +173,7 @@ void VideoConfig::VerifyValidity()
|
||||||
if (!backend_info.bSupports3DVision) b3DVision = false;
|
if (!backend_info.bSupports3DVision) b3DVision = false;
|
||||||
if (!backend_info.bSupportsFormatReinterpretation) bEFBEmulateFormatChanges = false;
|
if (!backend_info.bSupportsFormatReinterpretation) bEFBEmulateFormatChanges = false;
|
||||||
if (!backend_info.bSupportsPixelLighting) bEnablePixelLighting = false;
|
if (!backend_info.bSupportsPixelLighting) bEnablePixelLighting = false;
|
||||||
|
if (backend_info.APIType != API_OPENGL) backend_info.bSupportsGLSLUBO = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoConfig::Save(const char *ini_file)
|
void VideoConfig::Save(const char *ini_file)
|
||||||
|
|
|
@ -163,8 +163,6 @@ struct VideoConfig
|
||||||
bool bSupportsFormatReinterpretation;
|
bool bSupportsFormatReinterpretation;
|
||||||
bool bSupportsPixelLighting;
|
bool bSupportsPixelLighting;
|
||||||
|
|
||||||
bool bSupportsGLSL;
|
|
||||||
bool bSupportsGLSLBlend;
|
|
||||||
bool bSupportsGLSLUBO;
|
bool bSupportsGLSLUBO;
|
||||||
bool bSupportsGLSLCache;
|
bool bSupportsGLSLCache;
|
||||||
} backend_info;
|
} backend_info;
|
||||||
|
|
|
@ -100,7 +100,7 @@ void ProgramShaderCache::SetProgramVariables(PCacheEntry &entry)
|
||||||
|
|
||||||
void ProgramShaderCache::SetProgramBindings ( ProgramShaderCache::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 do support extended blending
|
||||||
// So we need to set a few more things here.
|
// So we need to set a few more things here.
|
||||||
|
|
|
@ -300,7 +300,7 @@ Renderer::Renderer()
|
||||||
s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL;
|
s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL;
|
||||||
|
|
||||||
if (glewIsSupported("GL_ARB_blend_func_extended"))
|
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"))
|
if (glewIsSupported("GL_ARB_uniform_buffer_object"))
|
||||||
g_Config.backend_info.bSupportsGLSLUBO = true;
|
g_Config.backend_info.bSupportsGLSLUBO = true;
|
||||||
if (glewIsSupported("GL_ARB_get_program_binary"))
|
if (glewIsSupported("GL_ARB_get_program_binary"))
|
||||||
|
@ -308,7 +308,7 @@ Renderer::Renderer()
|
||||||
|
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
OSD::AddMessage(StringFromFormat("Supports Blending: %s UBOs: %s Cache: %s",
|
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.bSupportsGLSLUBO ? "True" : "False",
|
||||||
g_ActiveConfig.backend_info.bSupportsGLSLCache ? "True" : "False").c_str(), 5000);
|
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
|
bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate
|
||||||
&& bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
&& 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)
|
if (changes & 1)
|
||||||
// blend enable change
|
// blend enable change
|
||||||
|
@ -985,7 +985,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
|
||||||
GLenum equation = newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD;
|
GLenum equation = newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD;
|
||||||
GLenum equationAlpha = useDualSource ? GL_FUNC_ADD : equation;
|
GLenum equationAlpha = useDualSource ? GL_FUNC_ADD : equation;
|
||||||
|
|
||||||
if (g_ActiveConfig.backend_info.bSupportsGLSLBlend)
|
if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend)
|
||||||
glBlendEquationSeparate(equation, equationAlpha);
|
glBlendEquationSeparate(equation, equationAlpha);
|
||||||
else
|
else
|
||||||
glBlendEquation(newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD);
|
glBlendEquation(newval & 4 ? GL_FUNC_REVERSE_SUBTRACT : GL_FUNC_ADD);
|
||||||
|
@ -993,7 +993,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
|
||||||
|
|
||||||
if (changes & 0x1F8)
|
if (changes & 0x1F8)
|
||||||
{
|
{
|
||||||
if (g_ActiveConfig.backend_info.bSupportsGLSLBlend)
|
if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend)
|
||||||
{
|
{
|
||||||
GLenum srcFactor = glSrcFactors[(newval >> 3) & 7];
|
GLenum srcFactor = glSrcFactors[(newval >> 3) & 7];
|
||||||
GLenum srcFactorAlpha = srcFactor;
|
GLenum srcFactorAlpha = srcFactor;
|
||||||
|
|
|
@ -177,7 +177,7 @@ void VertexManager::vFlush()
|
||||||
&& bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
&& bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
||||||
|
|
||||||
// Makes sure we can actually do Dual source blending
|
// 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
|
// finally bind
|
||||||
FRAGMENTSHADER* ps;
|
FRAGMENTSHADER* ps;
|
||||||
|
|
|
@ -135,7 +135,6 @@ void InitBackendInfo()
|
||||||
g_Config.backend_info.bSupportsDualSourceBlend = false; // supported, but broken
|
g_Config.backend_info.bSupportsDualSourceBlend = false; // supported, but broken
|
||||||
g_Config.backend_info.bSupportsFormatReinterpretation = false;
|
g_Config.backend_info.bSupportsFormatReinterpretation = false;
|
||||||
g_Config.backend_info.bSupportsPixelLighting = true;
|
g_Config.backend_info.bSupportsPixelLighting = true;
|
||||||
g_Config.backend_info.bSupportsGLSL = true;
|
|
||||||
|
|
||||||
// aamodes
|
// aamodes
|
||||||
const char* caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
|
const char* caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
|
||||||
|
|
Loading…
Reference in New Issue