summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAapo Tahkola <[email protected]>2005-02-08 07:05:25 +0000
committerAapo Tahkola <[email protected]>2005-02-08 07:05:25 +0000
commit46cde1715f29dddf5d0a41d8c91ee117208d9685 (patch)
tree6870894e031d2eb1919bc9462d856a5651af0199 /src
parentd084982240bafba0169c4a6cacf02d45d6cfd8c1 (diff)
BIG FAT NOTE: Theres a nasty bug somewhere thats causing vb color buffer clears and other things not to work. This bug can be triggered by extending struct r300_hw_state by two struct r300_state_atom's from its current size. Everything zbs and unk42B4 related is now covered with HAVE_ZBS and GA ifdefs. Who wants to fix it? Not i. :)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.c8
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h6
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c10
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c7
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c17
5 files changed, 31 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index 67ec2fedc51..0142db2d0fd 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -349,10 +349,14 @@ void r300InitCmdBuf(r300ContextPtr r300)
r300->hw.unk4288.cmd[0] = cmducs(0x4288, 5);
ALLOC_STATE( unk42A0, always, 2, "unk42A0", 0 );
r300->hw.unk42A0.cmd[0] = cmducs(0x42A0, 1);
+#ifdef HAVE_ZBS
ALLOC_STATE( zbs, always, R300_ZBS_CMDSIZE, "zbs", 0 );
r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmducs(R300_RE_ZBIAS_T_FACTOR, 4);
+#endif
+#ifdef GA
ALLOC_STATE( unk42B4, always, 2, "unk42B4", 0 );
r300->hw.unk42B4.cmd[0] = cmducs(0x42B4, 1);
+#endif
ALLOC_STATE( cul, always, R300_CUL_CMDSIZE, "cul", 0 );
r300->hw.cul.cmd[R300_CUL_CMD_0] = cmducs(R300_RE_CULL_CNTL, 1);
ALLOC_STATE( unk42C0, always, 3, "unk42C0", 0 );
@@ -486,8 +490,12 @@ void r300InitCmdBuf(r300ContextPtr r300)
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4274);
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4288);
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42A0);
+#ifdef HAVE_ZBS
insert_at_tail(&r300->hw.atomlist, &r300->hw.zbs);
+#endif
+#ifdef GA
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42B4);
+#endif
insert_at_tail(&r300->hw.atomlist, &r300->hw.cul);
insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42C0);
insert_at_tail(&r300->hw.atomlist, &r300->hw.rc);
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 428614b7a65..eaec08d6027 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -407,8 +407,10 @@ struct r300_hw_state {
struct r300_state_atom unk4274; /* (4274) */
struct r300_state_atom unk4288; /* (4288) */
struct r300_state_atom unk42A0; /* (42A0) */
- struct r300_state_atom zbs; /* zbias (42A4) */
- struct r300_state_atom unk42B4; /* (42B4) */
+#ifdef HAVE_ZBS
+#endif
+ //struct r300_state_atom zbs; /* zbias (42A4) */
+ //struct r300_state_atom unk42B4; /* (42B4) */
struct r300_state_atom cul; /* cull cntl (42B8) */
struct r300_state_atom unk42C0; /* (42C0) */
struct r300_state_atom rc; /* rs control (4300) */
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index e7e1d37b681..84b475d064c 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -281,7 +281,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
if (dPriv->numClipRects == 0)
return;
}
-
+#ifdef HAVE_ZBS
/* When unk42B4==0 z-bias is still on for vb mode with points ... */
R300_STATECHANGE(r300, zbs);
zbs[0]=r300->hw.zbs.cmd[R300_ZBS_T_FACTOR];
@@ -297,8 +297,8 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
/* Make sure z-bias isnt on */
R300_STATECHANGE(r300, unk42B4);
unk42B4=r300->hw.unk42B4.cmd[1];
- r300->hw.unk42B4.cmd[1]=3;
-
+ r300->hw.unk42B4.cmd[1]=0;//3;
+#endif
if (mask & DD_FRONT_LEFT_BIT) {
flags |= DD_FRONT_LEFT_BIT;
mask &= ~DD_FRONT_LEFT_BIT;
@@ -340,7 +340,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
* but do keep it like this for now.
*/
r300ResetHwState(r300);
-
+#ifdef HAVE_ZBS
R300_STATECHANGE(r300, unk42B4);
r300->hw.unk42B4.cmd[1]=unk42B4;
@@ -350,7 +350,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask, GLboolean all,
r300->hw.zbs.cmd[R300_ZBS_T_CONSTANT] = zbs[1];
r300->hw.zbs.cmd[R300_ZBS_W_FACTOR] = zbs[2];
r300->hw.zbs.cmd[R300_ZBS_W_CONSTANT] = zbs[3];
-
+#endif
/* r300ClearBuffer has trampled all over the hardware state.. */
r300->hw.all_dirty=GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index c6d57a35517..cbe7d91d1af 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -58,9 +58,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r300_emit.h"
-#if 0
+
+#ifdef HAVE_ZBS
/* Turns out we might not need this after all... */
-static void update_zbias(GLcontext * ctx, int prim)
+void update_zbias(GLcontext * ctx, int prim)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
int enabled = 0;
@@ -690,7 +691,7 @@ static GLboolean r300_run_render(GLcontext *ctx,
#if 1
- #if 1
+ #if 0
return r300_run_immediate_render(ctx, stage);
#else
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 0dc3293ab23..f31c9f0aa33 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -498,7 +498,7 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state)
case GL_CULL_FACE:
r300UpdateCulling(ctx);
break;
-
+#ifdef HAVE_ZBS
case GL_POLYGON_OFFSET_POINT:
case GL_POLYGON_OFFSET_LINE:
WARN_ONCE("Don't know how to enable polygon offset point/line. Help me !\n");
@@ -512,6 +512,7 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state)
r300->hw.unk42B4.cmd[1] &= ~3;
}
break;
+#endif
case GL_VERTEX_PROGRAM_ARB:
//TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_TCL_DISABLE, state);
break;
@@ -816,7 +817,7 @@ static void r300DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval)
/* =============================================================
* Polygon state
*/
-
+#ifdef HAVE_ZBS
static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
@@ -832,7 +833,7 @@ static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units)
rmesa->hw.zbs.cmd[R300_ZBS_W_FACTOR] = r300PackFloat32(factor);
rmesa->hw.zbs.cmd[R300_ZBS_W_CONSTANT] = r300PackFloat32(constant);
}
-
+#endif
/* Routing and texture-related */
@@ -1634,6 +1635,7 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
r300ResetHwState(r300);
}
+void update_zbias(GLcontext * ctx, int prim);
/**
* Completely recalculates hardware state based on the Mesa state.
@@ -1790,11 +1792,11 @@ void r300ResetHwState(r300ContextPtr r300)
r300->hw.unk4288.cmd[5] = 0x00000000;
r300->hw.unk42A0.cmd[1] = 0x00000000;
-
-#if 0
+#ifdef GA
+#ifndef HAVE_ZBS
r300->hw.unk42B4.cmd[1] = 0x00000000;
#endif
-
+#endif
r300->hw.unk42C0.cmd[1] = 0x4B7FFFFF;
r300->hw.unk42C0.cmd[2] = 0x00000000;
@@ -1993,6 +1995,7 @@ void r300InitStateFuncs(struct dd_function_table* functions)
functions->DepthRange = r300DepthRange;
functions->PointSize = r300PointSize;
-
+#ifdef HAVE_ZBS
functions->PolygonOffset = r300PolygonOffset;
+#endif
}