summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h25
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c16
4 files changed, 24 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index 21ae712e81..243a65a267 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -398,7 +398,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, 3);
r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1);
ALLOC_STATE(fogs, always, R300_FOGS_CMDSIZE, 0);
- r300->hw.fogs.cmd[R300_FOGS_CMD_0] = cmdpacket0(R300_RE_FOG_STATE, 1);
+ r300->hw.fogs.cmd[R300_FOGS_CMD_0] = cmdpacket0(FG_FOG_BLEND, 1);
ALLOC_STATE(fogc, always, R300_FOGC_CMDSIZE, 0);
r300->hw.fogc.cmd[R300_FOGC_CMD_0] = cmdpacket0(R300_FOG_COLOR_R, 3);
ALLOC_STATE(at, always, R300_AT_CMDSIZE, 0);
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index d9eaedd70f..ff9c2c880d 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -207,7 +207,7 @@ static void r300EmitClearState(GLcontext * ctx)
/* disable fog */
R300_STATECHANGE(r300, fogs);
- reg_start(R300_RE_FOG_STATE, 0);
+ reg_start(FG_FOG_BLEND, 0);
e32(0x0);
R300_STATECHANGE(r300, vir[1]);
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index 182d7fe98a..17d051da4a 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -1459,14 +1459,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R300_FPI2_UNKNOWN_31 (1 << 31)
/* END: Fragment program instruction set */
-/* Fog state and color */
-#define R300_RE_FOG_STATE 0x4BC0
-# define R300_FOG_DISABLE (0 << 0)
-# define R300_FOG_ENABLE (1 << 0)
-# define R300_FOG_MODE_LINEAR (0 << 1)
-# define R300_FOG_MODE_EXP (1 << 1)
-# define R300_FOG_MODE_EXP2 (2 << 1)
-# define R300_FOG_MODE_MASK (3 << 1)
+/* Fog: Fog Blending Enable */
+#define FG_FOG_BLEND 0x4bc0
+# define FG_FOG_BLEND_DISABLE (0 << 0)
+# define FG_FOG_BLEND_ENABLE (1 << 0)
+# define FG_FOG_BLEND_FN_LINEAR (0 << 1)
+# define FG_FOG_BLEND_FN_EXP (1 << 1)
+# define FG_FOG_BLEND_FN_EXP2 (2 << 1)
+# define FG_FOG_BLEND_FN_CONSTANT (3 << 1)
+# define FG_FOG_BLEND_FN_MASK 0x00000006
+
#define R300_FOG_COLOR_R 0x4BC8
#define R300_FOG_COLOR_G 0x4BCC
#define R300_FOG_COLOR_B 0x4BD0
@@ -1507,13 +1509,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define FG_ALPHA_FUNC_FP16_ENABLE (1 << 28)
/* gap in AMD spec */
-/* Where does the depth come from? */
+/* Fog: Where does the depth come from? */
#define R300_FG_DEPTH_SRC 0x4bd8
# define R300_FG_DEPTH_SRC_SCAN (0 << 0)
# define R300_FG_DEPTH_SRC_SHADER (1 << 0)
-/* Alpha Compare Value */
-#define R300_FG_ALPHA_VALUE 0x4be0
+/* Fog: Alpha Compare Value */
+#define FG_ALPHA_VALUE 0x4be0
+# define FG_ALPHA_VALUE_MASK 0x0000ffff
/* gap */
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 970561c258..5d40855440 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -641,8 +641,8 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
R300_STATECHANGE(r300, fogs);
r300->hw.fogs.cmd[R300_FOGS_STATE] =
(r300->hw.fogs.
- cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) |
- R300_FOG_MODE_LINEAR;
+ cmd[FG_FOG_BLEND] & ~FG_FOG_BLEND_FN_MASK) |
+ FG_FOG_BLEND_FN_LINEAR;
if (ctx->Fog.Start == ctx->Fog.End) {
fogScale.f = -1.0;
@@ -659,8 +659,8 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
R300_STATECHANGE(r300, fogs);
r300->hw.fogs.cmd[R300_FOGS_STATE] =
(r300->hw.fogs.
- cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) |
- R300_FOG_MODE_EXP;
+ cmd[FG_FOG_BLEND] & ~FG_FOG_BLEND_FN_MASK) |
+ FG_FOG_BLEND_FN_EXP;
fogScale.f = 0.0933 * ctx->Fog.Density;
fogStart.f = 0.0;
break;
@@ -668,8 +668,8 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
R300_STATECHANGE(r300, fogs);
r300->hw.fogs.cmd[R300_FOGS_STATE] =
(r300->hw.fogs.
- cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) |
- R300_FOG_MODE_EXP2;
+ cmd[FG_FOG_BLEND] & ~FG_FOG_BLEND_FN_MASK) |
+ FG_FOG_BLEND_FN_EXP2;
fogScale.f = 0.3 * ctx->Fog.Density;
fogStart.f = 0.0;
default:
@@ -1681,7 +1681,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
case GL_FOG:
R300_STATECHANGE(r300, fogs);
if (state) {
- r300->hw.fogs.cmd[R300_FOGS_STATE] |= R300_FOG_ENABLE;
+ r300->hw.fogs.cmd[FG_FOG_BLEND] |= FG_FOG_BLEND_ENABLE;
r300Fogfv(ctx, GL_FOG_MODE, NULL);
r300Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density);
@@ -1689,7 +1689,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
r300Fogfv(ctx, GL_FOG_END, &ctx->Fog.End);
r300Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color);
} else {
- r300->hw.fogs.cmd[R300_FOGS_STATE] &= ~R300_FOG_ENABLE;
+ r300->hw.fogs.cmd[FG_FOG_BLEND] &= ~FG_FOG_BLEND_ENABLE;
}
break;