Allow multiple depth targets to be viewable in the TextureViewer

This commit is contained in:
Leonard Tsai
2023-01-18 12:56:47 +00:00
committed by Baldur Karlsson
parent 588d205279
commit f578e62684
6 changed files with 77 additions and 2 deletions
+7
View File
@@ -388,6 +388,13 @@ For some APIs that don't distinguish by entry point, this may be empty.
)");
BoundResource GetDepthTarget() const;
DOCUMENT(R"(Retrieves the read/write resources bound to the depth-stencil resolve output.
:return: The currently bound depth-stencil resolve resource.
:rtype: BoundResource
)");
BoundResource GetDepthResolveTarget() const;
DOCUMENT(R"(Retrieves the resources bound to the color outputs.
:return: The currently bound output targets.
+26
View File
@@ -1760,6 +1760,32 @@ BoundResource PipeState::GetDepthTarget() const
return BoundResource();
}
BoundResource PipeState::GetDepthResolveTarget() const
{
if(IsCaptureLoaded())
{
if(IsCaptureVK())
{
const VKPipe::RenderPass &rp = m_Vulkan->currentPass.renderpass;
const VKPipe::Framebuffer &fb = m_Vulkan->currentPass.framebuffer;
if(rp.depthstencilResolveAttachment >= 0 &&
rp.depthstencilResolveAttachment < fb.attachments.count())
{
BoundResource ret;
ret.resourceId = fb.attachments[rp.depthstencilResolveAttachment].imageResourceId;
ret.firstMip = (int)fb.attachments[rp.depthstencilResolveAttachment].firstMip;
ret.firstSlice = (int)fb.attachments[rp.depthstencilResolveAttachment].firstSlice;
ret.typeCast = fb.attachments[rp.depthstencilResolveAttachment].viewFormat.compType;
return ret;
}
return BoundResource();
}
}
return BoundResource();
}
rdcarray<BoundResource> PipeState::GetOutputTargets() const
{
rdcarray<BoundResource> ret;