mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
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:
parent
e1f6dfd716
commit
ced67af6b2
9 changed files with 62 additions and 32 deletions
|
@ -365,6 +365,30 @@ impl WebGLProgram {
|
|||
Ok(location)
|
||||
}
|
||||
|
||||
/// glGetFragDataLocation
|
||||
pub fn get_frag_data_location(&self, name: DOMString) -> WebGLResult<i32> {
|
||||
if !self.is_linked() || self.is_deleted() {
|
||||
return Err(WebGLError::InvalidOperation);
|
||||
}
|
||||
|
||||
if !validate_glsl_name(&name)? {
|
||||
return Ok(-1);
|
||||
}
|
||||
if name.starts_with("gl_") {
|
||||
return Ok(-1);
|
||||
}
|
||||
|
||||
let (sender, receiver) = webgl_channel().unwrap();
|
||||
self.upcast::<WebGLObject>()
|
||||
.context()
|
||||
.send_command(WebGLCommand::GetFragDataLocation(
|
||||
self.id,
|
||||
name.into(),
|
||||
sender,
|
||||
));
|
||||
Ok(receiver.recv().unwrap())
|
||||
}
|
||||
|
||||
/// glGetUniformLocation
|
||||
pub fn get_uniform_location(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue