mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue