RetroArch
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
spirv_cross::CompilerMSL Class Reference

#include <spirv_msl.hpp>

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

Classes

struct  MemberSorter
 
struct  OpCodePreprocessor
 
struct  Options
 

Public Types

enum  SPVFuncImpl {
  SPVFuncImplNone, SPVFuncImplMod, SPVFuncImplRadians, SPVFuncImplDegrees,
  SPVFuncImplFindILsb, SPVFuncImplFindSMsb, SPVFuncImplFindUMsb, SPVFuncImplArrayCopy,
  SPVFuncImplTexelBufferCoords, SPVFuncImplInverse4x4, SPVFuncImplInverse3x3, SPVFuncImplInverse2x2,
  SPVFuncImplRowMajor2x3, SPVFuncImplRowMajor2x4, SPVFuncImplRowMajor3x2, SPVFuncImplRowMajor3x4,
  SPVFuncImplRowMajor4x2, SPVFuncImplRowMajor4x3
}
 
typedef Options MSLConfiguration
 

Public Member Functions

 SPIRV_CROSS_DEPRECATED ("CompilerMSL::get_options() is obsolete, use get_msl_options() instead.") const Options &get_options() const
 
const Optionsget_msl_options () const
 
 SPIRV_CROSS_DEPRECATED ("CompilerMSL::set_options() is obsolete, use set_msl_options() instead.") void set_options(Options &opts)
 
void set_msl_options (const Options &opts)
 
 CompilerMSL (std::vector< uint32_t > spirv, std::vector< MSLVertexAttr > *p_vtx_attrs=nullptr, std::vector< MSLResourceBinding > *p_res_bindings=nullptr)
 
 CompilerMSL (const uint32_t *ir, size_t word_count, MSLVertexAttr *p_vtx_attrs=nullptr, size_t vtx_attrs_count=0, MSLResourceBinding *p_res_bindings=nullptr, size_t res_bindings_count=0)
 
std::string compile () override
 
std::string compile (std::vector< MSLVertexAttr > *p_vtx_attrs, std::vector< MSLResourceBinding > *p_res_bindings)
 
SPIRV_CROSS_DEPRECATED("Please use get_msl_options() and set_msl_options() instead.") std void remap_constexpr_sampler (uint32_t id, const MSLConstexprSampler &sampler)
 
- Public Member Functions inherited from spirv_cross::CompilerGLSL
void remap_pixel_local_storage (std::vector< PlsRemap > inputs, std::vector< PlsRemap > outputs)
 
 CompilerGLSL (std::vector< uint32_t > spirv_)
 
 CompilerGLSL (const uint32_t *ir, size_t word_count)
 
 SPIRV_CROSS_DEPRECATED ("get_options() is obsolete, use get_common_options() instead.") const Options &get_options() const
 
const Optionsget_common_options () const
 
 SPIRV_CROSS_DEPRECATED ("set_options() is obsolete, use set_common_options() instead.") void set_options(Options &opts)
 
void set_common_options (const Options &opts)
 
std::string get_partial_source ()
 
void add_header_line (const std::string &str)
 
void require_extension (const std::string &ext)
 
void flatten_buffer_block (uint32_t id)
 
- Public Member Functions inherited from spirv_cross::Compiler
 Compiler (std::vector< uint32_t > ir)
 
 Compiler (const uint32_t *ir, size_t word_count)
 
virtual ~Compiler ()=default
 
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
 
 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
 

Protected Member Functions

void emit_instruction (const Instruction &instr) override
 
void emit_glsl_op (uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count) override
 
void emit_header () override
 
void emit_function_prototype (SPIRFunction &func, const Bitset &return_flags) override
 
void emit_sampled_image_op (uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) override
 
void emit_fixup () override
 
void emit_struct_member (const SPIRType &type, uint32_t member_type_id, uint32_t index, const std::string &qualifier="", uint32_t base_offset=0) override
 
std::string type_to_glsl (const SPIRType &type, uint32_t id=0) override
 
std::string image_type_glsl (const SPIRType &type, uint32_t id=0) override
 
std::string sampler_type (const SPIRType &type)
 
std::string builtin_to_glsl (spv::BuiltIn builtin, spv::StorageClass storage) override
 
std::string constant_expression (const SPIRConstant &c) override
 
size_t get_declared_struct_member_size (const SPIRType &struct_type, uint32_t index) const override
 
std::string to_func_call_arg (uint32_t id) override
 
std::string to_name (uint32_t id, bool allow_alias=true) const override
 
std::string to_function_name (uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather, bool is_proj, bool has_array_offsets, bool has_offset, bool has_grad, bool has_dref, uint32_t lod) override
 
std::string to_function_args (uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather, bool is_proj, uint32_t coord, uint32_t coord_components, uint32_t dref, uint32_t grad_x, uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias, uint32_t comp, uint32_t sample, bool *p_forward) override
 
std::string to_initializer_expression (const SPIRVariable &var) override
 
std::string unpack_expression_type (std::string expr_str, const SPIRType &type) override
 
std::string bitcast_glsl_op (const SPIRType &result_type, const SPIRType &argument_type) override
 
bool skip_argument (uint32_t id) const override
 
std::string to_qualifiers_glsl (uint32_t id) override
 
