Mesa (master): i965: Comment gen6_hiz_get_framebuffer_enum()
Chad Versace
chadversary at kemper.freedesktop.org
Fri Jan 13 18:27:43 UTC 2012
Module: Mesa
Branch: master
Commit: e13c99a0043854cb286c773faa891a3115cd0a68
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e13c99a0043854cb286c773faa891a3115cd0a68
Author: Chad Versace <chad.versace at linux.intel.com>
Date: Fri Jan 13 10:26:01 2012 -0800
i965: Comment gen6_hiz_get_framebuffer_enum()
Make the comments precise. Explain why each branch is needed and correct.
Document the potential pitfall in the true-branch.
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
src/mesa/drivers/dri/i965/gen6_hiz.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen6_hiz.c b/src/mesa/drivers/dri/i965/gen6_hiz.c
index 92b1d61..4d36729 100644
--- a/src/mesa/drivers/dri/i965/gen6_hiz.c
+++ b/src/mesa/drivers/dri/i965/gen6_hiz.c
@@ -114,14 +114,16 @@ gen6_hiz_get_framebuffer_enum(struct gl_context *ctx,
GLenum *bind_enum,
GLenum *get_enum)
{
- /* If the blit framebuffer extension isn't supported then Mesa will
- report an error if we try to bind GL_DRAW_FRAMEBUFFER. However in
- that case it should be safe to just save and restore
- GL_FRAMEBUFFER instead. */
if (ctx->Extensions.EXT_framebuffer_blit && ctx->API == API_OPENGL) {
+ /* Different buffers may be bound to GL_DRAW_FRAMEBUFFER and
+ * GL_READ_FRAMEBUFFER. Take care to not disrupt the read buffer.
+ */
*bind_enum = GL_DRAW_FRAMEBUFFER;
*get_enum = GL_DRAW_FRAMEBUFFER_BINDING;
} else {
+ /* The enums GL_DRAW_FRAMEBUFFER and GL_READ_FRAMEBUFFER do not exist.
+ * The bound framebuffer is both the read and draw buffer.
+ */
*bind_enum = GL_FRAMEBUFFER;
*get_enum = GL_FRAMEBUFFER_BINDING;
}
More information about the mesa-commit
mailing list