diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_fragprog.c | 16 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 20 |
2 files changed, 17 insertions, 19 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index e47dbbdaf35..f5ffe41fc19 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -26,6 +26,7 @@ #include "colormac.h" #include "context.h" #include "prog_instruction.h" +#include "texstate.h" #include "s_fragprog.h" #include "s_span.h" @@ -199,6 +200,7 @@ void _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) { const struct gl_fragment_program *program = ctx->FragmentProgram._Current; + GLuint i; /* incoming colors should be floats */ if (program->Base.InputsRead & FRAG_BIT_COL0) { @@ -207,8 +209,22 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */ + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._Current != NULL) { + _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, + GL_TRUE); + } + } + run_program(ctx, span, 0, span->end); + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._Current != NULL) { + _mesa_update_texture_compare_function(ctx->Texture.Unit[i]._Current, + GL_FALSE); + } + } + if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) { span->interpMask &= ~SPAN_RGBA; span->arrayMask |= SPAN_RGBA; diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 2c8e443daf9..d4516f6faa8 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -2893,25 +2893,7 @@ sample_depth_texture( GLcontext *ctx, /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */ - /* XXX this could be precomputed and saved in the texture object */ - if (tObj->CompareFlag) { - /* GL_SGIX_shadow */ - if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - function = GL_LEQUAL; - } - else { - ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX); - function = GL_GEQUAL; - } - } - else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { - /* GL_ARB_shadow */ - function = tObj->CompareFunc; - } - else { - function = GL_NONE; /* pass depth through as grayscale */ - } - + function = tObj->_Function; if (tObj->MagFilter == GL_NEAREST) { GLuint i; for (i = 0; i < n; i++) { |