summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/x11/fakeglx.c23
-rw-r--r--src/mesa/main/config.h4
-rw-r--r--src/mesa/main/context.c16
-rw-r--r--src/mesa/main/mtypes.h6
-rw-r--r--src/mesa/swrast/s_accum.c2
5 files changed, 20 insertions, 31 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 2cb6963114..cd26bade30 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -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,
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 6fddbd116e..44de635c3f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -234,10 +234,6 @@
*/
#define TRIANGLE_WALK_DOUBLE 0
-/**
- * Bits per accumulation buffer color component: 8, 16 or 32
- */
-#define ACCUM_BITS 16
/**
* Bits per depth buffer value.
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index d660dfd8fe..9db0b87ec1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -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;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a076f82a22..6ed7a22807 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -66,12 +66,6 @@
#endif
-#if ACCUM_BITS != 16
-/* Software accum done with GLshort at this time */
-# error "illegal number of accumulation bits"
-#endif
-
-
/**
* Stencil buffer data type.
*/
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index e9946c55df..cf6dab912b 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -62,7 +62,7 @@
*/
-#if CHAN_BITS == 8 && ACCUM_BITS <= 32
+#if CHAN_BITS == 8
/* enable the optimization */
#define USE_OPTIMIZED_ACCUM 1
#else