mesa: new _mesa_valid_to_render() function
[mesa.git] / src / mesa / main / buffers.c
index 85db3868c4968a3818e8ee127b14503a397505d3..d8b5f3b1f4aafe02bbd5f53e27b8644210901682 100644 (file)
@@ -120,11 +120,9 @@ draw_buffer_enum_to_bitmask(GLenum buffer)
       case GL_AUX0:
          return BUFFER_BIT_AUX0;
       case GL_AUX1:
-         return BUFFER_BIT_AUX1;
       case GL_AUX2:
-         return BUFFER_BIT_AUX2;
       case GL_AUX3:
-         return BUFFER_BIT_AUX3;
+         return 1 << BUFFER_COUNT; /* invalid, but not BAD_MASK */
       case GL_COLOR_ATTACHMENT0_EXT:
          return BUFFER_BIT_COLOR0;
       case GL_COLOR_ATTACHMENT1_EXT:
@@ -177,11 +175,9 @@ read_buffer_enum_to_index(GLenum buffer)
       case GL_AUX0:
          return BUFFER_AUX0;
       case GL_AUX1:
-         return BUFFER_AUX1;
       case GL_AUX2:
-         return BUFFER_AUX2;
       case GL_AUX3:
-         return BUFFER_AUX3;
+         return BUFFER_COUNT; /* invalid, but not -1 */
       case GL_COLOR_ATTACHMENT0_EXT:
          return BUFFER_COLOR0;
       case GL_COLOR_ATTACHMENT1_EXT:
@@ -447,7 +443,7 @@ _mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex)
    fb->ColorReadBuffer = buffer;
    fb->_ColorReadBufferIndex = bufferIndex;
 
-   ctx->NewState |= _NEW_PIXEL;
+   ctx->NewState |= _NEW_BUFFERS;
 }