From 4adb522945ad717645bfc96a1fd60dbd426f1dcb Mon Sep 17 00:00:00 2001 From: chyyran Date: Thu, 22 Feb 2024 01:04:01 -0500 Subject: [PATCH] Add functions from `program_uniform_` --- src/lib.rs | 260 +++++++++++++++++++++++- src/native.rs | 527 ++++++++++++++++++++++++++++++++++++++++++++++++- src/web_sys.rs | 352 +++++++++++++++++++++++++++++++-- 3 files changed, 1120 insertions(+), 19 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 44dbc01..ddf1cfa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,7 +87,7 @@ pub struct ProgramBinary { pub format: u32, } -pub trait HasContext : __private::Sealed { +pub trait HasContext: __private::Sealed { type Shader: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; type Program: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; type Buffer: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; @@ -176,6 +176,264 @@ pub trait HasContext : __private::Sealed { properties: &[u32], ) -> Vec; + unsafe fn program_uniform_1_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + ); + + unsafe fn program_uniform_2_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + y: i32, + ); + + unsafe fn program_uniform_3_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + y: i32, + z: i32, + ); + + unsafe fn program_uniform_4_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + y: i32, + z: i32, + w: i32, + ); + + unsafe fn program_uniform_1_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ); + + unsafe fn program_uniform_2_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ); + + unsafe fn program_uniform_3_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ); + + unsafe fn program_uniform_4_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ); + + unsafe fn program_uniform_1_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + ); + + unsafe fn program_uniform_2_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + y: u32, + ); + + unsafe fn program_uniform_3_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + y: u32, + z: u32, + ); + + unsafe fn program_uniform_4_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + y: u32, + z: u32, + w: u32, + ); + + unsafe fn program_uniform_1_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ); + + unsafe fn program_uniform_2_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ); + + unsafe fn program_uniform_3_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ); + + unsafe fn program_uniform_4_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ); + + unsafe fn program_uniform_1_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + ); + + unsafe fn program_uniform_2_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + y: f32, + ); + + unsafe fn program_uniform_3_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + y: f32, + z: f32, + ); + + unsafe fn program_uniform_4_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + y: f32, + z: f32, + w: f32, + ); + + unsafe fn program_uniform_1_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ); + + unsafe fn program_uniform_2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ); + + unsafe fn program_uniform_3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ); + + unsafe fn program_uniform_4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_2x3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_2x4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_3x2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_3x4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_4x2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_4x3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + + unsafe fn program_uniform_matrix_4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ); + unsafe fn program_binary_retrievable_hint(&self, program: Self::Program, value: bool); unsafe fn get_program_binary(&self, program: Self::Program) -> Option; diff --git a/src/native.rs b/src/native.rs index c4d40f1..bb0046a 100644 --- a/src/native.rs +++ b/src/native.rs @@ -456,6 +456,528 @@ impl HasContext for Context { params } + unsafe fn program_uniform_1_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform1i(program.0.get(), loc.0 as i32, x); + } + } + + unsafe fn program_uniform_2_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + y: i32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform2i(program.0.get(), loc.0 as i32, x, y); + } + } + + unsafe fn program_uniform_3_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + y: i32, + z: i32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform3i(program.0.get(), loc.0 as i32, x, y, z); + } + } + + unsafe fn program_uniform_4_i32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: i32, + y: i32, + z: i32, + w: i32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform4i(program.0.get(), loc.0 as i32, x, y, z, w); + } + } + + unsafe fn program_uniform_1_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform1iv(program.0.get(), loc.0 as i32, v.len() as i32, v.as_ptr()); + } + } + + unsafe fn program_uniform_2_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform2iv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 2, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_3_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform3iv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 3, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_4_i32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[i32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform4iv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 4, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_1_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform1ui(program.0.get(), loc.0 as i32, x); + } + } + + unsafe fn program_uniform_2_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + y: u32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform2ui(program.0.get(), loc.0 as i32, x, y); + } + } + + unsafe fn program_uniform_3_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + y: u32, + z: u32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform3ui(program.0.get(), loc.0 as i32, x, y, z); + } + } + + unsafe fn program_uniform_4_u32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: u32, + y: u32, + z: u32, + w: u32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform4ui(program.0.get(), loc.0 as i32, x, y, z, w); + } + } + + unsafe fn program_uniform_1_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform1uiv(program.0.get(), loc.0 as i32, v.len() as i32, v.as_ptr()); + } + } + + unsafe fn program_uniform_2_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform2uiv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 2, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_3_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform3uiv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 3, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_4_u32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[u32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform4uiv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 4, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_1_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform1f(program.0.get(), loc.0 as i32, x); + } + } + + unsafe fn program_uniform_2_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + y: f32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform2f(program.0.get(), loc.0 as i32, x, y); + } + } + + unsafe fn program_uniform_3_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + y: f32, + z: f32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform3f(program.0.get(), loc.0 as i32, x, y, z); + } + } + + unsafe fn program_uniform_4_f32( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + x: f32, + y: f32, + z: f32, + w: f32, + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform4f(program.0.get(), loc.0 as i32, x, y, z, w); + } + } + + unsafe fn program_uniform_1_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform1fv(program.0.get(), loc.0 as i32, v.len() as i32, v.as_ptr()); + } + } + + unsafe fn program_uniform_2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform2fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 2, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform3fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 3, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniform4fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 4, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix2fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 4, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_2x3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix2x3fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 6, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_2x4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix2x4fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 8, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_3x2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix3x2fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 6, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix3fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 9, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_3x4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix3x4fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 12, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_4x2_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix4x2fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 8, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_4x3_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix4x3fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 12, + transpose as u8, + v.as_ptr(), + ); + } + } + + unsafe fn program_uniform_matrix_4_f32_slice( + &self, + program: Self::Program, + location: Option<&Self::UniformLocation>, + transpose: bool, + v: &[f32], + ) { + let gl = &self.raw; + if let Some(loc) = location { + gl.ProgramUniformMatrix4fv( + program.0.get(), + loc.0 as i32, + v.len() as i32 / 16, + transpose as u8, + v.as_ptr(), + ); + } + } + unsafe fn program_binary_retrievable_hint(&self, program: Self::Program, value: bool) { let gl = &self.raw; gl.ProgramParameteri( @@ -484,10 +1006,7 @@ impl HasContext for Context { ); if gl.GetError() == crate::NO_ERROR { - Some(ProgramBinary { - buffer, - format, - }) + Some(ProgramBinary { buffer, format }) } else { None } diff --git a/src/web_sys.rs b/src/web_sys.rs index 28aa5c9..b2d7d81 100644 --- a/src/web_sys.rs +++ b/src/web_sys.rs @@ -1734,18 +1734,342 @@ impl HasContext for Context { panic!("get_program_resource_i32 not supported on webgl"); } - unsafe fn program_binary_retrievable_hint(&self, program: Self::Program, value: bool) { + unsafe fn program_binary_retrievable_hint(&self, _program: Self::Program, _value: bool) { panic!("Program binaries are not supported"); } - unsafe fn get_program_binary(&self, program: Self::Program) -> Option { + unsafe fn get_program_binary(&self, _program: Self::Program) -> Option { panic!("Program binaries are not supported"); } - unsafe fn program_binary(&self, program: Self::Program, binary: &ProgramBinary) { + unsafe fn program_binary(&self, _program: Self::Program, _binary: &ProgramBinary) { panic!("Program binaries are not supported"); } + unsafe fn program_uniform_1_i32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: i32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_2_i32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: i32, + _y: i32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_3_i32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: i32, + _y: i32, + _z: i32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_4_i32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: i32, + _y: i32, + _z: i32, + _w: i32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_1_i32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[i32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_2_i32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[i32], + ) { + panic!("DSA _program objects are not supported") + } + + unsafe fn program_uniform_3_i32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[i32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_4_i32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[i32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_1_u32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: u32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_2_u32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: u32, + _y: u32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_3_u32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: u32, + _y: u32, + _z: u32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_4_u32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: u32, + _y: u32, + _z: u32, + _w: u32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_1_u32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[u32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_2_u32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[u32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_3_u32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[u32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_4_u32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[u32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_1_f32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: f32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_2_f32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: f32, + _y: f32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_3_f32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: f32, + _y: f32, + _z: f32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_4_f32( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _x: f32, + _y: f32, + _z: f32, + _w: f32, + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_1_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_2_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_3_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_4_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_2_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_2x3_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_2x4_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_3x2_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_3_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_3x4_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_4x2_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_4x3_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + + unsafe fn program_uniform_matrix_4_f32_slice( + &self, + _program: Self::Program, + _location: Option<&Self::UniformLocation>, + _transpose: bool, + _v: &[f32], + ) { + panic!("DSA program objects are not supported") + } + unsafe fn get_active_uniforms(&self, program: Self::Program) -> u32 { let programs = self.programs.borrow(); let raw_program = programs.get_unchecked(program); @@ -3580,7 +3904,7 @@ impl HasContext for Context { v: &[f32], ) { match self.raw { - RawRenderingContext::WebGl1(ref gl) => { + RawRenderingContext::WebGl1(ref _gl) => { panic!("2x3 matrices not supported in uniforms"); } RawRenderingContext::WebGl2(ref gl) => { @@ -3596,7 +3920,7 @@ impl HasContext for Context { v: &[f32], ) { match self.raw { - RawRenderingContext::WebGl1(ref gl) => { + RawRenderingContext::WebGl1(ref _gl) => { panic!("2x4 matrices not supported in uniforms"); } RawRenderingContext::WebGl2(ref gl) => { @@ -3612,7 +3936,7 @@ impl HasContext for Context { v: &[f32], ) { match self.raw { - RawRenderingContext::WebGl1(ref gl) => { + RawRenderingContext::WebGl1(ref _gl) => { panic!("3x2 matrices not supported in uniforms"); } RawRenderingContext::WebGl2(ref gl) => { @@ -3644,7 +3968,7 @@ impl HasContext for Context { v: &[f32], ) { match self.raw { - RawRenderingContext::WebGl1(ref gl) => { + RawRenderingContext::WebGl1(ref _gl) => { panic!("3x4 matrices not supported in uniforms"); } RawRenderingContext::WebGl2(ref gl) => { @@ -3660,7 +3984,7 @@ impl HasContext for Context { v: &[f32], ) { match self.raw { - RawRenderingContext::WebGl1(ref gl) => { + RawRenderingContext::WebGl1(ref _gl) => { panic!("4x2 matrices not supported in uniforms"); } RawRenderingContext::WebGl2(ref gl) => { @@ -3676,7 +4000,7 @@ impl HasContext for Context { v: &[f32], ) { match self.raw { - RawRenderingContext::WebGl1(ref gl) => { + RawRenderingContext::WebGl1(ref _gl) => { panic!("4x3 matrices not supported in uniforms"); } RawRenderingContext::WebGl2(ref gl) => { @@ -4520,7 +4844,7 @@ impl HasContext for Context { panic!("WebGL does not support the KHR_debug extension.") } - unsafe fn debug_message_callback(&mut self, callback: F) + unsafe fn debug_message_callback(&mut self, _callback: F) where F: FnMut(u32, u32, u32, u32, &str) + 'static, { @@ -4732,7 +5056,7 @@ impl HasContext for Context { } } - unsafe fn query_counter(&self, query: Self::Query, target: u32) { + unsafe fn query_counter(&self, _query: Self::Query, _target: u32) { panic!("Query counters are not supported"); } @@ -4751,9 +5075,9 @@ impl HasContext for Context { unsafe fn get_query_parameter_u64_with_offset( &self, - query: Self::Query, - parameter: u32, - offset: usize, + _query: Self::Query, + _parameter: u32, + _offset: usize, ) { panic!("Query buffers are not supported"); }