void replace_illegal_names () override
 
void declare_undefined_values () override
 
void declare_constant_arrays ()
 
bool is_non_native_row_major_matrix (uint32_t id) override
 
bool member_is_non_native_row_major_matrix (const SPIRType &type, uint32_t index) override
 
std::string convert_row_major_matrix (std::string exp_str, const SPIRType &exp_type, bool is_packed) override
 
void preprocess_op_codes ()
 
void localize_global_variables ()
 
void extract_global_variables_from_functions ()
 
void resolve_specialized_array_lengths ()
 
void mark_packable_structs ()
 
void mark_as_packable (SPIRType &type)
 
void extract_global_variables_from_function (uint32_t func_id, std::set< uint32_t > &added_arg_ids, std::unordered_set< uint32_t > &global_var_ids, std::unordered_set< uint32_t > &processed_func_ids)
 
uint32_t add_interface_block (spv::StorageClass storage)
 
void mark_location_as_used_by_shader (uint32_t location, spv::StorageClass storage)
 
uint32_t ensure_correct_builtin_type (uint32_t type_id, spv::BuiltIn builtin)
 
void emit_custom_functions ()
 
void emit_resources ()
 
void emit_specialization_constants ()
 
void emit_interface_block (uint32_t ib_var_id)
 
bool maybe_emit_input_struct_assignment (uint32_t id_lhs, uint32_t id_rhs)
 
bool maybe_emit_array_assignment (uint32_t id_lhs, uint32_t id_rhs)
 
void add_convert_row_major_matrix_function (uint32_t cols, uint32_t rows)
 
std::string func_type_decl (SPIRType &type)
 
std::string entry_point_args (bool append_comma)
 
std::string to_qualified_member_name (const SPIRType &type, uint32_t index)
 
std::string ensure_valid_name (std::string name, std::string pfx)
 
std::string to_sampler_expression (uint32_t id)
 
std::string builtin_qualifier (spv::BuiltIn builtin)
 
std::string builtin_type_decl (spv::BuiltIn builtin)
 
std::string built_in_func_arg (spv::BuiltIn builtin, bool prefix_comma)
 
std::string member_attribute_qualifier (const SPIRType &type, uint32_t index)
 
std::string argument_decl (const SPIRFunction::Parameter &arg)
 
std::string round_fp_tex_coords (std::string tex_coords, bool coord_is_fp)
 
uint32_t get_metal_resource_index (SPIRVariable &var, SPIRType::BaseType basetype)
 
uint32_t get_ordered_member_location (uint32_t type_id, uint32_t index)
 
size_t get_declared_struct_member_alignment (const SPIRType &struct_type, uint32_t index) const
 
std::string to_component_argument (uint32_t id)
 
void align_struct (SPIRType &ib_type)
 
bool is_member_packable (SPIRType &ib_type, uint32_t index)
 
MSLStructMemberKey get_struct_member_key (uint32_t type_id, uint32_t index)
 
std::string get_argument_address_space (const SPIRVariable &argument)
 
void emit_atomic_func_op (uint32_t result_type, uint32_t result_id, const char *op, uint32_t mem_order_1, uint32_t mem_order_2, bool has_mem_order_2, uint32_t op0, uint32_t op1=0, bool op1_is_pointer=false, uint32_t op2=0)
 
const char * get_memory_order (uint32_t spv_mem_sem)
 
void add_pragma_line (const std::string &line)
 
void add_typedef_line (const std::string &line)
 
void emit_barrier (uint32_t id_exe_scope, uint32_t id_mem_scope, uint32_t id_mem_sem)
 
void emit_array_copy (const std::string &lhs, uint32_t rhs_id) override
 
void build_implicit_builtins ()
 
void emit_entry_point_declarations () override
 
void bitcast_to_builtin_store (uint32_t target_id, std::string &expr, const SPIRType &expr_type) override
 
void bitcast_from_builtin_load (uint32_t source_id, std::string &expr, const SPIRType &expr_type) override
 
- Protected Member Functions inherited from spirv_cross::CompilerGLSL
void reset ()
 
void emit_function (SPIRFunction &func, const Bitset &return_flags)
 
bool has_extension (const std::string &ext) const
 
void require_extension_internal (const std::string &ext)
 
void emit_block_instructions (SPIRBlock &block)
 
virtual void emit_spv_amd_shader_ballot_op (uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count)
 
virtual void emit_spv_amd_shader_explicit_vertex_parameter_op (uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count)
 
virtual void emit_spv_amd_shader_trinary_minmax_op (uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count)
 
virtual void emit_spv_amd_gcn_shader_op (uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count)
 
virtual void emit_texture_op (const Instruction &i)
 
virtual void emit_subgroup_op (const Instruction &i)
 
std::string constant_op_expression (const SPIRConstantOp &cop)
 
virtual std::string constant_expression_vector (const SPIRConstant &c, uint32_t vector)
 
virtual std::string variable_decl (const SPIRType &type, const std::string &name, uint32_t id=0)
 
virtual void emit_buffer_block (const SPIRVariable &type)
 
virtual void emit_push_constant_block (const SPIRVariable &var)
 
virtual void emit_uniform (const SPIRVariable &var)
 
template<typename T >
void statement_inner (T &&t)
 
