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

Method get_annotation_string_from_uniform_variable

source/runtime_api.cpp:298–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 return false;
297}
298bool reshade::runtime::get_annotation_string_from_uniform_variable(api::effect_uniform_variable handle, const char *name_in, char *value, size_t *size) const
299{
300 if (handle != 0 && name_in != nullptr)
301 {
302 const uniform &variable = *reinterpret_cast<const uniform *>(handle.handle);
303 const std::string_view name(name_in);
304
305 if (const auto it = std::find_if(variable.annotations.cbegin(), variable.annotations.cend(),
306 [&](const reshadefx::annotation &annotation) { return annotation.name == name; });
307 it != variable.annotations.cend())
308 {
309 const std::string_view annotation = variable.annotation_as_string(name);
310
311 if (size != nullptr)
312 {
313 if (value == nullptr)
314 {
315 *size = annotation.size() + 1;
316 }
317 else if (*size != 0)
318 {
319 *size = annotation.copy(value, *size - 1);
320 value[*size] = '\0';
321 }
322 }
323
324 return true;
325 }
326 }
327
328 if (size != nullptr)
329 *size = 0;
330 return false;
331}
332
333void reshade::runtime::reset_uniform_value(api::effect_uniform_variable handle)
334{

Callers 5

on_set_uniform_valueFunction · 0.45
draw_history_windowFunction · 0.45
update_effect_runtimeFunction · 0.45
update_uniform_variablesFunction · 0.45

Calls 1

annotation_as_stringMethod · 0.45

Tested by

no test coverage detected