Mesa (master): ARB_texture_rg: Allow RED and RG textures as FBO color buffer attachments
Ian Romanick
idr at kemper.freedesktop.org
Fri Oct 1 22:56:19 UTC 2010
Module: Mesa
Branch: master
Commit: 421f4d8dc1e324067534719fc096e82fd9ef3017
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=421f4d8dc1e324067534719fc096e82fd9ef3017
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Thu Sep 30 16:30:09 2010 -0700
ARB_texture_rg: Allow RED and RG textures as FBO color buffer attachments
---
src/mesa/main/fbobject.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 5201f50..f28846c 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -451,7 +451,11 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
if (baseFormat != GL_RGB &&
baseFormat != GL_RGBA &&
(!ctx->Extensions.ARB_framebuffer_object ||
- baseFormat != GL_ALPHA)) {
+ baseFormat != GL_ALPHA) &&
+ (!ctx->Extensions.ARB_texture_rg ||
+ baseFormat != GL_RED) &&
+ (!ctx->Extensions.ARB_texture_rg ||
+ baseFormat != GL_RG)) {
att_incomplete("bad format");
att->Complete = GL_FALSE;
return;
@@ -631,7 +635,9 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
numImages++;
if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT
&& f != GL_DEPTH_STENCIL_EXT
- && (!ctx->Extensions.ARB_framebuffer_object || f != GL_ALPHA)) {
+ && (!ctx->Extensions.ARB_framebuffer_object || f != GL_ALPHA)
+ && (!ctx->Extensions.ARB_texture_rg || f != GL_RED)
+ && (!ctx->Extensions.ARB_texture_rg || f != GL_RG)) {
fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
fbo_incomplete("texture attachment incomplete", -1);
return;
More information about the mesa-commit
mailing list