template<typename T , typename... Ts>
void statement_inner (T &&t, Ts &&... ts)
 
template<typename... Ts>
void statement (Ts &&... ts)
 
template<typename... Ts>
void statement_no_indent (Ts &&... ts)
 
void begin_scope ()
 
void end_scope ()
 
void end_scope_decl ()
 
void end_scope_decl (const std::string &decl)
 
std::string type_to_array_glsl (const SPIRType &type)
 
std::string to_array_size (const SPIRType &type, uint32_t index)
 
uint32_t to_array_size_literal (const SPIRType &type, uint32_t index) const
 
std::string variable_decl (const SPIRVariable &variable)
 
std::string variable_decl_function_local (SPIRVariable &variable)
 
void add_local_variable_name (uint32_t id)
 
void add_resource_name (uint32_t id)
 
void add_member_name (SPIRType &type, uint32_t name)
 
void add_function_overload (const SPIRFunction &func)
 
bool member_is_packed_type (const SPIRType &type, uint32_t index) const
 
void emit_struct (SPIRType &type)
 
void emit_resources ()
 
void emit_buffer_block_native (const SPIRVariable &var)
 
void emit_buffer_block_legacy (const SPIRVariable &var)
 
void emit_buffer_block_flattened (const SPIRVariable &type)
 
void emit_declared_builtin_block (spv::StorageClass storage, spv::ExecutionModel model)
 
void emit_push_constant_block_vulkan (const SPIRVariable &var)
 
void emit_push_constant_block_glsl (const SPIRVariable &var)
 
void emit_interface_block (const SPIRVariable &type)
 
void emit_flattened_io_block (const SPIRVariable &var, const char *qual)
 
void emit_block_chain (SPIRBlock &block)
 
void emit_hoisted_temporaries (std::vector< std::pair< uint32_t, uint32_t >> &temporaries)
 
void emit_constant (const SPIRConstant &constant)
 
void emit_specialization_constant_op (const SPIRConstantOp &constant)
 
std::string emit_continue_block (uint32_t continue_block)
 
bool attempt_emit_loop_header (SPIRBlock &block, SPIRBlock::Method method)
 
void propagate_loop_dominators (const SPIRBlock &block)
 
void branch (uint32_t from, uint32_t to)
 
void branch_to_continue (uint32_t from, uint32_t to)
 
void branch (uint32_t from, uint32_t cond, uint32_t true_block, uint32_t false_block)
 
void flush_phi (uint32_t from, uint32_t to)
 
bool flush_phi_required (uint32_t from, uint32_t to)
 
void flush_variable_declaration (uint32_t id)
 
void flush_undeclared_variables (SPIRBlock &block)
 
bool should_forward (uint32_t id)
 
void emit_mix_op (uint32_t result_type, uint32_t id, uint32_t left, uint32_t right, uint32_t lerp)
 
bool to_trivial_mix_op (const SPIRType &type, std::string &op, uint32_t left, uint32_t right, uint32_t lerp)
 
void emit_quaternary_func_op (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, uint32_t op3, const char *op)
 
void emit_trinary_func_op (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, uint32_t op2, const char *op)
 
void emit_binary_func_op (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op)
 
void emit_binary_func_op_cast (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op, SPIRType::BaseType input_type, bool skip_cast_if_equal_type)
 
void emit_unary_func_op (uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op)
 
void emit_unrolled_unary_op (uint32_t result_type, uint32_t result_id, uint32_t operand, const char *op)
 
void emit_binary_op (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op)
 
void emit_unrolled_binary_op (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op)
 
void emit_binary_op_cast (uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op, SPIRType::BaseType input_type, bool skip_cast_if_equal_type)
 
SPIRType binary_op_bitcast_helper (std::string &cast_op0, std::string &cast_op1, SPIRType::BaseType &input_type, uint32_t op0, uint32_t op1, bool skip_cast_if_equal_type)
 
std::string to_ternary_expression (const SPIRType &result_type, uint32_t select, uint32_t true_value, uint32_t false_value)
 
void emit_unary_op (uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op)
 
bool expression_is_forwarded (uint32_t id)
 
SPIRExpressionemit_op (uint32_t result_type, uint32_t result_id, const std::string &rhs, bool forward_rhs, bool suppress_usage_tracking=false)
 
std::string access_chain_internal (uint32_t base, const uint32_t *indices, uint32_t count, bool index_is_literal, bool chain_only=false, bool *need_transpose=nullptr, bool *result_is_packed=nullptr)
 
std::string access_chain (uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, bool *need_transpose=nullptr, bool *result_is_packed=nullptr)
 
std::string flattened_access_chain (uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, bool need_transpose)
 
std::string flattened_access_chain_struct (uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, uint32_t offset)
 
std::string flattened_access_chain_matrix (uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, bool need_transpose)
 
std::string flattened_access_chain_vector (uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type, uint32_t offset, uint32_t matrix_stride, bool need_transpose)
 
std::pair< std::string, uint32_tflattened_access_chain_offset (const SPIRType &basetype, const uint32_t *indices, uint32_t count, uint32_t offset, uint32_t word_stride, bool *need_transpose=nullptr, uint32_t *matrix_stride=nullptr)
 
const char * index_to_swizzle (uint32_t index)
 
