-
Fix PointCoord builtin · ef55c4e7Chris Forbes authored
There were two bugs here: - Across a 2x2 pixel quad, we were producing a uniform PointCoord value. This is not correct, and causes trouble even for size 1 points if the derivative of the PointCoord value is ever used, or if the non-helper lane is not lane 0 (in which case the live lane may end up having PointCoord values outside [0,1].) - SetupRoutine was using the clipspace position of the vertex. Xf,Yf are specified to be in screenspace. It's possible to do this in a less redundant way, but currently we don't have unrounded vertex positions in screenspace available in the setup program. Just reproject for now, as we do in clipping paths etc. Note that we only do this if we're drawing points, so most (filled triangle) draws should not incur any additional cost. Bug: b/140680704 Test: dEQP-VK.glsl.builtin_var.simple.pointcoord* Change-Id: If006cc92b86673b6bb747cf60f60e0ed46f5e8e3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36115Tested-by:
Chris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
ef55c4e7
×