Bug 1049960 - WebGL generate invalid operation errors when copyTex[Sub]Image2D is called with a format that is not a subset of the FBO format. r=jgilbert
This commit is contained in:
@@ -76,6 +76,26 @@ WebGLFramebuffer::Attachment::HasAlpha() const
|
||||
return FormatHasAlpha(format);
|
||||
}
|
||||
|
||||
GLenum
|
||||
WebGLFramebuffer::GetFormatForAttachment(const WebGLFramebuffer::Attachment& attachment) const
|
||||
{
|
||||
MOZ_ASSERT(attachment.IsDefined());
|
||||
MOZ_ASSERT(attachment.Texture() || attachment.Renderbuffer());
|
||||
|
||||
if (attachment.Texture()) {
|
||||
const WebGLTexture& tex = *attachment.Texture();
|
||||
MOZ_ASSERT(tex.HasImageInfoAt(tex.Target(), 0));
|
||||
|
||||
const WebGLTexture::ImageInfo& imgInfo = tex.ImageInfoAt(tex.Target(), 0);
|
||||
return imgInfo.WebGLFormat();
|
||||
}
|
||||
|
||||
if (attachment.Renderbuffer())
|
||||
return attachment.Renderbuffer()->InternalFormat();
|
||||
|
||||
return LOCAL_GL_NONE;
|
||||
}
|
||||
|
||||
bool
|
||||
WebGLFramebuffer::Attachment::IsReadableFloat() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user