summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-03-10 18:05:52 +0100
committerGitHub <noreply@github.com>2017-03-10 18:05:52 +0100
commite99cd57eb3827b246ea712e031bac3ffe92fe109 (patch)
treef12d83d565f2e36d785046ff5917814be50fe62b /Source/Core/Common
parenta3f5e3e27dacc40082346bbb00d41eddd61b16b9 (diff)
parent3f41e6d4cf9f1a318c6d32fea4d2b422684961a3 (diff)
Merge pull request #4935 from Armada651/depth-range-fix
VideoBackends: Set the maximum range when the depth range is oversized.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Common.vcxproj1
-rw-r--r--Source/Core/Common/Common.vcxproj.filters3
-rw-r--r--Source/Core/Common/GL/GLExtensions/GLExtensions.cpp23
-rw-r--r--Source/Core/Common/GL/GLExtensions/GLExtensions.h1
-rw-r--r--Source/Core/Common/GL/GLExtensions/NV_depth_buffer_float.h41
5 files changed, 60 insertions, 9 deletions
diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj
index a30d70b4c9..928c8c8196 100644
--- a/Source/Core/Common/Common.vcxproj
+++ b/Source/Core/Common/Common.vcxproj
@@ -109,6 +109,7 @@
<ClInclude Include="GL\GLExtensions\gl_common.h" />
<ClInclude Include="GL\GLExtensions\HP_occlusion_test.h" />
<ClInclude Include="GL\GLExtensions\KHR_debug.h" />
+ <ClInclude Include="GL\GLExtensions\NV_depth_buffer_float.h" />
<ClInclude Include="GL\GLExtensions\NV_occlusion_query_samples.h" />
<ClInclude Include="GL\GLExtensions\NV_primitive_restart.h" />
<ClInclude Include="GL\GLInterfaceBase.h" />
diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters
index e68660d752..b6dd7d27e0 100644
--- a/Source/Core/Common/Common.vcxproj.filters
+++ b/Source/Core/Common/Common.vcxproj.filters
@@ -226,6 +226,9 @@
<ClInclude Include="GL\GLExtensions\NV_primitive_restart.h">
<Filter>GL\GLExtensions</Filter>
</ClInclude>
+ <ClInclude Include="GL\GLExtensions\NV_depth_buffer_float.h">
+ <Filter>GL\GLExtensions</Filter>
+ </ClInclude>
<ClInclude Include="GL\GLInterface\WGL.h">
<Filter>GL\GLInterface</Filter>
</ClInclude>
diff --git a/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp b/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp
index 591792468e..ff252bb1f7 100644
--- a/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp
+++ b/Source/Core/Common/GL/GLExtensions/GLExtensions.cpp
@@ -984,6 +984,11 @@ PFNDOLCOPYIMAGESUBDATAPROC dolCopyImageSubData;
// ARB_shader_storage_buffer_object
PFNDOLSHADERSTORAGEBLOCKBINDINGPROC dolShaderStorageBlockBinding;
+// NV_depth_buffer_float
+PFNDOLDEPTHRANGEDNVPROC dolDepthRangedNV;
+PFNDOLCLEARDEPTHDNVPROC dolClearDepthdNV;
+PFNDOLDEPTHBOUNDSDNVPROC dolDepthBoundsdNV;
+
// Creates a GLFunc object that requires a feature
#define GLFUNC_REQUIRES(x, y) \
{ \
@@ -1838,6 +1843,11 @@ const GLFunc gl_function_array[] = {
// ARB_shader_storage_buffer_object
GLFUNC_REQUIRES(glShaderStorageBlockBinding, "ARB_shader_storage_buffer_object !VERSION_4_3"),
+
+ // NV_depth_buffer_float
+ GLFUNC_REQUIRES(glDepthRangedNV, "GL_NV_depth_buffer_float"),
+ GLFUNC_REQUIRES(glClearDepthdNV, "GL_NV_depth_buffer_float"),
+ GLFUNC_REQUIRES(glDepthBoundsdNV, "GL_NV_depth_buffer_float"),
};
namespace GLExtensions
@@ -2060,26 +2070,21 @@ static void InitExtensionList()
// Quite a lot of these had their names changed when merged in to core
// Disable the ones that have
std::string gl300exts[] = {
- "GL_ARB_map_buffer_range",
+ "GL_ARB_map_buffer_range", "GL_ARB_color_buffer_float", "GL_ARB_texture_float",
+ "GL_ARB_half_float_pixel", "GL_ARB_framebuffer_object", "GL_ARB_texture_float",
+ "GL_ARB_vertex_array_object", "GL_NV_depth_buffer_float",
+ //"GL_EXT_texture_integer",
//"GL_EXT_gpu_shader4",
//"GL_APPLE_flush_buffer_range",
- "GL_ARB_color_buffer_float",
- //"GL_NV_depth_buffer_float",
- "GL_ARB_texture_float",
//"GL_EXT_packed_float",
//"GL_EXT_texture_shared_exponent",
- "GL_ARB_half_float_pixel",
//"GL_NV_half_float",
- "GL_ARB_framebuffer_object",
//"GL_EXT_framebuffer_sRGB",
- "GL_ARB_texture_float",
- //"GL_EXT_texture_integer",
//"GL_EXT_draw_buffers2",
//"GL_EXT_texture_integer",
//"GL_EXT_texture_array",
//"GL_EXT_texture_compression_rgtc",
//"GL_EXT_transform_feedback",
- "GL_ARB_vertex_array_object",
//"GL_NV_conditional_render",
"VERSION_3_0",
};
diff --git a/Source/Core/Common/GL/GLExtensions/GLExtensions.h b/Source/Core/Common/GL/GLExtensions/GLExtensions.h
index fa00aa4a97..4c58167700 100644
--- a/Source/Core/Common/GL/GLExtensions/GLExtensions.h
+++ b/Source/Core/Common/GL/GLExtensions/GLExtensions.h
@@ -31,6 +31,7 @@
#include "Common/GL/GLExtensions/EXT_texture_filter_anisotropic.h"
#include "Common/GL/GLExtensions/HP_occlusion_test.h"
#include "Common/GL/GLExtensions/KHR_debug.h"
+#include "Common/GL/GLExtensions/NV_depth_buffer_float.h"
#include "Common/GL/GLExtensions/NV_occlusion_query_samples.h"
#include "Common/GL/GLExtensions/NV_primitive_restart.h"
#include "Common/GL/GLExtensions/gl_1_1.h"
diff --git a/Source/Core/Common/GL/GLExtensions/NV_depth_buffer_float.h b/Source/Core/Common/GL/GLExtensions/NV_depth_buffer_float.h
new file mode 100644
index 0000000000..7912c55ba2
--- /dev/null
+++ b/Source/Core/Common/GL/GLExtensions/NV_depth_buffer_float.h
@@ -0,0 +1,41 @@
+/*
+** Copyright (c) 2013-2015 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#include "Common/GL/GLExtensions/gl_common.h"
+
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+
+typedef void(APIENTRYP PFNDOLDEPTHRANGEDNVPROC)(GLdouble zNear, GLdouble zFar);
+typedef void(APIENTRYP PFNDOLCLEARDEPTHDNVPROC)(GLdouble depth);
+typedef void(APIENTRYP PFNDOLDEPTHBOUNDSDNVPROC)(GLdouble zmin, GLdouble zmax);
+
+extern PFNDOLDEPTHRANGEDNVPROC dolDepthRangedNV;
+extern PFNDOLCLEARDEPTHDNVPROC dolClearDepthdNV;
+extern PFNDOLDEPTHBOUNDSDNVPROC dolDepthBoundsdNV;
+
+#define glDepthRangedNV dolDepthRangedNV
+#define glClearDepthdNV dolClearDepthdNV
+#define glDepthBoundsdNV dolDepthBoundsdNV