mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
OGL: Add support for glDepthRangedNV to handle oversized depth ranges.
This commit is contained in:
@ -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",
|
||||
};
|
||||
|
@ -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"
|
||||
|
41
Source/Core/Common/GL/GLExtensions/NV_depth_buffer_float.h
Normal file
41
Source/Core/Common/GL/GLExtensions/NV_depth_buffer_float.h
Normal file
@ -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
|
Reference in New Issue
Block a user