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

Method get_annotation_float_from_uniform_variable

source/runtime_api.cpp:235–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 return false;
234}
235bool reshade::runtime::get_annotation_float_from_uniform_variable(api::effect_uniform_variable handle, const char *name_in, float *values, size_t count, size_t array_index) const
236{
237 if (handle != 0 && name_in != nullptr)
238 {
239 const uniform &variable = *reinterpret_cast<const uniform *>(handle.handle);
240 const std::string_view name(name_in);
241
242 if (const auto it = std::find_if(variable.annotations.cbegin(), variable.annotations.cend(),
243 [&](const reshadefx::annotation &annotation) { return annotation.name == name; });
244 it != variable.annotations.cend())
245 {
246 for (size_t i = 0; i < count; ++i)
247 values[i] = variable.annotation_as_float(name, i + array_index);
248 return true;
249 }
250 }
251
252 for (size_t i = 0; i < count; ++i)
253 values[i] = 0.0f;
254 return false;
255}
256bool reshade::runtime::get_annotation_int_from_uniform_variable(api::effect_uniform_variable handle, const char *name_in, int32_t *values, size_t count, size_t array_index) const
257{
258 if (handle != 0 && name_in != nullptr)

Callers 1

draw_history_windowFunction · 0.80

Calls 1

annotation_as_floatMethod · 0.45

Tested by

no test coverage detected