| 89 | } |
| 90 | |
| 91 | void ShaderModule::set_resource_mode(const std::string &resource_name, const ShaderResourceMode &resource_mode) |
| 92 | { |
| 93 | auto it = std::ranges::find_if(resources, [&resource_name](const ShaderResource &resource) { return resource.name == resource_name; }); |
| 94 | |
| 95 | if (it != resources.end()) |
| 96 | { |
| 97 | if (resource_mode == ShaderResourceMode::Dynamic) |
| 98 | { |
| 99 | if (it->type == ShaderResourceType::BufferUniform || it->type == ShaderResourceType::BufferStorage) |
| 100 | { |
| 101 | it->mode = resource_mode; |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | LOGW("Resource `{}` does not support dynamic.", resource_name); |
| 106 | } |
| 107 | } |
| 108 | else |
| 109 | { |
| 110 | it->mode = resource_mode; |
| 111 | } |
| 112 | } |
| 113 | else |
| 114 | { |
| 115 | LOGW("Resource `{}` not found for shader.", resource_name); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | size_t ShaderVariant::get_id() const |
| 120 | { |
no test coverage detected