Skip to content

Commit

Permalink
Rename delete_program to delete_shader (add delete_shader, delete_pip…
Browse files Browse the repository at this point in the history
…eline to the metal backend as place holder)
  • Loading branch information
eloraiby authored and not-fl3 committed May 10, 2024
1 parent 4f85ba0 commit 4c588af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ pub trait RenderingBackend {
///
/// There is no protection against using deleted programs later. However its not a CPU-level Porgram and thats why
/// this function is not marked as unsafe
fn delete_program(&mut self, program: ShaderId);
fn delete_shader(&mut self, program: ShaderId);

/// Set a new viewport rectangle.
/// Should be applied after begin_pass.
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ impl RenderingBackend for GlContext {
t.delete();
}

fn delete_program(&mut self, program: ShaderId) {
fn delete_shader(&mut self, program: ShaderId) {
unsafe { glDeleteProgram(self.shaders[program.0].program) };
self.shaders.remove(program.0);
self.cache.cur_pipeline = None;
Expand Down
2 changes: 2 additions & 0 deletions src/graphics/metal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,8 @@ impl RenderingBackend for MetalContext {
}
}

fn delete_shader(&mut self, shader: ShaderId) {}
fn delete_pipeline(&mut self, pipeline: Pipeline) {}
fn commit_frame(&mut self) {
unsafe {
assert!(!self.command_queue.is_null());
Expand Down

0 comments on commit 4c588af

Please sign in to comment.