Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions from glProgramUniform* #283

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 270 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ pub enum CompressedPixelUnpackData<'a> {
Slice(&'a [u8]),
}

pub trait HasContext : __private::Sealed {
pub struct ProgramBinary {
pub buffer: Vec<u8>,
pub format: u32,
}

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;
Expand Down Expand Up @@ -171,6 +176,270 @@ pub trait HasContext : __private::Sealed {
properties: &[u32],
) -> Vec<i32>;

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<ProgramBinary>;

unsafe fn program_binary(&self, program: Self::Program, binary: &ProgramBinary);

unsafe fn get_active_uniforms(&self, program: Self::Program) -> u32;

unsafe fn get_active_uniform(
Expand Down
Loading
Loading