RetroArch
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
spirv_cross::Compiler Class Reference

#include <spirv_cross.hpp>

Inheritance diagram for spirv_cross::Compiler:
[legend]
Collaboration diagram for spirv_cross::Compiler:
[legend]

Classes

struct  ActiveBuiltinHandler
 
struct  AnalyzeVariableScopeAccessHandler
 
struct  BufferAccessHandler
 
struct  CFGBuilder
 
struct  CombinedImageSamplerDrefHandler
 
struct  CombinedImageSamplerHandler
 
struct  CombinedImageSamplerUsageHandler
 
struct  DummySamplerForCombinedImageHandler
 
struct  InterfaceVariableAccessHandler
 
struct  OpcodeHandler
 
struct  Source
 
struct  StaticExpressionAccessHandler
 

Public Member Functions

 Compiler (std::vector< uint32_t > ir)
 
 Compiler (const uint32_t *ir, size_t word_count)
 
virtual ~Compiler ()=default
 
virtual std::string compile ()
 
const std::stringget_name (uint32_t id) const
 
void set_decoration (uint32_t id, spv::Decoration decoration, uint32_t argument=0)
 
void set_decoration_string (uint32_t id, spv::Decoration decoration, const std::string &argument)
 
void set_name (uint32_t id, const std::string &name)
 
uint64_t get_decoration_mask (uint32_t id) const
 
const Bitsetget_decoration_bitset (uint32_t id) const
 
bool has_decoration (uint32_t id, spv::Decoration decoration) const
 
uint32_t get_decoration (uint32_t id, spv::Decoration decoration) const
 
const std::stringget_decoration_string (uint32_t id, spv::Decoration decoration) const
 
void unset_decoration (uint32_t id, spv::Decoration decoration)
 
const SPIRTypeget_type (uint32_t id) const
 
const SPIRTypeget_type_from_variable (uint32_t id) const
 
uint32_t get_non_pointer_type_id (uint32_t type_id) const
 
const SPIRTypeget_non_pointer_type (const SPIRType &type) const
 
const SPIRTypeget_non_pointer_type (uint32_t type_id) const
 
spv::StorageClass get_storage_class (uint32_t id) const
 
virtual const std::string get_fallback_name (uint32_t id) const
 
virtual const std::string get_block_fallback_name (uint32_t id) const
 
const std::stringget_member_name (uint32_t id, uint32_t index) const
 
uint32_t get_member_decoration (uint32_t id, uint32_t index, spv::Decoration decoration) const
 
const std::stringget_member_decoration_string (uint32_t id, uint32_t index, spv::Decoration decoration) const
 
void set_member_name (uint32_t id, uint32_t index, const std::string &name)
 
const std::stringget_member_qualified_name (uint32_t type_id, uint32_t index) const
 
void set_member_qualified_name (uint32_t type_id, uint32_t index, const std::string &name)
 
uint64_t get_member_decoration_mask (uint32_t id, uint32_t index) const
 
const Bitsetget_member_decoration_bitset (uint32_t id, uint32_t index) const
 
bool has_member_decoration (uint32_t id, uint32_t index, spv::Decoration decoration) const
 
void set_member_decoration (uint32_t id, uint32_t index, spv::Decoration decoration, uint32_t argument=0)
 
void set_member_decoration_string (uint32_t id, uint32_t index, spv::Decoration decoration, const std::string &argument)
 
void unset_member_decoration (uint32_t id, uint32_t index, spv::Decoration decoration)
 
virtual const std::string get_fallback_member_name (uint32_t index) const
 
std::vector< BufferRangeget_active_buffer_ranges (uint32_t id) const
 
size_t get_declared_struct_size (const SPIRType &struct_type) const
 
virtual size_t get_declared_struct_member_size (const SPIRType &struct_type, uint32_t index) const
 
 SPIRV_CROSS_DEPRECATED ("Please use flatten_buffer_block instead.") void flatten_interface_block(uint32_t id)
 
std::unordered_set< uint32_tget_active_interface_variables () const
 
void set_enabled_interface_variables (std::unordered_set< uint32_t > active_variables)
 
ShaderResources get_shader_resources () const
 
ShaderResources get_shader_resources (const std::unordered_set< uint32_t > &active_variables) const
 
void set_remapped_variable_state (uint32_t id, bool remap_enable)
 
bool get_remapped_variable_state (uint32_t id) const
 
void set_subpass_input_remapped_components (uint32_t id, uint32_t components)
 
uint32_t get_subpass_input_remapped_components (uint32_t id) const
 
std::vector< std::stringget_entry_points () const
 
void set_entry_point (const std::string &name)
 
SPIREntryPointget_entry_point (const std::string &name)
 
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)
 
const SPIREntryPointget_entry_point (const std::string &name, spv::ExecutionModel execution_model) const
 
SPIREntryPointget_entry_point (const std::string &name, spv::ExecutionModel execution_model)
 
const std::stringget_cleansed_entry_point_name (const std::string &name, spv::ExecutionModel execution_model) const
 
uint64_t get_execution_mode_mask () const
 
