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

Method UI_UpdateCachedTexture

qrenderdoc/Windows/TextureViewer.cpp:397–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397void TextureViewer::UI_UpdateCachedTexture()
398{
399 if(!m_Ctx.IsCaptureLoaded())
400 {
401 m_CachedTexture = NULL;
402 return;
403 }
404
405 ResourceId id = m_LockedId;
406 if(id == ResourceId())
407 id = m_Following.GetResourceId(m_Ctx);
408
409 if(id == ResourceId())
410 id = m_TexDisplay.resourceId;
411
412 m_CachedTexture = m_Ctx.GetTexture(id);
413
414 if(m_CachedTexture != NULL)
415 {
416 if(m_Ctx.APIProps().shaderDebugging)
417 {
418 const ShaderReflection *shaderDetails =
419 m_Ctx.CurPipelineState().GetShaderReflection(ShaderStage::Pixel);
420
421 if(!m_Ctx.CurAction() ||
422 !(m_Ctx.CurAction()->flags & (ActionFlags::MeshDispatch | ActionFlags::Drawcall)))
423 {
424 ui->debugPixelContext->setEnabled(false);
425 ui->debugPixelContext->setToolTip(tr("No draw call selected"));
426 }
427 else if(!shaderDetails)
428 {
429 ui->debugPixelContext->setEnabled(false);
430 ui->debugPixelContext->setToolTip(tr("No pixel shader bound"));
431 }
432 else if(!shaderDetails->debugInfo.debuggable)
433 {
434 ui->debugPixelContext->setEnabled(false);
435 ui->debugPixelContext->setToolTip(
436 tr("The current pixel shader does not support debugging: %1")
437 .arg(shaderDetails->debugInfo.debugStatus));
438 }
439 else
440 {
441 ui->debugPixelContext->setEnabled(true);
442 ui->debugPixelContext->setToolTip(QString());
443 }
444 }
445 else
446 {
447 ui->debugPixelContext->setEnabled(false);
448 ui->debugPixelContext->setToolTip(tr("Shader Debugging not supported on this API"));
449 }
450
451 if(m_Ctx.APIProps().pixelHistory)
452 {
453 ui->pixelHistory->setEnabled(true);
454 ui->pixelHistory->setToolTip(QString());

Callers

nothing calls this directly

Calls 9

ResourceIdFunction · 0.50
trFunction · 0.50
QStringFunction · 0.50
IsCaptureLoadedMethod · 0.45
GetResourceIdMethod · 0.45
GetTextureMethod · 0.45
CurActionMethod · 0.45
setToolTipMethod · 0.45
argMethod · 0.45

Tested by

no test coverage detected