Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bb30529

Browse files
committed
Fix culling to match Vulkan convention
Correct the sign of the area calculation. The front facing determination can then be written to exactly match the spec -- CCW means positive area is front facing. Change-Id: Ibed3e26b0cf77030325044c7dc9e818264a8750d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26009 Tested-by: Chris Forbes <chrisforbes@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
1 parent 823ca85 commit bb30529

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Pipeline/SetupRoutine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace sw
8383
Float y1 = Float(Y[1]);
8484
Float y2 = Float(Y[2]);
8585

86-
Float A = (y2 - y0) * x1 + (y1 - y2) * x0 + (y0 - y1) * x2; // Area
86+
Float A = (y0 - y2) * x1 + (y2 - y1) * x0 + (y1 - y0) * x2; // Area
8787

8888
If(A == 0.0f)
8989
{

0 commit comments

Comments
 (0)