aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-04-05 18:01:32 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-04-06 11:22:28 +0200
commite8f19fa7fcf0b51debbd33b0c0cf5f6b2c3bf82d (patch)
treec652eee0078085ae3f246f3c696846517b9335d0
parentac85d1255d1fa714fde05afab85e0480327b713b (diff)
downloadservo-e8f19fa7fcf0b51debbd33b0c0cf5f6b2c3bf82d.tar.gz
servo-e8f19fa7fcf0b51debbd33b0c0cf5f6b2c3bf82d.zip
Properly check the right internal formats in gl.renderbufferStorage
-rw-r--r--components/script/dom/webglrenderbuffer.rs11
-rw-r--r--tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini14
2 files changed, 18 insertions, 7 deletions
diff --git a/components/script/dom/webglrenderbuffer.rs b/components/script/dom/webglrenderbuffer.rs
index feac4eed416..a672f9faa72 100644
--- a/components/script/dom/webglrenderbuffer.rs
+++ b/components/script/dom/webglrenderbuffer.rs
@@ -95,11 +95,14 @@ impl WebGLRenderbuffer {
// validation.
match internal_format {
constants::RGBA4 |
- constants::DEPTH_STENCIL |
+ constants::RGB565 |
+ constants::RGB5_A1 |
constants::DEPTH_COMPONENT16 |
- constants::STENCIL_INDEX8 =>
- self.internal_format.set(Some(internal_format)),
-
+ constants::STENCIL_INDEX8 |
+ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.7
+ constants::DEPTH_STENCIL => {
+ self.internal_format.set(Some(internal_format))
+ }
_ => return Err(WebGLError::InvalidEnum),
};
diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini
index fce3bfa64ff..4d390acaba6 100644
--- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini
+++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini
@@ -1,9 +1,17 @@
[tex-input-validation.html]
type: testharness
- expected: CRASH
- [WebGL test #3: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
+ [WebGL test #34: getError expected: INVALID_OPERATION. Was NO_ERROR : colorBufferFormat: RGB565 internalFormat: RGBA target: TEXTURE_2D border: 0]
expected: FAIL
- [WebGL test #20: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
+ [WebGL test #37: getError expected: NO_ERROR. Was INVALID_OPERATION : colorBufferFormat: RGB565 internalFormat: RGB target: TEXTURE_2D border: 0]
+ expected: FAIL
+
+ [WebGL test #45: getError expected: INVALID_OPERATION. Was NO_ERROR : colorBufferFormat: RGB565 internalFormat: RGBA target: TEXTURE_2D]
+ expected: FAIL
+
+ [WebGL test #53: getError expected: INVALID_OPERATION. Was NO_ERROR : colorBufferFormat: RGB internalFormat: RGBA]
+ expected: FAIL
+
+ [WebGL test #61: getError expected: INVALID_OPERATION. Was NO_ERROR : colorBufferFormat: RGB internalFormat: RGBA]
expected: FAIL