From 6c10d5ca75d8d6064fa36c3ec3309fdd54e5f1c7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 17 Sep 2016 12:20:24 +0100 Subject: [PATCH] webgl: Add support for FBO attachments. This allows many FBO tests to start running as their framebuffers start coming back as framebuffer complete. --- components/script/dom/webglframebuffer.rs | 169 +++++++++++++++++- .../script/dom/webglrenderingcontext.rs | 26 +++ .../dom/webidls/WebGLRenderingContext.webidl | 10 +- ...ncorrect-context-object-behaviour.html.ini | 6 - .../conformance/context/methods.html.ini | 12 -- .../misc/bad-arguments-test.html.ini | 12 -- .../conformance/misc/error-reporting.html.ini | 6 - .../misc/object-deletion-behaviour.html.ini | 90 +++++++--- .../more/functions/isTests.html.ini | 5 - .../renderbuffers/feedback-loop.html.ini | 4 +- .../framebuffer-object-attachment.html.ini | 2 +- .../rendering/gl-scissor-fbo-test.html.ini | 1 - .../copy-tex-image-2d-formats.html.ini | 28 ++- .../conformance/textures/mipmap-fbo.html.ini | 1 - .../texture-attachment-formats.html.ini | 7 +- .../texture-copying-feedback-loops.html.ini | 7 +- .../textures/texture-fakeblack.html.ini | 7 +- 17 files changed, 310 insertions(+), 83 deletions(-) delete mode 100644 tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/functions/isTests.html.ini diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index 22749832389..4dddfb047a0 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -4,15 +4,27 @@ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl use canvas_traits::CanvasMsg; +use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::WebGLFramebufferBinding; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; -use dom::bindings::js::Root; +use dom::bindings::js::{HeapGCValue, JS, Root}; use dom::bindings::reflector::reflect_dom_object; use dom::globalscope::GlobalScope; use dom::webglobject::WebGLObject; +use dom::webglrenderbuffer::WebGLRenderbuffer; +use dom::webgltexture::WebGLTexture; use ipc_channel::ipc::{self, IpcSender}; use std::cell::Cell; -use webrender_traits::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId}; +use webrender_traits::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId, WebGLResult, WebGLError}; + +#[must_root] +#[derive(JSTraceable, Clone, HeapSizeOf)] +enum WebGLFramebufferAttachment { + Renderbuffer(JS), + Texture(JS), +} + +impl HeapGCValue for WebGLFramebufferAttachment {} #[dom_struct] pub struct WebGLFramebuffer { @@ -21,8 +33,16 @@ pub struct WebGLFramebuffer { /// target can only be gl::FRAMEBUFFER at the moment target: Cell>, is_deleted: Cell, + status: Cell, #[ignore_heap_size_of = "Defined in ipc-channel"] renderer: IpcSender, + + // The attachment points for textures and renderbuffers on this + // FBO. + color: DOMRefCell>, + depth: DOMRefCell>, + stencil: DOMRefCell>, + depthstencil: DOMRefCell>, } impl WebGLFramebuffer { @@ -35,6 +55,11 @@ impl WebGLFramebuffer { target: Cell::new(None), is_deleted: Cell::new(false), renderer: renderer, + status: Cell::new(constants::FRAMEBUFFER_UNSUPPORTED), + color: DOMRefCell::new(None), + depth: DOMRefCell::new(None), + stencil: DOMRefCell::new(None), + depthstencil: DOMRefCell::new(None), } } @@ -80,10 +105,144 @@ impl WebGLFramebuffer { self.is_deleted.get() } + fn update_status(&self) { + let has_c = self.color.borrow().is_some(); + let has_z = self.depth.borrow().is_some(); + let has_s = self.stencil.borrow().is_some(); + let has_zs = self.depthstencil.borrow().is_some(); + + // From the WebGL spec, 6.6 ("Framebuffer Object Attachments"): + // + // "In the WebGL API, it is an error to concurrently attach + // renderbuffers to the following combinations of + // attachment points: + // + // DEPTH_ATTACHMENT + DEPTH_STENCIL_ATTACHMENT + // STENCIL_ATTACHMENT + DEPTH_STENCIL_ATTACHMENT + // DEPTH_ATTACHMENT + STENCIL_ATTACHMENT + // + // If any of the constraints above are violated, then: + // + // checkFramebufferStatus must return FRAMEBUFFER_UNSUPPORTED." + if (has_zs && (has_z || has_s)) || + (has_z && has_s) { + self.status.set(constants::FRAMEBUFFER_UNSUPPORTED); + return; + } + + if has_c || has_z || has_zs || has_s { + self.status.set(constants::FRAMEBUFFER_COMPLETE); + } else { + self.status.set(constants::FRAMEBUFFER_UNSUPPORTED); + } + } + pub fn check_status(&self) -> u32 { - // Until we build support for attaching renderbuffers or - // textures, all user FBOs are incomplete. - return constants::FRAMEBUFFER_UNSUPPORTED; + return self.status.get(); + } + + pub fn renderbuffer(&self, attachment: u32, rb: Option<&WebGLRenderbuffer>) -> WebGLResult<()> { + let binding = match attachment { + constants::COLOR_ATTACHMENT0 => &self.color, + constants::DEPTH_ATTACHMENT => &self.depth, + constants::STENCIL_ATTACHMENT => &self.stencil, + constants::DEPTH_STENCIL_ATTACHMENT => &self.depthstencil, + _ => return Err(WebGLError::InvalidEnum), + }; + + let rb_id = match rb { + Some(rb) => { + *binding.borrow_mut() = Some(WebGLFramebufferAttachment::Renderbuffer(JS::from_ref(rb))); + Some(rb.id()) + } + + _ => { + *binding.borrow_mut() = None; + None + } + }; + + self.renderer.send(CanvasMsg::WebGL(WebGLCommand::FramebufferRenderbuffer(constants::FRAMEBUFFER, + attachment, + constants::RENDERBUFFER, + rb_id))).unwrap(); + + self.update_status(); + Ok(()) + } + + pub fn texture2d(&self, attachment: u32, textarget: u32, texture: Option<&WebGLTexture>, + level: i32) -> WebGLResult<()> { + let binding = match attachment { + constants::COLOR_ATTACHMENT0 => &self.color, + constants::DEPTH_ATTACHMENT => &self.depth, + constants::STENCIL_ATTACHMENT => &self.stencil, + constants::DEPTH_STENCIL_ATTACHMENT => &self.depthstencil, + _ => return Err(WebGLError::InvalidEnum), + }; + + let tex_id = match texture { + // Note, from the GLES 2.0.25 spec, page 113: + // "If texture is zero, then textarget and level are ignored." + Some(texture) => { + *binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture(JS::from_ref(texture))); + + // From the GLES 2.0.25 spec, page 113: + // + // "level specifies the mipmap level of the texture image + // to be attached to the framebuffer and must be + // 0. Otherwise, INVALID_VALUE is generated." + if level != 0 { + return Err(WebGLError::InvalidValue); + } + + // "If texture is not zero, then texture must either + // name an existing texture object with an target of + // textarget, or texture must name an existing cube + // map texture and textarget must be one of: + // TEXTURE_CUBE_MAP_POSITIVE_X, + // TEXTURE_CUBE_MAP_POSITIVE_Y, + // TEXTURE_CUBE_MAP_POSITIVE_Z, + // TEXTURE_CUBE_MAP_NEGATIVE_X, + // TEXTURE_CUBE_MAP_NEGATIVE_Y, or + // TEXTURE_CUBE_MAP_NEGATIVE_Z. Otherwise, + // INVALID_OPERATION is generated." + let is_cube = match textarget { + constants::TEXTURE_2D => false, + + constants::TEXTURE_CUBE_MAP_POSITIVE_X => true, + constants::TEXTURE_CUBE_MAP_POSITIVE_Y => true, + constants::TEXTURE_CUBE_MAP_POSITIVE_Z => true, + constants::TEXTURE_CUBE_MAP_NEGATIVE_X => true, + constants::TEXTURE_CUBE_MAP_NEGATIVE_Y => true, + constants::TEXTURE_CUBE_MAP_NEGATIVE_Z => true, + + _ => return Err(WebGLError::InvalidEnum), + }; + + match texture.target() { + Some(constants::TEXTURE_CUBE_MAP) if is_cube => {} + Some(_) if !is_cube => {} + _ => return Err(WebGLError::InvalidOperation), + } + + Some(texture.id()) + } + + _ => { + *binding.borrow_mut() = None; + None + } + }; + + self.renderer.send(CanvasMsg::WebGL(WebGLCommand::FramebufferTexture2D(constants::FRAMEBUFFER, + attachment, + textarget, + tex_id, + level))).unwrap(); + + self.update_status(); + Ok(()) } pub fn target(&self) -> Option { diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index a40de7da9c8..59f27aa3139 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -2602,6 +2602,32 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // FIXME: We need to clear the renderbuffer before it can be // accessed. See https://github.com/servo/servo/issues/13710 } + + fn FramebufferRenderbuffer(&self, target: u32, attachment: u32, + renderbuffertarget: u32, + rb: Option<&WebGLRenderbuffer>) { + if target != constants::FRAMEBUFFER || renderbuffertarget != constants::RENDERBUFFER { + return self.webgl_error(InvalidEnum); + } + + match self.bound_framebuffer.get() { + Some(fb) => handle_potential_webgl_error!(self, fb.renderbuffer(attachment, rb)), + None => self.webgl_error(InvalidOperation), + }; + } + + fn FramebufferTexture2D(&self, target: u32, attachment: u32, + textarget: u32, texture: Option<&WebGLTexture>, + level: i32) { + if target != constants::FRAMEBUFFER { + return self.webgl_error(InvalidEnum); + } + + match self.bound_framebuffer.get() { + Some(fb) => handle_potential_webgl_error!(self, fb.texture2d(attachment, textarget, texture, level)), + None => self.webgl_error(InvalidOperation), + }; + } } pub trait LayoutCanvasWebGLRenderingContextHelpers { diff --git a/components/script/dom/webidls/WebGLRenderingContext.webidl b/components/script/dom/webidls/WebGLRenderingContext.webidl index 913eb644545..3f20d89ce96 100644 --- a/components/script/dom/webidls/WebGLRenderingContext.webidl +++ b/components/script/dom/webidls/WebGLRenderingContext.webidl @@ -566,11 +566,11 @@ interface WebGLRenderingContextBase void enableVertexAttribArray(GLuint index); void finish(); void flush(); - //void framebufferRenderbuffer(GLenum target, GLenum attachment, - // GLenum renderbuffertarget, - // WebGLRenderbuffer? renderbuffer); - //void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, - // WebGLTexture? texture, GLint level); + void framebufferRenderbuffer(GLenum target, GLenum attachment, + GLenum renderbuffertarget, + WebGLRenderbuffer? renderbuffer); + void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, + WebGLTexture? texture, GLint level); void frontFace(GLenum mode); void generateMipmap(GLenum target); diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/incorrect-context-object-behaviour.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/incorrect-context-object-behaviour.html.ini index e23f84f8b5b..fc8454c9dcd 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/incorrect-context-object-behaviour.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/incorrect-context-object-behaviour.html.ini @@ -32,12 +32,6 @@ [WebGL test #12: getError expected: INVALID_OPERATION. Was NO_ERROR : after evaluating: contextA.bindTexture(contextA.TEXTURE_2D, textureB)] expected: FAIL - [WebGL test #13: contextA.framebufferRenderbuffer(contextA.FRAMEBUFFER, contextA.DEPTH_ATTACHMENT, contextA.RENDERBUFFER, renderBufferB) threw exception TypeError: contextA.framebufferRenderbuffer is not a function] - expected: FAIL - - [WebGL test #14: contextA.framebufferTexture2D(contextA.FRAMEBUFFER, contextA.COLOR_ATTACHMENT0, contextA.TEXTURE_2D, textureB, 0) threw exception TypeError: contextA.framebufferTexture2D is not a function] - expected: FAIL - [WebGL test #15: getError expected: INVALID_OPERATION. Was INVALID_ENUM : after evaluating: contextA.getProgramParameter(programB, 0)] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/methods.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/methods.html.ini index 6b1b2a64df3..9bdfbe5b6e0 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/methods.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/context/methods.html.ini @@ -20,12 +20,6 @@ [WebGL test #6: Property either does not exist or is not a function: flush] expected: FAIL - [WebGL test #7: Property either does not exist or is not a function: framebufferRenderbuffer] - expected: FAIL - - [WebGL test #8: Property either does not exist or is not a function: framebufferTexture2D] - expected: FAIL - [WebGL test #9: Property either does not exist or is not a function: generateMipmap] expected: FAIL @@ -161,12 +155,6 @@ [WebGL test #3: Property either does not exist or is not a function: disableVertexAttribArray] expected: FAIL - [WebGL test #4: Property either does not exist or is not a function: framebufferRenderbuffer] - expected: FAIL - - [WebGL test #5: Property either does not exist or is not a function: framebufferTexture2D] - expected: FAIL - [WebGL test #6: Property either does not exist or is not a function: getActiveAttrib] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/bad-arguments-test.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/bad-arguments-test.html.ini index 96ffe85122a..814488f2b9a 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/bad-arguments-test.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/bad-arguments-test.html.ini @@ -6,12 +6,6 @@ [WebGL test #60: context.detachShader(argument, shader) should be undefined. Threw exception TypeError: context.detachShader is not a function] expected: FAIL - [WebGL test #68: context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, argument) should be undefined. Threw exception TypeError: context.framebufferRenderbuffer is not a function] - expected: FAIL - - [WebGL test #69: context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, argument, 0) should be undefined. Threw exception TypeError: context.framebufferTexture2D is not a function] - expected: FAIL - [WebGL test #70: context.uniform2fv(argument, new Float32Array([0.0, 0.0\])) should be undefined. Threw exception TypeError: context.uniform2fv is not a function] expected: FAIL @@ -36,12 +30,6 @@ [WebGL test #86: context.detachShader(argument, shader) should be undefined. Threw exception TypeError: context.detachShader is not a function] expected: FAIL - [WebGL test #94: context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, argument) should be undefined. Threw exception TypeError: context.framebufferRenderbuffer is not a function] - expected: FAIL - - [WebGL test #95: context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, argument, 0) should be undefined. Threw exception TypeError: context.framebufferTexture2D is not a function] - expected: FAIL - [WebGL test #96: context.uniform2fv(argument, new Float32Array([0.0, 0.0\])) should be undefined. Threw exception TypeError: context.uniform2fv is not a function] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/error-reporting.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/error-reporting.html.ini index ce51d383e89..da28ac25155 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/error-reporting.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/error-reporting.html.ini @@ -24,15 +24,9 @@ [WebGL test #11: getError expected: INVALID_VALUE. Was NO_ERROR : ] expected: FAIL - [WebGL test #15: context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, null) should be undefined. Threw exception TypeError: context.framebufferRenderbuffer is not a function] - expected: FAIL - [WebGL test #16: getError expected: INVALID_OPERATION. Was NO_ERROR : ] expected: FAIL - [WebGL test #18: context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, null, 0) should be undefined. Threw exception TypeError: context.framebufferTexture2D is not a function] - expected: FAIL - [WebGL test #19: getError expected: INVALID_OPERATION. Was NO_ERROR : ] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/object-deletion-behaviour.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/object-deletion-behaviour.html.ini index d878ff93ddb..70c044382d1 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/object-deletion-behaviour.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/misc/object-deletion-behaviour.html.ini @@ -18,9 +18,6 @@ [WebGL test #21: gl.isShader(fragmentShader) should be false. Threw exception TypeError: gl.isShader is not a function] expected: FAIL - [WebGL test #29: gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0) threw exception TypeError: gl.framebufferTexture2D is not a function] - expected: FAIL - [WebGL test #30: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLTexture\]. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] expected: FAIL @@ -45,9 +42,6 @@ [WebGL test #45: getError expected: NO_ERROR. Was INVALID_OPERATION : after evaluating: gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)] expected: FAIL - [WebGL test #69: gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo) threw exception TypeError: gl.framebufferRenderbuffer is not a function] - expected: FAIL - [WebGL test #70: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer\]. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] expected: FAIL @@ -60,27 +54,12 @@ [WebGL test #74: gl.isRenderbuffer(rbo) should be false. Threw exception TypeError: gl.isRenderbuffer is not a function] expected: FAIL - [WebGL test #85: gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo) threw exception TypeError: gl.framebufferRenderbuffer is not a function] - expected: FAIL - [WebGL test #86: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL [WebGL test #51: getError expected: NO_ERROR. Was INVALID_OPERATION : after evaluating: gl.bindTexture(gl.TEXTURE_2D, t)] expected: FAIL - [WebGL test #89: gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo) threw exception TypeError: gl.framebufferRenderbuffer is not a function] - expected: FAIL - - [WebGL test #94: gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0) threw exception TypeError: gl.framebufferTexture2D is not a function] - expected: FAIL - - [WebGL test #100: gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo) threw exception TypeError: gl.framebufferRenderbuffer is not a function] - expected: FAIL - - [WebGL test #104: gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0) threw exception TypeError: gl.framebufferTexture2D is not a function] - expected: FAIL - [WebGL test #113: gl.getParameter(gl.ARRAY_BUFFER_BINDING) should be null. Was [object WebGLBuffer\].] expected: FAIL @@ -117,9 +96,72 @@ [WebGL test #156: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)] expected: FAIL - [WebGL test #172: gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo) threw exception TypeError: gl.framebufferRenderbuffer is not a function] - expected: FAIL - [WebGL test #161: getError expected: NO_ERROR. Was INVALID_OPERATION : after evaluating: gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)] expected: FAIL + [WebGL test #114: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer\]. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] + expected: FAIL + + [WebGL test #115: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer\]. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] + expected: FAIL + + [WebGL test #118: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 0. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] + expected: FAIL + + [WebGL test #119: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 0. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] + expected: FAIL + + [WebGL test #120: gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36053. Was 36061.] + expected: FAIL + + [WebGL test #121: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer\]. Threw exception TypeError: gl.getFramebufferAttachmentParameter is not a function] + expected: FAIL + + [WebGL test #145: gl.getParameter(gl.ARRAY_BUFFER_BINDING) should be null. Was [object WebGLBuffer\].] + expected: FAIL + + [WebGL test #154: gl.getParameter(gl.ARRAY_BUFFER_BINDING) should be null. Was [object WebGLBuffer\].] + expected: FAIL + + [WebGL test #162: gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING) should be null. Was [object WebGLBuffer\].] + expected: FAIL + + [WebGL test #165: gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW) threw exception TypeError: Value is not an object.] + expected: FAIL + + [WebGL test #168: gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW) threw exception TypeError: Value is not an object.] + expected: FAIL + + [WebGL test #179: gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.] + expected: FAIL + + [WebGL test #180: gl.getVertexAttrib(2, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.] + expected: FAIL + + [WebGL test #181: gl.getVertexAttrib(3, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.] + expected: FAIL + + [WebGL test #182: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.deleteBuffer(b2);] + expected: FAIL + + [WebGL test #183: gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.] + expected: FAIL + + [WebGL test #186: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.deleteBuffer(b1);] + expected: FAIL + + [WebGL test #188: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)] + expected: FAIL + + [WebGL test #193: getError expected: NO_ERROR. Was INVALID_OPERATION : after evaluating: gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)] + expected: FAIL + + [WebGL test #216: at (0, 0) expected: 255,0,0,255 was 0,0,0,0] + expected: FAIL + + [WebGL test #224: at (16, 0) expected: 0,255,0,255 was 0,0,0,0] + expected: FAIL + + [WebGL test #227: at (0, 0) expected: 0,255,0,255 was 255,0,0,255] + expected: FAIL + diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/functions/isTests.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/functions/isTests.html.ini deleted file mode 100644 index 7d7b9a8f4d0..00000000000 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/functions/isTests.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[isTests.html] - type: testharness - [WebGL test #0: testIs] - expected: FAIL - diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/feedback-loop.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/feedback-loop.html.ini index 67298025ed2..76ecfa152bc 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/feedback-loop.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/feedback-loop.html.ini @@ -1,9 +1,11 @@ [feedback-loop.html] type: testharness - expected: ERROR [WebGL test #0: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL [WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL + [WebGL test #3: getError expected: INVALID_OPERATION. Was NO_ERROR : after draw with invalid feedback loop] + expected: FAIL + diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html.ini index 1ebc4ac1066..07b83234bcd 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html.ini @@ -1,6 +1,6 @@ [framebuffer-object-attachment.html] type: testharness - expected: ERROR + expected: CRASH [WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/rendering/gl-scissor-fbo-test.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/rendering/gl-scissor-fbo-test.html.ini index ad1a5ccb284..c46acd960cd 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/rendering/gl-scissor-fbo-test.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/rendering/gl-scissor-fbo-test.html.ini @@ -1,6 +1,5 @@ [gl-scissor-fbo-test.html] type: testharness - expected: ERROR [WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/copy-tex-image-2d-formats.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/copy-tex-image-2d-formats.html.ini index a83b26a3250..46c6fe81390 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/copy-tex-image-2d-formats.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/copy-tex-image-2d-formats.html.ini @@ -1,6 +1,32 @@ [copy-tex-image-2d-formats.html] type: testharness - expected: ERROR [WebGL test #16: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL + [WebGL test #16: Creating framebuffer from ALPHA texture succeeded even though it is not a renderable format] + expected: FAIL + + [WebGL test #17: Creating framebuffer from LUMINANCE texture succeeded even though it is not a renderable format] + expected: FAIL + + [WebGL test #18: Creating framebuffer from LUMINANCE_ALPHA texture succeeded even though it is not a renderable format] + expected: FAIL + + [WebGL test #19: getError expected: INVALID_OPERATION. Was NO_ERROR : should not be able to copyTexImage2D ALPHA from RGB] + expected: FAIL + + [WebGL test #23: getError expected: INVALID_OPERATION. Was NO_ERROR : should not be able to copyTexImage2D LUMINANCE_ALPHA from RGB] + expected: FAIL + + [WebGL test #27: getError expected: INVALID_OPERATION. Was NO_ERROR : should not be able to copyTexImage2D RGBA from RGB] + expected: FAIL + + [WebGL test #44: getError expected: INVALID_OPERATION. Was NO_ERROR : should not be able to copyTexImage2D ALPHA from RGB] + expected: FAIL + + [WebGL test #48: getError expected: INVALID_OPERATION. Was NO_ERROR : should not be able to copyTexImage2D LUMINANCE_ALPHA from RGB] + expected: FAIL + + [WebGL test #52: getError expected: INVALID_OPERATION. Was NO_ERROR : should not be able to copyTexImage2D RGBA from RGB] + expected: FAIL + diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/mipmap-fbo.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/mipmap-fbo.html.ini index f32f3f19116..26d0b6d0615 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/mipmap-fbo.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/mipmap-fbo.html.ini @@ -1,6 +1,5 @@ [mipmap-fbo.html] type: testharness - expected: ERROR [WebGL test #0: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-attachment-formats.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-attachment-formats.html.ini index 57049ef8261..6ea96be3e18 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-attachment-formats.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-attachment-formats.html.ini @@ -1,6 +1,5 @@ [texture-attachment-formats.html] type: testharness - expected: ERROR [WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL @@ -10,3 +9,9 @@ [WebGL test #1: context does not exist] expected: FAIL + [WebGL test #14: at (0, 0) expected: 63,63,63,255 was 64,0,0,255] + expected: FAIL + + [WebGL test #16: at (0, 0) expected: 63,63,63,63 was 64,0,0,64] + expected: FAIL + diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-copying-feedback-loops.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-copying-feedback-loops.html.ini index bf07713d84b..d6cc3560606 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-copying-feedback-loops.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-copying-feedback-loops.html.ini @@ -1,6 +1,11 @@ [texture-copying-feedback-loops.html] type: testharness - expected: ERROR [WebGL test #0: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL + [WebGL test #3: getError expected: INVALID_OPERATION. Was NO_ERROR : after copyTexImage2D to same texture same level, invalid feedback loop] + expected: FAIL + + [WebGL test #6: getError expected: INVALID_OPERATION. Was NO_ERROR : after copyTexSubImage2D to same texture same level, invalid feedback loop] + expected: FAIL + diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-fakeblack.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-fakeblack.html.ini index 74d50e4841e..977f4e4481f 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-fakeblack.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/textures/texture-fakeblack.html.ini @@ -1,6 +1,11 @@ [texture-fakeblack.html] type: testharness - expected: ERROR [WebGL test #0: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).] expected: FAIL + [WebGL test #1: at (0, 0) expected: 0,0,0,255 was 255,0,0,255] + expected: FAIL + + [WebGL test #3: at (0, 0) expected: 0,0,0,255 was 255,0,0,255] + expected: FAIL +