fix GL_ALPHA render-to-texture problem (Jon Smirl)

This commit is contained in:
Brian Paul
2005-06-07 15:03:40 +00:00
parent 395280bf88
commit ed7f3aead8
2 changed files with 7 additions and 0 deletions

View File

@@ -389,6 +389,10 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
h = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Height; h = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Height;
f = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Format; f = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Format;
numImages++; 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) { else if (att->Type == GL_RENDERBUFFER_EXT) {
w = att->Renderbuffer->Width; w = att->Renderbuffer->Width;

View File

@@ -151,9 +151,12 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
trb->Base.Height = trb->TexImage->Height; trb->Base.Height = trb->TexImage->Height;
trb->Base.InternalFormat = trb->TexImage->IntFormat; /* XXX fix? */ trb->Base.InternalFormat = trb->TexImage->IntFormat; /* XXX fix? */
trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat; trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat;
#if 0
/* fix/avoid this assertion someday */
assert(trb->Base._BaseFormat == GL_RGB || assert(trb->Base._BaseFormat == GL_RGB ||
trb->Base._BaseFormat == GL_RGBA || trb->Base._BaseFormat == GL_RGBA ||
trb->Base._BaseFormat == GL_DEPTH_COMPONENT); trb->Base._BaseFormat == GL_DEPTH_COMPONENT);
#endif
trb->Base.DataType = GL_UNSIGNED_BYTE; /* XXX fix! */ trb->Base.DataType = GL_UNSIGNED_BYTE; /* XXX fix! */
trb->Base.Data = trb->TexImage->Data; trb->Base.Data = trb->TexImage->Data;