summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common/glcontextmodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/common/glcontextmodes.c')
-rw-r--r--src/mesa/drivers/dri/common/glcontextmodes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c
index 4bff387ae0a..5e9e352f2c6 100644
--- a/src/mesa/drivers/dri/common/glcontextmodes.c
+++ b/src/mesa/drivers/dri/common/glcontextmodes.c
@@ -157,8 +157,8 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode,
mode->greenMask = config->greenMask;
mode->blueMask = config->blueMask;
mode->alphaMask = config->alphaMask;
- mode->rgbBits = config->bufferSize;
- mode->indexBits = config->bufferSize;
+ mode->rgbBits = mode->rgbMode ? config->bufferSize : 0;
+ mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0;
mode->accumRedBits = config->accumRedSize;
mode->accumGreenBits = config->accumGreenSize;