Skip to content

Commit

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

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
  • Loading branch information
sagudev authored Nov 5, 2024
1 parent 62cfeee commit 36dc9f4
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 @@ -1900,7 +1900,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 @@ -4342,7 +4342,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 @@ -4352,7 +4352,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 @@ -6035,7 +6035,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 36dc9f4

Please sign in to comment.