The former calculations were for min/max y. The width/height don't take translate into account.
Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu> --- Not sure that this fixes anything. However it probably should, since you're supposed to clip triangles at the viewport boundary. There are definitely dEQP tests for this, but maybe not piglits. src/gallium/drivers/swr/swr_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 520faea..f7b77fd 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -1018,9 +1018,9 @@ swr_update_derived(struct pipe_context *pipe, SWR_VIEWPORT_MATRICES *vpm = &ctx->derived.vpm; vp->x = state->translate[0] - state->scale[0]; - vp->width = state->translate[0] + state->scale[0]; + vp->width = 2 * state->scale[0]; vp->y = state->translate[1] - fabs(state->scale[1]); - vp->height = state->translate[1] + fabs(state->scale[1]); + vp->height = 2 * fabs(state->scale[1]); util_viewport_zmin_zmax(state, rasterizer->clip_halfz, &vp->minZ, &vp->maxZ); -- 2.7.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev