diff options
author | Felix Kuehling <[email protected]> | 2005-02-05 21:21:02 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2005-02-05 21:21:02 +0000 |
commit | 5bdf2bc6c707f0a815cc46fb0bab7e2a209110a3 (patch) | |
tree | e7e44f784eb033ab47c7bba84dcdd99560d7e7a5 /src/mesa/drivers/dri/savage/savageioctl.c | |
parent | d9d972a944c9953d99ff09deeb2a739386aa0a76 (diff) |
- Fixed scissor rectangle not moving with the window (Xorg bug #1731).
- Flush buffered primitives before changing scissors.
- Require Savage DRM version 2.1.0, so that the broken single-cliprect
code can finally rest in peace.
- Removed some more dead code.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savageioctl.c')
-rw-r--r-- | src/mesa/drivers/dri/savage/savageioctl.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index 51faea0295c..cd25b620f0d 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -401,8 +401,6 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, cmd[1].clear1.mask = depthMask; cmd[1].clear1.value = clearDepth; } - - imesa->dirty |= SAVAGE_UPLOAD_CLIPRECTS; } if (mask) @@ -562,16 +560,25 @@ void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard ) cmdbuf.vb_stride = imesa->HwVertexSize; cmdbuf.cmd_addr = start; cmdbuf.size = (imesa->cmdBuf.write - start); - if (!imesa->inSwap && imesa->glCtx->Scissor.Enabled) { + if (!imesa->inSwap && imesa->scissor.enabled) { drm_clip_rect_t *box = dPriv->pClipRects, *ibox; + drm_clip_rect_t scissor; GLuint nbox = dPriv->numClipRects, nibox; + /* transform and clip scissor to viewport */ + scissor.x1 = MAX2(imesa->scissor.x, 0) + dPriv->x; + scissor.y1 = MAX2(dPriv->h - imesa->scissor.y - imesa->scissor.h, + 0) + dPriv->y; + scissor.x2 = MIN2(imesa->scissor.x + imesa->scissor.w, + dPriv->w) + dPriv->x; + scissor.y2 = MIN2(dPriv->h - imesa->scissor.y, + dPriv->h) + dPriv->y; + /* intersect cliprects with scissor */ ibox = malloc(dPriv->numClipRects*sizeof(drm_clip_rect_t)); if (!ibox) { fprintf(stderr, "Out of memory.\n"); exit(1); } - nibox = savageIntersectClipRects(ibox, box, nbox, - &imesa->scissor_rect); + nibox = savageIntersectClipRects(ibox, box, nbox, &scissor); cmdbuf.nbox = nibox; cmdbuf.box_addr = ibox; } else { |