Fix ARB_fp spec conformance bug WRT shadow sampling.

The ARB_fp (and other assembly-level fragment program specs) say that the
depth comparison function is always GL_NONE in fragment program mode.
This commit is contained in:
Ian Romanick
2007-06-07 13:38:06 -07:00
parent 359c6eada7
commit 84d1b24647
5 changed files with 60 additions and 19 deletions

View File

@@ -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;