mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
webgl: Fix filling a non-zero level
You can fill a level > 0 as long as the width and height values are power of two, so the previous test was bogus.
This commit is contained in:
parent
1ad7f73caf
commit
21e2f97cfa
1 changed files with 7 additions and 8 deletions
|
@ -251,13 +251,10 @@ impl WebGLRenderingContext {
|
|||
|
||||
// If an attempt is made to call this function with no
|
||||
// WebGLTexture bound, an INVALID_OPERATION error is generated.
|
||||
let texture = match texture {
|
||||
Some(texture) => texture,
|
||||
None => {
|
||||
self.webgl_error(InvalidOperation);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if texture.is_none() {
|
||||
self.webgl_error(InvalidOperation);
|
||||
return false;
|
||||
}
|
||||
|
||||
// GL_INVALID_ENUM is generated if data_type is not an accepted value.
|
||||
match data_type {
|
||||
|
@ -324,7 +321,9 @@ impl WebGLRenderingContext {
|
|||
|
||||
// GL_INVALID_VALUE is generated if level is greater than zero and the
|
||||
// texture and the texture is not power of two.
|
||||
if level > 0 && !texture.is_power_of_two() {
|
||||
if level > 0 &&
|
||||
(!(width as u32).is_power_of_two() ||
|
||||
!(height as u32).is_power_of_two()) {
|
||||
self.webgl_error(InvalidValue);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue