mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-05 09:39:58 +00:00
GLSL: don't apply unsupported msaa settings
This commit is contained in:
parent
4a8ab0fafa
commit
2312a8d9d5
@ -132,47 +132,62 @@ static std::vector<u32> s_efbCache[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT]; // 2
|
|||||||
|
|
||||||
int GetNumMSAASamples(int MSAAMode)
|
int GetNumMSAASamples(int MSAAMode)
|
||||||
{
|
{
|
||||||
|
int samples, maxSamples;
|
||||||
switch (MSAAMode)
|
switch (MSAAMode)
|
||||||
{
|
{
|
||||||
case MULTISAMPLE_OFF:
|
case MULTISAMPLE_OFF:
|
||||||
return 1;
|
samples = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case MULTISAMPLE_2X:
|
case MULTISAMPLE_2X:
|
||||||
return 2;
|
samples = 2;
|
||||||
|
break;
|
||||||
|
|
||||||
case MULTISAMPLE_4X:
|
case MULTISAMPLE_4X:
|
||||||
case MULTISAMPLE_CSAA_8X:
|
case MULTISAMPLE_CSAA_8X:
|
||||||
case MULTISAMPLE_CSAA_16X:
|
case MULTISAMPLE_CSAA_16X:
|
||||||
return 4;
|
samples = 4;
|
||||||
|
break;
|
||||||
|
|
||||||
case MULTISAMPLE_8X:
|
case MULTISAMPLE_8X:
|
||||||
case MULTISAMPLE_CSAA_8XQ:
|
case MULTISAMPLE_CSAA_8XQ:
|
||||||
case MULTISAMPLE_CSAA_16XQ:
|
case MULTISAMPLE_CSAA_16XQ:
|
||||||
return 8;
|
samples = 8;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 1;
|
samples = 1;
|
||||||
}
|
}
|
||||||
|
glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
|
||||||
|
|
||||||
|
if(samples <= maxSamples) return samples;
|
||||||
|
|
||||||
|
ERROR_LOG(VIDEO, "MSAA Bug: %d samples selected, but only %d supported by gpu.", samples, maxSamples);
|
||||||
|
return maxSamples;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetNumMSAACoverageSamples(int MSAAMode)
|
int GetNumMSAACoverageSamples(int MSAAMode)
|
||||||
{
|
{
|
||||||
if (!s_bHaveCoverageMSAA)
|
int samples;
|
||||||
return 0;
|
|
||||||
|
|
||||||
switch (g_ActiveConfig.iMultisampleMode)
|
switch (g_ActiveConfig.iMultisampleMode)
|
||||||
{
|
{
|
||||||
case MULTISAMPLE_CSAA_8X:
|
case MULTISAMPLE_CSAA_8X:
|
||||||
case MULTISAMPLE_CSAA_8XQ:
|
case MULTISAMPLE_CSAA_8XQ:
|
||||||
return 8;
|
samples = 8;
|
||||||
|
break;
|
||||||
|
|
||||||
case MULTISAMPLE_CSAA_16X:
|
case MULTISAMPLE_CSAA_16X:
|
||||||
case MULTISAMPLE_CSAA_16XQ:
|
case MULTISAMPLE_CSAA_16XQ:
|
||||||
return 16;
|
samples = 16;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
samples = 0;
|
||||||
}
|
}
|
||||||
|
if(s_bHaveCoverageMSAA || samples == 0) return samples;
|
||||||
|
|
||||||
|
ERROR_LOG(VIDEO, "MSAA Bug: CSAA selected, but not supported by gpu.");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init functions
|
// Init functions
|
||||||
@ -286,13 +301,13 @@ Renderer::Renderer()
|
|||||||
g_ActiveConfig.backend_info.bSupportsGLSync ? "" : "Sync "
|
g_ActiveConfig.backend_info.bSupportsGLSync ? "" : "Sync "
|
||||||
).c_str(), 5000);
|
).c_str(), 5000);
|
||||||
|
|
||||||
|
if (!bSuccess)
|
||||||
|
return; // TODO: fail
|
||||||
|
|
||||||
s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
|
s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
|
||||||
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
|
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
|
||||||
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
|
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
|
||||||
|
|
||||||
if (!bSuccess)
|
|
||||||
return; // TODO: fail
|
|
||||||
|
|
||||||
// Decide frambuffer size
|
// Decide frambuffer size
|
||||||
s_backbuffer_width = (int)GLInterface->GetBackBufferWidth();
|
s_backbuffer_width = (int)GLInterface->GetBackBufferWidth();
|
||||||
s_backbuffer_height = (int)GLInterface->GetBackBufferHeight();
|
s_backbuffer_height = (int)GLInterface->GetBackBufferHeight();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user