std::string remap_swizzle (const SPIRType &result_type, uint32_t input_components, const std::string &expr)
 
std::string declare_temporary (uint32_t type, uint32_t id)
 
void append_global_func_args (const SPIRFunction &func, uint32_t index, std::vector< std::string > &arglist)
 
std::string to_expression (uint32_t id)
 
std::string to_enclosed_expression (uint32_t id)
 
std::string to_unpacked_expression (uint32_t id)
 
std::string to_enclosed_unpacked_expression (uint32_t id)
 
std::string to_extract_component_expression (uint32_t id, uint32_t index)
 
std::string enclose_expression (const std::string &expr)
 
void strip_enclosed_expression (std::string &expr)
 
std::string to_member_name (const SPIRType &type, uint32_t index)
 
std::string type_to_glsl_constructor (const SPIRType &type)
 
std::string argument_decl (const SPIRFunction::Parameter &arg)
 
const char * to_precision_qualifiers_glsl (uint32_t id)
 
virtual const char * to_storage_qualifiers_glsl (const SPIRVariable &var)
 
const char * flags_to_precision_qualifiers_glsl (const SPIRType &type, const Bitset &flags)
 
const char * format_to_glsl (spv::ImageFormat format)
 
virtual std::string layout_for_member (const SPIRType &type, uint32_t index)
 
virtual std::string to_interpolation_qualifiers (const Bitset &flags)
 
std::string layout_for_variable (const SPIRVariable &variable)
 
std::string to_combined_image_sampler (uint32_t image_id, uint32_t samp_id)
 
virtual void emit_block_hints (const SPIRBlock &block)
 
bool buffer_is_packing_standard (const SPIRType &type, BufferPackingStandard packing, uint32_t start_offset=0, uint32_t end_offset=UINT32_MAX)
 
uint32_t type_to_packed_base_size (const SPIRType &type, BufferPackingStandard packing)
 
uint32_t type_to_packed_alignment (const SPIRType &type, const Bitset &flags, BufferPackingStandard packing)
 
uint32_t type_to_packed_array_stride (const SPIRType &type, const Bitset &flags, BufferPackingStandard packing)
 
uint32_t type_to_packed_size (const SPIRType &type, const Bitset &flags, BufferPackingStandard packing)
 
std::string bitcast_glsl (const SPIRType &result_type, uint32_t arg)
 
std::string bitcast_expression (SPIRType::BaseType target_type, uint32_t arg)
 
std::string bitcast_expression (const SPIRType &target_type, SPIRType::BaseType expr_type, const std::string &expr)
 
std::string build_composite_combiner (uint32_t result_type, const uint32_t *elems, uint32_t length)
 
bool remove_duplicate_swizzle (std::string &op)
 
bool remove_unity_swizzle (uint32_t base, std::string &op)
 
bool check_atomic_image (uint32_t id)
 
void replace_fragment_output (SPIRVariable &var)
 
void replace_fragment_outputs ()
 
bool check_explicit_lod_allowed (uint32_t lod)
 
std::string legacy_tex_op (const std::string &op, const SPIRType &imgtype, uint32_t lod, uint32_t id)
 
std::string load_flattened_struct (SPIRVariable &var)
 
std::string to_flattened_struct_member (const SPIRVariable &var, uint32_t index)
 
void store_flattened_struct (SPIRVariable &var, uint32_t value)
 
void track_expression_read (uint32_t id)
 
bool is_legacy () const
 
bool is_legacy_es () const
 
bool is_legacy_desktop () const
 
bool args_will_forward (uint32_t id, const uint32_t *args, uint32_t num_args, bool pure)
 
void register_call_out_argument (uint32_t id)
 
void register_impure_function_call ()
 
void register_control_dependent_expression (uint32_t expr)
 
std::string pls_decl (const PlsRemap &variable)
 
const char * to_pls_qualifiers_glsl (const SPIRVariable &variable)
 
void emit_pls ()
 
void remap_pls_variables ()
 
void add_variable (std::unordered_set< std::string > &variables, uint32_t id)
 
void add_variable (std::unordered_set< std::string > &variables, std::string &name)
 
void check_function_call_constraints (const uint32_t *args, uint32_t length)
 
void handle_invalid_expression (uint32_t id)
 
void find_static_extensions ()
 
std::string emit_for_loop_initializers (const SPIRBlock &block)
 
bool for_loop_initializers_are_same_type (const SPIRBlock &block)
 
bool optimize_read_modify_write (const SPIRType &type, const std::string &lhs, const std::string &rhs)
 
void fixup_image_load_store_access ()
 
bool type_is_empty (const SPIRType &type)
 
bool can_use_io_location (spv::StorageClass storage, bool block)
 
const Instructionget_next_instruction_in_block (const Instruction &instr)
 
std::string convert_half_to_string (const SPIRConstant &value, uint32_t col, uint32_t row)
 
std::string convert_float_to_string (const SPIRConstant &value, uint32_t col, uint32_t row)
 
std::string convert_double_to_string (const SPIRConstant &value, uint32_t col, uint32_t row)
 
std::string convert_separate_image_to_combined (uint32_t id)
 
- Protected Member Functions inherited from spirv_cross::Compiler
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 ()
 
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
 

Protected Attributes

std::unordered_map< uint32_t, std::set< uint32_t > > function_global_vars
 
