Remove ACCUM_BITS.
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 21 Sep 2005 03:35:08 +0000 (03:35 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 21 Sep 2005 03:35:08 +0000 (03:35 +0000)
src/mesa/drivers/x11/fakeglx.c
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/mtypes.h
src/mesa/swrast/s_accum.c

index 2cb69631148fc8831dab09b8a93b2e6448123f7b..cd26bade30b25e0a3bb95c75c702ec33be5974ea 100644 (file)
@@ -378,6 +378,12 @@ default_depth_bits(void)
    return zBits;
 }
 
+static GLint
+default_accum_bits(void)
+{
+   return 16;
+}
+
 
 
 /*
@@ -393,6 +399,7 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
 {
    int vislevel;
    GLint zBits = default_depth_bits();
+   GLint accBits = default_accum_bits();
 
    vislevel = level_of_visual( dpy, visinfo );
    if (vislevel) {
@@ -435,10 +442,10 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
                                  GL_FALSE,  /* stereo */
                                  zBits,
                                  STENCIL_BITS,
-                                 ACCUM_BITS, /* r */
-                                 ACCUM_BITS, /* g */
-                                 ACCUM_BITS, /* b */
-                                 ACCUM_BITS, /* a */
+                                 accBits, /* r */
+                                 accBits, /* g */
+                                 accBits, /* b */
+                                 accBits, /* a */
                                  0,         /* level */
                                  0          /* numAux */
                                );
@@ -1221,10 +1228,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
          stencil_size = STENCIL_BITS;
       if (accumRedSize > 0 || accumGreenSize > 0 || accumBlueSize > 0 ||
           accumAlphaSize > 0) {
-         accumRedSize = ACCUM_BITS;
-         accumGreenSize = ACCUM_BITS;
-         accumBlueSize = ACCUM_BITS;
-         accumAlphaSize = alpha_flag ? ACCUM_BITS : 0;
+         accumRedSize = 
+         accumGreenSize = 
+         accumBlueSize = default_accum_bits();
+         accumAlphaSize = alpha_flag ? accumRedSize : 0;
       }
 
       xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
index 6fddbd116ead66f9dc2fb1d2e103a5c5a5b4f24e..44de635c3f7a9b875512402e73ea95b6ce61bf4a 100644 (file)
  */
 #define TRIANGLE_WALK_DOUBLE 0
 
-/**
- * Bits per accumulation buffer color component:  8, 16 or 32
- */
-#define ACCUM_BITS 16
 
 /**
  * Bits per depth buffer value.  
index d660dfd8fe33163696fb9ec9edccc187199cf511..9db0b87ec101e3dc66d4259b4f78280735d51280 100644 (file)
@@ -527,18 +527,10 @@ _mesa_initialize_visual( GLvisual *vis,
    if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
       return GL_FALSE;
    }
-   if (accumRedBits < 0 || accumRedBits > ACCUM_BITS) {
-      return GL_FALSE;
-   }
-   if (accumGreenBits < 0 || accumGreenBits > ACCUM_BITS) {
-      return GL_FALSE;
-   }
-   if (accumBlueBits < 0 || accumBlueBits > ACCUM_BITS) {
-      return GL_FALSE;
-   }
-   if (accumAlphaBits < 0 || accumAlphaBits > ACCUM_BITS) {
-      return GL_FALSE;
-   }
+   assert(accumRedBits >= 0);
+   assert(accumGreenBits >= 0);
+   assert(accumBlueBits >= 0);
+   assert(accumAlphaBits >= 0);
 
    vis->rgbMode          = rgbFlag;
    vis->doubleBufferMode = dbFlag;
index a076f82a2298a3e02a0eeb3af0f9ab0221fce05f..6ed7a22807eeb02088f60fe329b4c1918ca459a8 100644 (file)
 #endif
 
 
-#if ACCUM_BITS != 16
-/* Software accum done with GLshort at this time */
-#  error "illegal number of accumulation bits"
-#endif
-
-
 /**
  * Stencil buffer data type.
  */
index e9946c55df99709b4dd32b7abce2d6cc043d18ae..cf6dab912b9a00895d8f7a5c56a620f7e32025e6 100644 (file)
@@ -62,7 +62,7 @@
  */
 
 
-#if CHAN_BITS == 8 && ACCUM_BITS <= 32
+#if CHAN_BITS == 8
 /* enable the optimization */
 #define USE_OPTIMIZED_ACCUM  1
 #else