mesa: add GL 3.2 GL_CONTEXT_PROFILE_MASK query
[mesa.git] / src / mesa / tnl_dd / t_dd_unfilled.h
index 46415ea5f68b17309b49c52d5618c575674b432f..9c467291a140725c39f9df0490bf858166d9e793 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  6.5.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  *    Keith Whitwell <keith@tungstengraphics.com>
  */
 
-#if HAVE_RGBA
-#define VERT_SET_IND( v, c )
-#define VERT_COPY_IND( v0, v1 )
-#define VERT_SAVE_IND( idx )
-#define VERT_RESTORE_IND( idx )
-#endif
-
 #if !HAVE_SPEC
 #define VERT_SET_SPEC( v, c )
 #define VERT_COPY_SPEC( v0, v1 )
@@ -53,24 +45,17 @@ static void TAG(unfilled_tri)( GLcontext *ctx,
    v[1] = (VERTEX *)GET_VERTEX(e1);
    v[2] = (VERTEX *)GET_VERTEX(e2);
 
-   if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
-      if (HAVE_RGBA) {
-        VERT_SAVE_RGBA(0);
-        VERT_SAVE_RGBA(1);
-        VERT_COPY_RGBA(v[0], v[2]);
-        VERT_COPY_RGBA(v[1], v[2]);
-
-        if (HAVE_SPEC) {
-           VERT_SAVE_SPEC(0);
-           VERT_SAVE_SPEC(1);
-           VERT_COPY_SPEC(v[0], v[2]);
-           VERT_COPY_SPEC(v[1], v[2]);
-        }
-      } else {
-        VERT_SAVE_IND(0);
-        VERT_SAVE_IND(1);
-        VERT_COPY_IND(v[0], v[2]);
-        VERT_COPY_IND(v[1], v[2]);
+   if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) {
+      VERT_SAVE_RGBA(0);
+      VERT_SAVE_RGBA(1);
+      VERT_COPY_RGBA(v[0], v[2]);
+      VERT_COPY_RGBA(v[1], v[2]);
+
+      if (HAVE_SPEC) {
+        VERT_SAVE_SPEC(0);
+        VERT_SAVE_SPEC(1);
+        VERT_COPY_SPEC(v[0], v[2]);
+        VERT_COPY_SPEC(v[1], v[2]);
       }
    }
 
@@ -98,18 +83,13 @@ static void TAG(unfilled_tri)( GLcontext *ctx,
       }
    }
 
-   if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
-      if (HAVE_RGBA) {
-        VERT_RESTORE_RGBA(0);
-        VERT_RESTORE_RGBA(1);
-
-        if (HAVE_SPEC) {
-           VERT_RESTORE_SPEC(0);
-           VERT_RESTORE_SPEC(1);
-        }
-      } else {
-        VERT_RESTORE_IND(0);
-        VERT_RESTORE_IND(1);
+   if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) {
+      VERT_RESTORE_RGBA(0);
+      VERT_RESTORE_RGBA(1);
+
+      if (HAVE_SPEC) {
+        VERT_RESTORE_SPEC(0);
+        VERT_RESTORE_SPEC(1);
       }
    }
 }
@@ -133,30 +113,21 @@ static void TAG(unfilled_quad)( GLcontext *ctx,
    /* Hardware flatshading breaks down here.  If the hardware doesn't
     * support flatshading, this will already have been done:
     */
-   if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
-      if (HAVE_RGBA) {
-        VERT_SAVE_RGBA(0);
-        VERT_SAVE_RGBA(1);
-        VERT_SAVE_RGBA(2);
-        VERT_COPY_RGBA(v[0], v[3]);
-        VERT_COPY_RGBA(v[1], v[3]);
-        VERT_COPY_RGBA(v[2], v[3]);
-
-        if (HAVE_SPEC) {
-           VERT_SAVE_SPEC(0);
-           VERT_SAVE_SPEC(1);
-           VERT_SAVE_SPEC(2);
-           VERT_COPY_SPEC(v[0], v[3]);
-           VERT_COPY_SPEC(v[1], v[3]);
-           VERT_COPY_SPEC(v[2], v[3]);
-        }
-      } else {
-        VERT_SAVE_IND(0);
-        VERT_SAVE_IND(1);
-        VERT_SAVE_IND(2);
-        VERT_COPY_IND(v[0], v[3]);
-        VERT_COPY_IND(v[1], v[3]);
-        VERT_COPY_IND(v[2], v[3]);
+   if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) {
+      VERT_SAVE_RGBA(0);
+      VERT_SAVE_RGBA(1);
+      VERT_SAVE_RGBA(2);
+      VERT_COPY_RGBA(v[0], v[3]);
+      VERT_COPY_RGBA(v[1], v[3]);
+      VERT_COPY_RGBA(v[2], v[3]);
+
+      if (HAVE_SPEC) {
+        VERT_SAVE_SPEC(0);
+        VERT_SAVE_SPEC(1);
+        VERT_SAVE_SPEC(2);
+        VERT_COPY_SPEC(v[0], v[3]);
+        VERT_COPY_SPEC(v[1], v[3]);
+        VERT_COPY_SPEC(v[2], v[3]);
       }
    }
 
@@ -175,33 +146,20 @@ static void TAG(unfilled_quad)( GLcontext *ctx,
       if (ef[e3]) LINE( v[3], v[0] );
    }
 
-   if ((ctx->_TriangleCaps & DD_FLATSHADE) && HAVE_HW_FLATSHADE) {
-      if (HAVE_RGBA) {
-        VERT_RESTORE_RGBA(0);
-        VERT_RESTORE_RGBA(1);
-        VERT_RESTORE_RGBA(2);
-
-        if (HAVE_SPEC) {
-           VERT_RESTORE_SPEC(0);
-           VERT_RESTORE_SPEC(1);
-           VERT_RESTORE_SPEC(2);
-        }
-      } else {
-        VERT_RESTORE_IND(0);
-        VERT_RESTORE_IND(1);
-        VERT_RESTORE_IND(2);
+   if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) {
+      VERT_RESTORE_RGBA(0);
+      VERT_RESTORE_RGBA(1);
+      VERT_RESTORE_RGBA(2);
+
+      if (HAVE_SPEC) {
+        VERT_RESTORE_SPEC(0);
+        VERT_RESTORE_SPEC(1);
+        VERT_RESTORE_SPEC(2);
       }
    }
 }
 
 
-#if HAVE_RGBA
-#undef VERT_SET_IND
-#undef VERT_COPY_IND
-#undef VERT_SAVE_IND
-#undef VERT_RESTORE_IND
-#endif
-
 #if !HAVE_SPEC
 #undef VERT_SET_SPEC
 #undef VERT_COPY_SPEC