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

Method define_variable

source/effect_codegen_spirv.cpp:1149–1158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1147 }
1148 }
1149 id define_variable(const location &loc, const type &type, std::string name, bool global, id initializer_value) override
1150 {
1151 spv::StorageClass storage = spv::StorageClassFunction;
1152 if (type.has(type::q_groupshared))
1153 storage = spv::StorageClassWorkgroup;
1154 else if (global)
1155 storage = spv::StorageClassPrivate;
1156
1157 return define_variable(loc, type, name.c_str(), storage, spv::ImageFormatUnknown, initializer_value);
1158 }
1159 id define_variable(const location &loc, const type &type, const char *name, spv::StorageClass storage, spv::ImageFormat format = spv::ImageFormatUnknown, id initializer_value = 0)
1160 {
1161 assert(storage != spv::StorageClassFunction || (_current_function_blocks != nullptr && _current_function != nullptr && !_current_function->unique_name.empty() && (_current_function->unique_name[0] == 'F' || _current_function->unique_name[0] == 'E')));

Callers

nothing calls this directly

Calls 6

define_variableFunction · 0.85
emit_storeFunction · 0.85
reset_to_lvalueMethod · 0.80
is_numericMethod · 0.80
precisionMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected