Skip to content

Commit

Permalink
webgl: Mark zero-sized framebuffers as incomplete attachments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Aug 1, 2018
1 parent 733552d commit 3334e47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/script/dom/webglframebuffer.rs
Expand Up @@ -175,7 +175,11 @@ impl WebGLFramebuffer {
self.size.set(fb_size);

if has_c || has_z || has_zs || has_s {
self.status.set(constants::FRAMEBUFFER_COMPLETE);
if self.size.get().map_or(false, |(w, h)| w != 0 && h != 0) {
self.status.set(constants::FRAMEBUFFER_COMPLETE);
} else {
self.status.set(constants::FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
}
} else {
self.status.set(constants::FRAMEBUFFER_UNSUPPORTED);
}
Expand Down

0 comments on commit 3334e47

Please sign in to comment.