mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Simplify GetShaderPrecisionFormat
This commit is contained in:
parent
7e5160b79e
commit
bdd53f35af
3 changed files with 23 additions and 29 deletions
|
@ -1156,21 +1156,8 @@ impl WebGLImpl {
|
|||
fn shader_precision_format(gl: &gl::Gl,
|
||||
shader_type: u32,
|
||||
precision_type: u32,
|
||||
chan: WebGLSender<WebGLResult<(i32, i32, i32)>>) {
|
||||
let result = match precision_type {
|
||||
gl::LOW_FLOAT |
|
||||
gl::MEDIUM_FLOAT |
|
||||
gl::HIGH_FLOAT |
|
||||
gl::LOW_INT |
|
||||
gl::MEDIUM_INT |
|
||||
gl::HIGH_INT => {
|
||||
Ok(gl.get_shader_precision_format(shader_type, precision_type))
|
||||
},
|
||||
_=> {
|
||||
Err(WebGLError::InvalidEnum)
|
||||
}
|
||||
};
|
||||
|
||||
chan: WebGLSender<(i32, i32, i32)>) {
|
||||
let result = gl.get_shader_precision_format(shader_type, precision_type);
|
||||
chan.send(result).unwrap();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue