Class Compiler

Nested Relationships

Nested Types

Inheritance Relationships

Derived Type

Class Documentation

class Compiler

Subclassed by SPIRV_CROSS_NAMESPACE::CompilerGLSL

Public Functions

explicit Compiler(std::vector<uint32_t> ir)
Compiler(const uint32_t *ir, size_t word_count)
explicit Compiler(const ParsedIR &ir)
explicit Compiler(ParsedIR &&ir)
virtual ~Compiler() = default
virtual std::string compile()
const std::string &get_name(ID id) const
void set_decoration(ID id, spv::Decoration decoration, uint32_t argument = 0)
void set_decoration_string(ID id, spv::Decoration decoration, const std::string &argument)
void set_name(ID id, const std::string &name)
const Bitset &get_decoration_bitset(ID id) const
bool has_decoration(ID id, spv::Decoration decoration) const
uint32_t get_decoration(ID id, spv::Decoration decoration) const
const std::string &get_decoration_string(ID id, spv::Decoration decoration) const
void unset_decoration(ID id, spv::Decoration decoration)
const SPIRType &get_type(TypeID id) const
const SPIRType &get_type_from_variable(VariableID id) const
spv::StorageClass get_storage_class(VariableID id) const
virtual const std::string get_fallback_name(ID id) const
virtual const std::string get_block_fallback_name(VariableID id) const
const std::string &get_member_name(TypeID id, uint32_t index) const
uint32_t get_member_decoration(TypeID id, uint32_t index, spv::Decoration decoration) const
const std::string &get_member_decoration_string(TypeID id, uint32_t index, spv::Decoration decoration) const
void set_member_name(TypeID id, uint32_t index, const std::string &name)
const std::string &get_member_qualified_name(TypeID type_id, uint32_t index) const
const Bitset &get_member_decoration_bitset(TypeID id, uint32_t index) const
bool has_member_decoration(TypeID id, uint32_t index, spv::Decoration decoration) const
void set_member_decoration(TypeID id, uint32_t index, spv::Decoration decoration, uint32_t argument = 0)
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)
inline virtual const std::string get_fallback_member_name(uint32_t index) const
SmallVector<BufferRange> get_active_buffer_ranges(VariableID id) const
size_t get_declared_struct_size(const SPIRType &struct_type) const
size_t get_declared_struct_size_runtime_array(const SPIRType &struct_type, size_t array_size) const
size_t get_declared_struct_member_size(const SPIRType &struct_type, uint32_t index) const
std::unordered_set<VariableID> get_active_interface_variables() const
void set_enabled_interface_variables(std::unordered_set<VariableID> active_variables)
ShaderResources get_shader_resources() const
ShaderResources get_shader_resources(const std::unordered_set<VariableID> &active_variables) const
void set_remapped_variable_state(VariableID id, bool remap_enable)
bool get_remapped_variable_state(VariableID id) const
void set_subpass_input_remapped_components(VariableID id, uint32_t components)
uint32_t get_subpass_input_remapped_components(VariableID id) const
SmallVector<EntryPoint> get_entry_points_and_stages() const
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 SPIREntryPoint &get_entry_point(const std::string &name, spv::ExecutionModel execution_model) const
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) const
void update_active_builtins()
bool has_active_builtin(spv::BuiltIn builtin, spv::StorageClass storage) const
const Bitset &get_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
bool is_tessellation_shader() const
bool is_tessellating_triangles() const
uint32_t get_work_group_size_specialization_constants(SpecializationConstant &x, SpecializationConstant &y, SpecializationConstant &z) const
VariableID build_dummy_sampler_for_combined_images()
void build_combined_image_samplers()
inline const SmallVector<CombinedImageSampler> &get_combined_image_samplers() const
inline void set_variable_type_remap_callback(VariableTypeRemapCallback cb)
SmallVector<SpecializationConstant> get_specialization_constants() const
SPIRConstant &get_constant(ConstantID id)
const SPIRConstant &get_constant(ConstantID id) const
inline 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(VariableID id, spv::Decoration decoration, uint32_t &word_offset) const
bool buffer_is_hlsl_counter_buffer(VariableID id) const
bool buffer_get_hlsl_counter_buffer(VariableID id, uint32_t &counter_id) const
const SmallVector<spv::Capability> &get_declared_capabilities() const
const SmallVector<std::string> &get_declared_extensions() const
std::string get_remapped_declared_block_name(VariableID id) const
Bitset get_buffer_block_flags(VariableID id) const
inline bool is_position_invariant() const

Protected Functions

