Skip to content

Commit

Permalink
fix: variable id methods should take impl Into<VariableId>
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Sep 4, 2024
1 parent f5c4a82 commit ed50a6c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spirv-cross2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spirv-cross2"
version = "0.3.0"
version = "0.3.1"
edition = "2021"

license = "MIT OR Apache-2.0"
Expand Down
3 changes: 2 additions & 1 deletion spirv-cross2/src/compile/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ impl Compiler<'_, Glsl> {
/// mixing int and float is not.
///
/// The name of the uniform array will be the same as the interface block name.
pub fn flatten_buffer_block(&mut self, block: Handle<VariableId>) -> error::Result<()> {
pub fn flatten_buffer_block(&mut self, block: impl Into<Handle<VariableId>>) -> error::Result<()> {
let block = block.into();
let block = self.yield_id(block)?;

unsafe { sys::spvc_compiler_flatten_buffer_block(self.ptr.as_ptr(), block).ok(self) }
Expand Down
3 changes: 2 additions & 1 deletion spirv-cross2/src/reflect/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ impl<T> Compiler<'_, T> {
}

/// Get the underlying type of the variable.
pub fn variable_type(&self, variable: Handle<VariableId>) -> error::Result<Handle<TypeId>> {
pub fn variable_type(&self, variable: impl Into<Handle<VariableId>>) -> error::Result<Handle<TypeId>> {
let variable = variable.into();
let variable_id = self.yield_id(variable)?;

unsafe {
Expand Down

0 comments on commit ed50a6c

Please sign in to comment.