| 49 | } |
| 50 | |
| 51 | void ResourceReplay::play(ResourceCache &resource_cache, ResourceRecord &recorder) |
| 52 | { |
| 53 | std::istringstream stream{recorder.get_stream().str()}; |
| 54 | |
| 55 | while (true) |
| 56 | { |
| 57 | // Read command id |
| 58 | ResourceType resource_type; |
| 59 | read(stream, resource_type); |
| 60 | |
| 61 | if (stream.eof()) |
| 62 | { |
| 63 | break; |
| 64 | } |
| 65 | |
| 66 | // Find command function for the given command id |
| 67 | auto cmd_it = stream_resources.find(resource_type); |
| 68 | |
| 69 | // Check if command replayer supports the given command |
| 70 | if (cmd_it != stream_resources.end()) |
| 71 | { |
| 72 | // Run command function |
| 73 | cmd_it->second(resource_cache, stream); |
| 74 | } |
| 75 | else |
| 76 | { |
| 77 | LOGE("Replay command not supported."); |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | void ResourceReplay::create_shader_module(ResourceCache &resource_cache, std::istringstream &stream) |
| 83 | { |