const Bitsetget_execution_mode_bitset () const
 
void unset_execution_mode (spv::ExecutionMode mode)
 
void set_execution_mode (spv::ExecutionMode mode, uint32_t arg0=0, uint32_t arg1=0, uint32_t arg2=0)
 
uint32_t get_execution_mode_argument (spv::ExecutionMode mode, uint32_t index=0) const
 
spv::ExecutionModel get_execution_model () const
 
uint32_t get_work_group_size_specialization_constants (SpecializationConstant &x, SpecializationConstant &y, SpecializationConstant &z) const
 
uint32_t build_dummy_sampler_for_combined_images ()
 
void build_combined_image_samplers ()
 
const std::vector< CombinedImageSampler > & get_combined_image_samplers () const
 
void set_variable_type_remap_callback (VariableTypeRemapCallback cb)
 
std::vector< SpecializationConstantget_specialization_constants () const
 
SPIRConstantget_constant (uint32_t id)
 
const SPIRConstantget_constant (uint32_t id) const
 
uint32_t get_current_id_bound () const
 
uint32_t type_struct_member_offset (const SPIRType &type, uint32_t index) const
 
uint32_t type_struct_member_array_stride (const SPIRType &type, uint32_t index) const
 
uint32_t type_struct_member_matrix_stride (const SPIRType &type, uint32_t index) const
 
bool get_binary_offset_for_decoration (uint32_t id, spv::Decoration decoration, uint32_t &word_offset) const
 
bool buffer_is_hlsl_counter_buffer (uint32_t id) const
 
bool buffer_get_hlsl_counter_buffer (uint32_t id, uint32_t &counter_id) const
 
const std::vector< spv::Capability > & get_declared_capabilities () const
 
const std::vector< std::string > & get_declared_extensions () const
 
std::string get_remapped_declared_block_name (uint32_t id) const
 
Bitset get_buffer_block_flags (uint32_t id) const
 

Public Attributes

SPIRV_CROSS_DEPRECATED("Please use rename_entry_point(const std::string&, const std::string&, spv::ExecutionModel) instead.") void rename_entry_point(const std const SPIREntryPointget_entry_point (const std::string &name) const
 
SPIRV_CROSS_DEPRECATED("Please use get_cleansed_entry_point_name(const std::string &, spv::ExecutionModel) instead.") const std std::vector< EntryPointget_entry_points_and_stages () const
 

Protected Member Functions

const uint32_tstream (const Instruction &instr) const
 
template<typename T , typename... P>
Tset (uint32_t id, P &&... args)
 
template<typename T >
Tget (uint32_t id)
 
template<typename T >
Tmaybe_get (uint32_t id)
 
template<typename T >
const Tget (uint32_t id) const
 
template<typename T >
const Tmaybe_get (uint32_t id) const
 
const SPIREntryPointget_entry_point () const
 
SPIREntryPointget_entry_point ()
 
virtual std::string to_name (uint32_t id, bool allow_alias=true) const
 
bool is_builtin_variable (const SPIRVariable &var) const
 
bool is_hidden_variable (const SPIRVariable &var, bool include_builtins=false) const
 
bool is_immutable (uint32_t id) const
 
bool is_member_builtin (const SPIRType &type, uint32_t index, spv::BuiltIn *builtin) const
 
bool is_scalar (const SPIRType &type) const
 
bool is_vector (const SPIRType &type) const
 
bool is_matrix (const SPIRType &type) const
 
bool is_array (const SPIRType &type) const
 
uint32_t expression_type_id (uint32_t id) const
 
const SPIRTypeexpression_type (uint32_t id) const
 
bool expression_is_lvalue (uint32_t id) const
 
bool variable_storage_is_aliased (const SPIRVariable &var)
 
SPIRVariablemaybe_get_backing_variable (uint32_t chain)
 
void mark_used_as_array_length (uint32_t id)
 
void register_read (uint32_t expr, uint32_t chain, bool forwarded)
 
void register_write (uint32_t chain)
 
bool is_continue (uint32_t next) const
 
bool is_single_block_loop (uint32_t next) const
 
bool is_break (uint32_t next) const
 
bool is_loop_break (uint32_t next) const
 
bool is_conditional (uint32_t next) const
 
void flush_dependees (SPIRVariable &var)
 
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)
 
bool function_is_pure (const SPIRFunction &func)
 
bool block_is_pure (const SPIRBlock &block)
 
bool block_is_outside_flow_control_from_block (const SPIRBlock &from, const SPIRBlock &to)
 
bool execution_is_branchless (const SPIRBlock &from, const SPIRBlock &to) const
 
bool execution_is_noop (const SPIRBlock &from, const SPIRBlock &to) const
 
SPIRBlock::ContinueBlockType continue_block_type (const SPIRBlock &continue_block) const
 
bool block_is_loop_candidate (const SPIRBlock &block, SPIRBlock::Method method) const
 
uint32_t increase_bound_by (uint32_t incr_amount)
 
bool types_are_logically_equivalent (const SPIRType &a, const SPIRType &b) const
 
