class Compiler
Defined at line 157 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
Protected Members
ParsedIR ir
SmallVector global_variables
SmallVector aliased_variables
SPIRFunction * current_function
SPIRBlock * current_block
uint32_t current_loop_level
unordered_set active_interface_variables
bool check_active_interface_variables
unordered_set invalid_expressions
bool is_force_recompile
bool is_force_recompile_forward_progress
SmallVector combined_image_samplers
SmallVector global_struct_cache
function variable_remap_callback
unordered_set forced_temporaries
unordered_set forwarded_temporaries
unordered_set suppressed_usage_tracking
unordered_set hoisted_temporaries
unordered_set forced_invariant_temporaries
Bitset active_input_builtins
Bitset active_output_builtins
uint32_t clip_distance_count
uint32_t cull_distance_count
bool position_invariant
unordered_set comparison_ids
bool need_subpass_input
bool need_subpass_input_ms
uint32_t dummy_sampler_id
unordered_map function_cfgs
SmallVector physical_storage_non_block_pointer_types
unordered_map physical_storage_type_to_alignment
unordered_set interlocked_resources
bool interlocked_is_complex
unordered_map declared_block_names
Public Methods
void Compiler (std::vector<uint32_t> ir)
The constructor takes a buffer of SPIR-V words and parses it.
It will create its own parser, parse the SPIR-V and move the parsed IR
as if you had called the constructors taking ParsedIR directly.
void Compiler (const uint32_t * ir, size_t word_count)
void Compiler (const ParsedIR & ir)
This is more modular. We can also consume a ParsedIR structure directly, either as a move, or copy.
With copy, we can reuse the same parsed IR for multiple Compiler instances.
void Compiler (ParsedIR && ir)
std::string compile ()
After parsing, API users can modify the SPIR-V via reflection and call this
to disassemble the SPIR-V into the desired langauage.
Sub-classes actually implement this.
const std::string & get_name (ID id)
Gets the identifier (OpName) of an ID. If not defined, an empty string will be returned.
void set_decoration (ID id, spv::Decoration decoration, uint32_t argument)
Applies a decoration to an ID. Effectively injects OpDecorate.
void set_decoration_string (ID id, spv::Decoration decoration, const std::string & argument)
void set_name (ID id, const std::string & name)
Overrides the identifier OpName of an ID.
Identifiers beginning with underscores or identifiers which contain double underscores
are reserved by the implementation.
const Bitset & get_decoration_bitset (ID id)
Gets a bitmask for the decorations which are applied to ID.
I.e. (1ull
<
<
spv::DecorationFoo) | (1ull
<
<
spv::DecorationBar)
bool has_decoration (ID id, spv::Decoration decoration)
Returns whether the decoration has been applied to the ID.
uint32_t get_decoration (ID id, spv::Decoration decoration)
Gets the value for decorations which take arguments.
If the decoration is a boolean (i.e. spv::DecorationNonWritable),
1 will be returned.
If decoration doesn't exist or decoration is not recognized,
0 will be returned.
const std::string & get_decoration_string (ID id, spv::Decoration decoration)
void unset_decoration (ID id, spv::Decoration decoration)
Removes the decoration for an ID.
const SPIRType & get_type (TypeID id)
Gets the SPIR-V type associated with ID.
Mostly used with Resource::type_id and Resource::base_type_id to parse the underlying type of a resource.
const SPIRType & get_type_from_variable (VariableID id)
Gets the SPIR-V type of a variable.
spv::StorageClass get_storage_class (VariableID id)
Gets the underlying storage class for an OpVariable.
const std::string get_fallback_name (ID id)
If get_name() is an empty string, get the fallback name which will be used
instead in the disassembled source.
const std::string get_block_fallback_name (VariableID id)
If get_name() of a Block struct is an empty string, get the fallback name.
This needs to be per-variable as multiple variables can use the same block type.
const std::string & get_member_name (TypeID id, uint32_t index)
Given an OpTypeStruct in ID, obtain the identifier for member number "index".
This may be an empty string.
uint32_t get_member_decoration (TypeID id, uint32_t index, spv::Decoration decoration)
Given an OpTypeStruct in ID, obtain the OpMemberDecoration for member number "index".
const std::string & get_member_decoration_string (TypeID id, uint32_t index, spv::Decoration decoration)
void set_member_name (TypeID id, uint32_t index, const std::string & name)
Sets the member identifier for OpTypeStruct ID, member number "index".
const std::string & get_member_qualified_name (TypeID type_id, uint32_t index)
Returns the qualified member identifier for OpTypeStruct ID, member number "index",
or an empty string if no qualified alias exists
const Bitset & get_member_decoration_bitset (TypeID id, uint32_t index)
Gets the decoration mask for a member of a struct, similar to get_decoration_mask.
bool has_member_decoration (TypeID id, uint32_t index, spv::Decoration decoration)
Returns whether the decoration has been applied to a member of a struct.
void set_member_decoration (TypeID id, uint32_t index, spv::Decoration decoration, uint32_t argument)
Similar to set_decoration, but for struct members.
void set_member_decoration_string (TypeID id, uint32_t index, spv::Decoration decoration, const std::string & argument)
void unset_member_decoration (TypeID id, uint32_t index, spv::Decoration decoration)
Unsets a member decoration, similar to unset_decoration.
SmallVector<BufferRange> get_active_buffer_ranges (VariableID id)
Returns a vector of which members of a struct are potentially in use by a
SPIR-V shader. The granularity of this analysis is per-member of a struct.
This can be used for Buffer (UBO), BufferBlock/StorageBuffer (SSBO) and PushConstant blocks.
ID is the Resource::id obtained from get_shader_resources().
size_t get_declared_struct_size (const SPIRType & struct_type)
Returns the effective size of a buffer block.
size_t get_declared_struct_size_runtime_array (const SPIRType & struct_type, size_t array_size)
Returns the effective size of a buffer block, with a given array size
for a runtime array.
SSBOs are typically declared as runtime arrays. get_declared_struct_size() will return 0 for the size.
This is not very helpful for applications which might need to know the array stride of its last member.
This can be done through the API, but it is not very intuitive how to accomplish this, so here we provide a helper function
to query the size of the buffer, assuming that the last member has a certain size.
If the buffer does not contain a runtime array, array_size is ignored, and the function will behave as
get_declared_struct_size().
To get the array stride of the last member, something like:
get_declared_struct_size_runtime_array(type, 1) - get_declared_struct_size_runtime_array(type, 0) will work.
size_t get_declared_struct_member_size (const SPIRType & struct_type, uint32_t index)
Returns the effective size of a buffer block struct member.
std::unordered_set<VariableID> get_active_interface_variables ()
Returns a set of all global variables which are statically accessed
by the control flow graph from the current entry point.
Only variables which change the interface for a shader are returned, that is,
variables with storage class of Input, Output, Uniform, UniformConstant, PushConstant and AtomicCounter
storage classes are returned.
To use the returned set as the filter for which variables are used during compilation,
this set can be moved to set_enabled_interface_variables().
void set_enabled_interface_variables (std::unordered_set<VariableID> active_variables)
Sets the interface variables which are used during compilation.
By default, all variables are used.
Once set, compile() will only consider the set in active_variables.
ShaderResources get_shader_resources ()
Query shader resources, use ids with reflection interface to modify or query binding points, etc.
ShaderResources get_shader_resources (const std::unordered_set<VariableID> & active_variables)
Query shader resources, but only return the variables which are part of active_variables.
E.g.: get_shader_resources(get_active_variables()) to only return the variables which are statically
accessed.
void set_remapped_variable_state (VariableID id, bool remap_enable)
Remapped variables are considered built-in variables and a backend will
not emit a declaration for this variable.
This is mostly useful for making use of builtins which are dependent on extensions.
bool get_remapped_variable_state (VariableID id)
void set_subpass_input_remapped_components (VariableID id, uint32_t components)
For subpassInput variables which are remapped to plain variables,
the number of components in the remapped
variable must be specified as the backing type of subpass inputs are opaque.
uint32_t get_subpass_input_remapped_components (VariableID id)
SmallVector<EntryPoint> get_entry_points_and_stages ()
New variants of entry point query and reflection.
Names for entry points in the SPIR-V module may alias if they belong to different execution models.
To disambiguate, we must pass along with the entry point names the execution model.
void set_entry_point (const std::string & entry, spv::ExecutionModel execution_model)
void rename_entry_point (const std::string & old_name, const std::string & new_name, spv::ExecutionModel execution_model)
Renames an entry point from old_name to new_name.
If old_name is currently selected as the current entry point, it will continue to be the current entry point,
albeit with a new name.
get_entry_points() is essentially invalidated at this point.
const SPIREntryPoint & get_entry_point (const std::string & name, spv::ExecutionModel execution_model)
SPIREntryPoint & get_entry_point (const std::string & name, spv::ExecutionModel execution_model)
const std::string & get_cleansed_entry_point_name (const std::string & name, spv::ExecutionModel execution_model)
void update_active_builtins ()
Traverses all reachable opcodes and sets active_builtins to a bitmask of all builtin variables which are accessed in the shader.
bool has_active_builtin (spv::BuiltIn builtin, spv::StorageClass storage)
const Bitset & get_execution_mode_bitset ()
Query and modify OpExecutionMode.
void unset_execution_mode (spv::ExecutionMode mode)
void set_execution_mode (spv::ExecutionMode mode, uint32_t arg0, uint32_t arg1, uint32_t arg2)
uint32_t get_execution_mode_argument (spv::ExecutionMode mode, uint32_t index)
Gets argument for an execution mode (LocalSize, Invocations, OutputVertices).
For LocalSize or LocalSizeId, the index argument is used to select the dimension (X = 0, Y = 1, Z = 2).
For execution modes which do not have arguments, 0 is returned.
LocalSizeId query returns an ID. If LocalSizeId execution mode is not used, it returns 0.
LocalSize always returns a literal. If execution mode is LocalSizeId,
the literal (spec constant or not) is still returned.
spv::ExecutionModel get_execution_model ()
bool is_tessellation_shader ()
bool is_tessellating_triangles ()
uint32_t get_work_group_size_specialization_constants (SpecializationConstant & x, SpecializationConstant & y, SpecializationConstant & z)
In SPIR-V, the compute work group size can be represented by a constant vector, in which case
the LocalSize execution mode is ignored.
This constant vector can be a constant vector, specialization constant vector, or partly specialized constant vector.
To modify and query work group dimensions which are specialization constants, SPIRConstant values must be modified
directly via get_constant() rather than using LocalSize directly. This function will return which constants should be modified.
To modify dimensions which are *not* specialization constants, set_execution_mode should be used directly.
Arguments to set_execution_mode which are specialization constants are effectively ignored during compilation.
NOTE: This is somewhat different from how SPIR-V works. In SPIR-V, the constant vector will completely replace LocalSize,
while in this interface, LocalSize is only ignored for specialization constants.
The specialization constant will be written to x, y and z arguments.
If the component is not a specialization constant, a zeroed out struct will be written.
The return value is the constant ID of the builtin WorkGroupSize, but this is not expected to be useful
for most use cases.
If LocalSizeId is used, there is no uvec3 value representing the workgroup size, so the return value is 0,
but x, y and z are written as normal if the components are specialization constants.
VariableID build_dummy_sampler_for_combined_images ()
Analyzes all OpImageFetch (texelFetch) opcodes and checks if there are instances where
said instruction is used without a combined image sampler.
GLSL targets do not support the use of texelFetch without a sampler.
To workaround this, we must inject a dummy sampler which can be used to form a sampler2D at the call-site of
texelFetch as necessary.
This must be called before build_combined_image_samplers().
build_combined_image_samplers() may refer to the ID returned by this method if the returned ID is non-zero.
The return value will be the ID of a sampler object if a dummy sampler is necessary, or 0 if no sampler object
is required.
If the returned ID is non-zero, it can be decorated with set/bindings as desired before calling compile().
Calling this function also invalidates get_active_interface_variables(), so this should be called
before that function.
void build_combined_image_samplers ()
Analyzes all separate image and samplers used from the currently selected entry point,
and re-routes them all to a combined image sampler instead.
This is required to "support" separate image samplers in targets which do not natively support
this feature, like GLSL/ESSL.
This must be called before compile() if such remapping is desired.
This call will add new sampled images to the SPIR-V,
so it will appear in reflection if get_shader_resources() is called after build_combined_image_samplers.
If any image/sampler remapping was found, no separate image/samplers will appear in the decompiled output,
but will still appear in reflection.
The resulting samplers will be void of any decorations like name, descriptor sets and binding points,
so this can be added before compile() if desired.
Combined image samplers originating from this set are always considered active variables.
Arrays of separate samplers are not supported, but arrays of separate images are supported.
Array of images + sampler -> Array of combined image samplers.
SmallVector<SpecializationConstant> get_specialization_constants ()
API for querying which specialization constants exist.
To modify a specialization constant before compile(), use get_constant(constant.id),
then update constants directly in the SPIRConstant data structure.
For composite types, the subconstants can be iterated over and modified.
constant_type is the SPIRType for the specialization constant,
which can be queried to determine which fields in the unions should be poked at.
SPIRConstant & get_constant (ConstantID id)
const SPIRConstant & get_constant (ConstantID id)
uint32_t type_struct_member_offset (const SPIRType & type, uint32_t index)
API for querying buffer objects.
The type passed in here should be the base type of a resource, i.e.
get_type(resource.base_type_id)
as decorations are set in the basic Block type.
The type passed in here must have these decorations set, or an exception is raised.
Only UBOs and SSBOs or sub-structs which are part of these buffer types will have these decorations set.
uint32_t type_struct_member_array_stride (const SPIRType & type, uint32_t index)
uint32_t type_struct_member_matrix_stride (const SPIRType & type, uint32_t index)
bool get_binary_offset_for_decoration (VariableID id, spv::Decoration decoration, uint32_t & word_offset)
Gets the offset in SPIR-V words (uint32_t) for a decoration which was originally declared in the SPIR-V binary.
The offset will point to one or more uint32_t literals which can be modified in-place before using the SPIR-V binary.
Note that adding or removing decorations using the reflection API will not change the behavior of this function.
If the decoration was declared, sets the word_offset to an offset into the provided SPIR-V binary buffer and returns true,
otherwise, returns false.
If the decoration does not have any value attached to it (e.g. DecorationRelaxedPrecision), this function will also return false.
bool buffer_is_hlsl_counter_buffer (VariableID id)
If SPV_GOOGLE_hlsl_functionality1 is used, this can be used even with a stripped SPIR-V module.
Otherwise, this query is purely based on OpName identifiers as found in the SPIR-V module, and will
only return true if OpSource was reported HLSL.
To rely on this functionality, ensure that the SPIR-V module is not stripped.
bool buffer_get_hlsl_counter_buffer (VariableID id, uint32_t & counter_id)
Queries if a buffer object has a neighbor "counter" buffer.
If so, the ID of that counter buffer will be returned in counter_id.
If SPV_GOOGLE_hlsl_functionality1 is used, this can be used even with a stripped SPIR-V module.
Otherwise, this query is purely based on OpName identifiers as found in the SPIR-V module, and will
only return true if OpSource was reported HLSL.
To rely on this functionality, ensure that the SPIR-V module is not stripped.
const SmallVector<spv::Capability> & get_declared_capabilities ()
Gets the list of all SPIR-V Capabilities which were declared in the SPIR-V module.
const SmallVector<std::string> & get_declared_extensions ()
Gets the list of all SPIR-V extensions which were declared in the SPIR-V module.
std::string get_remapped_declared_block_name (VariableID id)
When declaring buffer blocks in GLSL, the name declared in the GLSL source
might not be the same as the name declared in the SPIR-V module due to naming conflicts.
In this case, SPIRV-Cross needs to find a fallback-name, and it might only
be possible to know this name after compiling to GLSL.
This is particularly important for HLSL input and UAVs which tends to reuse the same block type
for multiple distinct blocks. For these cases it is not possible to modify the name of the type itself
because it might be unique. Instead, you can use this interface to check after compilation which
name was actually used if your input SPIR-V tends to have this problem.
For other names like remapped names for variables, etc, it's generally enough to query the name of the variables
after compiling, block names are an exception to this rule.
ID is the name of a variable as returned by Resource::id, and must be a variable with a Block-like type.
This also applies to HLSL cbuffers.
Bitset get_buffer_block_flags (VariableID id)
For buffer block variables, get the decorations for that variable.
Sometimes, decorations for buffer blocks are found in member decorations instead
of direct decorations on the variable itself.
The most common use here is to check if a buffer is readonly or writeonly.
const SmallVector<CombinedImageSampler> & get_combined_image_samplers ()
Gets a remapping for the combined image samplers.
Defined at line 435 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
uint32_t get_current_id_bound ()
Defined at line 464 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
void ~Compiler ()
Defined at line 174 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
const std::string get_fallback_member_name (uint32_t index)
Gets the fallback name for a member, similar to get_fallback_name.
Defined at line 259 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
void set_variable_type_remap_callback (VariableTypeRemapCallback cb)
Set a new variable type remap callback.
The type remapping is designed to allow global interface variable to assume more special types.
A typical example here is to remap sampler2D into samplerExternalOES, which currently isn't supported
directly by SPIR-V.
In compile() while emitting code,
for every variable that is declared, including function parameters, the callback will be called
and the API user has a chance to change the textual representation of the type used to declare the variable.
The API user can detect special patterns in names to guide the remapping.
Defined at line 449 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
bool is_position_invariant ()
Returns whether the position output is invariant
Defined at line 538 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
Protected Methods
template <typename T>
T & get (uint32_t id)
Defined at line 608 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
template <typename T>
const T & get (uint32_t id)
Defined at line 625 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
void add_loop_level ()
uint32_t get_pointee_type_id (uint32_t type_id)
Gets the id of SPIR-V type underlying the given type_id, which might be a pointer.
const SPIRType & get_pointee_type (const SPIRType & type)
Gets the SPIR-V type underlying the given type, which might be a pointer.
const SPIRType & get_pointee_type (uint32_t type_id)
Gets the SPIR-V type underlying the given type_id, which might be a pointer.
uint32_t get_variable_data_type_id (const SPIRVariable & var)
Gets the ID of the SPIR-V type underlying a variable.
SPIRType & get_variable_data_type (const SPIRVariable & var)
Gets the SPIR-V type underlying a variable.
const SPIRType & get_variable_data_type (const SPIRVariable & var)
Gets the SPIR-V type underlying a variable.
SPIRType & get_variable_element_type (const SPIRVariable & var)
Gets the SPIR-V element type underlying an array variable.
const SPIRType & get_variable_element_type (const SPIRVariable & var)
Gets the SPIR-V element type underlying an array variable.
void set_member_qualified_name (uint32_t type_id, uint32_t index, const std::string & name)
Sets the qualified member identifier for OpTypeStruct ID, member number "index".
void set_qualified_name (uint32_t id, const std::string & name)
bool is_sampled_image_type (const SPIRType & type)
Returns if the given type refers to a sampled image.
const SPIREntryPoint & get_entry_point ()
SPIREntryPoint & get_entry_point ()
bool is_tessellation_shader (spv::ExecutionModel model)
std::string to_name (uint32_t id, bool allow_alias)
bool is_builtin_variable (const SPIRVariable & var)
bool is_builtin_type (const SPIRType & type)
bool is_hidden_variable (const SPIRVariable & var, bool include_builtins)
bool is_immutable (uint32_t id)
bool is_member_builtin (const SPIRType & type, uint32_t index, spv::BuiltIn * builtin)
bool is_scalar (const SPIRType & type)
bool is_vector (const SPIRType & type)
bool is_matrix (const SPIRType & type)
bool is_array (const SPIRType & type)
bool is_pointer (const SPIRType & type)
bool is_physical_pointer (const SPIRType & type)
bool is_physical_pointer_to_buffer_block (const SPIRType & type)
bool is_runtime_size_array (const SPIRType & type)
uint32_t expression_type_id (uint32_t id)
const SPIRType & expression_type (uint32_t id)
bool expression_is_lvalue (uint32_t id)
bool variable_storage_is_aliased (const SPIRVariable & var)
SPIRVariable * maybe_get_backing_variable (uint32_t chain)
void register_read (uint32_t expr, uint32_t chain, bool forwarded)
void register_write (uint32_t chain)
void flush_dependees (SPIRVariable & var)
Dependency tracking for temporaries read from variables.
void flush_all_active_variables ()
void flush_control_dependent_expressions (uint32_t block)
void flush_all_atomic_capable_variables ()
void flush_all_aliased_variables ()
void register_global_read_dependencies (const SPIRBlock & func, uint32_t id)
void register_global_read_dependencies (const SPIRFunction & func, uint32_t id)
void update_name_cache (std::unordered_set<std::string> & cache, std::string & name)
void update_name_cache (std::unordered_set<std::string> & cache_primary, const std::unordered_set<std::string> & cache_secondary, std::string & name)
A variant which takes two sets of names. The secondary is only used to verify there are no collisions,
but the set is not updated when we have found a new name.
Used primarily when adding block interface names.
bool function_is_pure (const SPIRFunction & func)
bool block_is_pure (const SPIRBlock & block)
bool function_is_control_dependent (const SPIRFunction & func)
bool block_is_control_dependent (const SPIRBlock & block)
bool execution_is_branchless (const SPIRBlock & from, const SPIRBlock & to)
bool execution_is_direct_branch (const SPIRBlock & from, const SPIRBlock & to)
bool execution_is_noop (const SPIRBlock & from, const SPIRBlock & to)
SPIRBlock::ContinueBlockType continue_block_type (const SPIRBlock & continue_block)
void force_recompile ()
void force_recompile_guarantee_forward_progress ()
void clear_force_recompile ()
bool is_forcing_recompilation ()
bool block_is_noop (const SPIRBlock & block)
bool block_is_loop_candidate (const SPIRBlock & block, SPIRBlock::Method method)
bool types_are_logically_equivalent (const SPIRType & a, const SPIRType & b)
void inherit_expression_dependencies (uint32_t dst, uint32_t source)
void add_implied_read_expression (SPIRExpression & e, uint32_t source)
void add_implied_read_expression (SPIRAccessChain & e, uint32_t source)
void add_active_interface_variable (uint32_t var_id)
bool interface_variable_exists_in_entry_point (uint32_t id)
For proper multiple entry point support, allow querying if an Input or Output
variable is part of that entry points interface.
void set_ir (const ParsedIR & parsed)
void set_ir (ParsedIR && parsed)
void parse_fixup ()
bool traverse_all_reachable_opcodes (const SPIRBlock & block, OpcodeHandler & handler)
bool traverse_all_reachable_opcodes (const SPIRFunction & block, OpcodeHandler & handler)
ShaderResources get_shader_resources (const std::unordered_set<VariableID> * active_variables)
bool get_common_basic_type (const SPIRType & type, SPIRType::BaseType & base_type)
void analyze_parameter_preservation (SPIRFunction & entry, const CFG & cfg, const std::unordered_map<uint32_t, std::unordered_set<uint32_t>> & variable_to_blocks, const std::unordered_map<uint32_t, std::unordered_set<uint32_t>> & complete_write_blocks)
void analyze_image_and_sampler_usage ()
void build_function_control_flow_graphs_and_analyze ()
const CFG & get_cfg_for_current_function ()
const CFG & get_cfg_for_function (uint32_t id)
void analyze_non_block_pointer_types ()
void analyze_variable_scope (SPIRFunction & function, AnalyzeVariableScopeAccessHandler & handler)
void find_function_local_luts (SPIRFunction & function, const AnalyzeVariableScopeAccessHandler & handler, bool single_function)
bool may_read_undefined_variable_in_block (const SPIRBlock & block, uint32_t var)
void analyze_interlocked_resource_usage ()
void make_constant_null (uint32_t id, uint32_t type)
bool instruction_to_result_type (uint32_t & result_type, uint32_t & result_id, spv::Op op, const uint32_t * args, uint32_t length)
Bitset combined_decoration_for_member (const SPIRType & type, uint32_t index)
bool is_desktop_only_format (spv::ImageFormat format)
bool is_depth_image (const SPIRType & type, uint32_t id)
void set_extended_decoration (uint32_t id, ExtendedDecorations decoration, uint32_t value)
uint32_t get_extended_decoration (uint32_t id, ExtendedDecorations decoration)
bool has_extended_decoration (uint32_t id, ExtendedDecorations decoration)
void unset_extended_decoration (uint32_t id, ExtendedDecorations decoration)
void set_extended_member_decoration (uint32_t type, uint32_t index, ExtendedDecorations decoration, uint32_t value)
uint32_t get_extended_member_decoration (uint32_t type, uint32_t index, ExtendedDecorations decoration)
bool has_extended_member_decoration (uint32_t type, uint32_t index, ExtendedDecorations decoration)
void unset_extended_member_decoration (uint32_t type, uint32_t index, ExtendedDecorations decoration)
bool check_internal_recursion (const SPIRType & type, std::unordered_set<uint32_t> & checked_ids)
bool type_contains_recursion (const SPIRType & type)
bool type_is_array_of_pointers (const SPIRType & type)
bool type_is_block_like (const SPIRType & type)
bool type_is_top_level_block (const SPIRType & type)
bool type_is_opaque_value (const SPIRType & type)
bool reflection_ssbo_instance_name_is_significant ()
std::string get_remapped_declared_block_name (uint32_t id, bool fallback_prefer_instance_name)
bool flush_phi_required (BlockID from, BlockID to)
uint32_t evaluate_spec_constant_u32 (const SPIRConstantOp & spec)
uint32_t evaluate_constant_u32 (uint32_t id)
bool is_vertex_like_shader ()
const SmallVector<SPIRBlock::Case> & get_case_list (const SPIRBlock & block)
Get the correct case list for the OpSwitch, since it can be either a
32 bit wide condition or a 64 bit, but the type is not embedded in the
instruction itself.
const uint32_t * stream (const Instruction & instr)
Defined at line 544 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
uint32_t * stream_mutable (const Instruction & instr)
Defined at line 566 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
void set_initializers (SPIRExpression & e)
Defined at line 585 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
template <typename T>
void set_initializers (const T & )
Defined at line 591 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
template <typename T, typename... P>
T & set (uint32_t id, P &&... args)
If our IDs are out of range here as part of opcodes, throw instead of
undefined behavior.
Defined at line 598 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
template <typename T>
T * maybe_get (uint32_t id)
Defined at line 614 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
template <typename T>
const T * maybe_get (uint32_t id)
Defined at line 631 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
bool is_continue (uint32_t next)
Defined at line 699 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
bool is_single_block_loop (uint32_t next)
Defined at line 704 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
bool is_break (uint32_t next)
Defined at line 710 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
bool is_loop_break (uint32_t next)
Defined at line 716 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
bool is_conditional (uint32_t next)
Defined at line 721 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
void remap_variable_type_name (const SPIRType & type, const std::string & var_name, std::string & type_name)
Defined at line 777 of file ../../third_party/spirv-cross/src/spirv_cross.hpp
Records
-
class ActiveBuiltinHandler -
class AnalyzeVariableScopeAccessHandler -
class BufferAccessHandler -
class CFGBuilder -
class CombinedImageSamplerDrefHandler -
class CombinedImageSamplerHandler -
class CombinedImageSamplerUsageHandler -
class DummySamplerForCombinedImageHandler -
class InterfaceVariableAccessHandler -
class InterlockedResourceAccessHandler -
class InterlockedResourceAccessPrepassHandler -
class OpcodeHandler -
class PhysicalBlockMeta -
class PhysicalStorageBufferPointerHandler -
class StaticExpressionAccessHandler
Friends
class DominatorBuilder
class CFG