From 7c9e191b812cf15c678bb49e38642c9b46094d51 Mon Sep 17 00:00:00 2001 From: CyCle1024 Date: Wed, 28 Jan 2026 01:34:03 +0800 Subject: [PATCH 1/2] fix viewportFlipY XOR condition --- source/dk_device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dk_device.h b/source/dk_device.h index 661d3a7..37763f4 100644 --- a/source/dk_device.h +++ b/source/dk_device.h @@ -99,7 +99,7 @@ class Device // Rasterizer expects clip space +Y to point down. In UpperLeft mode with Y pointing up // (or LowerLeft mode with Y pointing down) we need to flip the incoming Y coordinate. - bool viewportFlipY() const noexcept { return !isYAxisPointsDown() ^ !isOriginLowerLeft(); } + bool viewportFlipY() const noexcept { return !(!isYAxisPointsDown() ^ !isOriginLowerLeft()); } DkResult initialize() noexcept; ~Device(); From 0cb811387cb56ad1a1edb9de56c44b42036dec11 Mon Sep 17 00:00:00 2001 From: CyCle1024 Date: Wed, 28 Jan 2026 01:59:36 +0800 Subject: [PATCH 2/2] simplify XOR in viewportFlipY --- source/dk_device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dk_device.h b/source/dk_device.h index 37763f4..90ed378 100644 --- a/source/dk_device.h +++ b/source/dk_device.h @@ -99,7 +99,7 @@ class Device // Rasterizer expects clip space +Y to point down. In UpperLeft mode with Y pointing up // (or LowerLeft mode with Y pointing down) we need to flip the incoming Y coordinate. - bool viewportFlipY() const noexcept { return !(!isYAxisPointsDown() ^ !isOriginLowerLeft()); } + bool viewportFlipY() const noexcept { return isYAxisPointsDown() ^ !isOriginLowerLeft(); } DkResult initialize() noexcept; ~Device();