summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2007-07-16 17:41:22 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2007-07-16 17:41:22 +0200
commit894557d625b6813dfb23602b96fde6a59d3db54e (patch)
treef5b94aeb19ee42b4327be5e75dc9e92616c5422f /src
parent56cbdfd7d541e5d99b7e7c4fb7b03ac6ac1536a1 (diff)
get rid of more cliprects...
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.c33
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_draw.c7
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 db72f59a2c..3ecd2e8e48 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 b1ecf2b0ce..1c83028d8a 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,