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

Method define_sampler

source/effect_codegen_glsl.cpp:821–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819 return res;
820 }
821 id define_sampler(const location &loc, const texture &, sampler &info) override
822 {
823 const id res = info.id = create_block();
824 define_name<naming::unique>(res, info.unique_name);
825
826 std::string &code = _blocks.at(res);
827
828 write_location(code, loc);
829
830 // Default to a binding index equivalent to the entry in the sampler list (this is later overwritten in 'finalize_code_for_entry_point' to a more optimal placement)
831 const uint32_t default_binding = static_cast<uint32_t>(_module.samplers.size());
832
833 code += "layout(binding = " + std::to_string(default_binding);
834 code += ") uniform ";
835 write_type(code, info.type);
836 code += ' ' + id_to_name(res) + ";\n";
837
838 _module.samplers.push_back(info);
839
840 return res;
841 }
842 id define_storage(const location &loc, const texture &tex_info, storage &info) override
843 {
844 const id res = info.id = create_block();

Callers 1

parse_variableMethod · 0.45

Calls 6

write_locationFunction · 0.85
to_stringFunction · 0.85
write_typeFunction · 0.85
id_to_nameFunction · 0.85
atMethod · 0.80
create_blockFunction · 0.70

Tested by

no test coverage detected