Unify the bounding depth checks, correct them if minmax clip is needed

This commit is contained in:
Henrik Rydgård committed 2026-05-30 19:07:59 +02:00
1 parent 0eede05f5f
commit e75d9f8a5f
9 files changed
+53 -50

No files matched your search

+1 -12
View File
@@ -254,18 +254,7 @@ void DrawEngineGLES::Flush() {
GEPrimitiveType prim = prevPrim_;
bool useHWTransform = CanUseHardwareTransform(prim);
if (useHWTransform && boundingDepths_.valid) {
if (boundingDepths_.hitClipSpaceZW) {
// Revert to software transform so we can clip more accurately.
useHWTransform = false;
}
if ((boundingDepths_.minProjZ < 0.0 || boundingDepths_.maxProjZ > 65535.0) && !gstate_c.Use(GPU_USE_DEPTH_CLAMP)) {
// Revert to software transform so we can clamp more accurately.
useHWTransform = false;
}
// Also handle clamping in software if it's not supported in hardware (or always?)
}
useHWTransform = CheckBoundingDepths(useHWTransform);
if (useHWTransform != lastUseHwTransform_) {
gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE | DIRTY_RASTER_STATE);