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

Method disassemble_typeChanged

qrenderdoc/Windows/ShaderViewer.cpp:2218–2284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2216}
2217
2218void ShaderViewer::disassemble_typeChanged(int index)
2219{
2220 if(m_ShaderDetails == NULL)
2221 return;
2222
2223 QString targetStr = m_DisassemblyType->currentText();
2224
2225 for(const ShaderProcessingTool &disasm : m_Ctx.Config().ShaderProcessors)
2226 {
2227 if(targetStr == targetName(disasm))
2228 {
2229 ShaderToolOutput out = disasm.DisassembleShader(this, m_ShaderDetails, "");
2230
2231 rdcstr text;
2232
2233 if(out.result.isEmpty())
2234 text = out.log;
2235 else
2236 text.assign((const char *)out.result.data(), out.result.size());
2237
2238 m_DisassemblyView->setReadOnly(false);
2239 SetTextAndUpdateMargin0(m_DisassemblyView, text);
2240 m_DisassemblyView->setReadOnly(true);
2241 m_DisassemblyView->emptyUndoBuffer();
2242 return;
2243 }
2244 }
2245
2246 if(targetStr == tr("More disassembly formats..."))
2247 {
2248 QString text;
2249
2250 text =
2251 tr("; More disassembly formats are available with a pipeline. This shader view is not\n"
2252 "; associated with any specific pipeline and shows only the shader itself.\n\n"
2253 "; Viewing the shader from the pipeline state view with a pipeline bound will expose\n"
2254 "; these other formats:\n\n");
2255
2256 for(const rdcstr &t : m_PipelineTargets)
2257 text += QFormatStr("%1\n").arg(QString(t));
2258
2259 m_DisassemblyView->setReadOnly(false);
2260 SetTextAndUpdateMargin0(m_DisassemblyView, text);
2261 m_DisassemblyView->setReadOnly(true);
2262 m_DisassemblyView->emptyUndoBuffer();
2263 return;
2264 }
2265
2266 QPointer<ShaderViewer> me(this);
2267
2268 m_Ctx.Replay().AsyncInvoke([me, this, targetStr](IReplayController *r) {
2269 if(!me)
2270 return;
2271
2272 rdcstr disasm = r->DisassembleShader(m_Pipeline, m_ShaderDetails, targetStr);
2273
2274 if(!me)
2275 return;

Callers

nothing calls this directly

Calls 12

setReadOnlyMethod · 0.80
emptyUndoBufferMethod · 0.80
trFunction · 0.50
QStringFunction · 0.50
ConfigMethod · 0.45
DisassembleShaderMethod · 0.45
isEmptyMethod · 0.45
assignMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
argMethod · 0.45
AsyncInvokeMethod · 0.45

Tested by

no test coverage detected