mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
ogl: drop csaa support
This commit is contained in:
parent
3161cdfa8e
commit
afea848e3b
@ -18,7 +18,6 @@ namespace OGL
|
||||
int FramebufferManager::m_targetWidth;
|
||||
int FramebufferManager::m_targetHeight;
|
||||
int FramebufferManager::m_msaaSamples;
|
||||
int FramebufferManager::m_msaaCoverageSamples;
|
||||
|
||||
GLuint FramebufferManager::m_efbFramebuffer;
|
||||
GLuint FramebufferManager::m_efbColor; // Renderbuffer in MSAA mode; Texture otherwise
|
||||
@ -35,7 +34,7 @@ GLuint FramebufferManager::m_xfbFramebuffer;
|
||||
SHADER FramebufferManager::m_pixel_format_shaders[2];
|
||||
|
||||
|
||||
FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int msaaSamples, int msaaCoverageSamples)
|
||||
FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int msaaSamples)
|
||||
{
|
||||
m_efbFramebuffer = 0;
|
||||
m_efbColor = 0;
|
||||
@ -49,7 +48,6 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
m_targetHeight = targetHeight;
|
||||
|
||||
m_msaaSamples = msaaSamples;
|
||||
m_msaaCoverageSamples = msaaCoverageSamples;
|
||||
|
||||
// The EFB can be set to different pixel formats by the game through the
|
||||
// BPMEM_ZCOMPARE register (which should probably have a different name).
|
||||
@ -117,16 +115,10 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||
m_efbDepth = glObj[1];
|
||||
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, m_efbColor);
|
||||
if (m_msaaCoverageSamples)
|
||||
glRenderbufferStorageMultisampleCoverageNV(GL_RENDERBUFFER, m_msaaCoverageSamples, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight);
|
||||
else
|
||||
glRenderbufferStorageMultisample(GL_RENDERBUFFER, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight);
|
||||
glRenderbufferStorageMultisample(GL_RENDERBUFFER, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight);
|
||||
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, m_efbDepth);
|
||||
if (m_msaaCoverageSamples)
|
||||
glRenderbufferStorageMultisampleCoverageNV(GL_RENDERBUFFER, m_msaaCoverageSamples, m_msaaSamples, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight);
|
||||
else
|
||||
glRenderbufferStorageMultisample(GL_RENDERBUFFER, m_msaaSamples, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight);
|
||||
glRenderbufferStorageMultisample(GL_RENDERBUFFER, m_msaaSamples, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight);
|
||||
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
|
||||
|
@ -60,7 +60,7 @@ struct XFBSource : public XFBSourceBase
|
||||
class FramebufferManager : public FramebufferManagerBase
|
||||
{
|
||||
public:
|
||||
FramebufferManager(int targetWidth, int targetHeight, int msaaSamples, int msaaCoverageSamples);
|
||||
FramebufferManager(int targetWidth, int targetHeight, int msaaSamples);
|
||||
~FramebufferManager();
|
||||
|
||||
// To get the EFB in texture form, these functions may have to transfer
|
||||
@ -99,7 +99,6 @@ private:
|
||||
static int m_targetWidth;
|
||||
static int m_targetHeight;
|
||||
static int m_msaaSamples;
|
||||
static int m_msaaCoverageSamples;
|
||||
|
||||
static GLuint m_efbFramebuffer;
|
||||
static GLuint m_efbColor; // Renderbuffer in MSAA mode; Texture otherwise
|
||||
|
@ -78,10 +78,6 @@ enum MultisampleMode {
|
||||
MULTISAMPLE_2X,
|
||||
MULTISAMPLE_4X,
|
||||
MULTISAMPLE_8X,
|
||||
MULTISAMPLE_CSAA_8X,
|
||||
MULTISAMPLE_CSAA_8XQ,
|
||||
MULTISAMPLE_CSAA_16X,
|
||||
MULTISAMPLE_CSAA_16XQ,
|
||||
MULTISAMPLE_SSAA_4X,
|
||||
};
|
||||
|
||||
@ -99,7 +95,6 @@ static RasterFont* s_pfont = nullptr;
|
||||
|
||||
// 1 for no MSAA. Use s_MSAASamples > 1 to check for MSAA.
|
||||
static int s_MSAASamples = 1;
|
||||
static int s_MSAACoverageSamples = 0;
|
||||
static int s_LastMultisampleMode = 0;
|
||||
|
||||
static u32 s_blendMode;
|
||||
@ -131,15 +126,11 @@ int GetNumMSAASamples(int MSAAMode)
|
||||
break;
|
||||
|
||||
case MULTISAMPLE_4X:
|
||||
case MULTISAMPLE_CSAA_8X:
|
||||
case MULTISAMPLE_CSAA_16X:
|
||||
case MULTISAMPLE_SSAA_4X:
|
||||
samples = 4;
|
||||
break;
|
||||
|
||||
case MULTISAMPLE_8X:
|
||||
case MULTISAMPLE_CSAA_8XQ:
|
||||
case MULTISAMPLE_CSAA_16XQ:
|
||||
samples = 8;
|
||||
break;
|
||||
|
||||
@ -154,31 +145,6 @@ int GetNumMSAASamples(int MSAAMode)
|
||||
return g_ogl_config.max_samples;
|
||||
}
|
||||
|
||||
int GetNumMSAACoverageSamples(int MSAAMode)
|
||||
{
|
||||
int samples;
|
||||
switch (g_ActiveConfig.iMultisampleMode)
|
||||
{
|
||||
case MULTISAMPLE_CSAA_8X:
|
||||
case MULTISAMPLE_CSAA_8XQ:
|
||||
samples = 8;
|
||||
break;
|
||||
|
||||
case MULTISAMPLE_CSAA_16X:
|
||||
case MULTISAMPLE_CSAA_16XQ:
|
||||
samples = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
samples = 0;
|
||||
}
|
||||
if (g_ogl_config.bSupportCoverageMSAA || samples == 0) return samples;
|
||||
|
||||
// TODO: move this to InitBackendInfo
|
||||
OSD::AddMessage("CSAA Anti Aliasing isn't supported by your GPU.", 10000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ApplySSAASettings() {
|
||||
// GLES3 doesn't support SSAA
|
||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
||||
@ -489,7 +455,6 @@ Renderer::Renderer()
|
||||
g_ogl_config.bSupportsGLSync = GLExtensions::Supports("GL_ARB_sync");
|
||||
g_ogl_config.bSupportsGLBaseVertex = GLExtensions::Supports("GL_ARB_draw_elements_base_vertex");
|
||||
g_ogl_config.bSupportsGLBufferStorage = GLExtensions::Supports("GL_ARB_buffer_storage");
|
||||
g_ogl_config.bSupportCoverageMSAA = GLExtensions::Supports("GL_NV_framebuffer_multisample_coverage");
|
||||
g_ogl_config.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading");
|
||||
g_ogl_config.bSupportOGL31 = GLExtensions::Version() >= 310;
|
||||
g_ogl_config.bSupportViewportFloat = GLExtensions::Supports("GL_ARB_viewport_array");
|
||||
@ -575,7 +540,7 @@ Renderer::Renderer()
|
||||
g_ogl_config.gl_renderer,
|
||||
g_ogl_config.gl_version), 5000);
|
||||
|
||||
WARN_LOG(VIDEO,"Missing OGL Extensions: %s%s%s%s%s%s%s%s%s%s",
|
||||
WARN_LOG(VIDEO,"Missing OGL Extensions: %s%s%s%s%s%s%s%s%s",
|
||||
g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
|
||||
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
||||
g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
||||
@ -584,13 +549,11 @@ Renderer::Renderer()
|
||||
g_ogl_config.bSupportsGLBaseVertex ? "" : "BaseVertex ",
|
||||
g_ogl_config.bSupportsGLBufferStorage ? "" : "BufferStorage ",
|
||||
g_ogl_config.bSupportsGLSync ? "" : "Sync ",
|
||||
g_ogl_config.bSupportCoverageMSAA ? "" : "CSAA ",
|
||||
g_ogl_config.bSupportSampleShading ? "" : "SSAA "
|
||||
);
|
||||
|
||||
s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
|
||||
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
|
||||
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
|
||||
ApplySSAASettings();
|
||||
|
||||
// Decide framebuffer size
|
||||
@ -681,7 +644,7 @@ void Renderer::Init()
|
||||
{
|
||||
// Initialize the FramebufferManager
|
||||
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
|
||||
s_MSAASamples, s_MSAACoverageSamples);
|
||||
s_MSAASamples);
|
||||
|
||||
s_pfont = new RasterFont();
|
||||
|
||||
@ -1609,12 +1572,11 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
|
||||
{
|
||||
s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
|
||||
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
|
||||
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
|
||||
ApplySSAASettings();
|
||||
|
||||
delete g_framebuffer_manager;
|
||||
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
|
||||
s_MSAASamples, s_MSAACoverageSamples);
|
||||
s_MSAASamples);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ extern struct VideoConfig {
|
||||
bool bSupportsGLSync;
|
||||
bool bSupportsGLBaseVertex;
|
||||
bool bSupportsGLBufferStorage;
|
||||
bool bSupportCoverageMSAA;
|
||||
bool bSupportSampleShading;
|
||||
GLSL_VERSION eSupportedGLSLVersion;
|
||||
bool bSupportOGL31;
|
||||
|
@ -152,7 +152,7 @@ void InitBackendInfo()
|
||||
g_Config.backend_info.Adapters.clear();
|
||||
|
||||
// aamodes
|
||||
const char* caamodes[] = {_trans("None"), "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA", "4x SSAA"};
|
||||
const char* caamodes[] = {_trans("None"), "2x", "4x", "8x", "4x SSAA"};
|
||||
g_Config.backend_info.AAModes.assign(caamodes, caamodes + sizeof(caamodes)/sizeof(*caamodes));
|
||||
|
||||
// pp shaders
|
||||
|
Loading…
Reference in New Issue
Block a user