| 2216 | } |
| 2217 | |
| 2218 | void 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; |
nothing calls this directly
no test coverage detected