commit | bb305299f4de4a87d45bb4197aded36749ebda46 | [log] [tgz] |
---|---|---|
author | Chris Forbes <chrisforbes@google.com> | Fri Mar 01 15:10:25 2019 -0800 |
committer | Chris Forbes <chrisforbes@google.com> | Mon Mar 04 17:17:52 2019 +0000 |
tree | c8437c3f73d4dc9c80a4ca979228106f04ec14be | |
parent | 823ca85404fb67037c0ecc68481fb59aa232196c [diff] |
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>
diff --git a/src/Pipeline/SetupRoutine.cpp b/src/Pipeline/SetupRoutine.cpp index 600bb0c..f130a4a 100644 --- a/src/Pipeline/SetupRoutine.cpp +++ b/src/Pipeline/SetupRoutine.cpp
@@ -83,7 +83,7 @@ Float y1 = Float(Y[1]); Float y2 = Float(Y[2]); - Float A = (y2 - y0) * x1 + (y1 - y2) * x0 + (y0 - y1) * x2; // Area + Float A = (y0 - y2) * x1 + (y2 - y1) * x0 + (y1 - y0) * x2; // Area If(A == 0.0f) {