MCPcopy Create free account
hub / github.com/crosire/reshade / write_location

Function write_location

source/effect_codegen_hlsl.cpp:656–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654 }
655 template <bool force_source = false>
656 void write_location(std::string &s, const location &loc)
657 {
658 if (loc.source.empty() || !_debug_info)
659 return;
660
661 s += "#line " + std::to_string(loc.line);
662
663 size_t offset = s.size();
664
665 // Avoid writing the file name every time to reduce output text size
666 if constexpr (force_source)
667 {
668 s += " \"" + loc.source + '\"';
669 }
670 else if (loc.source != _current_location)
671 {
672 s += " \"" + loc.source + '\"';
673
674 _current_location = loc.source;
675 }
676
677 // Need to escape string for new DirectX Shader Compiler (dxc)
678 if (_shader_model >= 60)
679 {
680 for (; (offset = s.find('\\', offset)) != std::string::npos; offset += 2)
681 s.insert(offset, "\\", 1);
682 }
683
684 s += '\n';
685 }
686 void write_texture_format(std::string &s, texture_format format)
687 {
688 switch (format)

Callers 15

define_structMethod · 0.85
define_samplerMethod · 0.85
define_storageMethod · 0.85
define_uniformMethod · 0.85
define_variableMethod · 0.85
define_functionMethod · 0.85
emit_storeMethod · 0.85
emit_unary_opMethod · 0.85
emit_binary_opMethod · 0.85
emit_ternary_opMethod · 0.85
emit_callMethod · 0.85
emit_call_intrinsicMethod · 0.85

Calls 1

to_stringFunction · 0.85

Tested by

no test coverage detected