| 220 | } |
| 221 | |
| 222 | static s32 parse_textures(Data &data, const char *json, CompileOptions &opts) |
| 223 | { |
| 224 | TempAllocator4096 ta; |
| 225 | JsonObject obj(ta); |
| 226 | RETURN_IF_ERROR(sjson::parse(obj, json)); |
| 227 | |
| 228 | auto cur = json_object::begin(obj); |
| 229 | auto end = json_object::end(obj); |
| 230 | for (; cur != end; ++cur) { |
| 231 | JSON_OBJECT_SKIP_HOLE(obj, cur); |
| 232 | |
| 233 | const StringView key = cur->first; |
| 234 | const char *value = cur->second; |
| 235 | |
| 236 | DynamicString texture(ta); |
| 237 | RETURN_IF_ERROR(sjson::parse_string(texture, value)); |
| 238 | WARN_IF_MISSING(MATERIAL_RESOURCE, "texture", texture.c_str(), opts); |
| 239 | opts.add_requirement("texture", texture.c_str()); |
| 240 | |
| 241 | data.add_texture(key, StringId64(texture.c_str())); |
| 242 | } |
| 243 | |
| 244 | return 0; |
| 245 | } |
| 246 | |
| 247 | static s32 parse_uniforms(Data &data, const char *json, CompileOptions &opts) |
| 248 | { |
no test coverage detected