MCPcopy Create free account
hub / github.com/baldurk/renderdoc / DisplayRendererPreview

Function DisplayRendererPreview

renderdoccmd/renderdoccmd.cpp:73–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void 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
127static std::vector<std::string> version_lines;
128

Callers 1

ExecuteMethod · 0.70

Calls 4

ResourceIdFunction · 0.50
GetTexturesMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected