mesa: Throw an error when starting conditional render on an active query.
[mesa.git] / src / mesa / main / framebuffer.c
index 6e2ce74212e661596b7c7e7a60478449cfe9cee7..42da176784351fbc9f800abbb9d5e94575a25a7f 100644 (file)
@@ -232,17 +232,13 @@ _mesa_free_framebuffer_data(struct gl_framebuffer *fb)
 
 /**
  * Set *ptr to point to fb, with refcounting and locking.
+ * This is normally only called from the _mesa_reference_framebuffer() macro
+ * when there's a real pointer change.
  */
 void
-_mesa_reference_framebuffer(struct gl_framebuffer **ptr,
-                            struct gl_framebuffer *fb)
+_mesa_reference_framebuffer_(struct gl_framebuffer **ptr,
+                             struct gl_framebuffer *fb)
 {
-   assert(ptr);
-   if (*ptr == fb) {
-      /* no change */
-      return;
-   }
-
    if (*ptr) {
       /* unreference old renderbuffer */
       GLboolean deleteFlag = GL_FALSE;
@@ -552,6 +548,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
             fb->Visual.rgbBits = fb->Visual.redBits
                + fb->Visual.greenBits + fb->Visual.blueBits;
             fb->Visual.samples = rb->NumSamples;
+            fb->Visual.sampleBuffers = rb->NumSamples > 0 ? 1 : 0;
             if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
                 fb->Visual.sRGBCapable = ctx->Const.sRGBCapable;
             break;
@@ -891,7 +888,6 @@ _mesa_source_buffer_exists(struct gl_context *ctx, GLenum format)
    case GL_RGBA:
    case GL_BGRA:
    case GL_ABGR_EXT:
-   case GL_COLOR_INDEX:
    case GL_RED_INTEGER_EXT:
    case GL_GREEN_INTEGER_EXT:
    case GL_BLUE_INTEGER_EXT:
@@ -979,7 +975,6 @@ _mesa_dest_buffer_exists(struct gl_context *ctx, GLenum format)
    case GL_RGBA:
    case GL_BGRA:
    case GL_ABGR_EXT:
-   case GL_COLOR_INDEX:
    case GL_RED_INTEGER_EXT:
    case GL_GREEN_INTEGER_EXT:
    case GL_BLUE_INTEGER_EXT: