summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-09-25 23:57:39 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-09-25 23:57:39 +0000
commita50b7dbc3ba1db8c92b4bbb4f7f06de8d6c039c4 (patch)
treeb1e19031a7563c7da67386584a7e42a4603c4ba1 /src/mesa/swrast/s_context.c
parentdf8632ebd87219c809810d993f56fef1e6853a25 (diff)
Initial work for supporting different renderbuffer color depths at runtime.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 030313aea6..bb096be75a 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -199,11 +199,6 @@ _swrast_update_fog_state( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- /* convert fog color to GLchan values */
- CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[RCOMP], ctx->Fog.Color[RCOMP]);
- CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[GCOMP], ctx->Fog.Color[GCOMP]);
- CLAMPED_FLOAT_TO_CHAN(swrast->_FogColor[BCOMP], ctx->Fog.Color[BCOMP]);
-
/* determine if fog is needed, and if so, which fog mode */
swrast->_FogEnabled = GL_FALSE;
if (ctx->FragmentProgram._Enabled) {
@@ -359,17 +354,16 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
* function, then call it.
*/
static void _ASMAPI
-_swrast_validate_blend_func( GLcontext *ctx, GLuint n,
- const GLubyte mask[],
- GLchan src[][4],
- CONST GLchan dst[][4] )
+_swrast_validate_blend_func(GLcontext *ctx, GLuint n, const GLubyte mask[],
+ GLchan src[][4], CONST GLchan dst[][4],
+ GLenum chanType )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
_swrast_validate_derived( ctx );
_swrast_choose_blend_func( ctx );
- swrast->BlendFunc( ctx, n, mask, src, dst );
+ swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
}
@@ -680,6 +674,17 @@ _swrast_CreateContext( GLcontext *ctx )
FREE(swrast);
return GL_FALSE;
}
+ swrast->SpanArrays->ChanType = CHAN_TYPE;
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz1.rgba;
+ swrast->SpanArrays->spec = swrast->SpanArrays->color.sz1.spec;
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz2.rgba;
+ swrast->SpanArrays->spec = swrast->SpanArrays->color.sz2.spec;
+#else
+ swrast->SpanArrays->rgba = swrast->SpanArrays->color.sz4.rgba;
+ swrast->SpanArrays->spec = swrast->SpanArrays->color.sz4.spec;
+#endif
/* init point span buffer */
swrast->PointSpan.primitive = GL_POINT;