mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webgl: Allow TexImage data argument to be larger than necessary.
texture-size-limit.html is using a large array for all of its calls at various sizes, and we were throwing errors on the calls that should have passed.
This commit is contained in:
parent
62689ba64d
commit
2f68297051
4 changed files with 1164 additions and 1356 deletions
|
@ -2359,7 +2359,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
Some(data) => data,
|
||||
};
|
||||
|
||||
if buff.len() != expected_byte_length as usize {
|
||||
// From the WebGL spec:
|
||||
//
|
||||
// "If pixels is non-null but its size is less than what
|
||||
// is required by the specified width, height, format,
|
||||
// type, and pixel storage parameters, generates an
|
||||
// INVALID_OPERATION error."
|
||||
if buff.len() < expected_byte_length as usize {
|
||||
return Ok(self.webgl_error(InvalidOperation));
|
||||
}
|
||||
|
||||
|
@ -2459,8 +2465,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
Some(data) => data,
|
||||
};
|
||||
|
||||
if expected_byte_length != 0 &&
|
||||
buff.len() != expected_byte_length as usize {
|
||||
// From the WebGL spec:
|
||||
//
|
||||
// "If pixels is non-null but its size is less than what
|
||||
// is required by the specified width, height, format,
|
||||
// type, and pixel storage parameters, generates an
|
||||
// INVALID_OPERATION error."
|
||||
if buff.len() < expected_byte_length as usize {
|
||||
return Ok(self.webgl_error(InvalidOperation));
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
[texture-formats-test.html]
|
||||
type: testharness
|
||||
[WebGL test #1: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #0: Unable to fetch WebGL rendering context for Canvas]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #1: context does not exist]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #77: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with format: RGBA, type: UNSIGNED_SHORT_4_4_4_4 should generate NO_ERROR]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #78: at (0, 0) expected: 0,0,255,255 was 0,255,0,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #79: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with format: RGB, type: UNSIGNED_SHORT_5_6_5 should generate NO_ERROR]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #81: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with format: RGBA, type: UNSIGNED_SHORT_5_5_5_1 should generate NO_ERROR]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #82: at (0, 0) expected: 0,0,255,255 was 0,255,0,255]
|
||||
expected: FAIL
|
||||
|
|
@ -3,33 +3,21 @@
|
|||
[WebGL test #4: at (0, 0) expected: 0,0,0,255 was 192,0,128,64]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #14: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with NPOT texture at level 0 should succeed]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #20: at (0, 0) expected: 192,0,128,255 was 0,0,0,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #26: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with NPOT texture at level 0 should succeed]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #32: at (0, 0) expected: 192,192,192,255 was 0,0,0,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #38: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with NPOT texture at level 0 should succeed]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #44: at (0, 0) expected: 0,0,0,64 was 0,0,0,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #50: getError expected: NO_ERROR. Was INVALID_OPERATION : gl.texImage2D with NPOT texture at level 0 should succeed]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #56: at (0, 0) expected: 192,192,192,64 was 0,0,0,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #64: at (0, 0) expected: 0,0,0,255 was 0,192,128,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #76: at (0, 0) expected: 0,0,0,255 was 0,192,128,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #16: at (0, 0) expected: 0,0,0,255 was 192,0,128,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #28: at (0, 0) expected: 0,0,0,255 was 192,192,192,255]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #40: at (0, 0) expected: 0,0,0,255 was 0,0,0,64]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #52: at (0, 0) expected: 0,0,0,255 was 192,192,192,64]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue