Commit bb305299 by Chris Forbes

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/+/26009Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 823ca854
......@@ -83,7 +83,7 @@ namespace sw
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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment