Skip to content

Commit

Permalink
Make bind_image_texture take Option<Self::Texture>
Browse files Browse the repository at this point in the history
Fix #259

Signed-off-by: sagudev <[email protected]>
  • Loading branch information
sagudev committed Nov 2, 2024
1 parent 721b09e commit 4db959c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ pub trait HasContext: __private::Sealed {
unsafe fn bind_image_texture(
&self,
unit: u32,
texture: Self::Texture,
texture: Option<Self::Texture>,
level: i32,
layered: bool,
layer: i32,
Expand Down
4 changes: 2 additions & 2 deletions src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4275,7 +4275,7 @@ impl HasContext for Context {
unsafe fn bind_image_texture(
&self,
unit: u32,
texture: Self::Texture,
texture: Option<Self::Texture>,
level: i32,
layered: bool,
layer: i32,
Expand All @@ -4285,7 +4285,7 @@ impl HasContext for Context {
let gl = &self.raw;
gl.BindImageTexture(
unit,
texture.0.get(),
texture.map(|tex| tex.0.get()).unwrap_or(0),
level,
layered as u8,
layer,
Expand Down
2 changes: 1 addition & 1 deletion src/web_sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5980,7 +5980,7 @@ impl HasContext for Context {
unsafe fn bind_image_texture(
&self,
_unit: u32,
_texture: Self::Texture,
_texture: Option<Self::Texture>,
_level: i32,
_layered: bool,
_layer: i32,
Expand Down

0 comments on commit 4db959c

Please sign in to comment.