uint32_t builtin_frag_coord_id = 0
 
Options msl_options
 
std::set< SPVFuncImplspv_function_implementations
 
std::unordered_map< uint32_t, MSLVertexAttr * > vtx_attrs_by_location
 
std::unordered_map< MSLStructMemberKey, uint32_tstruct_member_padding
 
std::set< std::stringpragma_lines
 
std::set< std::stringtypedef_lines
 
std::vector< uint32_tvars_needing_early_declaration
 
std::vector< MSLResourceBinding * > resource_bindings
 
MSLResourceBinding next_metal_resource_index
 
uint32_t stage_in_var_id = 0
 
uint32_t stage_out_var_id = 0
 
uint32_t stage_uniforms_var_id = 0
 
bool needs_vertex_idx_arg = false
 
bool needs_instance_idx_arg = false
 
std::string qual_pos_var_name
 
std::string stage_in_var_name = "in"
 
std::string stage_out_var_name = "out"
 
std::string stage_uniform_var_name = "uniforms"
 
std::string sampler_name_suffix = "Smplr"
 
spv::Op previous_instruction_opcode = spv::OpNop
 
std::unordered_map< uint32_t, MSLConstexprSamplerconstexpr_samplers
 
- Protected Attributes inherited from spirv_cross::CompilerGLSL
SPIRBlockcurrent_emitting_block = nullptr
 
std::unique_ptr< std::ostringstream > buffer
 
std::vector< std::string > * redirect_statement = nullptr
 
const SPIRBlockcurrent_continue_block = nullptr
 
Options options
 
std::unordered_set< std::stringlocal_variable_names
 
std::unordered_set< std::stringresource_names
 
std::unordered_map< std::string, std::unordered_set< uint64_t > > function_overloads
 
bool processing_entry_point = false
 
struct spirv_cross::CompilerGLSL::BackendVariations backend
 
uint32_t indent = 0
 
std::unordered_set< uint32_temitted_functions
 
std::unordered_set< uint32_tflattened_buffer_blocks
 
std::unordered_set< uint32_tflattened_structs
 
std::unordered_map< uint32_t, uint32_texpression_usage_counts
 
std::vector< std::stringforced_extensions
 
std::vector< std::stringheader_lines
 
uint32_t statement_count
 
std::vector< PlsRemappls_inputs
 
std::vector< PlsRemappls_outputs
 
- Protected Attributes inherited from spirv_cross::Compiler
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
 

Additional Inherited Members

- Public Attributes inherited from spirv_cross::Compiler
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
 
- Static Protected Member Functions inherited from spirv_cross::CompilerGLSL
static std::string sanitize_underscores (const std::string &str)
 
static uint32_t mask_relevant_memory_semantics (uint32_t semantics)
 
- Static Protected Member Functions inherited from spirv_cross::Compiler
static bool is_desktop_only_format (spv::ImageFormat format)
 

Member Typedef Documentation

◆ MSLConfiguration

Member Enumeration Documentation

◆ SPVFuncImpl

Enumerator
SPVFuncImplNone 
SPVFuncImplMod 
SPVFuncImplRadians 
SPVFuncImplDegrees 
SPVFuncImplFindILsb 
SPVFuncImplFindSMsb 
SPVFuncImplFindUMsb 
SPVFuncImplArrayCopy 
SPVFuncImplTexelBufferCoords 
SPVFuncImplInverse4x4 
SPVFuncImplInverse3x3 
SPVFuncImplInverse2x2 
SPVFuncImplRowMajor2x3 
SPVFuncImplRowMajor2x4 
SPVFuncImplRowMajor3x2 
SPVFuncImplRowMajor3x4 
SPVFuncImplRowMajor4x2 
SPVFuncImplRowMajor4x3 

Constructor & Destructor Documentation

◆ CompilerMSL() [1/2]

CompilerMSL::CompilerMSL ( std::vector< uint32_t spirv,
std::vector< MSLVertexAttr > *  p_vtx_attrs = nullptr,
std::vector< MSLResourceBinding > *  p_res_bindings = nullptr 
)

◆ CompilerMSL() [2/2]

CompilerMSL::CompilerMSL ( const uint32_t ir,
size_t  word_count,
MSLVertexAttr p_vtx_attrs = nullptr,
size_t  vtx_attrs_count = 0,
MSLResourceBinding p_res_bindings = nullptr,
size_t  res_bindings_count = 0 
)

Member Function Documentation

◆ add_convert_row_major_matrix_function()

void spirv_cross::CompilerMSL::add_convert_row_major_matrix_function ( uint32_t  cols,
uint32_t  rows 
)
protected

◆ add_interface_block()

uint32_t CompilerMSL::add_interface_block ( spv::StorageClass  storage)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_pragma_line()

void CompilerMSL::add_pragma_line ( const std::string line)
protected
Here is the caller graph for this function:

◆ add_typedef_line()

void CompilerMSL::add_typedef_line ( const std::string line)
protected

◆ align_struct()

void CompilerMSL::align_struct ( SPIRType ib_type)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ argument_decl()

std::string spirv_cross::CompilerMSL::argument_decl ( const SPIRFunction::Parameter arg)
protected

◆ bitcast_from_builtin_load()

