Lines Matching refs:string
221 std::string compile() override;
223 // Returns the current string held in the conversion buffer. Useful for
225 std::string get_partial_source();
237 void add_header_line(const std::string &str);
241 void require_extension(const std::string &ext);
288 static SmallVector<std::string> get_extra_required_extension_names(Candidate c);
348 bool has_extension(const std::string &ext) const;
349 void require_extension_internal(const std::string &ext);
372 void build_workgroup_size(SmallVector<std::string> &arguments, const SpecializationConstant &x,
379 virtual std::string to_texture_op(const Instruction &i, bool sparse, bool *forward,
382 virtual std::string type_to_glsl(const SPIRType &type, uint32_t id = 0);
383 virtual std::string builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage);
385 const std::string &qualifier = "", uint32_t base_offset = 0);
387 virtual std::string image_type_glsl(const SPIRType &type, uint32_t id = 0);
388 std::string constant_expression(const SPIRConstant &c);
389 std::string constant_op_expression(const SPIRConstantOp &cop);
390 virtual std::string constant_expression_vector(const SPIRConstant &c, uint32_t vector);
392 virtual std::string variable_decl(const SPIRType &type, const std::string &name, uint32_t id = 0);
394 virtual std::string to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_t id);
414 virtual std::string to_function_name(const TextureFunctionNameArguments &args);
426 virtual std::string to_function_args(const TextureFunctionArguments &args, bool *p_forward);
434 virtual std::string unpack_expression_type(std::string expr_str, const SPIRType &type, uint32_t physical_type_id,
496 SmallVector<std::string> *redirect_statement = nullptr;
501 void end_scope(const std::string &trailer);
503 void end_scope_decl(const std::string &decl);
507 virtual std::string type_to_array_glsl(
509 std::string to_array_size(const SPIRType &type, uint32_t index);
512 virtual std::string variable_decl(const SPIRVariable &variable); // Threadgroup arrays can't have a wrapper type
513 std::string variable_decl_function_local(SPIRVariable &variable);
524 virtual std::string convert_row_major_matrix(std::string exp_str, const SPIRType &exp_type,
527 std::unordered_set<std::string> local_variable_names;
528 std::unordered_set<std::string> resource_names;
529 std::unordered_set<std::string> block_input_names;
530 std::unordered_set<std::string> block_output_names;
531 std::unordered_set<std::string> block_ubo_names;
532 std::unordered_set<std::string> block_ssbo_names;
533 std::unordered_set<std::string> block_names; // A union of all block_*_names.
534 std::unordered_map<std::string, std::unordered_set<uint64_t>> function_overloads;
535 std::unordered_map<uint32_t, std::string> preserved_aliases;
545 std::string discard_literal = "discard";
546 std::string demote_literal = "demote";
547 std::string null_pointer_literal = "";
605 void emit_flattened_io_block_struct(const std::string &basename, const SPIRType &type, const char *qual,
607 void emit_flattened_io_block_member(const std::string &basename, const SPIRType &type, const char *qual,
611 std::string constant_value_macro_name(uint32_t id);
614 std::string emit_continue_block(uint32_t continue_block, bool follow_true_block, bool follow_false_block);
630 bool to_trivial_mix_op(const SPIRType &type, std::string &op, uint32_t left, uint32_t right, uint32_t lerp);
662 SPIRType binary_op_bitcast_helper(std::string &cast_op0, std::string &cast_op1, SPIRType::BaseType &input_type,
667 std::string to_ternary_expression(const SPIRType &result_type, uint32_t select, uint32_t true_value,
674 SPIRExpression &emit_op(uint32_t result_type, uint32_t result_id, const std::string &rhs, bool forward_rhs,
677 void access_chain_internal_append_index(std::string &expr, uint32_t base, const SPIRType *type,
680 std::string access_chain_internal(uint32_t base, const uint32_t *indices, uint32_t count, AccessChainFlags flags,
686 virtual void prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type,
689 std::string access_chain(uint32_t base, const uint32_t *indices, uint32_t count, const SPIRType &target_type,
692 std::string flattened_access_chain(uint32_t base, const uint32_t *indices, uint32_t count,
695 std::string flattened_access_chain_struct(uint32_t base, const uint32_t *indices, uint32_t count,
697 std::string flattened_access_chain_matrix(uint32_t base, const uint32_t *indices, uint32_t count,
700 std::string flattened_access_chain_vector(uint32_t base, const uint32_t *indices, uint32_t count,
703 std::pair<std::string, uint32_t> flattened_access_chain_offset(const SPIRType &basetype, const uint32_t *indices,
711 std::string remap_swizzle(const SPIRType &result_type, uint32_t input_components, const std::string &expr);
712 std::string declare_temporary(uint32_t type, uint32_t id);
715 void append_global_func_args(const SPIRFunction &func, uint32_t index, SmallVector<std::string> &arglist);
716 std::string to_non_uniform_aware_expression(uint32_t id);
717 std::string to_expression(uint32_t id, bool register_expression_read = true);
718 std::string to_composite_constructor_expression(uint32_t id, bool uses_buffer_offset);
719 std::string to_rerolled_array_expression(const std::string &expr, const SPIRType &type);
720 std::string to_enclosed_expression(uint32_t id, bool register_expression_read = true);
721 std::string to_unpacked_expression(uint32_t id, bool register_expression_read = true);
722 std::string to_unpacked_row_major_matrix_expression(uint32_t id);
723 std::string to_enclosed_unpacked_expression(uint32_t id, bool register_expression_read = true);
724 std::string to_dereferenced_expression(uint32_t id, bool register_expression_read = true);
725 std::string to_pointer_expression(uint32_t id, bool register_expression_read = true);
726 std::string to_enclosed_pointer_expression(uint32_t id, bool register_expression_read = true);
727 std::string to_extract_component_expression(uint32_t id, uint32_t index);
728 std::string to_extract_constant_composite_expression(uint32_t result_type, const SPIRConstant &c,
730 std::string enclose_expression(const std::string &expr);
731 std::string dereference_expression(const SPIRType &expression_type, const std::string &expr);
732 std::string address_of_expression(const std::string &expr);
733 void strip_enclosed_expression(std::string &expr);
734 std::string to_member_name(const SPIRType &type, uint32_t index);
735 virtual std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain);
736 std::string to_multi_member_reference(const SPIRType &type, const SmallVector<uint32_t> &indices);
737 std::string type_to_glsl_constructor(const SPIRType &type);
738 std::string argument_decl(const SPIRFunction::Parameter &arg);
739 virtual std::string to_qualifiers_glsl(uint32_t id);
742 std::string to_precision_qualifiers_glsl(uint32_t id);
744 std::string flags_to_qualifiers_glsl(const SPIRType &type, const Bitset &flags);
746 virtual std::string layout_for_member(const SPIRType &type, uint32_t index);
747 virtual std::string to_interpolation_qualifiers(const Bitset &flags);
748 std::string layout_for_variable(const SPIRVariable &variable);
749 std::string to_combined_image_sampler(VariableID image_id, VariableID samp_id);
751 virtual void emit_array_copy(const std::string &lhs, uint32_t lhs_id, uint32_t rhs_id,
754 virtual std::string to_initializer_expression(const SPIRVariable &var);
755 virtual std::string to_zero_initialized_expression(uint32_t type_id);
761 std::string buffer_to_packing_standard(const SPIRType &type, bool support_std430_without_scalar_layout);
769 std::string bitcast_glsl(const SPIRType &result_type, uint32_t arg);
770 virtual std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type);
772 std::string bitcast_expression(SPIRType::BaseType target_type, uint32_t arg);
773 std::string bitcast_expression(const SPIRType &target_type, SPIRType::BaseType expr_type, const std::string &expr);
775 std::string build_composite_combiner(uint32_t result_type, const uint32_t *elems, uint32_t length);
776 bool remove_duplicate_swizzle(std::string &op);
777 bool remove_unity_swizzle(uint32_t base, std::string &op);
784 void replace_illegal_names(const std::unordered_set<std::string> &keywords);
789 std::string legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t id);
803 std::string load_flattened_struct(const std::string &basename, const SPIRType &type);
804 std::string to_flattened_struct_member(const std::string &basename, const SPIRType &type, uint32_t index);
806 void store_flattened_struct(const std::string &basename, uint32_t rhs, const SPIRType &type,
808 std::string to_flattened_access_chain_expression(uint32_t id);
815 SmallVector<std::string> forced_extensions;
816 SmallVector<std::string> header_lines;
825 void rewrite_load_for_wrapped_row_major(std::string &expr, TypeID loaded_type, ID ptr);
858 std::string pls_decl(const PlsRemap &variable);
876 void add_variable(std::unordered_set<std::string> &variables_primary,
877 const std::unordered_set<std::string> &variables_secondary, std::string &name);
883 std::string emit_for_loop_initializers(const SPIRBlock &block);
886 bool optimize_read_modify_write(const SPIRType &type, const std::string &lhs, const std::string &rhs);
897 std::string convert_half_to_string(const SPIRConstant &value, uint32_t col, uint32_t row);
898 std::string convert_float_to_string(const SPIRConstant &value, uint32_t col, uint32_t row);
899 std::string convert_double_to_string(const SPIRConstant &value, uint32_t col, uint32_t row);
901 std::string convert_separate_image_to_expression(uint32_t id);
906 virtual void cast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type);
907 virtual void cast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type);
908 void unroll_array_from_complex_load(uint32_t target_id, uint32_t source_id, std::string &expr);
910 void convert_non_uniform_expression(std::string &expr, uint32_t ptr_id);