| 71 | } |
| 72 | |
| 73 | void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_t height, |
| 74 | uint32_t numLoops) |
| 75 | { |
| 76 | if(renderer == NULL) |
| 77 | return; |
| 78 | |
| 79 | rdcarray<TextureDescription> texs = renderer->GetTextures(); |
| 80 | |
| 81 | TextureDisplay d; |
| 82 | d.subresource = {0, 0, ~0U}; |
| 83 | d.overlay = DebugOverlay::NoOverlay; |
| 84 | d.typeCast = CompType::Typeless; |
| 85 | d.customShaderId = ResourceId(); |
| 86 | d.hdrMultiplier = -1.0f; |
| 87 | d.linearDisplayAsGamma = true; |
| 88 | d.flipY = false; |
| 89 | d.rangeMin = 0.0f; |
| 90 | d.rangeMax = 1.0f; |
| 91 | d.scale = 1.0f; |
| 92 | d.xOffset = 0.0f; |
| 93 | d.yOffset = 0.0f; |
| 94 | d.rawOutput = false; |
| 95 | d.red = d.green = d.blue = true; |
| 96 | d.alpha = false; |
| 97 | |
| 98 | for(const TextureDescription &desc : texs) |
| 99 | { |
| 100 | if(desc.creationFlags & TextureCategory::SwapBuffer) |
| 101 | { |
| 102 | d.resourceId = desc.resourceId; |
| 103 | break; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | rdcarray<ActionDescription> actions = renderer->GetRootActions(); |
| 108 | |
| 109 | ActionDescription *last = NULL; |
| 110 | |
| 111 | if(!actions.empty()) |
| 112 | last = &actions.back(); |
| 113 | |
| 114 | while(last && !last->children.empty()) |
| 115 | last = &last->children.back(); |
| 116 | |
| 117 | if(last && last->flags & ActionFlags::Present) |
| 118 | { |
| 119 | ResourceId id = last->copyDestination; |
| 120 | if(id != ResourceId()) |
| 121 | d.resourceId = id; |
| 122 | } |
| 123 | |
| 124 | DisplayRendererPreview(renderer, d, width, height, numLoops); |
| 125 | } |
| 126 | |
| 127 | static std::vector<std::string> version_lines; |
| 128 |
no test coverage detected