mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webgl: Add isProgram() support.
There's one failure still, where a deleted program should still be considered to be a program until it's unbound. However, I recently made it so that we unbind at delete time, and we may need to partially back that change out.
This commit is contained in:
parent
1f2346d3b6
commit
847ab63de6
7 changed files with 11 additions and 86 deletions
|
@ -87,6 +87,10 @@ impl WebGLProgram {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_deleted(&self) -> bool {
|
||||
self.is_deleted.get()
|
||||
}
|
||||
|
||||
/// glLinkProgram
|
||||
pub fn link(&self) {
|
||||
self.linked.set(false);
|
||||
|
|
|
@ -1403,6 +1403,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
frame_buffer.map_or(false, |buf| buf.target().is_some() && !buf.is_deleted())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn IsProgram(&self, program: Option<&WebGLProgram>) -> bool {
|
||||
program.map_or(false, |p| !p.is_deleted())
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7
|
||||
fn IsRenderbuffer(&self, render_buffer: Option<&WebGLRenderbuffer>) -> bool {
|
||||
render_buffer.map_or(false, |buf| buf.ever_bound() && !buf.is_deleted())
|
||||
|
|
|
@ -605,7 +605,7 @@ interface WebGLRenderingContextBase
|
|||
[WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer);
|
||||
//[WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap);
|
||||
[WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
|
||||
//[WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
|
||||
[WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
|
||||
[WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
|
||||
[WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
|
||||
[WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
[is-object.html]
|
||||
type: testharness
|
||||
[WebGL test #1: gl.isBuffer(buffer) should be false. Threw exception TypeError: gl.isBuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #3: gl.isBuffer(buffer) should be true. Threw exception TypeError: gl.isBuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #5: gl.isFramebuffer(framebuffer) should be false. Threw exception TypeError: gl.isFramebuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #7: gl.isFramebuffer(framebuffer) should be true. Threw exception TypeError: gl.isFramebuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #9: gl.isRenderbuffer(renderbuffer) should be false. Threw exception TypeError: gl.isRenderbuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #11: gl.isRenderbuffer(renderbuffer) should be true. Threw exception TypeError: gl.isRenderbuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #13: gl.isTexture(texture) should be false. Threw exception TypeError: gl.isTexture is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #15: gl.isTexture(texture) should be true. Threw exception TypeError: gl.isTexture is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #17: gl.isProgram(program) should be true. Threw exception TypeError: gl.isProgram is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #19: gl.isProgram(program) should be false. Threw exception TypeError: gl.isProgram is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #21: gl.isShader(shader) should be true. Threw exception TypeError: gl.isShader is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #23: gl.isShader(shader) should be false. Threw exception TypeError: gl.isShader is not a function]
|
||||
expected: FAIL
|
||||
|
|
@ -14,10 +14,7 @@
|
|||
[WebGL test #14: gl.isShader(fragmentShader) should be true. Threw exception TypeError: gl.isShader is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #17: gl.isProgram(program) should be true. Threw exception TypeError: gl.isProgram is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #20: gl.isProgram(program) should be false. Threw exception TypeError: gl.isProgram is not a function]
|
||||
[WebGL test #17: gl.isProgram(program) should be true. Was false.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #21: gl.isShader(fragmentShader) should be false. Threw exception TypeError: gl.isShader is not a function]
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[quickCheckAPI-B1.html]
|
||||
type: testharness
|
||||
[WebGL test #0: testValidArgs]
|
||||
expected: FAIL
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
[isTestsBadArgs.html]
|
||||
type: testharness
|
||||
[WebGL test #30: gl.isBuffer(null) should be false. Threw exception TypeError: gl.isBuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #31: gl.isBuffer(undefined) should be false. Threw exception TypeError: gl.isBuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #32: gl.isFramebuffer(null) should be false. Threw exception TypeError: gl.isFramebuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #33: gl.isFramebuffer(undefined) should be false. Threw exception TypeError: gl.isFramebuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #34: gl.isProgram(null) should be false. Threw exception TypeError: gl.isProgram is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #35: gl.isProgram(undefined) should be false. Threw exception TypeError: gl.isProgram is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #36: gl.isRenderbuffer(null) should be false. Threw exception TypeError: gl.isRenderbuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #37: gl.isRenderbuffer(undefined) should be false. Threw exception TypeError: gl.isRenderbuffer is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #38: gl.isShader(null) should be false. Threw exception TypeError: gl.isShader is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #39: gl.isShader(undefined) should be false. Threw exception TypeError: gl.isShader is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #40: gl.isTexture(null) should be false. Threw exception TypeError: gl.isTexture is not a function]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #41: gl.isTexture(undefined) should be false. Threw exception TypeError: gl.isTexture is not a function]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue