| 296 | return false; |
| 297 | } |
| 298 | bool 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 | |
| 333 | void reshade::runtime::reset_uniform_value(api::effect_uniform_variable handle) |
| 334 | { |
no test coverage detected