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

Method define_storage

source/effect_codegen_glsl.cpp:842–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();
845 define_name<naming::unique>(res, info.unique_name);
846
847 std::string &code = _blocks.at(res);
848
849 write_location(code, loc);
850
851 // Default to a binding index equivalent to the entry in the storage list (this is later overwritten in 'finalize_code_for_entry_point' to a more optimal placement)
852 const uint32_t default_binding = static_cast<uint32_t>(_module.storages.size());
853
854 code += "layout(binding = " + std::to_string(default_binding) + ", ";
855 write_texture_format(code, tex_info.format);
856 code += ") uniform ";
857 write_type(code, info.type);
858 code += ' ' + id_to_name(res) + ";\n";
859
860 _module.storages.push_back(info);
861
862 return res;
863 }
864 id define_uniform(const location &loc, uniform &info) override
865 {
866 const id res = make_id();

Callers 1

parse_variableMethod · 0.45

Calls 7

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

Tested by

no test coverage detected