Pedro Maia wrote:
I'm contacting, because i've read your email about the launch of Mesa. I'm
using Mesa cvs and r300 driver. Since day 28 of this month (yesterday) that
i'm getting weird result. If i use Mesa from day 27 and r300 driver from now
all work ok. For the look of the bug appears to be an viewport bug, but hey,
i'm only an user. Please consider fixing before launch :)
If you need any picture / debug log, just cc me.
Try the attached patch to r300_state.c
-Brian
? diff
Index: r300_state.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r300/r300_state.c,v
retrieving revision 1.150
diff -r1.150 r300_state.c
831d830
< const GLfloat *v = ctx->Viewport._WindowMap.m;
833,848c832,856
< GLfloat sx = v[MAT_SX];
< GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
< GLfloat sy = -v[MAT_SY];
< GLfloat ty = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
< GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
< GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
<
< R300_FIREVERTICES(rmesa);
< R300_STATECHANGE(rmesa, vpt);
<
< rmesa->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(sx);
< rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx);
< rmesa->hw.vpt.cmd[R300_VPT_YSCALE] = r300PackFloat32(sy);
< rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty);
< rmesa->hw.vpt.cmd[R300_VPT_ZSCALE] = r300PackFloat32(sz);
< rmesa->hw.vpt.cmd[R300_VPT_ZOFFSET] = r300PackFloat32(tz);
---
> if (ctx->NewState) {
> /* make sure ctx->Viewport._WindowMap is up to date */
> _mesa_update_state(ctx);
> }
>
> {
> const GLfloat *v = ctx->Viewport._WindowMap.m;
>
> GLfloat sx = v[MAT_SX];
> GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
> GLfloat sy = -v[MAT_SY];
> GLfloat ty = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
> GLfloat sz = v[MAT_SZ] * rmesa->state.depth.scale;
> GLfloat tz = v[MAT_TZ] * rmesa->state.depth.scale;
>
> R300_FIREVERTICES(rmesa);
> R300_STATECHANGE(rmesa, vpt);
>
> rmesa->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(sx);
> rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx);
> rmesa->hw.vpt.cmd[R300_VPT_YSCALE] = r300PackFloat32(sy);
> rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty);
> rmesa->hw.vpt.cmd[R300_VPT_ZSCALE] = r300PackFloat32(sz);
> rmesa->hw.vpt.cmd[R300_VPT_ZOFFSET] = r300PackFloat32(tz);
> }