void _swsetup_Wakeup( struct gl_context *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); SScontext *swsetup = SWSETUP_CONTEXT(ctx); tnl->Driver.Render.Start = _swsetup_RenderStart; tnl->Driver.Render.Finish = _swsetup_RenderFinish; tnl->Driver.Render.PrimitiveNotify = _swsetup_RenderPrimitive; tnl->Driver.Render.Interp = _tnl_interp; tnl->Driver.Render.CopyPV = _tnl_copy_pv; tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; /* new */ tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; /* new */ /* points */ /* line */ /* triangle */ /* quad */ tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; tnl->Driver.Render.BuildVertices = _tnl_build_vertices; tnl->Driver.Render.Multipass = 0; _tnl_invalidate_vertices( ctx, ~0 ); _tnl_need_projected_coords( ctx, GL_TRUE ); _swsetup_InvalidateState( ctx, ~0 ); swsetup->verts = (SWvertex *)tnl->clipspace.vertex_buf; swsetup->last_index_bitset = 0; }
void r300InitSwtcl(GLcontext *ctx) { TNLcontext *tnl = TNL_CONTEXT(ctx); r300ContextPtr rmesa = R300_CONTEXT(ctx); static int firsttime = 1; radeon_print(RADEON_SWRENDER, RADEON_NORMAL, "%s\n", __func__); if (firsttime) { init_rast_tab(); firsttime = 0; } rmesa->radeon.swtcl.emit_prediction = 0; tnl->Driver.Render.Start = r300RenderStart; tnl->Driver.Render.Finish = r300RenderFinish; tnl->Driver.Render.PrimitiveNotify = r300RenderPrimitive; tnl->Driver.Render.ResetLineStipple = r300ResetLineStipple; tnl->Driver.Render.BuildVertices = _tnl_build_vertices; tnl->Driver.Render.CopyPV = _tnl_copy_pv; tnl->Driver.Render.Interp = _tnl_interp; /* FIXME: what are these numbers? */ _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, 48 * sizeof(GLfloat) ); rmesa->radeon.swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf; rmesa->radeon.swtcl.RenderIndex = ~0; rmesa->radeon.swtcl.render_primitive = GL_TRIANGLES; rmesa->radeon.swtcl.hw_primitive = 0; _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); _tnl_need_projected_coords( ctx, GL_FALSE ); }
void radeonFallback( struct gl_context *ctx, GLuint bit, GLboolean mode ) { r100ContextPtr rmesa = R100_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint oldfallback = rmesa->radeon.Fallback; if (mode) { rmesa->radeon.Fallback |= bit; if (oldfallback == 0) { radeon_firevertices(&rmesa->radeon); TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE ); _swsetup_Wakeup( ctx ); rmesa->radeon.swtcl.RenderIndex = ~0; if (RADEON_DEBUG & RADEON_FALLBACKS) { fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n", bit, getFallbackString(bit)); } } } else { rmesa->radeon.Fallback &= ~bit; if (oldfallback == bit) { _swrast_flush( ctx ); tnl->Driver.Render.Start = radeonRenderStart; tnl->Driver.Render.PrimitiveNotify = radeonRenderPrimitive; tnl->Driver.Render.Finish = radeonRenderFinish; tnl->Driver.Render.BuildVertices = _tnl_build_vertices; tnl->Driver.Render.CopyPV = _tnl_copy_pv; tnl->Driver.Render.Interp = _tnl_interp; tnl->Driver.Render.ResetLineStipple = radeonResetLineStipple; TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_FALSE ); if (rmesa->radeon.TclFallback) { /* These are already done if rmesa->radeon.TclFallback goes to * zero above. But not if it doesn't (RADEON_NO_TCL for * example?) */ _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); rmesa->radeon.tnl_index_bitset = 0; radeonChooseVertexState( ctx ); radeonChooseRenderState( ctx ); } if (RADEON_DEBUG & RADEON_FALLBACKS) { fprintf(stderr, "Radeon end rasterization fallback: 0x%x %s\n", bit, getFallbackString(bit)); } } } }
void intelFallback( intelContextPtr intel, GLuint bit, GLboolean mode ) { GLcontext *ctx = &intel->ctx; TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint oldfallback = intel->Fallback; if (mode) { intel->Fallback |= bit; if (oldfallback == 0) { intelFlush(ctx); if (INTEL_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "ENTER FALLBACK 0x%x: %s\n", bit, getFallbackString(bit)); _swsetup_Wakeup( ctx ); intel->RenderIndex = ~0; } } else { intel->Fallback &= ~bit; if (oldfallback == bit) { _swrast_flush( ctx ); if (INTEL_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "LEAVE FALLBACK 0x%x: %s\n", bit, getFallbackString(bit)); tnl->Driver.Render.Start = intelRenderStart; tnl->Driver.Render.PrimitiveNotify = intelRenderPrimitive; tnl->Driver.Render.Finish = intelRenderFinish; tnl->Driver.Render.BuildVertices = _tnl_build_vertices; tnl->Driver.Render.CopyPV = _tnl_copy_pv; tnl->Driver.Render.Interp = _tnl_interp; _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); _tnl_install_attrs( ctx, intel->vertex_attrs, intel->vertex_attr_count, intel->ViewportMatrix.m, 0 ); intel->NewGLState |= _INTEL_NEW_RENDERSTATE; } } }
void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode) { GLcontext *ctx = nmesa->glCtx; GLuint oldfallback = nmesa->Fallback; if (mode) { nmesa->Fallback |= bit; if (oldfallback == 0) { if (nmesa->screen->card->type<NV_10) { //nv04FinishPrimitive(nmesa); } else { //nv10FinishPrimitive(nmesa); } _swsetup_Wakeup(ctx); nmesa->render_index = ~0; } } else { nmesa->Fallback &= ~bit; if (oldfallback == bit) { _swrast_flush( ctx ); if (nmesa->screen->card->type<NV_10) { nv04TriInitFunctions(ctx); } else { nv10TriInitFunctions(ctx); } _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); _tnl_install_attrs( ctx, nmesa->vertex_attrs, nmesa->vertex_attr_count, nmesa->viewport.m, 0 ); } } }