void spirv_cross::CompilerMSL::bitcast_from_builtin_load ( uint32_t  source_id,
std::string expr,
const SPIRType expr_type 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ bitcast_glsl_op()

std::string spirv_cross::CompilerMSL::bitcast_glsl_op ( const SPIRType result_type,
const SPIRType argument_type 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ bitcast_to_builtin_store()

void spirv_cross::CompilerMSL::bitcast_to_builtin_store ( uint32_t  target_id,
std::string expr,
const SPIRType expr_type 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ build_implicit_builtins()

void CompilerMSL::build_implicit_builtins ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ built_in_func_arg()

std::string spirv_cross::CompilerMSL::built_in_func_arg ( spv::BuiltIn  builtin,
bool  prefix_comma 
)
protected

◆ builtin_qualifier()

std::string spirv_cross::CompilerMSL::builtin_qualifier ( spv::BuiltIn  builtin)
protected

◆ builtin_to_glsl()

std::string spirv_cross::CompilerMSL::builtin_to_glsl ( spv::BuiltIn  builtin,
spv::StorageClass  storage 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

Here is the caller graph for this function:

◆ builtin_type_decl()

std::string spirv_cross::CompilerMSL::builtin_type_decl ( spv::BuiltIn  builtin)
protected

◆ compile() [1/2]

string CompilerMSL::compile ( )
overridevirtual

Reimplemented from spirv_cross::CompilerGLSL.

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

◆ compile() [2/2]

string CompilerMSL::compile ( std::vector< MSLVertexAttr > *  p_vtx_attrs,
std::vector< MSLResourceBinding > *  p_res_bindings 
)
Here is the call graph for this function:

◆ constant_expression()

std::string spirv_cross::CompilerMSL::constant_expression ( const SPIRConstant c)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

Here is the caller graph for this function:

◆ convert_row_major_matrix()

std::string spirv_cross::CompilerMSL::convert_row_major_matrix ( std::string  exp_str,
const SPIRType exp_type,
bool  is_packed 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ declare_constant_arrays()

void CompilerMSL::declare_constant_arrays ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ declare_undefined_values()

void CompilerMSL::declare_undefined_values ( )
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

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

◆ emit_array_copy()

void spirv_cross::CompilerMSL::emit_array_copy ( const std::string lhs,
uint32_t  rhs_id 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ emit_atomic_func_op()

void spirv_cross::CompilerMSL::emit_atomic_func_op ( uint32_t  result_type,
uint32_t  result_id,
const char *  op,
uint32_t  mem_order_1,
uint32_t  mem_order_2,
bool  has_mem_order_2,
uint32_t  op0,
uint32_t  op1 = 0,
bool  op1_is_pointer = false,
uint32_t  op2 = 0 
)
protected

◆ emit_barrier()

void spirv_cross::CompilerMSL::emit_barrier ( uint32_t  id_exe_scope,
uint32_t  id_mem_scope,
uint32_t  id_mem_sem 
)
protected

◆ emit_custom_functions()

void CompilerMSL::emit_custom_functions ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ emit_entry_point_declarations()

void CompilerMSL::emit_entry_point_declarations ( )
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

Here is the call graph for this function:

◆ emit_fixup()

void spirv_cross::CompilerMSL::emit_fixup ( )
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ emit_function_prototype()

void spirv_cross::CompilerMSL::emit_function_prototype ( SPIRFunction func,
const Bitset return_flags 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ emit_glsl_op()

void spirv_cross::CompilerMSL::emit_glsl_op ( uint32_t  result_type,
uint32_t  result_id,
uint32_t  op,
const uint32_t args,
uint32_t  count 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ emit_header()

void CompilerMSL::emit_header ( )
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

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

◆ emit_instruction()

void spirv_cross::CompilerMSL::emit_instruction ( const Instruction instr)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ emit_interface_block()

void spirv_cross::CompilerMSL::emit_interface_block ( uint32_t  ib_var_id)
protected
Here is the caller graph for this function:

◆ emit_resources()

void CompilerMSL::emit_resources ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ emit_sampled_image_op()

void spirv_cross::CompilerMSL::emit_sampled_image_op ( uint32_t  result_type,
uint32_t  result_id,
uint32_t  image_id,
uint32_t  samp_id 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ emit_specialization_constants()

void CompilerMSL::emit_specialization_constants ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ emit_struct_member()

void spirv_cross::CompilerMSL::emit_struct_member ( const SPIRType type,
uint32_t  member_type_id,
uint32_t  index,
const std::string qualifier = "",
uint32_t  base_offset = 0 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ ensure_correct_builtin_type()

uint32_t CompilerMSL::ensure_correct_builtin_type ( uint32_t  type_id,
spv::BuiltIn  builtin 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ensure_valid_name()

std::string spirv_cross::CompilerMSL::ensure_valid_name ( std::string  name,
std::string  pfx 
)
protected
Here is the caller graph for this function:

◆ entry_point_args()

std::string spirv_cross::CompilerMSL::entry_point_args ( bool  append_comma)
protected

◆ extract_global_variables_from_function()

void spirv_cross::CompilerMSL::extract_global_variables_from_function ( uint32_t  func_id,
std::set< uint32_t > &  added_arg_ids,
std::unordered_set< uint32_t > &  global_var_ids,
std::unordered_set< uint32_t > &  processed_func_ids 
)
protected
Here is the caller graph for this function:

◆ extract_global_variables_from_functions()

void CompilerMSL::extract_global_variables_from_functions ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_type_decl()

std::string spirv_cross::CompilerMSL::func_type_decl ( SPIRType type)
protected

◆ get_argument_address_space()

std::string spirv_cross::CompilerMSL::get_argument_address_space ( const SPIRVariable argument)
protected

◆ get_declared_struct_member_alignment()

size_t spirv_cross::CompilerMSL::get_declared_struct_member_alignment ( const SPIRType struct_type,
uint32_t  index 
) const
protected
Here is the caller graph for this function:

◆ get_declared_struct_member_size()

size_t spirv_cross::CompilerMSL::get_declared_struct_member_size ( const SPIRType struct_type,
uint32_t  index 
) const
overrideprotectedvirtual

Reimplemented from spirv_cross::Compiler.

Here is the caller graph for this function:

◆ get_memory_order()

const char* spirv_cross::CompilerMSL::get_memory_order ( uint32_t  spv_mem_sem)
protected

◆ get_metal_resource_index()

uint32_t spirv_cross::CompilerMSL::get_metal_resource_index ( SPIRVariable var,
SPIRType::BaseType  basetype 
)
protected

◆ get_msl_options()

const Options& spirv_cross::CompilerMSL::get_msl_options ( ) const
inline
Here is the caller graph for this function:

◆ get_ordered_member_location()

uint32_t spirv_cross::CompilerMSL::get_ordered_member_location ( uint32_t  type_id,
uint32_t  index 
)
protected

◆ get_struct_member_key()

MSLStructMemberKey CompilerMSL::get_struct_member_key ( uint32_t  type_id,
uint32_t  index 
)
protected
Here is the caller graph for this function:

◆ image_type_glsl()

std::string spirv_cross::CompilerMSL::image_type_glsl ( const SPIRType type,
uint32_t  id = 0 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ is_member_packable()

bool CompilerMSL::is_member_packable ( SPIRType ib_type,
uint32_t  index 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_non_native_row_major_matrix()

bool spirv_cross::CompilerMSL::is_non_native_row_major_matrix ( uint32_t  id)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ localize_global_variables()

void CompilerMSL::localize_global_variables ( )
protected
Here is the caller graph for this function:

◆ mark_as_packable()

void CompilerMSL::mark_as_packable ( SPIRType type)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mark_location_as_used_by_shader()

void CompilerMSL::mark_location_as_used_by_shader ( uint32_t  location,
spv::StorageClass  storage 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mark_packable_structs()

void CompilerMSL::mark_packable_structs ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ maybe_emit_array_assignment()

bool spirv_cross::CompilerMSL::maybe_emit_array_assignment ( uint32_t  id_lhs,
uint32_t  id_rhs 
)
protected

◆ maybe_emit_input_struct_assignment()

bool spirv_cross::CompilerMSL::maybe_emit_input_struct_assignment ( uint32_t  id_lhs,
uint32_t  id_rhs 
)
protected

◆ member_attribute_qualifier()

std::string spirv_cross::CompilerMSL::member_attribute_qualifier ( const SPIRType type,
uint32_t  index 
)
protected

◆ member_is_non_native_row_major_matrix()

bool spirv_cross::CompilerMSL::member_is_non_native_row_major_matrix ( const SPIRType type,
uint32_t  index 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ preprocess_op_codes()

void CompilerMSL::preprocess_op_codes ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remap_constexpr_sampler()

SPIRV_CROSS_DEPRECATED ("Please use get_msl_options() and set_msl_options() instead.") std void spirv_cross::CompilerMSL::remap_constexpr_sampler ( uint32_t  id,
const MSLConstexprSampler sampler 
)

◆ replace_illegal_names()

void spirv_cross::CompilerMSL::replace_illegal_names ( )
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

Here is the caller graph for this function:

◆ resolve_specialized_array_lengths()

void CompilerMSL::resolve_specialized_array_lengths ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ round_fp_tex_coords()

std::string spirv_cross::CompilerMSL::round_fp_tex_coords ( std::string  tex_coords,
bool  coord_is_fp 
)
protected

◆ sampler_type()

std::string spirv_cross::CompilerMSL::sampler_type ( const SPIRType type)
protected

◆ set_msl_options()

void spirv_cross::CompilerMSL::set_msl_options ( const Options opts)
inline
Here is the caller graph for this function:

◆ skip_argument()

bool spirv_cross::CompilerMSL::skip_argument ( uint32_t  id) const
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ SPIRV_CROSS_DEPRECATED() [1/2]

spirv_cross::CompilerMSL::SPIRV_CROSS_DEPRECATED ( "CompilerMSL::get_options() is  obsolete,
use get_msl_options() instead."   
) const &
inline

◆ SPIRV_CROSS_DEPRECATED() [2/2]

spirv_cross::CompilerMSL::SPIRV_CROSS_DEPRECATED ( "CompilerMSL::set_options() is  obsolete,
use set_msl_options() instead."   
) &
inline

◆ to_component_argument()

std::string spirv_cross::CompilerMSL::to_component_argument ( uint32_t  id)
protected

◆ to_func_call_arg()

std::string spirv_cross::CompilerMSL::to_func_call_arg ( uint32_t  id)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ to_function_args()

std::string spirv_cross::CompilerMSL::to_function_args ( uint32_t  img,
const SPIRType imgtype,
bool  is_fetch,
bool  is_gather,
bool  is_proj,
uint32_t  coord,
uint32_t  coord_components,
uint32_t  dref,
uint32_t  grad_x,
uint32_t  grad_y,
uint32_t  lod,
uint32_t  coffset,
uint32_t  offset,
uint32_t  bias,
uint32_t  comp,
uint32_t  sample,
bool p_forward 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ to_function_name()

std::string spirv_cross::CompilerMSL::to_function_name ( uint32_t  img,
const SPIRType imgtype,
bool  is_fetch,
bool  is_gather,
bool  is_proj,
bool  has_array_offsets,
bool  has_offset,
bool  has_grad,
bool  has_dref,
uint32_t  lod 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ to_initializer_expression()

std::string spirv_cross::CompilerMSL::to_initializer_expression ( const SPIRVariable var)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ to_name()

std::string spirv_cross::CompilerMSL::to_name ( uint32_t  id,
bool  allow_alias = true 
) const
overrideprotectedvirtual

Reimplemented from spirv_cross::Compiler.

Here is the caller graph for this function:

◆ to_qualified_member_name()

std::string spirv_cross::CompilerMSL::to_qualified_member_name ( const SPIRType type,
uint32_t  index 
)
protected
Here is the caller graph for this function:

◆ to_qualifiers_glsl()

std::string spirv_cross::CompilerMSL::to_qualifiers_glsl ( uint32_t  id)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

◆ to_sampler_expression()

std::string spirv_cross::CompilerMSL::to_sampler_expression ( uint32_t  id)
protected
Here is the caller graph for this function:

◆ type_to_glsl()

std::string spirv_cross::CompilerMSL::type_to_glsl ( const SPIRType type,
uint32_t  id = 0 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

Here is the caller graph for this function:

◆ unpack_expression_type()

string CompilerMSL::unpack_expression_type ( std::string  expr_str,
const SPIRType type 
)
overrideprotectedvirtual

Reimplemented from spirv_cross::CompilerGLSL.

Here is the call graph for this function:

Member Data Documentation

◆ builtin_frag_coord_id

uint32_t spirv_cross::CompilerMSL::builtin_frag_coord_id = 0
protected

◆ constexpr_samplers

std::unordered_map<uint32_t, MSLConstexprSampler> spirv_cross::CompilerMSL::constexpr_samplers
protected

◆ function_global_vars

std::unordered_map<uint32_t, std::set<uint32_t> > spirv_cross::CompilerMSL::function_global_vars
protected

◆ msl_options

Options spirv_cross::CompilerMSL::msl_options
protected

◆ needs_instance_idx_arg

bool spirv_cross::CompilerMSL::needs_instance_idx_arg = false
protected

◆ needs_vertex_idx_arg

bool spirv_cross::CompilerMSL::needs_vertex_idx_arg = false
protected

◆ next_metal_resource_index

MSLResourceBinding spirv_cross::CompilerMSL::next_metal_resource_index
protected

◆ pragma_lines

std::set<std::string> spirv_cross::CompilerMSL::pragma_lines
protected

◆ previous_instruction_opcode

spv::Op spirv_cross::CompilerMSL::previous_instruction_opcode = spv::OpNop
protected

◆ qual_pos_var_name

std::string spirv_cross::CompilerMSL::qual_pos_var_name
protected

◆ resource_bindings

std::vector<MSLResourceBinding *> spirv_cross::CompilerMSL::resource_bindings
protected

◆ sampler_name_suffix

std::string spirv_cross::CompilerMSL::sampler_name_suffix = "Smplr"
protected

◆ spv_function_implementations

std::set<SPVFuncImpl> spirv_cross::CompilerMSL::spv_function_implementations
protected

◆ stage_in_var_id

uint32_t spirv_cross::CompilerMSL::stage_in_var_id = 0
protected

◆ stage_in_var_name

std::string spirv_cross::CompilerMSL::stage_in_var_name = "in"
protected

◆ stage_out_var_id

uint32_t spirv_cross::CompilerMSL::stage_out_var_id = 0
protected

◆ stage_out_var_name

std::string spirv_cross::CompilerMSL::stage_out_var_name = "out"
protected

◆ stage_uniform_var_name

std::string spirv_cross::CompilerMSL::stage_uniform_var_name = "uniforms"
protected

◆ stage_uniforms_var_id

uint32_t spirv_cross::CompilerMSL::stage_uniforms_var_id = 0
protected

◆ struct_member_padding

std::unordered_map<MSLStructMemberKey, uint32_t> spirv_cross::CompilerMSL::struct_member_padding
protected

◆ typedef_lines

std::set<std::string> spirv_cross::CompilerMSL::typedef_lines
protected

◆ vars_needing_early_declaration

std::vector<uint32_t> spirv_cross::CompilerMSL::vars_needing_early_declaration
protected

◆ vtx_attrs_by_location

std::unordered_map<uint32_t, MSLVertexAttr *> spirv_cross::CompilerMSL::vtx_attrs_by_location
protected

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