mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-17 09:22:39 +00:00
[hlsl-out] basic support for pointer arguments
This commit is contained in:
parent
1907a92928
commit
e59582469c
@ -760,7 +760,16 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
|
||||
back::FunctionType::Function(handle) => {
|
||||
for (index, arg) in func.arguments.iter().enumerate() {
|
||||
// Write argument type
|
||||
self.write_type(module, arg.ty)?;
|
||||
let arg_ty = match module.types[arg.ty].inner {
|
||||
// pointers in function arguments are expected and resolve to `inout`
|
||||
TypeInner::Pointer { base, .. } => {
|
||||
//TODO: can we narrow this down to just `in` when possible?
|
||||
write!(self.out, "inout ")?;
|
||||
base
|
||||
}
|
||||
_ => arg.ty,
|
||||
};
|
||||
self.write_type(module, arg_ty)?;
|
||||
|
||||
let argument_name =
|
||||
&self.names[&NameKey::FunctionArgument(handle, index as u32)];
|
||||
|
Loading…
Reference in New Issue
Block a user