webgl: Do validation that the framebuffer is complete for FBO operations.

Given that we can't make a complete FBO yet, just return false from
the status check.
This commit is contained in:
Eric Anholt 2016-09-16 23:39:42 +01:00 committed by Glenn Watson
parent b2c169274a
commit 87c9333abd
2 changed files with 63 additions and 0 deletions

View file

@ -5,6 +5,7 @@
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
use canvas_traits::CanvasMsg;
use dom::bindings::codegen::Bindings::WebGLFramebufferBinding;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
@ -79,6 +80,12 @@ impl WebGLFramebuffer {
self.is_deleted.get()
}
pub fn check_status(&self) -> u32 {
// Until we build support for attaching renderbuffers or
// textures, all user FBOs are incomplete.
return constants::FRAMEBUFFER_UNSUPPORTED;
}
pub fn target(&self) -> Option<u32> {
self.target.get()
}