pub struct Ast<TTarget>where
TTarget: Target,{ /* private fields */ }Expand description
An abstract syntax tree that corresponds to a SPIR-V module.
Implementations§
Source§impl<TTarget> Ast<TTarget>
impl<TTarget> Ast<TTarget>
Sourcepub fn get_decoration(
&self,
id: u32,
decoration: Decoration,
) -> Result<u32, ErrorCode>
pub fn get_decoration( &self, id: u32, decoration: Decoration, ) -> Result<u32, ErrorCode>
Gets a decoration.
Sourcepub fn get_name(&mut self, id: u32) -> Result<String, ErrorCode>
pub fn get_name(&mut self, id: u32) -> Result<String, ErrorCode>
Gets a name. If not defined, an empty string will be returned.
Sourcepub fn set_member_name(
&mut self,
id: u32,
index: u32,
name: &str,
) -> Result<(), ErrorCode>
pub fn set_member_name( &mut self, id: u32, index: u32, name: &str, ) -> Result<(), ErrorCode>
Sets a member name.
Sourcepub fn unset_decoration(
&mut self,
id: u32,
decoration: Decoration,
) -> Result<(), ErrorCode>
pub fn unset_decoration( &mut self, id: u32, decoration: Decoration, ) -> Result<(), ErrorCode>
Unsets a decoration.
Sourcepub fn set_decoration(
&mut self,
id: u32,
decoration: Decoration,
argument: u32,
) -> Result<(), ErrorCode>
pub fn set_decoration( &mut self, id: u32, decoration: Decoration, argument: u32, ) -> Result<(), ErrorCode>
Sets a decoration.
Sourcepub fn get_entry_points(&self) -> Result<Vec<EntryPoint>, ErrorCode>
pub fn get_entry_points(&self) -> Result<Vec<EntryPoint>, ErrorCode>
Gets entry points.
Sourcepub fn get_cleansed_entry_point_name(
&self,
entry_point_name: &str,
execution_model: ExecutionModel,
) -> Result<String, ErrorCode>
pub fn get_cleansed_entry_point_name( &self, entry_point_name: &str, execution_model: ExecutionModel, ) -> Result<String, ErrorCode>
Gets cleansed entry point names. compile must be called first.
Sourcepub fn get_active_buffer_ranges(
&self,
id: u32,
) -> Result<Vec<BufferRange>, ErrorCode>
pub fn get_active_buffer_ranges( &self, id: u32, ) -> Result<Vec<BufferRange>, ErrorCode>
Gets active buffer ragnes. Useful for push constants.
Sourcepub fn get_specialization_constants(
&self,
) -> Result<Vec<SpecializationConstant>, ErrorCode>
pub fn get_specialization_constants( &self, ) -> Result<Vec<SpecializationConstant>, ErrorCode>
Gets all specialization constants.
Sourcepub fn set_scalar_constant(
&mut self,
id: u32,
value: u64,
) -> Result<(), ErrorCode>
pub fn set_scalar_constant( &mut self, id: u32, value: u64, ) -> Result<(), ErrorCode>
Set reference of a scalar constant to a value, overriding the default.
Can be used to override specialization constants.
Sourcepub fn get_shader_resources(&self) -> Result<ShaderResources, ErrorCode>
pub fn get_shader_resources(&self) -> Result<ShaderResources, ErrorCode>
Gets shader resources.
Sourcepub fn get_type(&self, id: u32) -> Result<Type, ErrorCode>
pub fn get_type(&self, id: u32) -> Result<Type, ErrorCode>
Gets the SPIR-V type associated with an ID.
Sourcepub fn get_member_name(&self, id: u32, index: u32) -> Result<String, ErrorCode>
pub fn get_member_name(&self, id: u32, index: u32) -> Result<String, ErrorCode>
Gets the identifier for a member located at index within an OpTypeStruct.
Sourcepub fn get_member_decoration(
&self,
id: u32,
index: u32,
decoration: Decoration,
) -> Result<u32, ErrorCode>
pub fn get_member_decoration( &self, id: u32, index: u32, decoration: Decoration, ) -> Result<u32, ErrorCode>
Gets a decoration for a member located at index within an OpTypeStruct.
Sourcepub fn set_member_decoration(
&mut self,
id: u32,
index: u32,
decoration: Decoration,
argument: u32,
) -> Result<(), ErrorCode>
pub fn set_member_decoration( &mut self, id: u32, index: u32, decoration: Decoration, argument: u32, ) -> Result<(), ErrorCode>
Sets a decoration for a member located at index within an OpTypeStruct.
Sourcepub fn get_declared_struct_size(&self, id: u32) -> Result<u32, ErrorCode>
pub fn get_declared_struct_size(&self, id: u32) -> Result<u32, ErrorCode>
Gets the effective size of a buffer block.
Sourcepub fn get_declared_struct_member_size(
&self,
id: u32,
index: u32,
) -> Result<u32, ErrorCode>
pub fn get_declared_struct_member_size( &self, id: u32, index: u32, ) -> Result<u32, ErrorCode>
Gets the effective size of a buffer block struct member.
Sourcepub fn rename_interface_variable(
&mut self,
resources: &[Resource],
location: u32,
name: &str,
) -> Result<(), ErrorCode>
pub fn rename_interface_variable( &mut self, resources: &[Resource], location: u32, name: &str, ) -> Result<(), ErrorCode>
Renames an interface variable.
Sourcepub fn get_active_interface_variables(
&mut self,
) -> Result<HashSet<u32>, ErrorCode>
pub fn get_active_interface_variables( &mut self, ) -> Result<HashSet<u32>, ErrorCode>
get the active interface variable.
Sourcepub fn get_work_group_size_specialization_constants(
&self,
) -> Result<WorkGroupSizeSpecializationConstants, ErrorCode>
pub fn get_work_group_size_specialization_constants( &self, ) -> Result<WorkGroupSizeSpecializationConstants, ErrorCode>
Gets work group size specialization constants.
Sourcepub fn set_compiler_options(
&mut self,
options: &<Self as Compile<TTarget>>::CompilerOptions,
) -> Result<(), ErrorCode>
pub fn set_compiler_options( &mut self, options: &<Self as Compile<TTarget>>::CompilerOptions, ) -> Result<(), ErrorCode>
Sets compile options.