/** * Called via ctx->Driver.UpdateState() */ void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state) { struct st_context *st = st_context(ctx); /* Replace _NEW_FRAG_CLAMP with ST_NEW_FRAGMENT_PROGRAM for the fallback. */ if (st->clamp_frag_color_in_shader && (new_state & _NEW_FRAG_CLAMP)) { new_state &= ~_NEW_FRAG_CLAMP; st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM; } /* Update the vertex shader if ctx->Light._ClampVertexColor was changed. */ if (st->clamp_vert_color_in_shader && (new_state & _NEW_LIGHT)) { st->dirty.st |= ST_NEW_VERTEX_PROGRAM; } /* Invalidate render and compute pipelines. */ st->dirty.mesa |= new_state; st->dirty.st |= ST_NEW_MESA; st->dirty_cp.mesa |= new_state; st->dirty_cp.st |= ST_NEW_MESA; /* This is the only core Mesa module we depend upon. * No longer use swrast, swsetup, tnl. */ _vbo_InvalidateState(ctx, new_state); }
/* Override intel default. */ static void i915InvalidateState(struct gl_context * ctx, GLuint new_state) { _swrast_InvalidateState(ctx, new_state); _swsetup_InvalidateState(ctx, new_state); _vbo_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); _tnl_invalidate_vertex_state(ctx, new_state); intel_context(ctx)->NewGLState |= new_state; /* Todo: gather state values under which tracked parameters become * invalidated, add callbacks for things like * ProgramLocalParameters, etc. */ { struct i915_fragment_program *p = (struct i915_fragment_program *) ctx->FragmentProgram._Current; if (p && p->nr_params) p->params_uptodate = 0; } if (new_state & (_NEW_STENCIL | _NEW_BUFFERS | _NEW_POLYGON)) i915_update_stencil(ctx); if (new_state & (_NEW_LIGHT)) i915_update_provoking_vertex(ctx); if (new_state & (_NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS)) i915_update_program(ctx); if (new_state & (_NEW_PROGRAM | _NEW_POINT)) i915_update_sprite_point_enable(ctx); }
static void tdfxDDInvalidateState( GLcontext *ctx, GLuint new_state ) { _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); TDFX_CONTEXT(ctx)->new_gl_state |= new_state; }
static void i810InvalidateState( struct gl_context *ctx, GLuint new_state ) { _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); I810_CONTEXT(ctx)->new_state |= new_state; }
static void gammaDDUpdateState( GLcontext *ctx, GLuint new_state ) { _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); GAMMA_CONTEXT(ctx)->new_gl_state |= new_state; }
static void UpdateState(GLcontext *ctx, GLuint new_state) { /* easy - just propogate */ _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); }
static void update_state( struct gl_context *ctx, GLuint new_state ) { /* not much to do here - pass it on */ _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); }
static void osmesa_update_state( struct gl_context *ctx, GLuint new_state ) { /* easy - just propogate */ _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); }
static void intelInvalidateState(struct gl_context * ctx, GLuint new_state) { struct brw_context *brw = brw_context(ctx); if (ctx->swrast_context) _swrast_InvalidateState(ctx, new_state); _vbo_InvalidateState(ctx, new_state); brw->NewGLState |= new_state; }
static void sis6326DDInvalidateState( GLcontext *ctx, GLuint new_state ) { sisContextPtr smesa = SIS_CONTEXT(ctx); _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); smesa->NewGLState |= new_state; }
void MesaSoftwareRenderer::_UpdateState(gl_context* ctx, GLuint new_state) { if (!ctx) return; CALLED(); _swrast_InvalidateState(ctx, new_state); _swsetup_InvalidateState(ctx, new_state); _vbo_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); }
/** * Called via ctx->Driver.UpdateState() */ void st_invalidate_state(GLcontext * ctx, GLuint new_state) { struct st_context *st = st_context(ctx); st->dirty.mesa |= new_state; st->dirty.st |= ST_NEW_MESA; /* This is the only core Mesa module we depend upon. * No longer use swrast, swsetup, tnl. */ _vbo_InvalidateState(ctx, new_state); }
static void intelInvalidateState(struct gl_context * ctx, GLuint new_state) { struct intel_context *intel = intel_context(ctx); if (ctx->swrast_context) _swrast_InvalidateState(ctx, new_state); _vbo_InvalidateState(ctx, new_state); intel->NewGLState |= new_state; if (intel->vtbl.invalidate_state) intel->vtbl.invalidate_state( intel, new_state ); }
static void intelInvalidateState(GLcontext * ctx, GLuint new_state) { struct intel_context *intel = intel_context(ctx); _swrast_InvalidateState(ctx, new_state); _swsetup_InvalidateState(ctx, new_state); _vbo_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); _tnl_invalidate_vertex_state(ctx, new_state); intel->NewGLState |= new_state; if (intel->vtbl.invalidate_state) intel->vtbl.invalidate_state( intel, new_state ); }
void MesaDriver::UpdateState( GLcontext *ctx, GLuint new_state ) { struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx ); _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); if (ctx->Color.DrawBuffer[0] == GL_FRONT) { /* read/write front buffer */ swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanFront; swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanFront; swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsFront; swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanFront; swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsFront; swdd->WriteCI32Span = MesaDriver::WriteCI32SpanFront; swdd->WriteCI8Span = MesaDriver::WriteCI8SpanFront; swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanFront; swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsFront; swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsFront; swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanFront; swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsFront; swdd->ReadCI32Span = MesaDriver::ReadCI32SpanFront; swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsFront; } else { /* read/write back buffer */ swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanBack; swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanBack; swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsBack; swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanBack; swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsBack; swdd->WriteCI32Span = MesaDriver::WriteCI32SpanBack; swdd->WriteCI8Span = MesaDriver::WriteCI8SpanBack; swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanBack; swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsBack; swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsBack; swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanBack; swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsBack; swdd->ReadCI32Span = MesaDriver::ReadCI32SpanBack; swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsBack; } }
/* Override intel default. */ static void i915InvalidateState(GLcontext * ctx, GLuint new_state) { _swrast_InvalidateState(ctx, new_state); _swsetup_InvalidateState(ctx, new_state); _vbo_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); _tnl_invalidate_vertex_state(ctx, new_state); intel_context(ctx)->NewGLState |= new_state; /* Todo: gather state values under which tracked parameters become * invalidated, add callbacks for things like * ProgramLocalParameters, etc. */ { struct i915_fragment_program *p = (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); }
void gld_update_state_DX7( struct gl_context *ctx, GLuint new_state) { GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx); TNLcontext *tnl = TNL_CONTEXT(ctx); GLD_pb_dx7 *gldPB; if (!gld || !gld->pDev) return; _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); // SetupIndex will be used in the pipelines for choosing setup function if ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE | DD_SEPARATE_SPECULAR)) || (ctx->Fog.Enabled)) { if (ctx->_TriangleCaps & DD_FLATSHADE) gld->iSetupFunc = GLD_SI_FLAT_EXTRAS; else gld->iSetupFunc = GLD_SI_SMOOTH_EXTRAS; } else { if (ctx->_TriangleCaps & DD_FLATSHADE) gld->iSetupFunc = GLD_SI_FLAT; // Setup flat shade + texture else gld->iSetupFunc = GLD_SI_SMOOTH; // Setup smooth shade + texture } gld->bUseMesaTnL = _gldChooseInternalPipeline(ctx, gld); if (gld->bUseMesaTnL) { gldPB = &gld->PB2d; // DX7 Does not implement D3DRS_SOFTWAREVERTEXPROCESSING // _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, TRUE)); _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, FALSE)); // _GLD_DX7_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); } else { gldPB = &gld->PB3d; _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_CLIPPING, TRUE)); // if (gld->TnLPipeline == GLD_PIPELINE_D3D_VS_TWOSIDE) { // _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware)); // _GLD_DX7_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader)); // } else { // DX7 Does not implement D3DRS_SOFTWAREVERTEXPROCESSING // _GLD_DX7_DEV(SetRenderState(gld->pDev, D3DRENDERSTATE_SOFTWAREVERTEXPROCESSING, !gld->bHasHWTnL)); // _GLD_DX7_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF)); // } } #define _GLD_TEST_STATE(a) \ if (new_state & (a)) { \ gld##a(ctx); \ new_state &= ~(a); \ } #define _GLD_TEST_STATE_DX7(a) \ if (new_state & (a)) { \ gld##a##_DX7(ctx); \ new_state &= ~(a); \ } #define _GLD_IGNORE_STATE(a) new_state &= ~(a); // if (!gld->bUseMesaTnL) { // Not required if Mesa is doing the TnL. // Problem: If gld->bUseMesaTnL is TRUE when these are signaled, // then we'll miss updating the D3D TnL pipeline. // Therefore, don't test for gld->bUseMesaTnL _GLD_TEST_STATE(_NEW_MODELVIEW); _GLD_TEST_STATE(_NEW_PROJECTION); // } _GLD_TEST_STATE_DX7(_NEW_TEXTURE); // extern, so guard with _DX7 _GLD_TEST_STATE(_NEW_COLOR); _GLD_TEST_STATE(_NEW_DEPTH); _GLD_TEST_STATE(_NEW_POLYGON); _GLD_TEST_STATE(_NEW_STENCIL); _GLD_TEST_STATE(_NEW_FOG); _GLD_TEST_STATE(_NEW_LIGHT); _GLD_TEST_STATE(_NEW_VIEWPORT); _GLD_IGNORE_STATE(_NEW_TRANSFORM); // Stubs for future use. /* _GLD_TEST_STATE(_NEW_TEXTURE_MATRIX); _GLD_TEST_STATE(_NEW_COLOR_MATRIX); _GLD_TEST_STATE(_NEW_EVAL); _GLD_TEST_STATE(_NEW_HINT); _GLD_TEST_STATE(_NEW_LINE); _GLD_TEST_STATE(_NEW_PIXEL); _GLD_TEST_STATE(_NEW_POINT); _GLD_TEST_STATE(_NEW_POLYGONSTIPPLE); _GLD_TEST_STATE(_NEW_SCISSOR); _GLD_TEST_STATE(_NEW_PACKUNPACK); _GLD_TEST_STATE(_NEW_ARRAY); _GLD_TEST_STATE(_NEW_RENDERMODE); _GLD_TEST_STATE(_NEW_BUFFERS); _GLD_TEST_STATE(_NEW_MULTISAMPLE); */ // For debugging. #if 0 #define _GLD_TEST_UNHANDLED_STATE(a) \ if (new_state & (a)) { \ gldLogMessage(GLDLOG_ERROR, "Unhandled " #a "\n"); \ } _GLD_TEST_UNHANDLED_STATE(_NEW_TEXTURE_MATRIX); _GLD_TEST_UNHANDLED_STATE(_NEW_COLOR_MATRIX); _GLD_TEST_UNHANDLED_STATE(_NEW_EVAL); _GLD_TEST_UNHANDLED_STATE(_NEW_HINT); _GLD_TEST_UNHANDLED_STATE(_NEW_LINE); _GLD_TEST_UNHANDLED_STATE(_NEW_PIXEL); _GLD_TEST_UNHANDLED_STATE(_NEW_POINT); _GLD_TEST_UNHANDLED_STATE(_NEW_POLYGONSTIPPLE); _GLD_TEST_UNHANDLED_STATE(_NEW_SCISSOR); _GLD_TEST_UNHANDLED_STATE(_NEW_PACKUNPACK); _GLD_TEST_UNHANDLED_STATE(_NEW_ARRAY); _GLD_TEST_UNHANDLED_STATE(_NEW_RENDERMODE); _GLD_TEST_UNHANDLED_STATE(_NEW_BUFFERS); _GLD_TEST_UNHANDLED_STATE(_NEW_MULTISAMPLE); #undef _GLD_UNHANDLED_STATE #endif #undef _GLD_TEST_STATE }