inline const uint32_t *stream(const Instruction &instr) const
inline uint32_t *stream_mutable(const Instruction &instr) const
void add_loop_level()
inline void set_initializers(SPIRExpression &e)
template<typename T>
inline void set_initializers(const T&)
template<typename T, typename ...P>
inline T &set(uint32_t id, P&&... args)
template<typename T>
inline T &get(uint32_t id)
template<typename T>
inline T *maybe_get(uint32_t id)
template<typename T>
inline const T &get(uint32_t id) const
template<typename T>
inline const T *maybe_get(uint32_t id) const
uint32_t get_pointee_type_id(uint32_t type_id) const
const SPIRType &get_pointee_type(const SPIRType &type) const
const SPIRType &get_pointee_type(uint32_t type_id) const
uint32_t get_variable_data_type_id(const SPIRVariable &var) const
SPIRType &get_variable_data_type(const SPIRVariable &var)
const SPIRType &get_variable_data_type(const SPIRVariable &var) const
SPIRType &get_variable_element_type(const SPIRVariable &var)
const SPIRType &get_variable_element_type(const SPIRVariable &var) const
void set_member_qualified_name(uint32_t type_id, uint32_t index, const std::string &name)
void set_qualified_name(uint32_t id, const std::string &name)
bool is_sampled_image_type(const SPIRType &type)
const SPIREntryPoint &get_entry_point() const
SPIREntryPoint &get_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_builtin_type(const SPIRType &type) 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
bool is_pointer(const SPIRType &type) const
bool is_physical_pointer(const SPIRType &type) const
bool is_physical_pointer_to_buffer_block(const SPIRType &type) const
uint32_t expression_type_id(uint32_t id) const
const SPIRType &expression_type(uint32_t id) const
bool expression_is_lvalue(uint32_t id) const
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)
inline bool is_continue(uint32_t next) const
inline bool is_single_block_loop(uint32_t next) const
inline bool is_break(uint32_t next) const
inline bool is_loop_break(uint32_t next) const
inline 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)
void update_name_cache(std::unordered_set<std::string> &cache_primary, const std::unordered_set<std::string> &cache_secondary, std::string &name)
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) const
bool execution_is_direct_branch(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
void force_recompile()
void force_recompile_guarantee_forward_progress()
void clear_force_recompile()
bool is_forcing_recompilation() const
bool block_is_noop(const SPIRBlock &block) const
bool block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method method) const
bool types_are_logically_equivalent(const SPIRType &a, const SPIRType &b) const
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) const
inline void remap_variable_type_name(const SPIRType &type, const std::string &var_name, std::string &type_name) const
void set_ir(const ParsedIR &parsed)
void set_ir(ParsedIR &&parsed)
void parse_fixup()
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<VariableID> *active_variables) const
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
const CFG &get_cfg_for_function(uint32_t id) const
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) const
bool is_depth_image(const SPIRType &type, uint32_t id) const
void set_extended_decoration(uint32_t id, ExtendedDecorations decoration, uint32_t value = 0)
uint32_t get_extended_decoration(uint32_t id, ExtendedDecorations decoration) const
bool has_extended_decoration(uint32_t id, ExtendedDecorations decoration) const
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 = 0)
uint32_t get_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const
bool has_extended_member_decoration(uint32_t type, uint32_t index, ExtendedDecorations decoration) const
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) const
bool type_is_block_like(const SPIRType &type) const
bool type_is_top_level_block(const SPIRType &type) const
bool type_is_opaque_value(const SPIRType &type) const
bool reflection_ssbo_instance_name_is_significant() const
std::string get_remapped_declared_block_name(uint32_t id, bool fallback_prefer_instance_name) const
bool flush_phi_required(BlockID from, BlockID to) const
uint32_t evaluate_spec_constant_u32(const SPIRConstantOp &spec) const
uint32_t evaluate_constant_u32(uint32_t id) const
bool is_vertex_like_shader() const
const SmallVector<SPIRBlock::Case> &get_case_list(const SPIRBlock &block) const

Protected Attributes

ParsedIR ir
SmallVector<uint32_t> global_variables
SmallVector<uint32_t> aliased_variables
SPIRFunction *current_function = nullptr
SPIRBlock *current_block = nullptr
uint32_t current_loop_level = 0
std::unordered_set<VariableID> active_interface_variables
bool check_active_interface_variables = false
std::unordered_set<uint32_t> invalid_expressions
bool is_force_recompile = false
bool is_force_recompile_forward_progress = false
SmallVector<CombinedImageSampler> combined_image_samplers
SmallVector<uint32_t> global_struct_cache
VariableTypeRemapCallback variable_remap_callback
std::unordered_set<uint32_t> forced_temporaries
std::unordered_set<uint32_t> forwarded_temporaries
std::unordered_set<uint32_t> suppressed_usage_tracking
std::unordered_set<uint32_t> hoisted_temporaries
std::unordered_set<uint32_t> forced_invariant_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_t> comparison_ids
bool need_subpass_input = false
bool need_subpass_input_ms = false
uint32_t dummy_sampler_id = 0
std::unordered_map<uint32_t, std::unique_ptr<CFG>> function_cfgs
SmallVector<uint32_t> physical_storage_non_block_pointer_types
std::unordered_map<uint32_t, PhysicalBlockMeta> physical_storage_type_to_alignment
std::unordered_set<uint32_t> interlocked_resources
bool interlocked_is_complex = false
std::unordered_map<uint32_t, std::string> declared_block_names

