mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
webgl: Add support for checkFramebufferStatus().
For now it's returning the default UNSUPPORTED on user FBOs. object-deletion-behaviour.html starts running a bunch more subtets.
This commit is contained in:
parent
cc0955f12d
commit
8a0ca2efba
6 changed files with 81 additions and 13 deletions
|
@ -2552,6 +2552,23 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
fn TexParameteri(&self, target: u32, name: u32, value: i32) {
|
||||
self.tex_parameter(target, name, TexParameterValue::Int(value))
|
||||
}
|
||||
|
||||
fn CheckFramebufferStatus(&self, target: u32) -> u32 {
|
||||
// From the GLES 2.0.25 spec, 4.4 ("Framebuffer Objects"):
|
||||
//
|
||||
// "If target is not FRAMEBUFFER, INVALID_ENUM is
|
||||
// generated. If CheckFramebufferStatus generates an
|
||||
// error, 0 is returned."
|
||||
if target != constants::FRAMEBUFFER {
|
||||
self.webgl_error(InvalidEnum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
match self.bound_framebuffer.get() {
|
||||
Some(fb) => return fb.check_status(),
|
||||
None => return constants::FRAMEBUFFER_COMPLETE,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait LayoutCanvasWebGLRenderingContextHelpers {
|
||||
|
|
|
@ -501,7 +501,7 @@ interface WebGLRenderingContextBase
|
|||
[Throws]
|
||||
void bufferSubData(GLenum target, GLintptr offset, object? data);
|
||||
|
||||
//[WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
|
||||
[WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
|
||||
void clear(GLbitfield mask);
|
||||
void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void clearDepth(GLclampf depth);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
[index-validation.html]
|
||||
type: testharness
|
||||
[WebGL test #0: gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36053. Threw exception TypeError: gl.checkFramebufferStatus is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #9: getError expected: INVALID_OPERATION. Was NO_ERROR : ]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
type: testharness
|
||||
expected:
|
||||
if os == "mac": CRASH
|
||||
[WebGL test #0: Property either does not exist or is not a function: checkFramebufferStatus]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #1: Property either does not exist or is not a function: copyTexImage2D]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[object-deletion-behaviour.html]
|
||||
type: testharness
|
||||
expected: ERROR
|
||||
[WebGL test #9: gl.isShader(vertexShader) should be true. Threw exception TypeError: gl.isShader is not a function]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -73,3 +72,66 @@
|
|||
[WebGL test #51: getError expected: NO_ERROR. Was INVALID_OPERATION : after evaluating: gl.bindTexture(gl.TEXTURE_2D, t)]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #87: gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16) threw exception TypeError: gl.renderbufferStorage is not a function]
|
||||
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 #98: gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16) threw exception TypeError: gl.renderbufferStorage 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
|
||||
|
||||
[WebGL test #122: gl.getParameter(gl.ARRAY_BUFFER_BINDING) should be null. Was [object WebGLBuffer\].]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #130: gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING) should be null. Was [object WebGLBuffer\].]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #133: gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW) threw exception TypeError: Value is not an object.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #136: gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW) threw exception TypeError: Value is not an object.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #147: gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #148: gl.getVertexAttrib(2, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #149: gl.getVertexAttrib(3, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #150: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.deleteBuffer(b2);]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #151: gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer\]. Was null.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #154: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.deleteBuffer(b1);]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #156: getError expected: NO_ERROR. Was INVALID_ENUM : after evaluating: gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #171: gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16) threw exception TypeError: gl.renderbufferStorage is not a function]
|
||||
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
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[quickCheckAPI-C.html]
|
||||
type: testharness
|
||||
[WebGL test #0: testValidArgs]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue