[Mesa-dev] [PATCH 1/6] intel: Add a function for creating a private window system buffer.

Chad Versace chad.versace at linux.intel.com
Mon Jul 16 15:02:34 PDT 2012


From: Eric Anholt <eric at anholt.net>

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_fbo.c | 19 +++++++++++++++++--
 src/mesa/drivers/dri/intel/intel_fbo.h |  3 +++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index a801bb7..99fee9d 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -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.
@@ -420,6 +418,23 @@ intel_create_renderbuffer(gl_format format)
 }
 
 /**
+ * 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().
  */
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index 758b4a0..e14fe55 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -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,
-- 
1.7.11.2



More information about the mesa-dev mailing list