Permalink
Browse files

Vulkan: Allow full depth range with depth clamp.

  • Loading branch information...
unknownbrackets committed Dec 27, 2017
1 parent b94ca6e commit e8ca467bc92cd11abaaea647629fe3799ed448bc
Showing with 4 additions and 0 deletions.
  1. +4 −0 GPU/Common/GPUStateUtils.cpp
@@ -508,6 +508,9 @@ float DepthSliceFactor() {
if (gstate_c.Supports(GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT)) {
return DEPTH_SLICE_FACTOR_16BIT;
}
if (gstate_c.Supports(GPU_SUPPORTS_DEPTH_CLAMP)) {
return 1.0f;
}
return DEPTH_SLICE_FACTOR_HIGH;
}
@@ -681,6 +684,7 @@ void ConvertViewportAndScissor(bool useBufferedRendering, float renderWidth, flo
// So, we apply the depth range as minz/maxz, and transform for the viewport.
float vpZScale = gstate.getViewportZScale();
float vpZCenter = gstate.getViewportZCenter();
// TODO: This clip the entire draw if minz > maxz.
float minz = gstate.getDepthRangeMin();
float maxz = gstate.getDepthRangeMax();

0 comments on commit e8ca467

Please sign in to comment.