OSDN Git Service

mesa: move call to init_c_cliptest() from enable.c to tnl module.
authorBrian Paul <brianp@vmware.com>
Wed, 9 Sep 2009 14:54:38 +0000 (08:54 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 9 Sep 2009 14:54:38 +0000 (08:54 -0600)
Fixed gallium build breakage.

src/mesa/main/enable.c
src/mesa/tnl/t_context.h
src/mesa/tnl/t_vb_program.c
src/mesa/tnl/t_vb_vertex.c

index d066153..4c1f461 100644 (file)
@@ -36,8 +36,6 @@
 #include "simple_list.h"
 #include "mtypes.h"
 #include "enums.h"
-#include "math/m_matrix.h"
-#include "math/m_xform.h"
 #include "api_arrayelt.h"
 
 
@@ -951,12 +949,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
       case GL_DEPTH_CLAMP:
          if (ctx->Transform.DepthClamp == state)
             return;
-        /* Neither the x86 nor sparc asm cliptest functions have been updated
-         * for ARB_depth_clamp, so force the C paths.
-         */
-        if (state)
-           init_c_cliptest();
-
         CHECK_EXTENSION(ARB_depth_clamp, cap);
          FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
         ctx->Transform.DepthClamp = state;
index c19eb3d..6137c2d 100644 (file)
@@ -548,4 +548,8 @@ typedef struct
 #define MAX_TYPES TYPE_IDX(GL_DOUBLE)+1      /* 0xa + 1 */
 
 
+extern void
+tnl_clip_prepare(GLcontext *ctx);
+
+
 #endif
index 5d89f8b..c10a276 100644 (file)
@@ -131,6 +131,8 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store)
    store->ormask = 0;
    store->andmask = CLIP_FRUSTUM_BITS;
 
+   tnl_clip_prepare(ctx);
+
    if (tnl->NeedNdcCoords) {
       VB->NdcPtr =
          _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
index 6a74641..4734754 100644 (file)
@@ -118,6 +118,22 @@ static void (*(usercliptab[5]))( GLcontext *,
 };
 
 
+void
+tnl_clip_prepare(GLcontext *ctx)
+{
+   /* Neither the x86 nor sparc asm cliptest functions have been updated
+    * for ARB_depth_clamp, so force the C paths.
+    */
+   if (ctx->Transform.DepthClamp) {
+      static GLboolean c_funcs_installed = GL_FALSE;
+      if (!c_funcs_installed) {
+         init_c_cliptest();
+         c_funcs_installed = GL_TRUE;
+      }
+   }
+}
+
+
 
 static GLboolean run_vertex_stage( GLcontext *ctx,
                                   struct tnl_pipeline_stage *stage )
@@ -129,6 +145,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
    if (ctx->VertexProgram._Current) 
       return GL_TRUE;
 
+   tnl_clip_prepare(ctx);
+
    if (ctx->_NeedEyeCoords) {
       /* Separate modelview transformation:
        * Use combined ModelProject to avoid some depth artifacts