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

Method RT_FetchCurrentPixel

qrenderdoc/Windows/TextureViewer.cpp:750–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

748}
749
750void TextureViewer::RT_FetchCurrentPixel(IReplayController *r, uint32_t x, uint32_t y,
751 PixelValue &pickValue, PixelValue &realValue)
752{
753 TextureDescription *texptr = GetCurrentTexture();
754
755 if(texptr == NULL)
756 return;
757
758 if(m_TexDisplay.flipY)
759 y = (texptr->height - 1) - y;
760
761 x = qMax(0U, MipCoordFromBase(x, texptr->width));
762 y = qMax(0U, MipCoordFromBase(y, texptr->height));
763
764 ResourceId id = m_TexDisplay.resourceId;
765 Subresource sub = m_TexDisplay.subresource;
766 CompType typeCast = m_TexDisplay.typeCast;
767
768 if(m_TexDisplay.overlay == DebugOverlay::QuadOverdrawDraw ||
769 m_TexDisplay.overlay == DebugOverlay::QuadOverdrawPass ||
770 m_TexDisplay.overlay == DebugOverlay::TriangleSizeDraw ||
771 m_TexDisplay.overlay == DebugOverlay::TriangleSizePass)
772 {
773 ResourceId overlayResId = m_Output->GetDebugOverlayTexID();
774
775 if(overlayResId != ResourceId())
776 {
777 id = overlayResId;
778 typeCast = CompType::Typeless;
779 }
780 }
781
782 realValue = r->PickPixel(id, x, y, sub, typeCast);
783
784 if(m_TexDisplay.customShaderId != ResourceId())
785 {
786 pickValue = r->PickPixel(m_Output->GetCustomShaderTexID(), x, y,
787 {m_TexDisplay.subresource.mip, 0, 0}, CompType::Typeless);
788 }
789 else
790 {
791 pickValue = realValue;
792 }
793}
794
795void TextureViewer::RT_PickPixelsAndUpdate(IReplayController *r)
796{

Callers

nothing calls this directly

Calls 5

MipCoordFromBaseFunction · 0.85
GetDebugOverlayTexIDMethod · 0.80
GetCustomShaderTexIDMethod · 0.80
ResourceIdFunction · 0.50
PickPixelMethod · 0.45

Tested by

no test coverage detected