summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-05-10 11:38:56 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-05-10 11:38:56 +0000
commit948fa3b295d384592ebc9396413a38aba4edf4a6 (patch)
treee4f3e73ef9948846eb088a5e746e09ccfcd2d220 /src
parent586f2c59fe80a31b6342805e6ffc39ca878b098d (diff)
get fog working with _TexEnvProgram
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c22
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_vtbl.c1
3 files changed, 19 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 43f03ccb85..150d9bd2c2 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -981,15 +981,27 @@ void i915ValidateFragmentProgram( i915ContextPtr i915 )
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4 );
}
- if (inputsRead & FRAG_BIT_COL1) {
- intel->specoffset = offset / 4;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, S4_VFMT_SPEC_FOG, 3 );
- EMIT_PAD( 1 );
+ if ((inputsRead & (FRAG_BIT_COL1|FRAG_BIT_FOGC)) ||
+ i915->vertex_fog != I915_FOG_NONE) {
+
+ if (inputsRead & FRAG_BIT_COL1) {
+ intel->specoffset = offset / 4;
+ EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, S4_VFMT_SPEC_FOG, 3 );
+ }
+ else
+ EMIT_PAD(3);
+
+ if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE)
+ EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, S4_VFMT_SPEC_FOG, 1 );
+ else
+ EMIT_PAD( 1 );
}
- if (inputsRead & FRAG_BIT_FOGC) {
+#if 0
+ if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) {
EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 );
}
+#endif
for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
if (inputsRead & FRAG_BIT_TEX(i)) {
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 00b8a12627..adb17b2187 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -533,7 +533,7 @@ void i915_update_fog( GLcontext *ctx )
mode = ctx->FragmentProgram._Current->FogOption;
enabled = (mode != GL_NONE);
- try_pixel_fog = 1;
+ try_pixel_fog = 0;
}
else {
enabled = ctx->Fog.Enabled;
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index dc3342d0d5..7952866010 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -107,6 +107,7 @@ static GLboolean i915_check_vertex_size( intelContextPtr intel,
if (lis4 & S4_VFMT_COLOR) sz++;
if (lis4 & S4_VFMT_DEPTH_OFFSET) sz++;
if (lis4 & S4_VFMT_POINT_WIDTH) sz++;
+ if (lis4 & S4_VFMT_FOG_PARAM) sz++;
for (i = 0 ; i < 8 ; i++) {
switch (lis2 & S2_TEXCOORD_FMT0_MASK) {