зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #20598 - Four nondescript WebGL improvements (from servo:webgl); r=Manishearth
Source-Repo: https://github.com/servo/servo Source-Revision: ce72e526566de70ed71684ebc39a531f59c92aa5 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 05941bd75cc79e79487600e3a09008ba7dce5c03
This commit is contained in:
Родитель
a0fd02b723
Коммит
8bd15f367b
|
@ -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) {
|
||||
|
|
|
@ -303,10 +303,11 @@ impl WebGLProgram {
|
|||
|
||||
// Check if the name is reserved
|
||||
if name.starts_with("gl_") {
|
||||
return Err(WebGLError::InvalidOperation);
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
if name.starts_with("webgl") || name.starts_with("_webgl_") {
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#GLSL_CONSTRUCTS
|
||||
if name.starts_with("webgl_") || name.starts_with("_webgl_") {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ impl WebGLTexture {
|
|||
let face_count = match target {
|
||||
constants::TEXTURE_2D => 1,
|
||||
constants::TEXTURE_CUBE_MAP => 6,
|
||||
_ => return Err(WebGLError::InvalidOperation)
|
||||
_ => return Err(WebGLError::InvalidEnum)
|
||||
};
|
||||
self.face_count.set(face_count);
|
||||
self.target.set(Some(target));
|
||||
|
|
Загрузка…
Ссылка в новой задаче