summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-07-07 17:32:39 -0600
committerTim Rowley <[email protected]>2016-07-20 10:22:14 -0500
commit98641f4e73030694bb79f41d40d7e1515b396f77 (patch)
tree403e9f2584220f01edd50cbe53feaf299f2da176
parent96dfed49e47eac7afc100e5b8d3b316dd6652fb6 (diff)
swr: [rasterizer core] viewport rounding for disabled scissor
Adjust viewport rounding when scissor rect is disabled during macro tile scissor setup. Signed-off-by: Tim Rowley <[email protected]>
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index 6460a16ec3f..aface7a77ef 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -732,10 +732,12 @@ void SetupMacroTileScissors(DRAW_CONTEXT *pDC)
}
else
{
+ // the vp width and height must be added to origin un-rounded then the result round to -inf.
+ // The cast to int works for rounding assuming all [left, right, top, bottom] are positive.
left = (int32_t)pState->vp[0].x;
- right = (int32_t)pState->vp[0].x + (int32_t)pState->vp[0].width;
+ right = (int32_t)(pState->vp[0].x + pState->vp[0].width);
top = (int32_t)pState->vp[0].y;
- bottom = (int32_t)pState->vp[0].y + (int32_t)pState->vp[0].height;
+ bottom = (int32_t)(pState->vp[0].y + pState->vp[0].height);
}
right = std::min<uint32_t>(right, KNOB_MAX_SCISSOR_X);