mesa: make _mesa_validate_sync() non-static
[mesa.git] / src / mesa / main / buffers.c
index 87848fb93796be2424dd8b1c16b0a3b0ffc5fcb2..2bdbf41be5d1a33bdf803224205394663a0be3bf 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.1
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
@@ -60,7 +60,6 @@ supported_buffer_bitmask(const struct gl_context *ctx,
    if (_mesa_is_user_fbo(fb)) {
       /* A user-created renderbuffer */
       GLuint i;
-      ASSERT(ctx->Extensions.EXT_framebuffer_object);
       for (i = 0; i < ctx->Const.MaxColorAttachments; i++) {
          mask |= (BUFFER_BIT_COLOR0 << i);
       }
@@ -226,8 +225,8 @@ read_buffer_enum_to_index(GLenum buffer)
  * \param buffer  buffer token such as GL_LEFT or GL_FRONT_AND_BACK, etc.
  *
  * Note that the behaviour of this function depends on whether the
- * current ctx->DrawBuffer is a window-system framebuffer (Name=0) or
- * a user-created framebuffer object (Name!=0).
+ * current ctx->DrawBuffer is a window-system framebuffer or a user-created
+ * framebuffer object.
  *   In the former case, we update the per-context ctx->Color.DrawBuffer
  *   state var _and_ the FB's ColorDrawBuffer state.
  *   In the later case, we update the FB's ColorDrawBuffer state only.
@@ -244,7 +243,8 @@ _mesa_DrawBuffer(GLenum buffer)
 {
    GLbitfield destMask;
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */
+
+   FLUSH_VERTICES(ctx, 0);
 
    if (MESA_VERBOSE & VERBOSE_API) {
       _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
@@ -301,7 +301,8 @@ _mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
    GLbitfield usedBufferMask, supportedMask;
    GLbitfield destMask[MAX_DRAW_BUFFERS];
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+   FLUSH_VERTICES(ctx, 0);
 
    /* Turns out n==0 is a valid input that should not produce an error.
     * The remaining code below correctly handles the n==0 case.
@@ -609,7 +610,8 @@ _mesa_ReadBuffer(GLenum buffer)
    GLbitfield supportedMask;
    GLint srcBuffer;
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+   FLUSH_VERTICES(ctx, 0);
 
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
@@ -642,7 +644,6 @@ _mesa_ReadBuffer(GLenum buffer)
    /* OK, all error checking has been completed now */
 
    _mesa_readbuffer(ctx, buffer, srcBuffer);
-   ctx->NewState |= _NEW_BUFFERS;
 
    /*
     * Call device driver function.