Protected Static Functions

static bool is_tessellation_shader(spv::ExecutionModel model)
static bool is_runtime_size_array(const SPIRType &type)
static bool is_desktop_only_format(spv::ImageFormat format)

Friends

friend class CFG
friend class DominatorBuilder
struct ActiveBuiltinHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline ActiveBuiltinHandler(Compiler &compiler_)
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override
void handle_builtin(const SPIRType &type, spv::BuiltIn builtin, const Bitset &decoration_flags)
void add_if_builtin(uint32_t id)
void add_if_builtin_or_block(uint32_t id)
void add_if_builtin(uint32_t id, bool allow_blocks)

Public Members

Compiler &compiler
struct AnalyzeVariableScopeAccessHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

AnalyzeVariableScopeAccessHandler(Compiler &compiler_, SPIRFunction &entry_)
virtual bool follow_function_call(const SPIRFunction&) override
virtual void set_current_block(const SPIRBlock &block) override
void notify_variable_access(uint32_t id, uint32_t block)
bool id_is_phi_variable(uint32_t id) const
bool id_is_potential_temporary(uint32_t id) const
virtual bool handle(spv::Op op, const uint32_t *args, uint32_t length) override
virtual bool handle_terminator(const SPIRBlock &block) override

Public Members

Compiler &compiler
SPIRFunction &entry
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> accessed_variables_to_block
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> accessed_temporaries_to_block
std::unordered_map<uint32_t, uint32_t> result_id_to_type
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> complete_write_variables_to_block
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> partial_write_variables_to_block
std::unordered_set<uint32_t> access_chain_expressions
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> rvalue_forward_children
const SPIRBlock *current_block = nullptr
struct BufferAccessHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline BufferAccessHandler(const Compiler &compiler_, SmallVector<BufferRange> &ranges_, uint32_t id_)
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override

Public Members

const Compiler &compiler
SmallVector<BufferRange> &ranges
uint32_t id
std::unordered_set<uint32_t> seen
struct CFGBuilder : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

explicit CFGBuilder(Compiler &compiler_)
virtual bool follow_function_call(const SPIRFunction &func) override
virtual bool handle(spv::Op op, const uint32_t *args, uint32_t length) override

Public Members

Compiler &compiler
std::unordered_map<uint32_t, std::unique_ptr<CFG>> function_cfgs
struct CombinedImageSamplerDrefHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline CombinedImageSamplerDrefHandler(Compiler &compiler_)
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override

Public Members

Compiler &compiler
std::unordered_set<uint32_t> dref_combined_samplers
struct CombinedImageSamplerHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline CombinedImageSamplerHandler(Compiler &compiler_)
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override
virtual bool begin_function_scope(const uint32_t *args, uint32_t length) override
virtual bool end_function_scope(const uint32_t *args, uint32_t length) override
uint32_t remap_parameter(uint32_t id)
void push_remap_parameters(const SPIRFunction &func, const uint32_t *args, uint32_t length)
void pop_remap_parameters()
void register_combined_image_sampler(SPIRFunction &caller, VariableID combined_id, VariableID texture_id, VariableID sampler_id, bool depth)

Public Members

Compiler &compiler
std::stack<std::unordered_map<uint32_t, uint32_t>> parameter_remapping
std::stack<SPIRFunction*> functions
struct CombinedImageSamplerUsageHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline CombinedImageSamplerUsageHandler(Compiler &compiler_, const std::unordered_set<uint32_t> &dref_combined_samplers_)
virtual bool begin_function_scope(const uint32_t *args, uint32_t length) override
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override
void add_hierarchy_to_comparison_ids(uint32_t ids)
void add_dependency(uint32_t dst, uint32_t src)

Public Members

Compiler &compiler
const std::unordered_set<uint32_t> &dref_combined_samplers
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> dependency_hierarchy
std::unordered_set<uint32_t> comparison_ids
bool need_subpass_input = false
bool need_subpass_input_ms = false
struct DummySamplerForCombinedImageHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline DummySamplerForCombinedImageHandler(Compiler &compiler_)
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override

Public Members

Compiler &compiler
bool need_dummy_sampler = false
struct InterfaceVariableAccessHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline InterfaceVariableAccessHandler(const Compiler &compiler_, std::unordered_set<VariableID> &variables_)
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override

Public Members

