Skip to content

Commit

Permalink
Add more gl functions (#317)
Browse files Browse the repository at this point in the history
* Add hint(target, mode)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add sample_coverage

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add is_transform_feedback

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_frag_data_location

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add validate_program

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add vertex_attrib_4_{i32, u32}

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_sync_parameter_i32

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_program_validate_status

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_program_parameter_i32

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_sampler_parameter_{i32, f32}

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add invalidate_sub_framebuffer

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_tex_parameter_f32

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_internal_format_i32_slice

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_vertex_attrib_parameter_f32_slice

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_uniform_u32

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix two clippy warnings

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_uniform_indices

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_renderbuffer_parameter_i32

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add get_active_uniforms_parameter

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
  • Loading branch information
sagudev authored Nov 1, 2024
1 parent dc2cfad commit 99aa994
Show file tree
Hide file tree
Showing 3 changed files with 556 additions and 10 deletions.
75 changes: 75 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,16 @@ pub trait HasContext: __private::Sealed {

unsafe fn link_program(&self, program: Self::Program);

unsafe fn validate_program(&self, program: Self::Program);

unsafe fn get_program_completion_status(&self, program: Self::Program) -> bool;

unsafe fn get_program_validate_status(&self, program: Self::Program) -> bool;

unsafe fn get_program_link_status(&self, program: Self::Program) -> bool;

unsafe fn get_program_parameter_i32(&self, program: Self::Program, parameter: u32) -> i32;

unsafe fn get_program_info_log(&self, program: Self::Program) -> String;

unsafe fn get_program_resource_i32(
Expand Down Expand Up @@ -457,6 +463,14 @@ pub trait HasContext: __private::Sealed {

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

#[doc(alias = "GetActiveUniformsiv")]
unsafe fn get_active_uniforms_parameter(
&self,
program: Self::Program,
uniforms: &[u32],
pname: u32,
) -> Vec<i32>;

unsafe fn get_active_uniform(
&self,
program: Self::Program,
Expand Down Expand Up @@ -554,6 +568,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn pixel_store_bool(&self, parameter: u32, value: bool);

unsafe fn get_frag_data_location(&self, program: Self::Program, name: &str) -> i32;

unsafe fn bind_frag_data_location(&self, program: Self::Program, color_number: u32, name: &str);

unsafe fn buffer_data_size(&self, target: u32, size: i32, usage: u32);
Expand Down Expand Up @@ -633,6 +649,9 @@ pub trait HasContext: __private::Sealed {
);

unsafe fn client_wait_sync(&self, fence: Self::Fence, flags: u32, timeout: i32) -> u32;

unsafe fn get_sync_parameter_i32(&self, fence: Self::Fence, parameter: u32) -> i32;

unsafe fn wait_sync(&self, fence: Self::Fence, flags: u32, timeout: u64);

unsafe fn copy_buffer_sub_data(
Expand Down Expand Up @@ -885,6 +904,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_tex_parameter_i32(&self, target: u32, parameter: u32) -> i32;

unsafe fn get_tex_parameter_f32(&self, target: u32, parameter: u32) -> f32;

unsafe fn get_buffer_parameter_i32(&self, target: u32, parameter: u32) -> i32;

#[doc(alias = "glGetBooleanv")]
Expand Down Expand Up @@ -942,6 +963,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_parameter_vertex_array(&self, parameter: u32) -> Option<Self::VertexArray>;

unsafe fn get_renderbuffer_parameter_i32(&self, target: u32, parameter: u32) -> i32;

unsafe fn get_framebuffer_parameter_i32(&self, target: u32, parameter: u32) -> i32;

unsafe fn get_named_framebuffer_parameter_i32(
Expand Down Expand Up @@ -1030,6 +1053,10 @@ pub trait HasContext: __private::Sealed {

unsafe fn sampler_parameter_i32(&self, sampler: Self::Sampler, name: u32, value: i32);

unsafe fn get_sampler_parameter_i32(&self, sampler: Self::Sampler, name: u32) -> i32;

unsafe fn get_sampler_parameter_f32(&self, sampler: Self::Sampler, name: u32) -> f32;

unsafe fn generate_mipmap(&self, target: u32);

unsafe fn generate_texture_mipmap(&self, texture: Self::Texture);
Expand Down Expand Up @@ -1176,6 +1203,13 @@ pub trait HasContext: __private::Sealed {
v: &mut [i32],
);

unsafe fn get_uniform_u32(
&self,
program: Self::Program,
location: &Self::UniformLocation,
v: &mut [u32],
);

unsafe fn get_uniform_f32(
&self,
program: Self::Program,
Expand Down Expand Up @@ -1368,6 +1402,16 @@ pub trait HasContext: __private::Sealed {

unsafe fn invalidate_framebuffer(&self, target: u32, attachments: &[u32]);

unsafe fn invalidate_sub_framebuffer(
&self,
target: u32,
attachments: &[u32],
x: i32,
y: i32,
width: i32,
height: i32,
);

unsafe fn polygon_offset(&self, factor: f32, units: f32);

unsafe fn polygon_mode(&self, face: u32, mode: u32);
Expand Down Expand Up @@ -1542,6 +1586,13 @@ pub trait HasContext: __private::Sealed {

unsafe fn vertex_attrib_divisor(&self, index: u32, divisor: u32);

unsafe fn get_vertex_attrib_parameter_f32_slice(
&self,
index: u32,
pname: u32,
result: &mut [f32],
);

unsafe fn vertex_attrib_pointer_f32(
&self,
index: u32,
Expand Down Expand Up @@ -1603,6 +1654,10 @@ pub trait HasContext: __private::Sealed {

unsafe fn vertex_attrib_4_f32(&self, index: u32, x: f32, y: f32, z: f32, w: f32);

unsafe fn vertex_attrib_4_i32(&self, index: u32, x: i32, y: i32, z: i32, w: i32);

unsafe fn vertex_attrib_4_u32(&self, index: u32, x: u32, y: u32, z: u32, w: u32);

unsafe fn vertex_attrib_1_f32_slice(&self, index: u32, v: &[f32]);

unsafe fn vertex_attrib_2_f32_slice(&self, index: u32, v: &[f32]);
Expand Down Expand Up @@ -1710,6 +1765,12 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_uniform_block_index(&self, program: Self::Program, name: &str) -> Option<u32>;

unsafe fn get_uniform_indices(
&self,
program: Self::Program,
names: &[&str],
) -> Vec<Option<u32>>;

unsafe fn uniform_block_binding(&self, program: Self::Program, index: u32, binding: u32);

unsafe fn get_shader_storage_block_index(
Expand Down Expand Up @@ -1756,6 +1817,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn delete_transform_feedback(&self, transform_feedback: Self::TransformFeedback);

unsafe fn is_transform_feedback(&self, transform_feedback: Self::TransformFeedback) -> bool;

unsafe fn create_transform_feedback(&self) -> Result<Self::TransformFeedback, String>;

unsafe fn bind_transform_feedback(
Expand Down Expand Up @@ -1801,6 +1864,18 @@ pub trait HasContext: __private::Sealed {
);

unsafe fn max_shader_compiler_threads(&self, count: u32);

unsafe fn hint(&self, target: u32, mode: u32);

unsafe fn sample_coverage(&self, value: f32, invert: bool);

unsafe fn get_internal_format_i32_slice(
&self,
target: u32,
internal_format: u32,
pname: u32,
result: &mut [i32],
);
}

pub const ACTIVE_ATOMIC_COUNTER_BUFFERS: u32 = 0x92D9;
Expand Down
Loading

0 comments on commit 99aa994

Please sign in to comment.