Fix pow <small> and a very stypid bug with dummy srcs(0 equals to tmp0.x)</small...
[mesa.git] / src / mesa / main / state.c
index 244cb485c6c4f21f06c0fe9f94f6ce2f26957c82..9c59ac301f3083a98f39af98086f7f4eafb851e5 100644 (file)
@@ -87,7 +87,6 @@
 #include "nvprogram.h"
 #endif
 #if FEATURE_NV_fragment_program
-#include "nvfragprog.h"
 #include "nvprogram.h"
 #include "program.h"
 #include "texenvprogram.h"
@@ -420,21 +419,6 @@ _mesa_init_exec_table(struct _glapi_table *exec)
    SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv);
 #endif
 
-   /* ?. GL_SGIX_pixel_texture */
-#if _HAVE_FULL_GL
-   SET_PixelTexGenSGIX(exec, _mesa_PixelTexGenSGIX);
-#endif
-
-   /* 15. GL_SGIS_pixel_texture */
-#if _HAVE_FULL_GL
-   SET_PixelTexGenParameteriSGIS(exec, _mesa_PixelTexGenParameteriSGIS);
-   SET_PixelTexGenParameterivSGIS(exec, _mesa_PixelTexGenParameterivSGIS);
-   SET_PixelTexGenParameterfSGIS(exec, _mesa_PixelTexGenParameterfSGIS);
-   SET_PixelTexGenParameterfvSGIS(exec, _mesa_PixelTexGenParameterfvSGIS);
-   SET_GetPixelTexGenParameterivSGIS(exec, _mesa_GetPixelTexGenParameterivSGIS);
-   SET_GetPixelTexGenParameterfvSGIS(exec, _mesa_GetPixelTexGenParameterfvSGIS);
-#endif
-
    /* 30. GL_EXT_vertex_array */
 #if _HAVE_FULL_GL
    SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT);
@@ -798,6 +782,10 @@ _mesa_init_exec_table(struct _glapi_table *exec)
    SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT);
    SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
 #endif
+
+   /* GL_EXT_timer_query */
+   SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT);
+   SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT);
 }
 
 
@@ -931,9 +919,9 @@ update_program(GLcontext *ctx)
     * have a runable program or shader.
     */
    ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled
-      && ctx->VertexProgram.Current->Instructions;
+      && ctx->VertexProgram.Current->Base.Instructions;
    ctx->FragmentProgram._Enabled = ctx->FragmentProgram.Enabled
-      && ctx->FragmentProgram.Current->Instructions;
+      && ctx->FragmentProgram.Current->Base.Instructions;
    ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled
       && ctx->ATIFragmentShader.Current->Instructions;
       
@@ -946,7 +934,9 @@ update_program(GLcontext *ctx)
            ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
 
       ctx->FragmentProgram._Current = ctx->_TexEnvProgram;
-      ctx->FragmentProgram._Active = GL_TRUE;
+
+      if (ctx->_UseTexEnvProgram)
+        ctx->FragmentProgram._Active = GL_TRUE;
    }
 }
 
@@ -967,7 +957,7 @@ update_program(GLcontext *ctx)
 void
 _mesa_update_state( GLcontext *ctx )
 {
-   GLuint new_state = ctx->NewState;
+   GLbitfield new_state = ctx->NewState;
 
    if (MESA_VERBOSE & VERBOSE_STATE)
       _mesa_print_state("_mesa_update_state", new_state);
@@ -984,7 +974,7 @@ _mesa_update_state( GLcontext *ctx )
    if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL))
       _mesa_update_framebuffer(ctx);
 
-   if (new_state & (_NEW_SCISSOR|_NEW_BUFFERS))
+   if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
       _mesa_update_draw_buffer_bounds( ctx );
 
    if (new_state & _NEW_POINT)