mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-21 22:34:43 +00:00
parent
c0379fce96
commit
5ca4805cbf
@ -299,6 +299,11 @@ fn write_interface(interface: &ShaderInterface) -> TokenStream {
|
||||
name,
|
||||
}| {
|
||||
let base_type = format_ident!("{}", format!("{:?}", base_type));
|
||||
let name = if let Some(name) = name {
|
||||
quote! { ::std::option::Option::Some(::std::borrow::Cow::Borrowed(#name)) }
|
||||
} else {
|
||||
quote! { ::std::option::Option::None }
|
||||
};
|
||||
|
||||
quote! {
|
||||
::vulkano::shader::ShaderInterfaceEntry {
|
||||
@ -310,7 +315,7 @@ fn write_interface(interface: &ShaderInterface) -> TokenStream {
|
||||
num_elements: #num_elements,
|
||||
is_64bit: #is_64bit,
|
||||
},
|
||||
name: ::std::option::Option::Some(::std::borrow::Cow::Borrowed(#name)),
|
||||
name: #name,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -264,7 +264,7 @@ fn inspect_entry_point(
|
||||
chain: [fn(&Spirv, Id) -> Option<Id>; N],
|
||||
id: Id,
|
||||
) -> Option<(&mut DescriptorBindingVariable, Option<u32>)> {
|
||||
let id = chain
|
||||
let mut id = chain
|
||||
.into_iter()
|
||||
.try_fold(id, |id, func| func(self.spirv, id))?;
|
||||
|
||||
@ -275,12 +275,11 @@ fn inspect_entry_point(
|
||||
return Some((variable, Some(0)));
|
||||
}
|
||||
|
||||
let (id, indexes) = match *self.spirv.id(id).instruction() {
|
||||
Instruction::AccessChain {
|
||||
while let Instruction::AccessChain {
|
||||
base, ref indexes, ..
|
||||
} => (base, indexes),
|
||||
_ => return None,
|
||||
};
|
||||
} = *self.spirv.id(id).instruction()
|
||||
{
|
||||
id = base;
|
||||
|
||||
if let Some(variable) = self.global.get(&id) {
|
||||
// Variable was accessed with an access chain.
|
||||
@ -294,6 +293,7 @@ fn inspect_entry_point(
|
||||
variable.reqs.stages = self.stage.into();
|
||||
return Some((variable, index));
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user