summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-06 08:15:54 -0700
committerBrian Paul <brianp@vmware.com>2009-01-06 08:15:54 -0700
commit374cf77b2f0f13f9380fb0c9d804222a83bdc2e0 (patch)
tree39cfbbcbbbdc9b2d64e4ad134472cf747101dc7b /src/mesa/drivers
parent52d5d25537a9291f7d247211d2881ed56edaca94 (diff)
parenta8ee35c1c59c23938e0a18b163515acc892ed407 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/drivers/dri/common/dri_util.c
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c20
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c1
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_emit.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c2
5 files changed, 26 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index a2316e2662..ae79055405 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -314,10 +314,28 @@ static void driReportDamage(__DRIdrawable *pdp,
static void driSwapBuffers(__DRIdrawable *dPriv)
{
__DRIscreen *psp = dPriv->driScreenPriv;
+ drm_clip_rect_t *rects;
+ int i;
+
+ if (!dPriv->numClipRects)
+ return;
psp->DriverAPI.SwapBuffers(dPriv);
- driReportDamage(dPriv, dPriv->pClipRects, dPriv->numClipRects);
+ rects = _mesa_malloc(sizeof(*rects) * dPriv->numClipRects);
+
+ if (!rects)
+ return;
+
+ for (i = 0; i < dPriv->numClipRects; i++) {
+ rects[i].x1 = dPriv->pClipRects[i].x1 - dPriv->x;
+ rects[i].y1 = dPriv->pClipRects[i].y1 - dPriv->y;
+ rects[i].x2 = dPriv->pClipRects[i].x2 - dPriv->x;
+ rects[i].y2 = dPriv->pClipRects[i].y2 - dPriv->y;
+ }
+
+ driReportDamage(dPriv, rects, dPriv->numClipRects);
+ _mesa_free(rects);
}
static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv,
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 31e9ceb42e..9e2b39af9b 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -753,6 +753,7 @@ ALU2(ADD)
ALU2(MUL)
ALU1(FRC)
ALU1(RNDD)
+ALU1(RNDZ)
ALU2(MAC)
ALU2(MACH)
ALU1(LZD)
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index ce4cf46cfa..4e099b5945 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -439,6 +439,7 @@ ALU2(ADD)
ALU2(MUL)
ALU1(FRC)
ALU1(RNDD)
+ALU1(RNDZ)
ALU2(MAC)
ALU2(MACH)
ALU1(LZD)
diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 80ff7437ba..71e2a95bfd 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -1133,6 +1133,10 @@ void brw_vs_emit(struct brw_vs_compile *c )
*/
emit_swz(c, dst, inst->SrcReg[0] );
break;
+ case OPCODE_TRUNC:
+ /* round toward zero */
+ brw_RNDZ(p, dst, args[0]);
+ break;
case OPCODE_XPD:
emit_xpd(p, dst, args[0], args[1]);
break;
diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index baecfdcb79..d43e326f7d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -267,7 +267,7 @@ static void emit_trunc( struct brw_wm_compile *c,
struct brw_reg src, dst;
dst = get_dst_reg(c, inst, i, 1) ;
src = get_src_reg(c, &inst->SrcReg[0], i, 1);
- brw_RNDD(p, dst, src);
+ brw_RNDZ(p, dst, src);
}
}
brw_set_saturate(p, 0);