summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--externals/glad/include/glad/glad.h3
-rw-r--r--externals/glad/src/glad.c2
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_device.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp6
5 files changed, 17 insertions, 1 deletions
diff --git a/externals/glad/include/glad/glad.h b/externals/glad/include/glad/glad.h
index 6e16358ea..191bb9fcb 100644
--- a/externals/glad/include/glad/glad.h
+++ b/externals/glad/include/glad/glad.h
@@ -5156,6 +5156,9 @@ GLAPI PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv;
5156typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC)(GLuint index, GLdouble n, GLdouble f); 5156typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC)(GLuint index, GLdouble n, GLdouble f);
5157GLAPI PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; 5157GLAPI PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed;
5158#define glDepthRangeIndexed glad_glDepthRangeIndexed 5158#define glDepthRangeIndexed glad_glDepthRangeIndexed
5159typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC)(GLuint index, GLdouble n, GLdouble f);
5160GLAPI PFNGLDEPTHRANGEINDEXEDDNVPROC glad_glDepthRangeIndexeddNV;
5161#define glDepthRangeIndexeddNV glad_glDepthRangeIndexeddNV
5159typedef void (APIENTRYP PFNGLGETFLOATI_VPROC)(GLenum target, GLuint index, GLfloat *data); 5162typedef void (APIENTRYP PFNGLGETFLOATI_VPROC)(GLenum target, GLuint index, GLfloat *data);
5160GLAPI PFNGLGETFLOATI_VPROC glad_glGetFloati_v; 5163GLAPI PFNGLGETFLOATI_VPROC glad_glGetFloati_v;
5161#define glGetFloati_v glad_glGetFloati_v 5164#define glGetFloati_v glad_glGetFloati_v
diff --git a/externals/glad/src/glad.c b/externals/glad/src/glad.c
index d3e13163f..7b24cd68d 100644
--- a/externals/glad/src/glad.c
+++ b/externals/glad/src/glad.c
@@ -1044,6 +1044,7 @@ PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
1044PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL; 1044PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
1045PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv = NULL; 1045PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv = NULL;
1046PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed = NULL; 1046PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed = NULL;
1047PFNGLDEPTHRANGEINDEXEDDNVPROC glad_glDepthRangeIndexeddNV = NULL;
1047PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL; 1048PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL;
1048PFNGLDETACHSHADERPROC glad_glDetachShader = NULL; 1049PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
1049PFNGLDISABLEPROC glad_glDisable = NULL; 1050PFNGLDISABLEPROC glad_glDisable = NULL;
@@ -7971,6 +7972,7 @@ static void load_GL_NV_depth_buffer_float(GLADloadproc load) {
7971 glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV"); 7972 glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV");
7972 glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV"); 7973 glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV");
7973 glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV"); 7974 glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV");
7975 glad_glDepthRangeIndexeddNV = (PFNGLDEPTHRANGEINDEXEDDNVPROC)load("glDepthRangeIndexeddNV");
7974} 7976}
7975static void load_GL_NV_draw_texture(GLADloadproc load) { 7977static void load_GL_NV_draw_texture(GLADloadproc load) {
7976 if(!GLAD_GL_NV_draw_texture) return; 7978 if(!GLAD_GL_NV_draw_texture) return;
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index 48d5c4a5e..1ae5f1d62 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -239,6 +239,7 @@ Device::Device() {
239 has_nv_viewport_array2 = GLAD_GL_NV_viewport_array2; 239 has_nv_viewport_array2 = GLAD_GL_NV_viewport_array2;
240 has_vertex_buffer_unified_memory = GLAD_GL_NV_vertex_buffer_unified_memory; 240 has_vertex_buffer_unified_memory = GLAD_GL_NV_vertex_buffer_unified_memory;
241 has_debugging_tool_attached = IsDebugToolAttached(extensions); 241 has_debugging_tool_attached = IsDebugToolAttached(extensions);
242 has_depth_buffer_float = HasExtension(extensions, "GL_NV_depth_buffer_float");
242 243
243 // At the moment of writing this, only Nvidia's driver optimizes BufferSubData on exclusive 244 // At the moment of writing this, only Nvidia's driver optimizes BufferSubData on exclusive
244 // uniform buffers as "push constants" 245 // uniform buffers as "push constants"
@@ -275,6 +276,7 @@ Device::Device(std::nullptr_t) {
275 has_image_load_formatted = true; 276 has_image_load_formatted = true;
276 has_texture_shadow_lod = true; 277 has_texture_shadow_lod = true;
277 has_variable_aoffi = true; 278 has_variable_aoffi = true;
279 has_depth_buffer_float = true;
278} 280}
279 281
280bool Device::TestVariableAoffi() { 282bool Device::TestVariableAoffi() {
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h
index ee053776d..f24bd0c7b 100644
--- a/src/video_core/renderer_opengl/gl_device.h
+++ b/src/video_core/renderer_opengl/gl_device.h
@@ -122,6 +122,10 @@ public:
122 return use_driver_cache; 122 return use_driver_cache;
123 } 123 }
124 124
125 bool HasDepthBufferFloat() const {
126 return has_depth_buffer_float;
127 }
128
125private: 129private:
126 static bool TestVariableAoffi(); 130 static bool TestVariableAoffi();
127 static bool TestPreciseBug(); 131 static bool TestPreciseBug();
@@ -150,6 +154,7 @@ private:
150 bool use_assembly_shaders{}; 154 bool use_assembly_shaders{};
151 bool use_asynchronous_shaders{}; 155 bool use_asynchronous_shaders{};
152 bool use_driver_cache{}; 156 bool use_driver_cache{};
157 bool has_depth_buffer_float{};
153}; 158};
154 159
155} // namespace OpenGL 160} // namespace OpenGL
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 418644108..4610fd160 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -889,7 +889,11 @@ void RasterizerOpenGL::SyncViewport() {
889 const GLdouble reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne; 889 const GLdouble reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne;
890 const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z; 890 const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z;
891 const GLdouble far_depth = src.translate_z + src.scale_z; 891 const GLdouble far_depth = src.translate_z + src.scale_z;
892 glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth); 892 if (device.HasDepthBufferFloat()) {
893 glDepthRangeIndexeddNV(static_cast<GLuint>(i), near_depth, far_depth);
894 } else {
895 glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth);
896 }
893 897
894 if (!GLAD_GL_NV_viewport_swizzle) { 898 if (!GLAD_GL_NV_viewport_swizzle) {
895 continue; 899 continue;