From 1a2378407a3cf403e9750d4c91644ea3509b296e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 4 Mar 2023 00:23:22 +0100 Subject: [PATCH] GL: don't treat NV_depth_buffer_float as being core in GL 3.0. The glDepthRangedNV() and glClearDepthdNV() behave differently from glDepthRange() and glClearDepth() -- they don't clamp. There doesn't seem to be any change in recent GL related to this, so this extension is still valuable for improving depth buffer precision. Or, alternatively, it's possible to use the glClipControl() API from GL 4.5 to achieve the same. --- src/Magnum/GL/Context.cpp | 4 ++-- src/Magnum/GL/Extensions.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 93a59094b..502aa02bb 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -110,6 +110,7 @@ constexpr Extension ExtensionList[]{ Extensions::KHR::texture_compression_astc_hdr{}, Extensions::KHR::texture_compression_astc_ldr{}, Extensions::KHR::texture_compression_astc_sliced_3d{}, + Extensions::NV::depth_buffer_float{}, Extensions::NV::fragment_shader_barycentric{}, Extensions::NV::sample_locations{}, Extensions::OVR::multiview{}, @@ -135,8 +136,7 @@ constexpr Extension ExtensionList300[]{ Extensions::EXT::texture_shared_exponent{}, Extensions::EXT::transform_feedback{}, Extensions::MAGNUM::shader_vertex_id{}, - Extensions::NV::conditional_render{}, - Extensions::NV::depth_buffer_float{} + Extensions::NV::conditional_render{} }; constexpr Extension ExtensionList310[]{ Extensions::ARB::copy_buffer{}, diff --git a/src/Magnum/GL/Extensions.h b/src/Magnum/GL/Extensions.h index cf5b8f7f7..0845000c3 100644 --- a/src/Magnum/GL/Extensions.h +++ b/src/Magnum/GL/Extensions.h @@ -261,7 +261,7 @@ namespace AMD { _extension(171,MAGNUM,shader_vertex_id, GL300, GL300) } namespace NV { _extension(175,NV,primitive_restart, GL210, GL310) // #285 - _extension(176,NV,depth_buffer_float, GL210, GL300) // #334 + _extension(176,NV,depth_buffer_float, GL210, None) // #334 _extension(177,NV,conditional_render, GL210, GL300) // #346 /* NV_draw_texture not supported */ // #430 _extension(178,NV,sample_locations, GL210, None) // #472