webgl: Ensure that framebuffers have a color attachment before reading or writing.

This commit is contained in:
Josh Matthews 2018-08-15 13:27:44 -04:00
parent 80ed829241
commit d179435eab
4 changed files with 129 additions and 4 deletions

View file

@ -339,7 +339,7 @@ impl WebGLRenderingContext {
// this: clear() and getParameter(IMPLEMENTATION_COLOR_READ_*).
fn validate_framebuffer(&self) -> WebGLResult<()> {
match self.bound_framebuffer.get() {
Some(ref fb) if fb.check_status() != constants::FRAMEBUFFER_COMPLETE => {
Some(ref fb) if fb.check_status_for_rendering() != constants::FRAMEBUFFER_COMPLETE => {
Err(InvalidFramebufferOperation)
},
_ => Ok(()),