mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 06:45:23 +00:00
Improve builtin variable detection
This commit is contained in:
parent
f220519e05
commit
3a4c1022f5
@ -114,10 +114,6 @@ fn write_interface_structs(doc: &parse::Spirv, capitalized_ep_name: &str, interf
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if is_builtin(doc, result_type_id) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let (to_write, ignore_first_array) = match storage_class {
|
let (to_write, ignore_first_array) = match storage_class {
|
||||||
&enums::StorageClass::StorageClassInput => (&mut input_elements, ignore_first_array_in),
|
&enums::StorageClass::StorageClassInput => (&mut input_elements, ignore_first_array_in),
|
||||||
&enums::StorageClass::StorageClassOutput => (&mut output_elements, ignore_first_array_out),
|
&enums::StorageClass::StorageClassOutput => (&mut output_elements, ignore_first_array_out),
|
||||||
|
@ -369,6 +369,37 @@ fn is_builtin(doc: &parse::Spirv, id: u32) -> bool {
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
parse::Instruction::MemberDecorate { target_id,
|
||||||
|
decoration: enums::Decoration::DecorationBuiltIn,
|
||||||
|
.. } if target_id == id =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
_ => ()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for instruction in &doc.instructions {
|
||||||
|
match *instruction {
|
||||||
|
parse::Instruction::Variable { result_type_id, result_id, ref storage_class, .. }
|
||||||
|
if result_id == id =>
|
||||||
|
{
|
||||||
|
return is_builtin(doc, result_type_id);
|
||||||
|
},
|
||||||
|
parse::Instruction::TypeArray { result_id, type_id, .. } if result_id == id => {
|
||||||
|
return is_builtin(doc, type_id);
|
||||||
|
},
|
||||||
|
parse::Instruction::TypeRuntimeArray { result_id, type_id } if result_id == id => {
|
||||||
|
return is_builtin(doc, type_id);
|
||||||
|
},
|
||||||
|
parse::Instruction::TypeStruct { result_id, ref member_types } if result_id == id => {
|
||||||
|
for &mem in member_types {
|
||||||
|
if is_builtin(doc, mem) { return true; }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
parse::Instruction::TypePointer { result_id, type_id, .. } if result_id == id => {
|
||||||
|
return is_builtin(doc, type_id);
|
||||||
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user