mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Add GetShaderPrecisionFormat argument validation
This patch adds a check on the shader_type argument. If it is not one either FRAGMENT_SHADER or VERTEX_SHADER, we return INVALID_ENUM.
This commit is contained in:
parent
369983211d
commit
4b5b3c3adb
1 changed files with 8 additions and 0 deletions
|
@ -2588,6 +2588,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
shader_type: u32,
|
shader_type: u32,
|
||||||
precision_type: u32,
|
precision_type: u32,
|
||||||
) -> Option<DomRoot<WebGLShaderPrecisionFormat>> {
|
) -> Option<DomRoot<WebGLShaderPrecisionFormat>> {
|
||||||
|
match shader_type {
|
||||||
|
constants::FRAGMENT_SHADER | constants::VERTEX_SHADER => (),
|
||||||
|
_ => {
|
||||||
|
self.webgl_error(InvalidEnum);
|
||||||
|
return None;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
match precision_type {
|
match precision_type {
|
||||||
constants::LOW_FLOAT |
|
constants::LOW_FLOAT |
|
||||||
constants::MEDIUM_FLOAT |
|
constants::MEDIUM_FLOAT |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue