| 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'))); |
nothing calls this directly
no test coverage detected