Skip to content

Commit

Permalink
Merge pull request #16442 from unknownbrackets/vulkan-geometry-safety
Browse files Browse the repository at this point in the history
Vulkan: Only use geometry shaders with accurate depth
  • Loading branch information
hrydgard committed Nov 27, 2022
2 parents 767a877 + 1d00824 commit e4998ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion GPU/Vulkan/GPU_Vulkan.cpp
Expand Up @@ -232,7 +232,8 @@ u32 GPU_Vulkan::CheckGPUFeatures() const {
features |= GPU_USE_TEXTURE_FLOAT;

// Fall back to geometry shader culling if we can't do vertex range culling.
if (draw_->GetDeviceCaps().geometryShaderSupported) {
// Checking accurate depth here because the old depth path is uncommon and not well tested for this.
if (draw_->GetDeviceCaps().geometryShaderSupported && (features & GPU_USE_ACCURATE_DEPTH) != 0) {
const bool useGeometry = g_Config.bUseGeometryShader && !draw_->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW_OR_BROKEN);
const bool vertexSupported = draw_->GetDeviceCaps().clipDistanceSupported && draw_->GetDeviceCaps().cullDistanceSupported;
if (useGeometry && (!vertexSupported || (features & GPU_USE_VS_RANGE_CULLING) == 0)) {
Expand Down

0 comments on commit e4998ad

Please sign in to comment.