intel: Add a function for creating a private window system buffer.
authorEric Anholt <eric@anholt.net>
Wed, 4 Jul 2012 17:52:31 +0000 (10:52 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 17 Jul 2012 15:17:38 +0000 (08:17 -0700)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_fbo.h

index b86df6ccba2af84fa202bf80b11fa0359f655383..f9fdc361de6513acc674a9112fbdb0f069f37f3b 100644 (file)
@@ -228,8 +228,6 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);
    rb->NumSamples = quantize_num_samples(intel, rb->NumSamples);
 
-   ASSERT(rb->Name != 0);
-
    switch (internalFormat) {
    default:
       /* Use the same format-choice logic as for textures.
@@ -427,6 +425,23 @@ intel_create_renderbuffer(gl_format format)
    return irb;
 }
 
+/**
+ * Private window-system buffers (as opposed to ones shared with the display
+ * server created with intel_create_renderbuffer()) are most similar in their
+ * handling to user-created renderbuffers, but they have a resize handler that
+ * may be called at intel_update_renderbuffers() time.
+ */
+struct intel_renderbuffer *
+intel_create_private_renderbuffer(gl_format format)
+{
+   struct intel_renderbuffer *irb;
+
+   irb = intel_create_renderbuffer(format);
+   irb->Base.Base.AllocStorage = intel_alloc_renderbuffer_storage;
+
+   return irb;
+}
+
 /**
  * Create a new renderbuffer object.
  * Typically called via glBindRenderbufferEXT().
index 758b4a0ec323e4f9c03557cd28c10f1b0e5dfa4c..e14fe550b0c11b2103485dc882be3e2f194a5064 100644 (file)
@@ -136,6 +136,9 @@ intel_framebuffer_has_hiz(struct gl_framebuffer *fb);
 extern struct intel_renderbuffer *
 intel_create_renderbuffer(gl_format format);
 
+struct intel_renderbuffer *
+intel_create_private_renderbuffer(gl_format format);
+
 struct gl_renderbuffer*
 intel_create_wrapped_renderbuffer(struct gl_context * ctx,
                                  int width, int height,