mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
Properly check for cubic dimensions in gl.copyTexImage2D
This commit is contained in:
parent
68898f4ebd
commit
fcb6d5112e
1 changed files with 7 additions and 7 deletions
|
@ -151,6 +151,13 @@ impl<'a> WebGLValidator for CommonTexImage2DValidator<'a> {
|
|||
}
|
||||
};
|
||||
|
||||
// GL_INVALID_VALUE is generated if target is one of the six cube map 2D
|
||||
// image targets and the width and height parameters are not equal.
|
||||
if target.is_cubic() && self.width != self.height {
|
||||
self.context.webgl_error(InvalidValue);
|
||||
return Err(TexImageValidationError::InvalidCubicTextureDimensions);
|
||||
}
|
||||
|
||||
// GL_INVALID_VALUE is generated if level is less than 0.
|
||||
if self.level < 0 {
|
||||
self.context.webgl_error(InvalidValue);
|
||||
|
@ -287,13 +294,6 @@ impl<'a> WebGLValidator for TexImage2DValidator<'a> {
|
|||
border,
|
||||
} = self.common_validator.validate()?;
|
||||
|
||||
// GL_INVALID_VALUE is generated if target is one of the six cube map 2D
|
||||
// image targets and the width and height parameters are not equal.
|
||||
if target.is_cubic() && width != height {
|
||||
context.webgl_error(InvalidValue);
|
||||
return Err(TexImageValidationError::InvalidCubicTextureDimensions);
|
||||
}
|
||||
|
||||
// GL_INVALID_ENUM is generated if format or data_type is not an
|
||||
// accepted value.
|
||||
let data_type = match TexDataType::from_gl_constant(self.data_type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue