OSDN Git Service

swrast: update program type assertion
authorBrian Paul <brianp@vmware.com>
Fri, 4 Nov 2011 01:56:51 +0000 (19:56 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 7 Nov 2011 21:25:47 +0000 (14:25 -0700)
Fixes bogus failed assertion when using NV_fragment_program, such
as with demos/fplight.c

Note: This is a candidate for the 7.11 branch.

src/mesa/swrast/s_context.c

index 9112cf3..98702f0 100644 (file)
@@ -249,7 +249,9 @@ _swrast_update_fog_state( struct gl_context *ctx )
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
 
-   assert((fp == NULL) || (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB));
+   assert((fp == NULL) ||
+          (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB) ||
+          (fp->Base.Target == GL_FRAGMENT_PROGRAM_NV));
 
    /* determine if fog is needed, and if so, which fog mode */
    swrast->_FogEnabled = (fp == NULL && ctx->Fog.Enabled);