[Mesa-dev] [PATCH 3/7] intel: Support renderbuffer unwrappers in intel_get_renderbuffer()
Chad Versace
chad at chad-versace.us
Wed Jun 15 17:34:40 PDT 2011
Now, if the renderbuffer contains an unwrapper for the requested
attachment, intel_get_renderbuffer returns the unwrapper.
Signed-off-by: Chad Versace <chad at chad-versace.us>
---
src/mesa/drivers/dri/intel/intel_fbo.h | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index 509f588..e220ef8 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -76,13 +76,26 @@ intel_renderbuffer(struct gl_renderbuffer *rb)
/**
- * Return a framebuffer's renderbuffer, named by a BUFFER_x index.
+ * \brief Return the framebuffer attachment specified by attIndex.
+ *
+ * If the framebuffer lacks the specified attachment, then return null.
+ * If the renderbuffer attachment contains an unwrapper for attIndex,
+ * then return the unwrapper.
*/
static INLINE struct intel_renderbuffer *
-intel_get_renderbuffer(struct gl_framebuffer *fb, int attIndex)
+intel_get_renderbuffer(struct gl_framebuffer *fb, gl_buffer_index attIndex)
{
- if (attIndex >= 0)
- return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
+ struct gl_renderbuffer *rb = NULL;
+
+ if (attIndex >= 0) {
+ rb = fb->Attachment[attIndex].Renderbuffer;
+ if (rb && rb->Unwrapped[attIndex]) {
+ rb = rb->Unwrapped[attIndex];
+ }
+ }
+
+ if (rb)
+ return intel_renderbuffer(rb);
else
return NULL;
}
--
1.7.5.2
More information about the mesa-dev
mailing list