Home | History | Annotate | Download | only in swrast

Lines Matching defs:swrast

37 #include "swrast.h"
49 * Recompute the value of swrast->_RasterMask, etc. according to
57 SWcontext *swrast = SWRAST_CONTEXT(ctx);
64 if (swrast->_FogEnabled) rasterMask |= FOG_BIT;
172 SWcontext *swrast = SWRAST_CONTEXT(ctx);
173 swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
176 swrast->AllowPixelFog));
182 * Update the swrast->_TextureCombinePrimary flag.
187 SWcontext *swrast = SWRAST_CONTEXT(ctx);
190 swrast->_TextureCombinePrimary = GL_FALSE;
198 swrast->_TextureCombinePrimary = GL_TRUE;
202 swrast->_TextureCombinePrimary = GL_TRUE;
218 SWcontext *swrast = SWRAST_CONTEXT(ctx);
221 swrast->_DeferredTexture = GL_FALSE;
229 swrast->_DeferredTexture = GL_FALSE;
232 swrast->_DeferredTexture = GL_FALSE;
236 swrast->_DeferredTexture = GL_FALSE;
239 swrast->_DeferredTexture = GL_TRUE;
246 * Update swrast->_FogColor and swrast->_FogEnable values.
251 SWcontext *swrast = SWRAST_CONTEXT(ctx);
259 swrast->_FogEnabled = (!_swrast_use_fragment_program(ctx) &&
286 SWcontext *swrast = SWRAST_CONTEXT(ctx);
291 swrast->SpecularVertexAdd = (separateSpecular
344 * Stub for swrast->Triangle to select a true triangle function
353 SWcontext *swrast = SWRAST_CONTEXT(ctx);
356 swrast->choose_triangle( ctx );
357 ASSERT(swrast->Triangle);
359 if (swrast->SpecularVertexAdd) {
361 swrast->SpecTriangle = swrast->Triangle;
362 swrast->Triangle = _swrast_add_spec_terms_triangle;
365 swrast->Triangle( ctx, v0, v1, v2 );
369 * Called via swrast->Line. Examine current GL state and choose a software
375 SWcontext *swrast = SWRAST_CONTEXT(ctx);
378 swrast->choose_line( ctx );
379 ASSERT(swrast->Line);
381 if (swrast->SpecularVertexAdd) {
382 swrast->SpecLine = swrast->Line;
383 swrast->Line = _swrast_add_spec_terms_line;
386 swrast->Line( ctx, v0, v1 );
390 * Called via swrast->Point. Examine current GL state and choose a software
396 SWcontext *swrast = SWRAST_CONTEXT(ctx);
399 swrast->choose_point( ctx );
401 if (swrast->SpecularVertexAdd) {
402 swrast->SpecPoint = swrast->Point;
403 swrast->Point = _swrast_add_spec_terms_point;
406 swrast->Point( ctx, v0 );
411 * Called via swrast->BlendFunc. Examine GL state to choose a blending
419 SWcontext *swrast = SWRAST_CONTEXT(ctx);
424 swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
437 SWcontext *swrast = SWRAST_CONTEXT(ctx);
440 swrast->NewState |= new_state;
442 /* After 10 statechanges without any swrast functions being called,
445 if (++swrast->StateChanges > 10) {
446 swrast->InvalidateState = _swrast_sleep;
447 swrast->NewState = ~0;
451 if (new_state & swrast->InvalidateTriangleMask)
452 swrast->Triangle = _swrast_validate_triangle;
454 if (new_state & swrast->InvalidateLineMask)
455 swrast->Line = _swrast_validate_line;
457 if (new_state & swrast->InvalidatePointMask)
458 swrast->Point = _swrast_validate_point;
461 swrast->BlendFunc = _swrast_validate_blend_func;
465 swrast->TextureSample[i] = NULL;
472 SWcontext *swrast = SWRAST_CONTEXT(ctx);
475 if (!swrast)
484 swrast->TextureSample[u] =
492 * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs,
493 * swrast->_ActiveAtttribMask.
498 SWcontext *swrast = SWRAST_CONTEXT(ctx);
526 if (swrast->_FogEnabled)
532 swrast->_ActiveAttribMask = attribsMask;
539 swrast->_ActiveAttribs[num++] = i;
542 swrast->_InterpMode[i] = ctx->Light.ShadeModel;
544 swrast->_InterpMode[i] = GL_SMOOTH;
547 swrast->_NumActiveAttribs = num;
555 SWcontext *swrast = SWRAST_CONTEXT(ctx);
557 if (swrast
558 if (swrast->NewState & _NEW_POLYGON)
561 if (swrast->NewState & (_NEW_HINT | _NEW_PROGRAM))
564 if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE)
567 if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
570 if (swrast->NewState & (_NEW_PROGRAM_CONSTANTS | _NEW_PROGRAM))
571 _swrast_update_fragment_program( ctx, swrast->NewState );
573 if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) {
577 if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM))
580 if (swrast->NewState & _SWRAST_NEW_RASTERMASK)
583 if (swrast->NewState & (_NEW_DEPTH |
590 if (swrast->NewState & (_NEW_FOG |
596 swrast->NewState = 0;
597 swrast->StateChanges = 0;
598 swrast->InvalidateState = _swrast_invalidate_state;
723 SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
746 if (!swrast)
749 swrast->NewState = ~0;
751 swrast->choose_point = _swrast_choose_point;
752 swrast->choose_line = _swrast_choose_line;
753 swrast->choose_triangle = _swrast_choose_triangle;
755 swrast->InvalidatePointMask = _SWRAST_NEW_POINT;
756 swrast->InvalidateLineMask = _SWRAST_NEW_LINE;
757 swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE;
759 swrast->Point = _swrast_validate_point;
760 swrast->Line = _swrast_validate_line;
761 swrast->Triangle = _swrast_validate_triangle;
762 swrast->InvalidateState = _swrast_sleep;
763 swrast->BlendFunc = _swrast_validate_blend_func;
765 swrast->AllowVertexFog = GL_TRUE;
766 swrast->AllowPixelFog = GL_TRUE;
768 swrast->Driver.SpanRenderStart = _swrast_span_render_start;
769 swrast->Driver.SpanRenderFinish = _swrast_span_render_finish;
772 swrast->TextureSample[i] = NULL;
778 swrast->SpanArrays = (SWspanarrays *) MALLOC(maxThreads * sizeof(SWspanarrays));
779 if (!swrast->SpanArrays) {
780 FREE(swrast);
784 swrast->SpanArrays[i].ChanType = CHAN_TYPE;
786 swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba8;
788 swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba16;
790 swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].attribs[FRAG_ATTRIB_COL0];
795 swrast->PointSpan.primitive = GL_POINT;
796 swrast->PointSpan.end = 0;
797 swrast->PointSpan.facing = 0;
798 swrast->PointSpan.array = swrast->SpanArrays;
804 ctx->swrast_context = swrast;
806 swrast->stencil_temp.buf1 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
807 swrast->stencil_temp.buf2 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
808 swrast->stencil_temp.buf3 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
809 swrast->stencil_temp.buf4 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
811 if (!swrast->stencil_temp.buf1 ||
812 !swrast->stencil_temp.buf2 ||
813 !swrast->stencil_temp.buf3 ||
814 !swrast->stencil_temp.buf4) {
825 SWcontext *swrast = SWRAST_CONTEXT(ctx);
831 FREE( swrast->SpanArrays );
832 if (swrast->ZoomedArrays)
833 FREE( swrast->ZoomedArrays );
834 FREE( swrast->TexelBuffer );
836 free(swrast->stencil_temp.buf1);
837 free(swrast->stencil_temp.buf2);
838 free(swrast->stencil_temp.buf3);
839 free(swrast->stencil_temp.buf4);
841 FREE( swrast );
850 SWcontext *swrast = SWRAST_CONTEXT(ctx);
851 return &swrast->Driver;
857 SWcontext *swrast = SWRAST_CONTEXT(ctx);
859 if (swrast->PointSpan.end > 0) {
860 _swrast_write_rgba_span(ctx, &(swrast->PointSpan));
861 swrast->PointSpan.end = 0;
868 SWcontext *swrast = SWRAST_CONTEXT(ctx);
869 if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) {
872 swrast->Primitive = prim;
876 /** called via swrast->Driver.SpanRenderStart() */
885 /** called via swrast->Driver.SpanRenderFinish() */
897 SWcontext *swrast = SWRAST_CONTEXT(ctx);
898 if (swrast->Driver.SpanRenderStart)
899 swrast->Driver.SpanRenderStart( ctx );
900 swrast->PointSpan.end = 0;
906 SWcontext *swrast = SWRAST_CONTEXT(ctx);
910 if (swrast->Driver.SpanRenderFinish)
911 swrast->Driver.SpanRenderFinish( ctx );