summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index 2a2eef5812..a05a29b7e1 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -218,32 +218,18 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
r300->hw.vpi.cmd[8] = 0;
R300_STATECHANGE(r300, zs);
+ r300->hw.zs.cmd[R300_ZS_CNTL_0] = 0;
+ r300->hw.zs.cmd[R300_ZS_CNTL_1] = 0;
if (flags & CLEARBUFFER_DEPTH) {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_0] |= 0x6; // test and write
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
+ r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_WRITE_ONLY;
r300->hw.zs.cmd[R300_ZS_CNTL_1] |= (R300_ZS_ALWAYS<<R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
-/*
- R300_STATECHANGE(r300, zb);
- r300->hw.zb.cmd[R300_ZB_OFFSET] =
- 1024*4*300 +
- r300->radeon.radeonScreen->frontOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.zb.cmd[R300_ZB_PITCH] =
- r300->radeon.radeonScreen->depthPitch;
-*/
} else {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_DISABLED_1; // disable
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
}
R300_STATECHANGE(r300, zs);
if (flags & CLEARBUFFER_STENCIL) {
- r300->hw.zs.cmd[R300_ZS_CNTL_0] &= ~R300_RB3D_STENCIL_ENABLE;
r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_STENCIL_ENABLE;
- r300->hw.zs.cmd[R300_ZS_CNTL_1] &=
- ~((R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT));
r300->hw.zs.cmd[R300_ZS_CNTL_1] |=
(R300_ZS_ALWAYS<<R300_RB3D_ZS1_FRONT_FUNC_SHIFT) |
(R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) |
@@ -299,37 +285,18 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
{
uint32_t t1, t2;
- t1 = r300->hw.zs.cmd[R300_ZS_CNTL_0];
- t2 = r300->hw.zs.cmd[R300_ZS_CNTL_1];
+ t1 = 0x0;
+ t2 = 0x0;
if (flags & CLEARBUFFER_DEPTH) {
- t1 &= R300_RB3D_STENCIL_ENABLE;
- t1 |= 0x6; // test and write
-
- t2 &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
- t2 |= (R300_ZS_ALWAYS<<R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
-/*
- R300_STATECHANGE(r300, zb);
- r300->hw.zb.cmd[R300_ZB_OFFSET] =
- 1024*4*300 +
- r300->radeon.radeonScreen->frontOffset +
- r300->radeon.radeonScreen->fbLocation;
- r300->hw.zb.cmd[R300_ZB_PITCH] =
- r300->radeon.radeonScreen->depthPitch;
-*/
+ t1 |= R300_RB3D_Z_WRITE_ONLY;
+ t2 |= (R300_ZS_ALWAYS << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
} else {
- t1 &= R300_RB3D_STENCIL_ENABLE;
t1 |= R300_RB3D_Z_DISABLED_1; // disable
-
- t2 &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
}
if (flags & CLEARBUFFER_STENCIL) {
- t1 &= ~R300_RB3D_STENCIL_ENABLE;
t1 |= R300_RB3D_STENCIL_ENABLE;
-
- t2 &=
- ~((R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT));
t2 |=
(R300_ZS_ALWAYS<<R300_RB3D_ZS1_FRONT_FUNC_SHIFT) |
(R300_ZS_REPLACE<<R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) |