webgl: Check for bound element array buffer on DrawElements

And remove outdated TODOs
This commit is contained in:
Emilio Cobos Álvarez 2015-12-29 14:09:31 +01:00
parent 910b2260ab
commit e3532dda24

View file

@ -286,8 +286,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14
fn GetExtension(&self, _cx: *mut JSContext, _name: DOMString) -> *mut JSObject {
// TODO(ecoal95) we actually do not support extensions.
// `getSupportedExtensions` cannot be implemented as of right now (see #544)
0 as *mut JSObject
}
@ -640,8 +638,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
WebGLProgram::maybe_new(self.global().r(), self.ipc_renderer.clone())
}
// TODO(ecoal95): Check if constants are cross-platform or if we must make a translation
// between WebGL constants and native ones.
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
fn CreateShader(&self, shader_type: u32) -> Option<Root<WebGLShader>> {
WebGLShader::maybe_new(self.global().r(), self.ipc_renderer.clone(), shader_type)
@ -734,8 +730,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
return self.webgl_error(InvalidValue);
}
// TODO ensure a non-null WebGLBuffer must be bound to the ELEMENT_ARRAY_BUFFER
if self.current_program.get().is_none() {
if self.current_program.get().is_none() || self.bound_buffer_element_array.get().is_none() {
return self.webgl_error(InvalidOperation);
}