void inherit_expression_dependencies (uint32_t dst, uint32_t source)
 
bool interface_variable_exists_in_entry_point (uint32_t id) const
 
void remap_variable_type_name (const SPIRType &type, const std::string &var_name, std::string &type_name) const
 
void parse ()
 
void parse (const Instruction &i)
 
bool traverse_all_reachable_opcodes (const SPIRBlock &block, OpcodeHandler &handler) const
 
bool traverse_all_reachable_opcodes (const SPIRFunction &block, OpcodeHandler &handler) const
 
ShaderResources get_shader_resources (const std::unordered_set< uint32_t > *active_variables) const
 
Bitset get_buffer_block_flags (const SPIRVariable &var) const
 
bool get_common_basic_type (const SPIRType &type, SPIRType::BaseType &base_type)
 
void update_active_builtins ()
 
bool has_active_builtin (spv::BuiltIn builtin, spv::StorageClass storage)
 
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 ()
 
void analyze_variable_scope (SPIRFunction &function, AnalyzeVariableScopeAccessHandler &handler)
 
void find_function_local_luts (SPIRFunction &function, const AnalyzeVariableScopeAccessHandler &handler)
 
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) const
 
bool image_is_comparison (const SPIRType &type, uint32_t id) const
 

Static Protected Member Functions

static bool is_desktop_only_format (spv::ImageFormat format)
 

Protected Attributes

std::vector< uint32_tspirv
 
std::vector< Instructioninst
 
std::vector< Variantids
 
std::vector< Metameta
 
SPIRFunctioncurrent_function = nullptr
 
SPIRBlockcurrent_block = nullptr
 
std::vector< uint32_tglobal_variables
 
std::vector< uint32_taliased_variables
 
std::unordered_set< uint32_tactive_interface_variables
 
bool check_active_interface_variables = false
 
uint32_t entry_point = 0
 
std::unordered_map< uint32_t, SPIREntryPointentry_points
 
struct spirv_cross::Compiler::Source source
 
std::unordered_set< uint32_tloop_blocks
 
std::unordered_set< uint32_tcontinue_blocks
 
std::unordered_set< uint32_tloop_merge_targets
 
std::unordered_set< uint32_tselection_merge_targets
 
std::unordered_set< uint32_tmultiselect_merge_targets
 
std::unordered_map< uint32_t, uint32_tcontinue_block_to_loop_header
 
std::unordered_set< uint32_tinvalid_expressions
 
bool force_recompile = false
 
std::vector< CombinedImageSamplercombined_image_samplers
 
std::vector< uint32_tglobal_struct_cache
 
VariableTypeRemapCallback variable_remap_callback
 
std::unordered_set< uint32_tforced_temporaries
 
std::unordered_set< uint32_tforwarded_temporaries
 
std::unordered_set< uint32_thoisted_temporaries
 
Bitset active_input_builtins
 
Bitset active_output_builtins
 
uint32_t clip_distance_count = 0
 
uint32_t cull_distance_count = 0
 
bool position_invariant = false
 
std::unordered_set< uint32_tcomparison_ids
 
bool need_subpass_input = false
 
uint32_t dummy_sampler_id = 0
 
std::unordered_map< uint32_t, std::unique_ptr< CFG > > function_cfgs
 
std::vector< spv::Capabilitydeclared_capabilities
 
std::vector< std::stringdeclared_extensions
 
std::unordered_map< uint32_t, std::stringdeclared_block_names
 

Private Member Functions

const SPIREntryPointget_first_entry_point (const std::string &name) const
 
SPIREntryPointget_first_entry_point (const std::string &name)
 
void fixup_type_alias ()
 
bool type_is_block_like (const SPIRType &type) const
 

Friends

class CFG
 
class DominatorBuilder
 

Constructor & Destructor Documentation

◆ Compiler() [1/2]

Compiler::Compiler ( std::vector< uint32_t ir)
Here is the call graph for this function:

◆ Compiler() [2/2]

Compiler::Compiler ( const uint32_t ir,
size_t  word_count 
)
Here is the call graph for this function:

◆ ~Compiler()

virtual spirv_cross::Compiler::~Compiler ( )
virtualdefault

Member Function Documentation

◆ analyze_image_and_sampler_usage()

void Compiler::analyze_image_and_sampler_usage ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ analyze_parameter_preservation()

void spirv_cross::Compiler::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 
)
protected
Here is the caller graph for this function:

◆ analyze_variable_scope()

