OGL: Add glClipControl support.
This commit is contained in:
parent
0e39b8d9e7
commit
522e721830
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
||||||
|
// Copyright 2013 Dolphin Emulator Project
|
||||||
|
// Licensed under GPLv2
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "VideoBackends/OGL/GLExtensions/gl_common.h"
|
||||||
|
|
||||||
|
extern PFNGLCLIPCONTROLPROC glClipControl;
|
||||||
|
|
|
@ -785,6 +785,9 @@ PFNGLENDOCCLUSIONQUERYNVPROC glEndOcclusionQueryNV;
|
||||||
PFNGLGETOCCLUSIONQUERYIVNVPROC glGetOcclusionQueryivNV;
|
PFNGLGETOCCLUSIONQUERYIVNVPROC glGetOcclusionQueryivNV;
|
||||||
PFNGLGETOCCLUSIONQUERYUIVNVPROC glGetOcclusionQueryuivNV;
|
PFNGLGETOCCLUSIONQUERYUIVNVPROC glGetOcclusionQueryuivNV;
|
||||||
|
|
||||||
|
// ARB_clip_control
|
||||||
|
PFNGLCLIPCONTROLPROC glClipControl;
|
||||||
|
|
||||||
// Creates a GLFunc object that requires a feature
|
// Creates a GLFunc object that requires a feature
|
||||||
#define GLFUNC_REQUIRES(x, y) { (void**)&x, #x, y }
|
#define GLFUNC_REQUIRES(x, y) { (void**)&x, #x, y }
|
||||||
// Creates a GLFunc object with a different function suffix
|
// Creates a GLFunc object with a different function suffix
|
||||||
|
@ -1272,6 +1275,9 @@ const GLFunc gl_function_array[] =
|
||||||
GLFUNC_REQUIRES(glGetOcclusionQueryivNV, "GL_NV_occlusion_query_samples"),
|
GLFUNC_REQUIRES(glGetOcclusionQueryivNV, "GL_NV_occlusion_query_samples"),
|
||||||
GLFUNC_REQUIRES(glGetOcclusionQueryuivNV, "GL_NV_occlusion_query_samples"),
|
GLFUNC_REQUIRES(glGetOcclusionQueryuivNV, "GL_NV_occlusion_query_samples"),
|
||||||
|
|
||||||
|
// ARB_clip_control
|
||||||
|
GLFUNC_REQUIRES(glClipControl, "GL_ARB_clip_control"),
|
||||||
|
|
||||||
// gl_1_1
|
// gl_1_1
|
||||||
// OpenGL 1.1 is at the end due to a bug in Android's EGL stack.
|
// OpenGL 1.1 is at the end due to a bug in Android's EGL stack.
|
||||||
// eglGetProcAddress can only return a finite amount of function pointers
|
// eglGetProcAddress can only return a finite amount of function pointers
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "VideoBackends/OGL/GLExtensions/ARB_blend_func_extended.h"
|
#include "VideoBackends/OGL/GLExtensions/ARB_blend_func_extended.h"
|
||||||
#include "VideoBackends/OGL/GLExtensions/ARB_buffer_storage.h"
|
#include "VideoBackends/OGL/GLExtensions/ARB_buffer_storage.h"
|
||||||
|
#include "VideoBackends/OGL/GLExtensions/ARB_clip_control.h"
|
||||||
#include "VideoBackends/OGL/GLExtensions/ARB_debug_output.h"
|
#include "VideoBackends/OGL/GLExtensions/ARB_debug_output.h"
|
||||||
#include "VideoBackends/OGL/GLExtensions/ARB_draw_elements_base_vertex.h"
|
#include "VideoBackends/OGL/GLExtensions/ARB_draw_elements_base_vertex.h"
|
||||||
#include "VideoBackends/OGL/GLExtensions/ARB_ES2_compatibility.h"
|
#include "VideoBackends/OGL/GLExtensions/ARB_ES2_compatibility.h"
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
<ClInclude Include="FramebufferManager.h" />
|
<ClInclude Include="FramebufferManager.h" />
|
||||||
<ClInclude Include="GLExtensions\ARB_blend_func_extended.h" />
|
<ClInclude Include="GLExtensions\ARB_blend_func_extended.h" />
|
||||||
<ClInclude Include="GLExtensions\ARB_buffer_storage.h" />
|
<ClInclude Include="GLExtensions\ARB_buffer_storage.h" />
|
||||||
|
<ClInclude Include="GLExtensions\ARB_clip_control.h" />
|
||||||
<ClInclude Include="GLExtensions\ARB_debug_output.h" />
|
<ClInclude Include="GLExtensions\ARB_debug_output.h" />
|
||||||
<ClInclude Include="GLExtensions\ARB_draw_elements_base_vertex.h" />
|
<ClInclude Include="GLExtensions\ARB_draw_elements_base_vertex.h" />
|
||||||
<ClInclude Include="GLExtensions\ARB_ES2_compatibility.h" />
|
<ClInclude Include="GLExtensions\ARB_ES2_compatibility.h" />
|
||||||
|
|
|
@ -199,6 +199,9 @@
|
||||||
<ClInclude Include="GLInterface\WGL.h">
|
<ClInclude Include="GLInterface\WGL.h">
|
||||||
<Filter>GLInterface</Filter>
|
<Filter>GLInterface</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="GLExtensions\ARB_clip_control.h">
|
||||||
|
<Filter>GLExtensions</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Text Include="CMakeLists.txt" />
|
<Text Include="CMakeLists.txt" />
|
||||||
|
|
|
@ -480,12 +480,13 @@ Renderer::Renderer()
|
||||||
GLExtensions::Supports("GL_EXT_draw_elements_base_vertex") ||
|
GLExtensions::Supports("GL_EXT_draw_elements_base_vertex") ||
|
||||||
GLExtensions::Supports("GL_OES_draw_elements_base_vertex");
|
GLExtensions::Supports("GL_OES_draw_elements_base_vertex");
|
||||||
g_ogl_config.bSupportsGLBufferStorage = GLExtensions::Supports("GL_ARB_buffer_storage") ||
|
g_ogl_config.bSupportsGLBufferStorage = GLExtensions::Supports("GL_ARB_buffer_storage") ||
|
||||||
GLExtensions::Supports("GL_EXT_buffer_storage");;
|
GLExtensions::Supports("GL_EXT_buffer_storage");
|
||||||
g_ogl_config.bSupportsMSAA = GLExtensions::Supports("GL_ARB_texture_multisample");
|
g_ogl_config.bSupportsMSAA = GLExtensions::Supports("GL_ARB_texture_multisample");
|
||||||
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");
|
||||||
g_ogl_config.bSupportsDebug = GLExtensions::Supports("GL_KHR_debug") || GLExtensions::Supports("GL_ARB_debug_output");
|
g_ogl_config.bSupportsDebug = GLExtensions::Supports("GL_KHR_debug") || GLExtensions::Supports("GL_ARB_debug_output");
|
||||||
|
g_ogl_config.bSupportsGLClipControl = GLExtensions::Supports("GL_ARB_clip_control");
|
||||||
|
|
||||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
|
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
|
||||||
{
|
{
|
||||||
|
@ -585,7 +586,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%s",
|
WARN_LOG(VIDEO,"Missing OGL Extensions: %s%s%s%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 ",
|
||||||
|
@ -596,7 +597,8 @@ Renderer::Renderer()
|
||||||
g_ogl_config.bSupportsGLSync ? "" : "Sync ",
|
g_ogl_config.bSupportsGLSync ? "" : "Sync ",
|
||||||
g_ogl_config.bSupportsMSAA ? "" : "MSAA ",
|
g_ogl_config.bSupportsMSAA ? "" : "MSAA ",
|
||||||
g_ogl_config.bSupportSampleShading ? "" : "SSAA ",
|
g_ogl_config.bSupportSampleShading ? "" : "SSAA ",
|
||||||
g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing "
|
g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing ",
|
||||||
|
g_ogl_config.bSupportsGLClipControl ? "" : "ClipControl "
|
||||||
);
|
);
|
||||||
|
|
||||||
s_last_multisample_mode = g_ActiveConfig.iMultisampleMode;
|
s_last_multisample_mode = g_ActiveConfig.iMultisampleMode;
|
||||||
|
@ -644,6 +646,8 @@ Renderer::Renderer()
|
||||||
glDisable(GL_STENCIL_TEST);
|
glDisable(GL_STENCIL_TEST);
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
|
if (g_ogl_config.bSupportsGLClipControl)
|
||||||
|
glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
|
||||||
glScissor(0, 0, GetTargetWidth(), GetTargetHeight());
|
glScissor(0, 0, GetTargetWidth(), GetTargetHeight());
|
||||||
glBlendColor(0, 0, 0, 0.5f);
|
glBlendColor(0, 0, 0, 0.5f);
|
||||||
glClearDepthf(1.0f);
|
glClearDepthf(1.0f);
|
||||||
|
|
|
@ -25,6 +25,7 @@ struct VideoConfig
|
||||||
bool bSupportsGLSync;
|
bool bSupportsGLSync;
|
||||||
bool bSupportsGLBaseVertex;
|
bool bSupportsGLBaseVertex;
|
||||||
bool bSupportsGLBufferStorage;
|
bool bSupportsGLBufferStorage;
|
||||||
|
bool bSupportsGLClipControl;
|
||||||
bool bSupportsMSAA;
|
bool bSupportsMSAA;
|
||||||
bool bSupportSampleShading;
|
bool bSupportSampleShading;
|
||||||
GLSL_VERSION eSupportedGLSLVersion;
|
GLSL_VERSION eSupportedGLSLVersion;
|
||||||
|
|
Loading…
Reference in New Issue