summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_clear.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-08 20:27:27 -0600
committerBrian Paul <[email protected]>2009-10-08 20:27:27 -0600
commit45e76d2665b38ba3787548310efc59e969124c01 (patch)
tree7a1ab9b61bbd0eb03e7154f6f000db58b8eab4f4 /src/mesa/swrast/s_clear.c
parent74d61d03b54d72217d463c248468cdcd09320efc (diff)
mesa: remove a bunch of gl_renderbuffer fields
_ActualFormat is replaced by Format (MESA_FORMAT_x). ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are all replaced by MESA_FORMAT_x queries.
Diffstat (limited to 'src/mesa/swrast/s_clear.c')
-rw-r--r--src/mesa/swrast/s_clear.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c
index 35080fd3945..002718ded85 100644
--- a/src/mesa/swrast/s_clear.c
+++ b/src/mesa/swrast/s_clear.c
@@ -24,6 +24,7 @@
#include "main/glheader.h"
#include "main/colormac.h"
+#include "main/formats.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/mtypes.h"
@@ -211,9 +212,6 @@ clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
ASSERT(!ctx->Visual.rgbMode);
- ASSERT((ctx->Color.IndexMask & ((1 << rb->IndexBits) - 1))
- == (GLuint) ((1 << rb->IndexBits) - 1));
-
ASSERT(rb->PutMonoRow);
/* setup clear value */
@@ -264,8 +262,8 @@ clear_color_buffers(GLcontext *ctx)
}
else {
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
- const GLuint indexBits = (1 << rb->IndexBits) - 1;
- if ((ctx->Color.IndexMask & indexBits) == indexBits) {
+ const GLuint indexMask = (1 << _mesa_get_format_bits(rb->Format, GL_INDEX_BITS)) - 1;
+ if ((ctx->Color.IndexMask & indexMask) == indexMask) {
masking = GL_FALSE;
}
else {