void Compiler::analyze_variable_scope ( SPIRFunction function,
AnalyzeVariableScopeAccessHandler handler 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ block_is_loop_candidate()

bool Compiler::block_is_loop_candidate ( const SPIRBlock block,
SPIRBlock::Method  method 
) const
protected
Here is the call graph for this function:

◆ block_is_outside_flow_control_from_block()

bool Compiler::block_is_outside_flow_control_from_block ( const SPIRBlock from,
const SPIRBlock to 
)
protected
Here is the call graph for this function:

◆ block_is_pure()

bool Compiler::block_is_pure ( const SPIRBlock block)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_get_hlsl_counter_buffer()

bool Compiler::buffer_get_hlsl_counter_buffer ( uint32_t  id,
uint32_t counter_id 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_is_hlsl_counter_buffer()

bool Compiler::buffer_is_hlsl_counter_buffer ( uint32_t  id) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_combined_image_samplers()

void Compiler::build_combined_image_samplers ( )
Here is the call graph for this function:

◆ build_dummy_sampler_for_combined_images()

uint32_t Compiler::build_dummy_sampler_for_combined_images ( )
Here is the call graph for this function:

◆ build_function_control_flow_graphs_and_analyze()

void Compiler::build_function_control_flow_graphs_and_analyze ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ combined_decoration_for_member()

Bitset Compiler::combined_decoration_for_member ( const SPIRType type,
uint32_t  index 
) const
protected

◆ compile()

string Compiler::compile ( )
virtual

◆ continue_block_type()

SPIRBlock::ContinueBlockType Compiler::continue_block_type ( const SPIRBlock continue_block) const
protected
Here is the call graph for this function:

◆ execution_is_branchless()

bool Compiler::execution_is_branchless ( const SPIRBlock from,
const SPIRBlock to 
) const
protected
Here is the caller graph for this function:

◆ execution_is_noop()

bool Compiler::execution_is_noop ( const SPIRBlock from,
const SPIRBlock to 
) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expression_is_lvalue()

bool Compiler::expression_is_lvalue ( uint32_t  id) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expression_type()

const SPIRType & Compiler::expression_type ( uint32_t  id) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expression_type_id()

uint32_t Compiler::expression_type_id ( uint32_t  id) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_function_local_luts()

void Compiler::find_function_local_luts ( SPIRFunction function,
const AnalyzeVariableScopeAccessHandler handler 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fixup_type_alias()

void Compiler::fixup_type_alias ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush_all_active_variables()

void Compiler::flush_all_active_variables ( )
protected
Here is the call graph for this function:

◆ flush_all_aliased_variables()

void Compiler::flush_all_aliased_variables ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush_all_atomic_capable_variables()

void Compiler::flush_all_atomic_capable_variables ( )
protected
Here is the call graph for this function:

◆ flush_control_dependent_expressions()

void Compiler::flush_control_dependent_expressions ( uint32_t  block)
protected
Here is the call graph for this function:

◆ flush_dependees()

void Compiler::flush_dependees ( SPIRVariable var)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ function_is_pure()

bool Compiler::function_is_pure ( const SPIRFunction func)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [1/2]

template<typename T >
T& spirv_cross::Compiler::get ( uint32_t  id)
inlineprotected
Here is the caller graph for this function:

◆ get() [2/2]

template<typename T >
const T& spirv_cross::Compiler::get ( uint32_t  id) const
inlineprotected

◆ get_active_buffer_ranges()

std::vector< BufferRange > Compiler::get_active_buffer_ranges ( uint32_t  id) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_active_interface_variables()

unordered_set< uint32_t > Compiler::get_active_interface_variables ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_binary_offset_for_decoration()

bool Compiler::get_binary_offset_for_decoration ( uint32_t  id,
spv::Decoration  decoration,
uint32_t word_offset 
) const

◆ get_block_fallback_name()

const std::string Compiler::get_block_fallback_name ( uint32_t  id) const
virtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_buffer_block_flags() [1/2]

Bitset Compiler::get_buffer_block_flags ( uint32_t  id) const
Here is the caller graph for this function:

◆ get_buffer_block_flags() [2/2]

Bitset Compiler::get_buffer_block_flags ( const SPIRVariable var) const
protected
Here is the call graph for this function:

◆ get_cleansed_entry_point_name()

const string & Compiler::get_cleansed_entry_point_name ( const std::string name,
spv::ExecutionModel  execution_model 
) const
Here is the call graph for this function:

◆ get_combined_image_samplers()

const std::vector<CombinedImageSampler>& spirv_cross::Compiler::get_combined_image_samplers ( ) const
inline
Here is the caller graph for this function:

◆ get_common_basic_type()

bool Compiler::get_common_basic_type ( const SPIRType type,
SPIRType::BaseType base_type 
)
protected

◆ get_constant() [1/2]

SPIRConstant & Compiler::get_constant ( uint32_t  id)

◆ get_constant() [2/2]

const SPIRConstant & Compiler::get_constant ( uint32_t  id) const

◆ get_current_id_bound()

uint32_t spirv_cross::Compiler::get_current_id_bound ( ) const
inline
Here is the caller graph for this function:

◆ get_declared_capabilities()

const std::vector< spv::Capability > & Compiler::get_declared_capabilities ( ) const
Here is the caller graph for this function:

◆ get_declared_extensions()

const std::vector< std::string > & Compiler::get_declared_extensions ( ) const
Here is the caller graph for this function:

◆ get_declared_struct_member_size()

size_t Compiler::get_declared_struct_member_size ( const SPIRType struct_type,
uint32_t  index 
) const
virtual

Reimplemented in spirv_cross::CompilerMSL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_declared_struct_size()

size_t Compiler::get_declared_struct_size ( const SPIRType struct_type) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_decoration()

uint32_t Compiler::get_decoration ( uint32_t  id,
spv::Decoration  decoration 
) const
Here is the caller graph for this function:

◆ get_decoration_bitset()

const Bitset & Compiler::get_decoration_bitset ( uint32_t  id) const
Here is the caller graph for this function:

◆ get_decoration_mask()

uint64_t Compiler::get_decoration_mask ( uint32_t  id) const
Here is the call graph for this function:

◆ get_decoration_string()

const string & Compiler::get_decoration_string ( uint32_t  id,
spv::Decoration  decoration 
) const

◆ get_entry_point() [1/5]

SPIREntryPoint& spirv_cross::Compiler::get_entry_point ( const std::string name)

◆ get_entry_point() [2/5]

const SPIREntryPoint& spirv_cross::Compiler::get_entry_point ( const std::string name,
spv::ExecutionModel  execution_model 
) const

◆ get_entry_point() [3/5]

SPIREntryPoint& spirv_cross::Compiler::get_entry_point ( const std::string name,
spv::ExecutionModel  execution_model 
)

◆ get_entry_point() [4/5]

const SPIREntryPoint& spirv_cross::Compiler::get_entry_point ( ) const
protected
Here is the caller graph for this function:

◆ get_entry_point() [5/5]

SPIREntryPoint& spirv_cross::Compiler::get_entry_point ( )
protected

◆ get_entry_points()

vector< string > Compiler::get_entry_points ( ) const

◆ get_execution_mode_argument()

uint32_t Compiler::get_execution_mode_argument ( spv::ExecutionMode  mode,
uint32_t  index = 0 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_execution_mode_bitset()

const Bitset & Compiler::get_execution_mode_bitset ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_execution_mode_mask()

uint64_t Compiler::get_execution_mode_mask ( ) const
Here is the call graph for this function:

◆ get_execution_model()

ExecutionModel Compiler::get_execution_model ( ) const
Here is the call graph for this function:

◆ get_fallback_member_name()

virtual const std::string spirv_cross::Compiler::get_fallback_member_name ( uint32_t  index) const
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_fallback_name()

const std::string Compiler::get_fallback_name ( uint32_t  id) const
virtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_first_entry_point() [1/2]

const SPIREntryPoint & Compiler::get_first_entry_point ( const std::string name) const
private
Here is the caller graph for this function:

◆ get_first_entry_point() [2/2]

SPIREntryPoint & Compiler::get_first_entry_point ( const std::string name)
private

◆ get_member_decoration()

uint32_t Compiler::get_member_decoration ( uint32_t  id,
uint32_t  index,
spv::Decoration  decoration 
) const
Here is the caller graph for this function:

◆ get_member_decoration_bitset()

const Bitset & Compiler::get_member_decoration_bitset ( uint32_t  id,
uint32_t  index 
) const
Here is the caller graph for this function:

◆ get_member_decoration_mask()

uint64_t Compiler::get_member_decoration_mask ( uint32_t  id,
uint32_t  index 
) const
Here is the call graph for this function:

◆ get_member_decoration_string()

const std::string& spirv_cross::Compiler::get_member_decoration_string ( uint32_t  id,
uint32_t  index,
spv::Decoration  decoration 
) const

◆ get_member_name()

const std::string & Compiler::get_member_name ( uint32_t  id,
uint32_t  index 
) const
Here is the caller graph for this function:

◆ get_member_qualified_name()

const std::string & Compiler::get_member_qualified_name ( uint32_t  type_id,
uint32_t  index 
) const

◆ get_name()

const std::string & Compiler::get_name ( uint32_t  id) const
Here is the caller graph for this function:

◆ get_non_pointer_type() [1/2]

const SPIRType & Compiler::get_non_pointer_type ( const SPIRType type) const
Here is the caller graph for this function:

◆ get_non_pointer_type() [2/2]

const SPIRType & Compiler::get_non_pointer_type ( uint32_t  type_id) const
Here is the call graph for this function:

◆ get_non_pointer_type_id()

uint32_t Compiler::get_non_pointer_type_id ( uint32_t  type_id) const

◆ get_remapped_declared_block_name()

std::string Compiler::get_remapped_declared_block_name ( uint32_t  id) const
Here is the call graph for this function:

◆ get_remapped_variable_state()

bool Compiler::get_remapped_variable_state ( uint32_t  id) const

◆ get_shader_resources() [1/3]

ShaderResources Compiler::get_shader_resources ( ) const
Here is the caller graph for this function:

◆ get_shader_resources() [2/3]

ShaderResources spirv_cross::Compiler::get_shader_resources ( const std::unordered_set< uint32_t > &  active_variables) const

◆ get_shader_resources() [3/3]

ShaderResources spirv_cross::Compiler::get_shader_resources ( const std::unordered_set< uint32_t > *  active_variables) const
protected

◆ get_specialization_constants()

vector< SpecializationConstant > Compiler::get_specialization_constants ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_storage_class()

StorageClass Compiler::get_storage_class ( uint32_t  id) const
Here is the caller graph for this function:

◆ get_subpass_input_remapped_components()

uint32_t Compiler::get_subpass_input_remapped_components ( uint32_t  id) const

◆ get_type()

const SPIRType & Compiler::get_type ( uint32_t  id) const
Here is the caller graph for this function:

◆ get_type_from_variable()

const SPIRType & Compiler::get_type_from_variable ( uint32_t  id) const

◆ get_work_group_size_specialization_constants()

uint32_t Compiler::get_work_group_size_specialization_constants ( SpecializationConstant x,
SpecializationConstant y,
SpecializationConstant z 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_active_builtin()

bool Compiler::has_active_builtin ( spv::BuiltIn  builtin,
spv::StorageClass  storage 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_decoration()

bool Compiler::has_decoration ( uint32_t  id,
spv::Decoration  decoration 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_member_decoration()

bool Compiler::has_member_decoration ( uint32_t  id,
uint32_t  index,
spv::Decoration  decoration 
) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ image_is_comparison()

bool Compiler::image_is_comparison ( const SPIRType type,
uint32_t  id 
) const
protected

◆ increase_bound_by()

uint32_t Compiler::increase_bound_by ( uint32_t  incr_amount)
protected
Here is the caller graph for this function:

◆ inherit_expression_dependencies()

void Compiler::inherit_expression_dependencies ( uint32_t  dst,
uint32_t  source 
)
protected
Here is the call graph for this function:

◆ instruction_to_result_type()

bool Compiler::instruction_to_result_type ( uint32_t result_type,
uint32_t result_id,
spv::Op  op,
const uint32_t args,
uint32_t  length 
)
protected

◆ interface_variable_exists_in_entry_point()

bool Compiler::interface_variable_exists_in_entry_point ( uint32_t  id) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_array()

bool Compiler::is_array ( const SPIRType type) const
protected
Here is the caller graph for this function:

◆ is_break()

bool spirv_cross::Compiler::is_break ( uint32_t  next) const
inlineprotected

◆ is_builtin_variable()

bool Compiler::is_builtin_variable ( const SPIRVariable var) const
protected
Here is the caller graph for this function:

◆ is_conditional()

bool spirv_cross::Compiler::is_conditional ( uint32_t  next) const
inlineprotected

◆ is_continue()

bool spirv_cross::Compiler::is_continue ( uint32_t  next) const
inlineprotected
Here is the caller graph for this function:

◆ is_desktop_only_format()

bool Compiler::is_desktop_only_format ( spv::ImageFormat  format)
staticprotected

◆ is_hidden_variable()

bool Compiler::is_hidden_variable ( const SPIRVariable var,
bool  include_builtins = false 
) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_immutable()

bool Compiler::is_immutable ( uint32_t  id) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_loop_break()

bool spirv_cross::Compiler::is_loop_break ( uint32_t  next) const
inlineprotected

◆ is_matrix()

bool Compiler::is_matrix ( const SPIRType type) const
protected
Here is the caller graph for this function:

◆ is_member_builtin()

bool Compiler::is_member_builtin ( const SPIRType type,
uint32_t  index,
spv::BuiltIn builtin 
) const
protected
Here is the caller graph for this function:

◆ is_scalar()

bool Compiler::is_scalar ( const SPIRType type) const
protected

◆ is_single_block_loop()

bool spirv_cross::Compiler::is_single_block_loop ( uint32_t  next) const
inlineprotected
Here is the caller graph for this function:

◆ is_vector()

bool Compiler::is_vector ( const SPIRType type) const
protected

◆ make_constant_null()

void Compiler::make_constant_null ( uint32_t  id,
uint32_t  type 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mark_used_as_array_length()

void Compiler::mark_used_as_array_length ( uint32_t  id)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ maybe_get() [1/2]

template<typename T >
T* spirv_cross::Compiler::maybe_get ( uint32_t  id)
inlineprotected
Here is the caller graph for this function:

◆ maybe_get() [2/2]

template<typename T >
const T* spirv_cross::Compiler::maybe_get ( uint32_t  id) const
inlineprotected

◆ maybe_get_backing_variable()

SPIRVariable * Compiler::maybe_get_backing_variable ( uint32_t  chain)
protected
Here is the caller graph for this function:

◆ parse() [1/2]

void Compiler::parse ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse() [2/2]

void Compiler::parse ( const Instruction i)
protected
Here is the call graph for this function:

◆ register_global_read_dependencies() [1/2]

void Compiler::register_global_read_dependencies ( const SPIRBlock func,
uint32_t  id 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_global_read_dependencies() [2/2]

void Compiler::register_global_read_dependencies ( const SPIRFunction func,
uint32_t  id 
)
protected
Here is the call graph for this function:

◆ register_read()

void Compiler::register_read ( uint32_t  expr,
uint32_t  chain,
bool  forwarded 
)
protected
Here is the call graph for this function:

◆ register_write()

void Compiler::register_write ( uint32_t  chain)
protected
Here is the call graph for this function:

◆ remap_variable_type_name()

void spirv_cross::Compiler::remap_variable_type_name ( const SPIRType type,
const std::string var_name,
std::string type_name 
) const
inlineprotected

◆ rename_entry_point()

void Compiler::rename_entry_point ( const std::string old_name,
const std::string new_name,
spv::ExecutionModel  execution_model 
)
Here is the call graph for this function:

◆ set()

template<typename T , typename... P>
T& spirv_cross::Compiler::set ( uint32_t  id,
P &&...  args 
)
inlineprotected

◆ set_decoration()

void Compiler::set_decoration ( uint32_t  id,
spv::Decoration  decoration,
uint32_t  argument = 0 
)
Here is the caller graph for this function:

◆ set_decoration_string()

void Compiler::set_decoration_string ( uint32_t  id,
spv::Decoration  decoration,
const std::string argument 
)
Here is the caller graph for this function:

◆ set_enabled_interface_variables()

void Compiler::set_enabled_interface_variables ( std::unordered_set< uint32_t active_variables)
Here is the caller graph for this function:

◆ set_entry_point() [1/2]

void Compiler::set_entry_point ( const std::string name)
Here is the call graph for this function:

◆ set_entry_point() [2/2]

void Compiler::set_entry_point ( const std::string entry,
spv::ExecutionModel  execution_model 
)
Here is the call graph for this function:

◆ set_execution_mode()

void Compiler::set_execution_mode ( spv::ExecutionMode  mode,
uint32_t  arg0 = 0,
uint32_t  arg1 = 0,
uint32_t  arg2 = 0 
)
Here is the call graph for this function:

◆ set_member_decoration()

void Compiler::set_member_decoration ( uint32_t  id,
uint32_t  index,
spv::Decoration  decoration,
uint32_t  argument = 0 
)
Here is the caller graph for this function:

◆ set_member_decoration_string()

void Compiler::set_member_decoration_string ( uint32_t  id,
uint32_t  index,
spv::Decoration  decoration,
const std::string argument 
)
Here is the caller graph for this function:

◆ set_member_name()

void Compiler::set_member_name ( uint32_t  id,
uint32_t  index,
const std::string name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_member_qualified_name()

void Compiler::set_member_qualified_name ( uint32_t  type_id,
uint32_t  index,
const std::string name 
)
Here is the caller graph for this function:

◆ set_name()

void Compiler::set_name ( uint32_t  id,
const std::string name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_remapped_variable_state()

void Compiler::set_remapped_variable_state ( uint32_t  id,
bool  remap_enable 
)
Here is the caller graph for this function:

◆ set_subpass_input_remapped_components()

void Compiler::set_subpass_input_remapped_components ( uint32_t  id,
uint32_t  components 
)
Here is the caller graph for this function:

◆ set_variable_type_remap_callback()

void spirv_cross::Compiler::set_variable_type_remap_callback ( VariableTypeRemapCallback  cb)
inline

◆ SPIRV_CROSS_DEPRECATED()

spirv_cross::Compiler::SPIRV_CROSS_DEPRECATED ( "Please use flatten_buffer_block instead."  )

◆ stream()

const uint32_t* spirv_cross::Compiler::stream ( const Instruction instr) const
inlineprotected
Here is the caller graph for this function:

◆ to_name()

string Compiler::to_name ( uint32_t  id,
bool  allow_alias = true 
) const
protectedvirtual

Reimplemented in spirv_cross::CompilerMSL.

Here is the call graph for this function:

◆ traverse_all_reachable_opcodes() [1/2]

bool Compiler::traverse_all_reachable_opcodes ( const SPIRBlock block,
OpcodeHandler handler 
) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverse_all_reachable_opcodes() [2/2]

bool Compiler::traverse_all_reachable_opcodes ( const SPIRFunction block,
OpcodeHandler handler 
) const
protected
Here is the call graph for this function:

◆ type_is_block_like()

bool Compiler::type_is_block_like ( const SPIRType type) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ type_struct_member_array_stride()

uint32_t Compiler::type_struct_member_array_stride ( const SPIRType type,
uint32_t  index 
) const
Here is the caller graph for this function:

◆ type_struct_member_matrix_stride()

uint32_t Compiler::type_struct_member_matrix_stride ( const SPIRType type,
uint32_t  index 
) const
Here is the caller graph for this function:

◆ type_struct_member_offset()

uint32_t Compiler::type_struct_member_offset ( const SPIRType type,
uint32_t  index 
) const
Here is the caller graph for this function:

◆ types_are_logically_equivalent()

bool Compiler::types_are_logically_equivalent ( const SPIRType a,
const SPIRType b 
) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unset_decoration()

void Compiler::unset_decoration ( uint32_t  id,
spv::Decoration  decoration 
)

◆ unset_execution_mode()

void Compiler::unset_execution_mode ( spv::ExecutionMode  mode)
Here is the call graph for this function:

◆ unset_member_decoration()

void Compiler::unset_member_decoration ( uint32_t  id,
uint32_t  index,
spv::Decoration  decoration 
)

◆ update_active_builtins()

void Compiler::update_active_builtins ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_name_cache()

void spirv_cross::Compiler::update_name_cache ( std::unordered_set< std::string > &  cache,
std::string name 
)
protected

◆ variable_storage_is_aliased()

bool Compiler::variable_storage_is_aliased ( const SPIRVariable var)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CFG

friend class CFG
friend

◆ DominatorBuilder

friend class DominatorBuilder
friend

Member Data Documentation

◆ active_input_builtins

Bitset spirv_cross::Compiler::active_input_builtins
protected

◆ active_interface_variables

std::unordered_set<uint32_t> spirv_cross::Compiler::active_interface_variables
protected

◆ active_output_builtins

Bitset spirv_cross::Compiler::active_output_builtins
protected

◆ aliased_variables

std::vector<uint32_t> spirv_cross::Compiler::aliased_variables
protected

◆ check_active_interface_variables

bool spirv_cross::Compiler::check_active_interface_variables = false
protected

◆ clip_distance_count

uint32_t spirv_cross::Compiler::clip_distance_count = 0
protected

◆ combined_image_samplers

std::vector<CombinedImageSampler> spirv_cross::Compiler::combined_image_samplers
protected

◆ comparison_ids

std::unordered_set<uint32_t> spirv_cross::Compiler::comparison_ids
protected

◆ continue_block_to_loop_header

std::unordered_map<uint32_t, uint32_t> spirv_cross::Compiler::continue_block_to_loop_header
protected

◆ continue_blocks

std::unordered_set<uint32_t> spirv_cross::Compiler::continue_blocks
protected

◆ cull_distance_count

uint32_t spirv_cross::Compiler::cull_distance_count = 0
protected

◆ current_block

SPIRBlock* spirv_cross::Compiler::current_block = nullptr
protected

◆ current_function

SPIRFunction* spirv_cross::Compiler::current_function = nullptr
protected

◆ declared_block_names

std::unordered_map<uint32_t, std::string> spirv_cross::Compiler::declared_block_names
protected

◆ declared_capabilities

std::vector<spv::Capability> spirv_cross::Compiler::declared_capabilities
protected

◆ declared_extensions

std::vector<std::string> spirv_cross::Compiler::declared_extensions
protected

◆ dummy_sampler_id

uint32_t spirv_cross::Compiler::dummy_sampler_id = 0
protected

◆ entry_point

uint32_t spirv_cross::Compiler::entry_point = 0
protected

◆ entry_points

std::unordered_map<uint32_t, SPIREntryPoint> spirv_cross::Compiler::entry_points
protected

◆ force_recompile

bool spirv_cross::Compiler::force_recompile = false
protected

◆ forced_temporaries

std::unordered_set<uint32_t> spirv_cross::Compiler::forced_temporaries
protected

◆ forwarded_temporaries

std::unordered_set<uint32_t> spirv_cross::Compiler::forwarded_temporaries
protected

◆ function_cfgs

std::unordered_map<uint32_t, std::unique_ptr<CFG> > spirv_cross::Compiler::function_cfgs
protected

◆ get_entry_point

SPIREntryPoint & Compiler::get_entry_point

◆ get_entry_points_and_stages

vector< EntryPoint > Compiler::get_entry_points_and_stages

◆ global_struct_cache

std::vector<uint32_t> spirv_cross::Compiler::global_struct_cache
protected

◆ global_variables

std::vector<uint32_t> spirv_cross::Compiler::global_variables
protected

◆ hoisted_temporaries

std::unordered_set<uint32_t> spirv_cross::Compiler::hoisted_temporaries
protected

◆ ids

std::vector<Variant> spirv_cross::Compiler::ids
protected

◆ inst

std::vector<Instruction> spirv_cross::Compiler::inst
protected

◆ invalid_expressions

std::unordered_set<uint32_t> spirv_cross::Compiler::invalid_expressions
protected

◆ loop_blocks

std::unordered_set<uint32_t> spirv_cross::Compiler::loop_blocks
protected

◆ loop_merge_targets

std::unordered_set<uint32_t> spirv_cross::Compiler::loop_merge_targets
protected

◆ meta

std::vector<Meta> spirv_cross::Compiler::meta
protected

◆ multiselect_merge_targets

std::unordered_set<uint32_t> spirv_cross::Compiler::multiselect_merge_targets
protected

◆ need_subpass_input

bool spirv_cross::Compiler::need_subpass_input = false
protected

◆ position_invariant

bool spirv_cross::Compiler::position_invariant = false
protected

◆ selection_merge_targets

std::unordered_set<uint32_t> spirv_cross::Compiler::selection_merge_targets
protected

◆ source

struct spirv_cross::Compiler::Source spirv_cross::Compiler::source
protected

◆ spirv

std::vector<uint32_t> spirv_cross::Compiler::spirv
protected

◆ variable_remap_callback

VariableTypeRemapCallback spirv_cross::Compiler::variable_remap_callback
protected

The documentation for this class was generated from the following files: