From 894557d625b6813dfb23602b96fde6a59d3db54e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 16 Jul 2007 17:41:22 +0200 Subject: [PATCH] get rid of more cliprects... --- src/mesa/drivers/dri/i915tex/intel_blit.c | 33 ++++++------------- .../drivers/dri/i915tex/intel_pixel_draw.c | 7 ++++ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c index db72f59a2c7..3ecd2e8e481 100644 --- a/src/mesa/drivers/dri/i915tex/intel_blit.c +++ b/src/mesa/drivers/dri/i915tex/intel_blit.c @@ -402,10 +402,8 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask) LOCK_HARDWARE(intel); if (intel->numClipRects) { - assert(intel->numClipRects == 1); GLint cx, cy, cw, ch; - drm_clip_rect_t clear; - int i; + drm_clip_rect_t b; /* Get clear bounds after locking */ cx = fb->_Xmin; @@ -416,36 +414,25 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask) if (fb->Name == 0) { /* clearing a window */ /* flip top to bottom */ - clear.x1 = cx; - clear.y1 = intel->pClipRects->y2 - cy - ch; - clear.x2 = clear.x1 + cw; - clear.y2 = clear.y1 + ch; + b.x1 = cx; + b.y1 = fb->Height - cy - ch; + b.x2 = b.x1 + cw; + b.y2 = b.y1 + ch; } else { /* clearing FBO */ - assert(intel->numClipRects == 1); - assert(intel->pClipRects == &intel->fboRect); - clear.x1 = cx; - clear.y1 = cy; - clear.x2 = clear.x1 + cw; - clear.y2 = clear.y1 + ch; + b.x1 = cx; + b.y1 = cy; + b.x2 = b.x1 + cw; + b.y2 = b.y1 + ch; /* no change to mask */ } - for (i = 0; i < intel->numClipRects; i++) { - const drm_clip_rect_t *box = &intel->pClipRects[i]; - drm_clip_rect_t b; + { GLuint buf; GLuint clearMask = mask; /* use copy, since we modify it below */ GLboolean all = (cw == fb->Width && ch == fb->Height); - if (!all) { - intel_intersect_cliprects(&b, &clear, box); - } - else { - b = *box; - } - DBG("clear %d,%d..%d,%d, mask %x\n", b.x1, b.y1, b.x2, b.y2, mask); diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c index b1ecf2b0ce3..1c83028d8ab 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c @@ -421,10 +421,17 @@ intelDrawPixels(GLcontext * ctx, * wise happily run the fragment program on each pixel in the image). */ struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; + /* can't just set current frag prog to 0 here as on buffer resize + we'll get new state checks which will segfault (actually don't get them + with current priv buffers). Remains a hack. */ ctx->FragmentProgram._Current = NULL; + ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE; + ctx->FragmentProgram._Active = GL_FALSE; _swrast_DrawPixels( ctx, x, y, width, height, format, type, unpack, pixels ); ctx->FragmentProgram._Current = fpSave; + ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE; + ctx->FragmentProgram._Active = GL_TRUE; } else { _swrast_DrawPixels( ctx, x, y, width, height, format, type, -- 2.30.2