diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 114692228c..b927382c62 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -245,6 +245,8 @@ D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *de // Seems like a fair approximation... caps_.dualSourceBlend = featureLevel_ >= D3D_FEATURE_LEVEL_10_0; caps_.depthClampSupported = featureLevel_ >= D3D_FEATURE_LEVEL_10_0; + // SV_ClipDistance# seems to be 10+. + caps_.clipCullDistanceSupported = featureLevel_ >= D3D_FEATURE_LEVEL_10_0; caps_.depthRangeMinusOneToOne = false; caps_.framebufferBlitSupported = false; diff --git a/Common/GPU/OpenGL/thin3d_gl.cpp b/Common/GPU/OpenGL/thin3d_gl.cpp index 1c7a19792d..83102c8898 100644 --- a/Common/GPU/OpenGL/thin3d_gl.cpp +++ b/Common/GPU/OpenGL/thin3d_gl.cpp @@ -534,6 +534,7 @@ OpenGLContext::OpenGLContext() { caps_.framebufferBlitSupported = gl_extensions.NV_framebuffer_blit || gl_extensions.ARB_framebuffer_object; caps_.framebufferDepthBlitSupported = caps_.framebufferBlitSupported; caps_.depthClampSupported = gl_extensions.ARB_depth_clamp; + caps_.clipCullDistanceSupported = gl_extensions.EXT_clip_cull_distance || (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(3, 0)); // 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 diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index 2d74240b9a..8d996aea0c 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -780,6 +780,7 @@ VKContext::VKContext(VulkanContext *vulkan, bool splitSubmit) caps_.multiViewport = vulkan->GetDeviceFeatures().enabled.multiViewport != 0; caps_.dualSourceBlend = vulkan->GetDeviceFeatures().enabled.dualSrcBlend != 0; caps_.depthClampSupported = vulkan->GetDeviceFeatures().enabled.depthClamp != 0; + caps_.clipCullDistanceSupported = vulkan->GetDeviceFeatures().enabled.shaderClipDistance != 0 && vulkan->GetDeviceFeatures().enabled.shaderCullDistance != 0; caps_.framebufferBlitSupported = true; caps_.framebufferCopySupported = true; caps_.framebufferDepthBlitSupported = false; // Can be checked for. diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index 023098405c..c7a4db531a 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -520,6 +520,7 @@ struct DeviceCaps { bool dualSourceBlend; bool logicOpSupported; bool depthClampSupported; + bool clipCullDistanceSupported; bool framebufferCopySupported; bool framebufferBlitSupported; bool framebufferDepthCopySupported; diff --git a/GPU/D3D11/GPU_D3D11.cpp b/GPU/D3D11/GPU_D3D11.cpp index f973d49e5e..e01dd30b23 100644 --- a/GPU/D3D11/GPU_D3D11.cpp +++ b/GPU/D3D11/GPU_D3D11.cpp @@ -128,6 +128,8 @@ void GPU_D3D11::CheckGPUFeatures() { features |= GPU_SUPPORTS_DUALSOURCE_BLEND; if (draw_->GetDeviceCaps().depthClampSupported) features |= GPU_SUPPORTS_DEPTH_CLAMP; + if (draw_->GetDeviceCaps().clipCullDistanceSupported) + features |= GPU_SUPPORTS_CLIP_CULL_DISTANCE; features |= GPU_SUPPORTS_COPY_IMAGE; features |= GPU_SUPPORTS_TEXTURE_FLOAT; features |= GPU_SUPPORTS_INSTANCE_RENDERING; diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 18b11d57f5..fc28f4d9ed 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -228,6 +228,8 @@ void GPU_GLES::CheckGPUFeatures() { if (gl_extensions.GLES3) features |= GPU_SUPPORTS_DEPTH_TEXTURE; } + if (draw_->GetDeviceCaps().clipCullDistanceSupported) + features |= GPU_SUPPORTS_CLIP_CULL_DISTANCE; // If we already have a 16-bit depth buffer, we don't need to round. bool prefer24 = draw_->GetDeviceCaps().preferredDepthBufferFormat == Draw::DataFormat::D24_S8;