From ed7f3aead819dfe089228363698b4860614e62e8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 7 Jun 2005 15:03:40 +0000 Subject: fix GL_ALPHA render-to-texture problem (Jon Smirl) --- src/mesa/main/fbobject.c | 4 ++++ src/mesa/main/texrender.c | 3 +++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6dae796620..cbc3dccc6d 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -389,6 +389,10 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) h = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Height; f = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Format; numImages++; + if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; + return; + } } else if (att->Type == GL_RENDERBUFFER_EXT) { w = att->Renderbuffer->Width; diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 12afa93d01..f7f3fdb4b0 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -151,9 +151,12 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att) trb->Base.Height = trb->TexImage->Height; trb->Base.InternalFormat = trb->TexImage->IntFormat; /* XXX fix? */ trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat; +#if 0 + /* fix/avoid this assertion someday */ assert(trb->Base._BaseFormat == GL_RGB || trb->Base._BaseFormat == GL_RGBA || trb->Base._BaseFormat == GL_DEPTH_COMPONENT); +#endif trb->Base.DataType = GL_UNSIGNED_BYTE; /* XXX fix! */ trb->Base.Data = trb->TexImage->Data; -- cgit v1.2.3