From 253f354ffb8eea5fc49d49a2f1cc42657606fef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 1 Feb 2021 09:22:58 +0100 Subject: [PATCH] Address feedback --- Common/GPU/OpenGL/thin3d_gl.cpp | 2 ++ GPU/GLES/GPU_GLES.cpp | 2 +- GPU/GLES/StateMappingGLES.cpp | 1 - GPU/Vulkan/GPU_Vulkan.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Common/GPU/OpenGL/thin3d_gl.cpp b/Common/GPU/OpenGL/thin3d_gl.cpp index 8c2e0487c66a..d9b8c0148585 100644 --- a/Common/GPU/OpenGL/thin3d_gl.cpp +++ b/Common/GPU/OpenGL/thin3d_gl.cpp @@ -540,6 +540,8 @@ OpenGLContext::OpenGLContext() { caps_.depthClampSupported = gl_extensions.ARB_depth_clamp; // Interesting potential hack for emulating GL_DEPTH_CLAMP (use a separate varying, force depth in fragment shader): + // This will induce a performance penalty on many architectures though so a blanket enable of this + // is probably not a good idea. // https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv switch (gl_extensions.gpuVendor) { diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 70496e5d5d4c..7e078f80989f 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -221,7 +221,7 @@ void GPU_GLES::CheckGPUFeatures() { features |= GPU_SUPPORTS_TEXTURE_FLOAT; if (draw_->GetDeviceCaps().depthClampSupported) { - features |= GPU_SUPPORTS_DEPTH_CLAMP; + features |= GPU_SUPPORTS_DEPTH_CLAMP | GPU_SUPPORTS_ACCURATE_DEPTH; // Our implementation of depth texturing needs simple Z range, so can't // use the extension hacks (yet). if (gl_extensions.GLES3) diff --git a/GPU/GLES/StateMappingGLES.cpp b/GPU/GLES/StateMappingGLES.cpp index 6981023adcd5..e4f77690bf51 100644 --- a/GPU/GLES/StateMappingGLES.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -236,7 +236,6 @@ void DrawEngineGLES::ApplyDrawState(int prim) { // TODO: Might happen in clear mode if not through... depthClampEnable = false; } else { - // Set cull if (gstate.getDepthRangeMin() == 0 || gstate.getDepthRangeMax() == 65535) { // TODO: Still has a bug where we clamp to depth range if one is not the full range. // But the alternate is not clamping in either direction... diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 2858224f05bb..7ce714b45df8 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -219,7 +219,7 @@ void GPU_Vulkan::CheckGPUFeatures() { } // Might enable this later - in the first round we are mostly looking at depth/stencil/discard. - // if (g_Config.bDisableVendorBugChecks) + // if (!g_Config.bEnableVendorBugChecks) // features |= GPU_SUPPORTS_ACCURATE_DEPTH; // Mandatory features on Vulkan, which may be checked in "centralized" code