#define I915_UPLOAD_STIPPLE 0x4
#define I915_UPLOAD_PROGRAM 0x8
#define I915_UPLOAD_CONSTANTS 0x10
-#define I915_UPLOAD_FOG 0x20
#define I915_UPLOAD_INVARIENT 0x40
#define I915_UPLOAD_DEFAULTS 0x80
#define I915_UPLOAD_RASTER_RULES 0x100
#define I915_BLENDREG_BLENDCOLOR1 2
#define I915_BLEND_SETUP_SIZE 3
-#define I915_FOGREG_COLOR 0
-#define I915_FOGREG_MODE0 1
-#define I915_FOGREG_MODE1 2
-#define I915_FOGREG_MODE2 3
-#define I915_FOGREG_MODE3 4
-#define I915_FOG_SETUP_SIZE 5
-
#define I915_STPREG_ST0 0
#define I915_STPREG_ST1 1
#define I915_STP_SETUP_SIZE 2
GLuint Blend[I915_BLEND_SETUP_SIZE];
GLuint Buffer[I915_DEST_SETUP_SIZE];
GLuint Stipple[I915_STP_SETUP_SIZE];
- GLuint Fog[I915_FOG_SETUP_SIZE];
GLuint Defaults[I915_DEF_SETUP_SIZE];
GLuint RasterRules[I915_RASTER_RULES_SETUP_SIZE];
GLuint Tex[I915_TEX_UNITS][I915_TEX_SETUP_SIZE];
*/
extern void i915InitStateFunctions(struct dd_function_table *functions);
extern void i915InitState(struct i915_context *i915);
-extern void i915_update_fog(struct gl_context * ctx);
extern void i915_update_stencil(struct gl_context * ctx);
extern void i915_update_provoking_vertex(struct gl_context *ctx);
/* =============================================================
* Fog
+ *
+ * This empty function remains because _mesa_init_driver_state calls
+ * dd_function_table::Fogfv unconditionally. We have to have some function
+ * there so that it doesn't try to call a NULL pointer.
*/
-void
-i915_update_fog(struct gl_context * ctx)
-{
- struct i915_context *i915 = I915_CONTEXT(ctx);
- GLuint dw;
-
- assert(ctx->FragmentProgram._Current);
-
- I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, 0);
- dw = i915->state.Ctx[I915_CTXREG_LIS5] & ~S5_FOG_ENABLE;
-
- if (dw != i915->state.Ctx[I915_CTXREG_LIS5]) {
- i915->state.Ctx[I915_CTXREG_LIS5] = dw;
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- }
-
- /* Always enable pixel fog. Vertex fog using fog coord will conflict
- * with fog code appended onto fragment program.
- */
- _tnl_allow_vertex_fog( ctx, 0 );
- _tnl_allow_pixel_fog( ctx, 1 );
-}
-
static void
i915Fogfv(struct gl_context * ctx, GLenum pname, const GLfloat * param)
{
- struct i915_context *i915 = I915_CONTEXT(ctx);
-
- switch (pname) {
- case GL_FOG_COORDINATE_SOURCE_EXT:
- case GL_FOG_MODE:
- case GL_FOG_START:
- case GL_FOG_END:
- break;
-
- case GL_FOG_DENSITY:
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
-
- if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
- i915->state.Fog[I915_FOGREG_MODE3] =
- (GLuint) (ctx->Fog.Density * FMC3_D_ONE);
- }
- else {
- fi_type fi;
- fi.f = ctx->Fog.Density;
- i915->state.Fog[I915_FOGREG_MODE3] = fi.i;
- }
- break;
-
- case GL_FOG_COLOR:
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_COLOR] =
- (_3DSTATE_FOG_COLOR_CMD |
- ((GLubyte) (ctx->Fog.Color[0] * 255.0F) << 16) |
- ((GLubyte) (ctx->Fog.Color[1] * 255.0F) << 8) |
- ((GLubyte) (ctx->Fog.Color[2] * 255.0F) << 0));
- break;
-
- default:
- break;
- }
-}
-
-static void
-i915Hint(struct gl_context * ctx, GLenum target, GLenum state)
-{
- switch (target) {
- case GL_FOG_HINT:
- break;
- default:
- break;
- }
+ (void) ctx;
+ (void) pname;
+ (void) param;
}
/* =============================================================
}
break;
- case GL_FOG:
- break;
-
case GL_CULL_FACE:
i915CullFaceFrontFace(ctx, 0);
break;
i915->state.Stipple[I915_STPREG_ST0] = _3DSTATE_STIPPLE;
}
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_MODE0] = _3DSTATE_FOG_MODE_CMD;
- i915->state.Fog[I915_FOGREG_MODE1] = (FMC1_FOGFUNC_MODIFY_ENABLE |
- FMC1_FOGFUNC_VERTEX |
- FMC1_FOGINDEX_MODIFY_ENABLE |
- FMC1_FOGINDEX_W |
- FMC1_C1_C2_MODIFY_ENABLE |
- FMC1_DENSITY_MODIFY_ENABLE);
- i915->state.Fog[I915_FOGREG_COLOR] = _3DSTATE_FOG_COLOR_CMD;
- }
-
{
i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
functions->Enable = i915Enable;
functions->Fogfv = i915Fogfv;
functions->FrontFace = i915CullFaceFrontFace;
- functions->Hint = i915Hint;
functions->LightModelfv = i915LightModelfv;
functions->LineWidth = i915LineWidth;
functions->LogicOpcode = i915LogicOp;
if (dirty & I915_UPLOAD_STIPPLE)
sz += sizeof(state->Stipple);
- if (dirty & I915_UPLOAD_FOG)
- sz += sizeof(state->Fog);
-
if (dirty & I915_UPLOAD_TEX_ALL) {
int nr = 0;
for (i = 0; i < I915_TEX_UNITS; i++)
emit(intel, state->Stipple, sizeof(state->Stipple));
}
- if (dirty & I915_UPLOAD_FOG) {
- if (INTEL_DEBUG & DEBUG_STATE)
- fprintf(stderr, "I915_UPLOAD_FOG:\n");
- emit(intel, state->Fog, sizeof(state->Fog));
- }
-
/* Combine all the dirty texture state into a single command to
* avoid lockups on I915 hardware.
*/