Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jul 9, 2021
1 parent cde3889 commit 4c9b5ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Common/GPU/OpenGL/thin3d_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,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) {
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/GPU_GLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,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)
Expand Down
1 change: 0 additions & 1 deletion GPU/GLES/StateMappingGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
2 changes: 1 addition & 1 deletion GPU/Vulkan/GPU_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,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
Expand Down

0 comments on commit 4c9b5ad

Please sign in to comment.