Lines Matching refs:swrast
38 #include "swrast.h"
50 * Recompute the value of swrast->_RasterMask, etc. according to
58 SWcontext *swrast = SWRAST_CONTEXT(ctx);
65 if (swrast->_FogEnabled) rasterMask |= FOG_BIT;
167 SWcontext *swrast = SWRAST_CONTEXT(ctx);
168 swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
171 swrast->AllowPixelFog));
177 * Update the swrast->_TextureCombinePrimary flag.
182 SWcontext *swrast = SWRAST_CONTEXT(ctx);
185 swrast->_TextureCombinePrimary = GL_FALSE;
193 swrast->_TextureCombinePrimary = GL_TRUE;
197 swrast->_TextureCombinePrimary = GL_TRUE;
213 SWcontext *swrast = SWRAST_CONTEXT(ctx);
216 swrast->_DeferredTexture = GL_FALSE;
224 swrast->_DeferredTexture = GL_FALSE;
227 swrast->_DeferredTexture = GL_FALSE;
231 swrast->_DeferredTexture = GL_FALSE;
234 swrast->_DeferredTexture = GL_TRUE;
241 * Update swrast->_FogColor and swrast->_FogEnable values.
246 SWcontext *swrast = SWRAST_CONTEXT(ctx);
253 swrast->_FogEnabled = (!_swrast_use_fragment_program(ctx) &&
280 SWcontext *swrast = SWRAST_CONTEXT(ctx);
285 swrast->SpecularVertexAdd = (separateSpecular
338 * Stub for swrast->Triangle to select a true triangle function
347 SWcontext *swrast = SWRAST_CONTEXT(ctx);
350 swrast->choose_triangle( ctx );
351 assert(swrast->Triangle);
353 if (swrast->SpecularVertexAdd) {
355 swrast->SpecTriangle = swrast->Triangle;
356 swrast->Triangle = _swrast_add_spec_terms_triangle;
359 swrast->Triangle( ctx, v0, v1, v2 );
363 * Called via swrast->Line. Examine current GL state and choose a software
369 SWcontext *swrast = SWRAST_CONTEXT(ctx);
372 swrast->choose_line( ctx );
373 assert(swrast->Line);
375 if (swrast->SpecularVertexAdd) {
376 swrast->SpecLine = swrast->Line;
377 swrast->Line = _swrast_add_spec_terms_line;
380 swrast->Line( ctx, v0, v1 );
384 * Called via swrast->Point. Examine current GL state and choose a software
390 SWcontext *swrast = SWRAST_CONTEXT(ctx);
393 swrast->choose_point( ctx );
395 if (swrast->SpecularVertexAdd) {
396 swrast->SpecPoint = swrast->Point;
397 swrast->Point = _swrast_add_spec_terms_point;
400 swrast->Point( ctx, v0 );
405 * Called via swrast->BlendFunc. Examine GL state to choose a blending
413 SWcontext *swrast = SWRAST_CONTEXT(ctx);
418 swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
431 SWcontext *swrast = SWRAST_CONTEXT(ctx);
434 swrast->NewState |= new_state;
436 /* After 10 statechanges without any swrast functions being called,
439 if (++swrast->StateChanges > 10) {
440 swrast->InvalidateState = _swrast_sleep;
441 swrast->NewState = ~0;
445 if (new_state & swrast->InvalidateTriangleMask)
446 swrast->Triangle = _swrast_validate_triangle;
448 if (new_state & swrast->InvalidateLineMask)
449 swrast->Line = _swrast_validate_line;
451 if (new_state & swrast->InvalidatePointMask)
452 swrast->Point = _swrast_validate_point;
455 swrast->BlendFunc = _swrast_validate_blend_func;
458 for (i = 0 ; i < ARRAY_SIZE(swrast->TextureSample); i++)
459 swrast->TextureSample[i] = NULL;
466 SWcontext *swrast = SWRAST_CONTEXT(ctx);
469 if (!swrast)
472 for (u = 0; u < ARRAY_SIZE(swrast->TextureSample); u++) {
478 swrast->TextureSample[u] =
486 * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs,
487 * swrast->_ActiveAtttribMask.
492 SWcontext *swrast = SWRAST_CONTEXT(ctx);
521 if (swrast->_FogEnabled)
527 swrast->_ActiveAttribMask = attribsMask;
534 swrast->_ActiveAttribs[num++] = i;
537 swrast->_InterpMode[i] = ctx->Light.ShadeModel;
539 swrast->_InterpMode[i] = GL_SMOOTH;
542 swrast->_NumActiveAttribs = num;
550 SWcontext *swrast = SWRAST_CONTEXT(ctx);
552 if (swrast->NewState) {
553 if (swrast->NewState & _NEW_POLYGON)
556 if (swrast->NewState & (_NEW_HINT | _NEW_PROGRAM))
559 if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE)
562 if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
565 if (swrast->NewState & (_NEW_PROGRAM_CONSTANTS | _NEW_PROGRAM))
566 _swrast_update_fragment_program( ctx, swrast->NewState );
568 if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) {
572 if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM))
575 if (swrast->NewState & _SWRAST_NEW_RASTERMASK)
578 if (swrast->NewState & (_NEW_DEPTH |
585 if (swrast->NewState & (_NEW_FOG |
591 swrast->NewState = 0;
592 swrast->StateChanges = 0;
593 swrast->InvalidateState = _swrast_invalidate_state;
718 SWcontext *swrast = calloc(1, sizeof(SWcontext));
741 if (!swrast)
744 swrast->NewState = ~0;
746 swrast->choose_point = _swrast_choose_point;
747 swrast->choose_line = _swrast_choose_line;
748 swrast->choose_triangle = _swrast_choose_triangle;
750 swrast->InvalidatePointMask = _SWRAST_NEW_POINT;
751 swrast->InvalidateLineMask = _SWRAST_NEW_LINE;
752 swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE;
754 swrast->Point = _swrast_validate_point;
755 swrast->Line = _swrast_validate_line;
756 swrast->Triangle = _swrast_validate_triangle;
757 swrast->InvalidateState = _swrast_sleep;
758 swrast->BlendFunc = _swrast_validate_blend_func;
760 swrast->AllowVertexFog = GL_TRUE;
761 swrast->AllowPixelFog = GL_TRUE;
763 swrast->Driver.SpanRenderStart = _swrast_span_render_start;
764 swrast->Driver.SpanRenderFinish = _swrast_span_render_finish;
766 for (i = 0; i < ARRAY_SIZE(swrast->TextureSample); i++)
767 swrast->TextureSample[i] = NULL;
773 swrast->SpanArrays = malloc(maxThreads * sizeof(SWspanarrays));
774 if (!swrast->SpanArrays) {
775 free(swrast);
779 swrast->SpanArrays[i].ChanType = CHAN_TYPE;
781 swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba8;
783 swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba16;
785 swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].attribs[VARYING_SLOT_COL0];
790 swrast->PointSpan.primitive = GL_POINT;
791 swrast->PointSpan.end = 0;
792 swrast->PointSpan.facing = 0;
793 swrast->PointSpan.array = swrast->SpanArrays;
799 ctx->swrast_context = swrast;
801 swrast->stencil_temp.buf1 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
802 swrast->stencil_temp.buf2 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
803 swrast->stencil_temp.buf3 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
804 swrast->stencil_temp.buf4 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
806 if (!swrast->stencil_temp.buf1 ||
807 !swrast->stencil_temp.buf2 ||
808 !swrast->stencil_temp.buf3 ||
809 !swrast->stencil_temp.buf4) {
820 SWcontext *swrast = SWRAST_CONTEXT(ctx);
826 free( swrast->SpanArrays );
827 free( swrast->ZoomedArrays );
828 free( swrast->TexelBuffer );
830 free(swrast->stencil_temp.buf1);
831 free(swrast->stencil_temp.buf2);
832 free(swrast->stencil_temp.buf3);
833 free(swrast->stencil_temp.buf4);
835 free( swrast );
844 SWcontext *swrast = SWRAST_CONTEXT(ctx);
845 return &swrast->Driver;
851 SWcontext *swrast = SWRAST_CONTEXT(ctx);
853 if (swrast->PointSpan.end > 0) {
854 _swrast_write_rgba_span(ctx, &(swrast->PointSpan));
855 swrast->PointSpan.end = 0;
862 SWcontext *swrast = SWRAST_CONTEXT(ctx);
863 if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) {
866 swrast->Primitive = prim;
870 /** called via swrast->Driver.SpanRenderStart() */
879 /** called via swrast->Driver.SpanRenderFinish() */
891 SWcontext *swrast = SWRAST_CONTEXT(ctx);
892 if (swrast->Driver.SpanRenderStart)
893 swrast->Driver.SpanRenderStart( ctx );
894 swrast->PointSpan.end = 0;
900 SWcontext *swrast = SWRAST_CONTEXT(ctx);
905 if (swrast->Driver.SpanRenderFinish)
906 swrast->Driver.SpanRenderFinish( ctx );