Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Four nondescript WebGL improvements #20598

Merged
merged 4 commits into from Apr 10, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Properly check for cubic dimensions in gl.copyTexImage2D

  • Loading branch information
nox committed Apr 9, 2018
commit fcb6d5112e62e74cf224e88d8693dce6983b281e
@@ -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) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.