Add support for WebGL2 GetFragDataLocation

Adds support for the `GetFragDataLocation` WebGL2 call.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.7
This commit is contained in:
Mátyás Mustoha 2020-03-06 11:42:21 +01:00
parent e1f6dfd716
commit ced67af6b2
9 changed files with 62 additions and 32 deletions

View file

@ -1287,6 +1287,12 @@ impl WebGLImpl {
Self::shader_precision_format(gl, shader_type, precision_type, chan)
},
WebGLCommand::GetExtensions(ref chan) => Self::get_extensions(gl, chan),
WebGLCommand::GetFragDataLocation(program_id, ref name, ref sender) => {
let location =
gl.get_frag_data_location(program_id.get(), &to_name_in_compiled_shader(name));
assert!(location >= 0);
sender.send(location).unwrap();
},
WebGLCommand::GetUniformLocation(program_id, ref name, ref chan) => {
Self::uniform_location(gl, program_id, &name, chan)
},