Eliminate the half-pixel NDC shift.
Bug 22123818
Change-Id: If9bf78d6b44ccd0662676c8896837cca8829efc8
Reviewed-on: https://swiftshader-review.googlesource.com/3624
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Renderer/Clipper.cpp b/src/Renderer/Clipper.cpp
index 246ec2f..e2bb617 100644
--- a/src/Renderer/Clipper.cpp
+++ b/src/Renderer/Clipper.cpp
@@ -166,8 +166,8 @@
{
int j = i == polygon.n - 1 ? 0 : i + 1;
- float di = V[i]->w + (V[i]->x + data.halfPixelX[0] * V[i]->w);
- float dj = V[j]->w + (V[j]->x + data.halfPixelX[0] * V[j]->w);
+ float di = V[i]->w + V[i]->x;
+ float dj = V[j]->w + V[j]->x;
if(di >= 0)
{
@@ -208,8 +208,8 @@
{
int j = i == polygon.n - 1 ? 0 : i + 1;
- float di = V[i]->w - (V[i]->x + data.halfPixelX[0] * V[i]->w);
- float dj = V[j]->w - (V[j]->x + data.halfPixelX[0] * V[j]->w);
+ float di = V[i]->w - V[i]->x;
+ float dj = V[j]->w - V[j]->x;
if(di >= 0)
{
@@ -250,8 +250,8 @@
{
int j = i == polygon.n - 1 ? 0 : i + 1;
- float di = V[i]->w - (V[i]->y + data.halfPixelY[0] * V[i]->w);
- float dj = V[j]->w - (V[j]->y + data.halfPixelY[0] * V[j]->w);
+ float di = V[i]->w - V[i]->y;
+ float dj = V[j]->w - V[j]->y;
if(di >= 0)
{
@@ -292,8 +292,8 @@
{
int j = i == polygon.n - 1 ? 0 : i + 1;
- float di = V[i]->w + (V[i]->y + data.halfPixelY[0] * V[i]->w);
- float dj = V[j]->w + (V[j]->y + data.halfPixelY[0] * V[j]->w);
+ float di = V[i]->w + V[i]->y;
+ float dj = V[j]->w + V[j]->y;
if(di >= 0)
{