Struct spirv_cross::spirv::Ast [−][src]
pub struct Ast<TTarget> where
TTarget: Target, { /* fields omitted */ }
An abstract syntax tree that corresponds to a SPIR-V module.
Methods
impl Ast<Target>
[src]
impl Ast<Target>
pub fn build_combined_image_samplers(&mut self) -> Result<(), ErrorCode>
[src]
pub fn build_combined_image_samplers(&mut self) -> Result<(), ErrorCode>
pub fn get_combined_image_samplers(
&mut self
) -> Result<Vec<CombinedImageSampler>, ErrorCode>
[src]
pub fn get_combined_image_samplers(
&mut self
) -> Result<Vec<CombinedImageSampler>, ErrorCode>
impl Ast<Target>
[src]
impl Ast<Target>
pub fn set_root_constant_layout(
&mut self,
layout: Vec<RootConstant>
) -> Result<(), ErrorCode>
[src]
pub fn set_root_constant_layout(
&mut self,
layout: Vec<RootConstant>
) -> Result<(), ErrorCode>
impl<TTarget> Ast<TTarget> where
Self: Parse<TTarget> + Compile<TTarget>,
TTarget: Target,
[src]
impl<TTarget> Ast<TTarget> where
Self: Parse<TTarget> + Compile<TTarget>,
TTarget: Target,
pub fn get_decoration(
&self,
id: u32,
decoration: Decoration
) -> Result<u32, ErrorCode>
[src]
pub fn get_decoration(
&self,
id: u32,
decoration: Decoration
) -> Result<u32, ErrorCode>
Gets a decoration.
pub fn set_name(&mut self, id: u32, name: &str) -> Result<(), ErrorCode>
[src]
pub fn set_name(&mut self, id: u32, name: &str) -> Result<(), ErrorCode>
Sets a name.
pub fn unset_decoration(
&mut self,
id: u32,
decoration: Decoration
) -> Result<(), ErrorCode>
[src]
pub fn unset_decoration(
&mut self,
id: u32,
decoration: Decoration
) -> Result<(), ErrorCode>
Unsets a decoration.
pub fn set_decoration(
&mut self,
id: u32,
decoration: Decoration,
argument: u32
) -> Result<(), ErrorCode>
[src]
pub fn set_decoration(
&mut self,
id: u32,
decoration: Decoration,
argument: u32
) -> Result<(), ErrorCode>
Sets a decoration.
pub fn get_entry_points(&self) -> Result<Vec<EntryPoint>, ErrorCode>
[src]
pub fn get_entry_points(&self) -> Result<Vec<EntryPoint>, ErrorCode>
Gets entry points.
pub fn get_cleansed_entry_point_name(
&self,
entry_point_name: &str,
execution_model: ExecutionModel
) -> Result<String, ErrorCode>
[src]
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.
pub fn get_specialization_constants(
&self
) -> Result<Vec<SpecializationConstant>, ErrorCode>
[src]
pub fn get_specialization_constants(
&self
) -> Result<Vec<SpecializationConstant>, ErrorCode>
Gets all specialization constants.
pub fn set_scalar_constant(
&mut self,
id: u32,
value: u64
) -> Result<(), ErrorCode>
[src]
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.
pub fn get_shader_resources(&self) -> Result<ShaderResources, ErrorCode>
[src]
pub fn get_shader_resources(&self) -> Result<ShaderResources, ErrorCode>
Gets shader resources.
pub fn get_type(&self, id: u32) -> Result<Type, ErrorCode>
[src]
pub fn get_type(&self, id: u32) -> Result<Type, ErrorCode>
Gets the SPIR-V type associated with an ID.
pub fn get_member_name(&self, id: u32, index: u32) -> Result<String, ErrorCode>
[src]
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
.
pub fn get_member_decoration(
&self,
id: u32,
index: u32,
decoration: Decoration
) -> Result<u32, ErrorCode>
[src]
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
.
pub fn set_member_decoration(
&mut self,
id: u32,
index: u32,
decoration: Decoration,
argument: u32
) -> Result<(), ErrorCode>
[src]
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
.
pub fn get_declared_struct_size(&self, id: u32) -> Result<u32, ErrorCode>
[src]
pub fn get_declared_struct_size(&self, id: u32) -> Result<u32, ErrorCode>
Gets the effective size of a buffer block.
pub fn get_declared_struct_member_size(
&self,
id: u32,
index: u32
) -> Result<u32, ErrorCode>
[src]
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.
pub fn rename_interface_variable(
&mut self,
resources: &[Resource],
location: u32,
name: &str
) -> Result<(), ErrorCode>
[src]
pub fn rename_interface_variable(
&mut self,
resources: &[Resource],
location: u32,
name: &str
) -> Result<(), ErrorCode>
Renames an interface variable.
pub fn get_work_group_size_specialization_constants(
&self
) -> Result<WorkGroupSizeSpecializationConstants, ErrorCode>
[src]
pub fn get_work_group_size_specialization_constants(
&self
) -> Result<WorkGroupSizeSpecializationConstants, ErrorCode>
Gets work group size specialization constants.
pub fn parse(module: &Module) -> Result<Self, ErrorCode>
[src]
pub fn parse(module: &Module) -> Result<Self, ErrorCode>
Parses a module into Ast
.
pub fn set_compiler_options(
&mut self,
options: &Self::CompilerOptions
) -> Result<(), ErrorCode>
[src]
pub fn set_compiler_options(
&mut self,
options: &Self::CompilerOptions
) -> Result<(), ErrorCode>
Sets compile options.
pub fn compile(&mut self) -> Result<String, ErrorCode>
[src]
pub fn compile(&mut self) -> Result<String, ErrorCode>
Compiles an abstract syntax tree to a String
in the specified TTarget
language.
Trait Implementations
impl Parse<Target> for Ast<Target>
[src]
impl Parse<Target> for Ast<Target>
impl Compile<Target> for Ast<Target>
[src]
impl Compile<Target> for Ast<Target>
type CompilerOptions = CompilerOptions
fn set_compiler_options(
&mut self,
options: &CompilerOptions
) -> Result<(), ErrorCode>
[src]
fn set_compiler_options(
&mut self,
options: &CompilerOptions
) -> Result<(), ErrorCode>
Set GLSL compiler specific compilation settings.
fn compile(&mut self) -> Result<String, ErrorCode>
[src]
fn compile(&mut self) -> Result<String, ErrorCode>
Generate GLSL shader from the AST.
impl Parse<Target> for Ast<Target>
[src]
impl Parse<Target> for Ast<Target>
impl Compile<Target> for Ast<Target>
[src]
impl Compile<Target> for Ast<Target>
type CompilerOptions = CompilerOptions
fn set_compiler_options(
&mut self,
options: &CompilerOptions
) -> Result<(), ErrorCode>
[src]
fn set_compiler_options(
&mut self,
options: &CompilerOptions
) -> Result<(), ErrorCode>
Set HLSL compiler specific compilation settings.
fn compile(&mut self) -> Result<String, ErrorCode>
[src]
fn compile(&mut self) -> Result<String, ErrorCode>
Generate HLSL shader from the AST.
impl<'a> Parse<Target> for Ast<Target>
[src]
impl<'a> Parse<Target> for Ast<Target>
impl Compile<Target> for Ast<Target>
[src]
impl Compile<Target> for Ast<Target>
type CompilerOptions = CompilerOptions
fn set_compiler_options(
&mut self,
options: &CompilerOptions
) -> Result<(), ErrorCode>
[src]
fn set_compiler_options(
&mut self,
options: &CompilerOptions
) -> Result<(), ErrorCode>
Set MSL compiler specific compilation settings.
fn compile(&mut self) -> Result<String, ErrorCode>
[src]
fn compile(&mut self) -> Result<String, ErrorCode>
Generate MSL shader from the AST.