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_targetWidth;
|
||||||
int FramebufferManager::m_targetHeight;
|
int FramebufferManager::m_targetHeight;
|
||||||
int FramebufferManager::m_msaaSamples;
|
int FramebufferManager::m_msaaSamples;
|
||||||
int FramebufferManager::m_msaaCoverageSamples;
|
|
||||||
|
|
||||||
GLuint FramebufferManager::m_efbFramebuffer;
|
GLuint FramebufferManager::m_efbFramebuffer;
|
||||||
GLuint FramebufferManager::m_efbColor; // Renderbuffer in MSAA mode; Texture otherwise
|
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];
|
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_efbFramebuffer = 0;
|
||||||
m_efbColor = 0;
|
m_efbColor = 0;
|
||||||
|
@ -49,7 +48,6 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
||||||
m_targetHeight = targetHeight;
|
m_targetHeight = targetHeight;
|
||||||
|
|
||||||
m_msaaSamples = msaaSamples;
|
m_msaaSamples = msaaSamples;
|
||||||
m_msaaCoverageSamples = msaaCoverageSamples;
|
|
||||||
|
|
||||||
// The EFB can be set to different pixel formats by the game through the
|
// The EFB can be set to different pixel formats by the game through the
|
||||||
// BPMEM_ZCOMPARE register (which should probably have a different name).
|
// 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];
|
m_efbDepth = glObj[1];
|
||||||
|
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, m_efbColor);
|
glBindRenderbuffer(GL_RENDERBUFFER, m_efbColor);
|
||||||
if (m_msaaCoverageSamples)
|
glRenderbufferStorageMultisample(GL_RENDERBUFFER, m_msaaSamples, GL_RGBA, m_targetWidth, m_targetHeight);
|
||||||
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);
|
|
||||||
|
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, m_efbDepth);
|
glBindRenderbuffer(GL_RENDERBUFFER, m_efbDepth);
|
||||||
if (m_msaaCoverageSamples)
|
glRenderbufferStorageMultisample(GL_RENDERBUFFER, m_msaaSamples, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight);
|
||||||
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);
|
|
||||||
|
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ struct XFBSource : public XFBSourceBase
|
||||||
class FramebufferManager : public FramebufferManagerBase
|
class FramebufferManager : public FramebufferManagerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FramebufferManager(int targetWidth, int targetHeight, int msaaSamples, int msaaCoverageSamples);
|
FramebufferManager(int targetWidth, int targetHeight, int msaaSamples);
|
||||||
~FramebufferManager();
|
~FramebufferManager();
|
||||||
|
|
||||||
// To get the EFB in texture form, these functions may have to transfer
|
// 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_targetWidth;
|
||||||
static int m_targetHeight;
|
static int m_targetHeight;
|
||||||
static int m_msaaSamples;
|
static int m_msaaSamples;
|
||||||
static int m_msaaCoverageSamples;
|
|
||||||
|
|
||||||
static GLuint m_efbFramebuffer;
|
static GLuint m_efbFramebuffer;
|
||||||
static GLuint m_efbColor; // Renderbuffer in MSAA mode; Texture otherwise
|
static GLuint m_efbColor; // Renderbuffer in MSAA mode; Texture otherwise
|
||||||
|
|
|
@ -78,10 +78,6 @@ enum MultisampleMode {
|
||||||
MULTISAMPLE_2X,
|
MULTISAMPLE_2X,
|
||||||
MULTISAMPLE_4X,
|
MULTISAMPLE_4X,
|
||||||
MULTISAMPLE_8X,
|
MULTISAMPLE_8X,
|
||||||
MULTISAMPLE_CSAA_8X,
|
|
||||||
MULTISAMPLE_CSAA_8XQ,
|
|
||||||
MULTISAMPLE_CSAA_16X,
|
|
||||||
MULTISAMPLE_CSAA_16XQ,
|
|
||||||
MULTISAMPLE_SSAA_4X,
|
MULTISAMPLE_SSAA_4X,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,7 +95,6 @@ static RasterFont* s_pfont = nullptr;
|
||||||
|
|
||||||
// 1 for no MSAA. Use s_MSAASamples > 1 to check for MSAA.
|
// 1 for no MSAA. Use s_MSAASamples > 1 to check for MSAA.
|
||||||
static int s_MSAASamples = 1;
|
static int s_MSAASamples = 1;
|
||||||
static int s_MSAACoverageSamples = 0;
|
|
||||||
static int s_LastMultisampleMode = 0;
|
static int s_LastMultisampleMode = 0;
|
||||||
|
|
||||||
static u32 s_blendMode;
|
static u32 s_blendMode;
|
||||||
|
@ -131,15 +126,11 @@ int GetNumMSAASamples(int MSAAMode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MULTISAMPLE_4X:
|
case MULTISAMPLE_4X:
|
||||||
case MULTISAMPLE_CSAA_8X:
|
|
||||||
case MULTISAMPLE_CSAA_16X:
|
|
||||||
case MULTISAMPLE_SSAA_4X:
|
case MULTISAMPLE_SSAA_4X:
|
||||||
samples = 4;
|
samples = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MULTISAMPLE_8X:
|
case MULTISAMPLE_8X:
|
||||||
case MULTISAMPLE_CSAA_8XQ:
|
|
||||||
case MULTISAMPLE_CSAA_16XQ:
|
|
||||||
samples = 8;
|
samples = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -154,31 +145,6 @@ int GetNumMSAASamples(int MSAAMode)
|
||||||
return g_ogl_config.max_samples;
|
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() {
|
void ApplySSAASettings() {
|
||||||
// GLES3 doesn't support SSAA
|
// GLES3 doesn't support SSAA
|
||||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
||||||
|
@ -489,7 +455,6 @@ Renderer::Renderer()
|
||||||
g_ogl_config.bSupportsGLSync = GLExtensions::Supports("GL_ARB_sync");
|
g_ogl_config.bSupportsGLSync = GLExtensions::Supports("GL_ARB_sync");
|
||||||
g_ogl_config.bSupportsGLBaseVertex = GLExtensions::Supports("GL_ARB_draw_elements_base_vertex");
|
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.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.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading");
|
||||||
g_ogl_config.bSupportOGL31 = GLExtensions::Version() >= 310;
|
g_ogl_config.bSupportOGL31 = GLExtensions::Version() >= 310;
|
||||||
g_ogl_config.bSupportViewportFloat = GLExtensions::Supports("GL_ARB_viewport_array");
|
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_renderer,
|
||||||
g_ogl_config.gl_version), 5000);
|
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.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
|
||||||
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
||||||
g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
||||||
|
@ -584,13 +549,11 @@ Renderer::Renderer()
|
||||||
g_ogl_config.bSupportsGLBaseVertex ? "" : "BaseVertex ",
|
g_ogl_config.bSupportsGLBaseVertex ? "" : "BaseVertex ",
|
||||||
g_ogl_config.bSupportsGLBufferStorage ? "" : "BufferStorage ",
|
g_ogl_config.bSupportsGLBufferStorage ? "" : "BufferStorage ",
|
||||||
g_ogl_config.bSupportsGLSync ? "" : "Sync ",
|
g_ogl_config.bSupportsGLSync ? "" : "Sync ",
|
||||||
g_ogl_config.bSupportCoverageMSAA ? "" : "CSAA ",
|
|
||||||
g_ogl_config.bSupportSampleShading ? "" : "SSAA "
|
g_ogl_config.bSupportSampleShading ? "" : "SSAA "
|
||||||
);
|
);
|
||||||
|
|
||||||
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);
|
|
||||||
ApplySSAASettings();
|
ApplySSAASettings();
|
||||||
|
|
||||||
// Decide framebuffer size
|
// Decide framebuffer size
|
||||||
|
@ -681,7 +644,7 @@ void Renderer::Init()
|
||||||
{
|
{
|
||||||
// Initialize the FramebufferManager
|
// Initialize the FramebufferManager
|
||||||
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
|
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
|
||||||
s_MSAASamples, s_MSAACoverageSamples);
|
s_MSAASamples);
|
||||||
|
|
||||||
s_pfont = new RasterFont();
|
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_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
|
||||||
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
|
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
|
||||||
s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);
|
|
||||||
ApplySSAASettings();
|
ApplySSAASettings();
|
||||||
|
|
||||||
delete g_framebuffer_manager;
|
delete g_framebuffer_manager;
|
||||||
g_framebuffer_manager = new FramebufferManager(s_target_width, s_target_height,
|
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 bSupportsGLSync;
|
||||||
bool bSupportsGLBaseVertex;
|
bool bSupportsGLBaseVertex;
|
||||||
bool bSupportsGLBufferStorage;
|
bool bSupportsGLBufferStorage;
|
||||||
bool bSupportCoverageMSAA;
|
|
||||||
bool bSupportSampleShading;
|
bool bSupportSampleShading;
|
||||||
GLSL_VERSION eSupportedGLSLVersion;
|
GLSL_VERSION eSupportedGLSLVersion;
|
||||||
bool bSupportOGL31;
|
bool bSupportOGL31;
|
||||||
|
|
|
@ -152,7 +152,7 @@ void InitBackendInfo()
|
||||||
g_Config.backend_info.Adapters.clear();
|
g_Config.backend_info.Adapters.clear();
|
||||||
|
|
||||||
// aamodes
|
// 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));
|
g_Config.backend_info.AAModes.assign(caamodes, caamodes + sizeof(caamodes)/sizeof(*caamodes));
|
||||||
|
|
||||||
// pp shaders
|
// pp shaders
|
||||||
|
|
Loading…
Reference in New Issue