const Compiler &compiler
std::unordered_set<VariableID> &variables
struct InterlockedResourceAccessHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline InterlockedResourceAccessHandler(Compiler &compiler_, uint32_t entry_point_id)
virtual bool handle(spv::Op op, const uint32_t *args, uint32_t length) override
virtual bool begin_function_scope(const uint32_t *args, uint32_t length) override
virtual bool end_function_scope(const uint32_t *args, uint32_t length) override
void access_potential_resource(uint32_t id)

Public Members

Compiler &compiler
bool in_crit_sec = false
uint32_t interlock_function_id = 0
bool split_function_case = false
bool control_flow_interlock = false
bool use_critical_section = false
bool call_stack_is_interlocked = false
SmallVector<uint32_t> call_stack
struct InterlockedResourceAccessPrepassHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

inline InterlockedResourceAccessPrepassHandler(Compiler &compiler_, uint32_t entry_point_id)
virtual void rearm_current_block(const SPIRBlock &block) override
virtual bool handle(spv::Op op, const uint32_t *args, uint32_t length) override
virtual bool begin_function_scope(const uint32_t *args, uint32_t length) override
virtual bool end_function_scope(const uint32_t *args, uint32_t length) override

Public Members

Compiler &compiler
uint32_t interlock_function_id = 0
uint32_t current_block_id = 0
bool split_function_case = false
bool control_flow_interlock = false
SmallVector<uint32_t> call_stack
struct OpcodeHandler

Subclassed by SPIRV_CROSS_NAMESPACE::Compiler::ActiveBuiltinHandler, SPIRV_CROSS_NAMESPACE::Compiler::AnalyzeVariableScopeAccessHandler, SPIRV_CROSS_NAMESPACE::Compiler::BufferAccessHandler, SPIRV_CROSS_NAMESPACE::Compiler::CFGBuilder, SPIRV_CROSS_NAMESPACE::Compiler::CombinedImageSamplerDrefHandler, SPIRV_CROSS_NAMESPACE::Compiler::CombinedImageSamplerHandler, SPIRV_CROSS_NAMESPACE::Compiler::CombinedImageSamplerUsageHandler, SPIRV_CROSS_NAMESPACE::Compiler::DummySamplerForCombinedImageHandler, SPIRV_CROSS_NAMESPACE::Compiler::InterfaceVariableAccessHandler, SPIRV_CROSS_NAMESPACE::Compiler::InterlockedResourceAccessHandler, SPIRV_CROSS_NAMESPACE::Compiler::InterlockedResourceAccessPrepassHandler, SPIRV_CROSS_NAMESPACE::Compiler::PhysicalStorageBufferPointerHandler, SPIRV_CROSS_NAMESPACE::Compiler::StaticExpressionAccessHandler, SPIRV_CROSS_NAMESPACE::CompilerMSL::OpCodePreprocessor, SPIRV_CROSS_NAMESPACE::CompilerMSL::SampledImageScanner

Public Functions

virtual ~OpcodeHandler() = default
virtual bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) = 0
inline virtual bool handle_terminator(const SPIRBlock&)
inline virtual bool follow_function_call(const SPIRFunction&)
inline virtual void set_current_block(const SPIRBlock&)
inline virtual void rearm_current_block(const SPIRBlock&)
inline virtual bool begin_function_scope(const uint32_t*, uint32_t)
inline virtual bool end_function_scope(const uint32_t*, uint32_t)
struct PhysicalBlockMeta

Public Members

uint32_t alignment = 0
struct PhysicalStorageBufferPointerHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

explicit PhysicalStorageBufferPointerHandler(Compiler &compiler_)
virtual bool handle(spv::Op op, const uint32_t *args, uint32_t length) override
void mark_aligned_access(uint32_t id, const uint32_t *args, uint32_t length)
PhysicalBlockMeta *find_block_meta(uint32_t id) const
bool type_is_bda_block_entry(uint32_t type_id) const
void setup_meta_chain(uint32_t type_id, uint32_t var_id)
uint32_t get_minimum_scalar_alignment(const SPIRType &type) const
void analyze_non_block_types_from_block(const SPIRType &type)
uint32_t get_base_non_block_type_id(uint32_t type_id) const

Public Members

Compiler &compiler
std::unordered_set<uint32_t> non_block_types
std::unordered_map<uint32_t, PhysicalBlockMeta> physical_block_type_meta
std::unordered_map<uint32_t, PhysicalBlockMeta*> access_chain_to_physical_block
struct StaticExpressionAccessHandler : public SPIRV_CROSS_NAMESPACE::Compiler::OpcodeHandler

Public Functions

StaticExpressionAccessHandler(Compiler &compiler_, uint32_t variable_id_)
virtual bool follow_function_call(const SPIRFunction&) override
virtual bool handle(spv::Op op, const uint32_t *args, uint32_t length) override

Public Members

Compiler &compiler
uint32_t variable_id
uint32_t static_expression = 0
uint32_t write_count = 0