Remove ctx->Point._Size and ctx->Line._Width.
[mesa.git] / src / mesa / main / state.c
index 6ed7ae6c7dd7087fb7f865298f155492077dc8f4..444f227760182c102d6e9d40ab8e46457dbac701 100644 (file)
 #include "accum.h"
 #include "api_loopback.h"
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-#include "arbprogram.h"
+#include "shader/arbprogram.h"
 #endif
 #if FEATURE_ATI_fragment_shader
-#include "atifragshader.h"
+#include "shader/atifragshader.h"
 #endif
 #include "attrib.h"
 #include "blend.h"
 #include "lines.h"
 #include "macros.h"
 #include "matrix.h"
-#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query
-#include "occlude.h"
-#endif
 #include "pixel.h"
 #include "points.h"
 #include "polygon.h"
+#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query
+#include "queryobj.h"
+#endif
 #include "rastpos.h"
 #include "state.h"
 #include "stencil.h"
 #include "mtypes.h"
 #include "varray.h"
 #if FEATURE_NV_vertex_program
-#include "nvprogram.h"
+#include "shader/nvprogram.h"
 #endif
 #if FEATURE_NV_fragment_program
-#include "nvprogram.h"
-#include "program.h"
+#include "shader/nvprogram.h"
+#include "shader/program.h"
 #include "texenvprogram.h"
 #endif
 #if FEATURE_ARB_shader_objects
 #include "shaders.h"
 #endif
 #include "debug.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
 
 
 
@@ -812,6 +812,11 @@ _mesa_init_exec_table(struct _glapi_table *exec)
    SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
    SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT);
 #endif
+
+   /* GL_MESA_texture_array / GL_EXT_texture_array */
+#if FEATURE_EXT_framebuffer_object
+   SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT);
+#endif
 }
 
 
@@ -964,6 +969,9 @@ update_program(GLcontext *ctx)
 
    if (shProg && shProg->LinkStatus) {
       /* Use shader programs */
+      /* XXX this isn't quite right, since we may have either a vertex
+       * _or_ fragment shader (not always both).
+       */
       ctx->VertexProgram._Current = shProg->VertexProgram;
       ctx->FragmentProgram._Current = shProg->FragmentProgram;
    }
@@ -1000,6 +1008,13 @@ update_program(GLcontext *ctx)
          ctx->FragmentProgram._Current = NULL;
       }
    }
+
+   ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled;
+   if (ctx->FragmentProgram._MaintainTexEnvProgram &&
+       !ctx->FragmentProgram._Enabled) {
+      if (ctx->FragmentProgram._UseTexEnvProgram)
+        ctx->FragmentProgram._Active = GL_TRUE;
+   }
 }
 
 
@@ -1050,10 +1065,10 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
    /*
     * Points
     */
-   if (new_state & _NEW_POINT) {
+   if (1/*new_state & _NEW_POINT*/) {
       if (ctx->Point.SmoothFlag)
          ctx->_TriangleCaps |= DD_POINT_SMOOTH;
-      if (ctx->Point._Size != 1.0F)
+      if (ctx->Point.Size != 1.0F)
          ctx->_TriangleCaps |= DD_POINT_SIZE;
       if (ctx->Point._Attenuated)
          ctx->_TriangleCaps |= DD_POINT_ATTEN;
@@ -1062,19 +1077,19 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state)
    /*
     * Lines
     */
-   if (new_state & _NEW_LINE) {
+   if (1/*new_state & _NEW_LINE*/) {
       if (ctx->Line.SmoothFlag)
          ctx->_TriangleCaps |= DD_LINE_SMOOTH;
       if (ctx->Line.StippleFlag)
          ctx->_TriangleCaps |= DD_LINE_STIPPLE;
-      if (ctx->Line._Width != 1.0)
+      if (ctx->Line.Width != 1.0)
          ctx->_TriangleCaps |= DD_LINE_WIDTH;
    }
 
    /*
     * Polygons
     */
-   if (new_state & _NEW_POLYGON) {
+   if (1/*new_state & _NEW_POLYGON*/) {
       if (ctx->Polygon.SmoothFlag)
          ctx->_TriangleCaps |= DD_TRI_SMOOTH;
       if (ctx->Polygon.StippleFlag)