*/
{
struct i915_fragment_program *p =
- (struct i915_fragment_program *)ctx->FragmentProgram.Current;
- if (p->nr_params)
+ (struct i915_fragment_program *)ctx->FragmentProgram._Current;
+ if (p && p->nr_params)
p->params_uptodate = 0;
}
+ if (new_state & (_NEW_FOG|_NEW_HINT|_NEW_PROGRAM))
+ i915_update_fog(ctx);
}
*/
extern void i915InitStateFunctions( struct dd_function_table *functions );
extern void i915InitState( i915ContextPtr i915 );
+extern void i915_update_fog( GLcontext *ctx );
/*======================================================================
*/
static void upload_program( struct i915_fragment_program *p )
{
- const struct fragment_program *program = p->ctx->FragmentProgram.Current;
+ const struct fragment_program *program = p->ctx->FragmentProgram._Current;
const struct fp_instruction *inst = program->Instructions;
/* _mesa_debug_fp_inst(program->Base.NumInstructions, inst); */
struct vertex_buffer *VB = &tnl->vb;
struct i915_fragment_program *p =
- (struct i915_fragment_program *)ctx->FragmentProgram.Current;
+ (struct i915_fragment_program *)ctx->FragmentProgram._Current;
GLuint inputsRead = p->FragProg.InputsRead;
GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
/* =============================================================
* Fog
*/
-static void update_fog( GLcontext *ctx )
+void i915_update_fog( GLcontext *ctx )
{
i915ContextPtr i915 = I915_CONTEXT(ctx);
GLenum mode;
GLboolean enabled;
GLboolean try_pixel_fog;
- if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
+ if (ctx->FragmentProgram._Active) {
/* Pull in static fog state from program */
- mode = ctx->FragmentProgram.Current->FogOption;
+ mode = ctx->FragmentProgram._Current->FogOption;
enabled = (mode != GL_NONE);
try_pixel_fog = 1;
}
case GL_FOG_MODE:
case GL_FOG_START:
case GL_FOG_END:
- update_fog( ctx );
break;
case GL_FOG_DENSITY:
{
switch (target) {
case GL_FOG_HINT:
- update_fog( ctx );
break;
default:
break;
break;
case GL_FRAGMENT_PROGRAM_ARB:
- update_fog( ctx );
break;
case GL_DITHER:
break;
case GL_FOG:
- update_fog( ctx );
break;
case GL_CULL_FACE:
GLcontext *ctx = &intel->ctx;
i915ContextPtr i915 = I915_CONTEXT(intel);
- if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current)
+ if (ctx->FragmentProgram._Active)
i915ValidateFragmentProgram( i915 );
else
i915ValidateTextureProgram( i915 );
TNLcontext *tnl = TNL_CONTEXT(ctx);
intelContextPtr intel = INTEL_CONTEXT(ctx);
GLuint flags = ctx->_TriangleCaps;
- struct fragment_program *program = ctx->FragmentProgram.Current;
+ struct fragment_program *program = ctx->FragmentProgram._Current;
GLboolean have_wpos = (program && (program->InputsRead & FRAG_BIT_WPOS));
GLuint index = 0;