baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
9.02k stars 1.35k forks source link

Add static const textures to the texture viewer window that are set via the ResourceDescriptorHeap #2801

Closed jay1975h closed 7 months ago

jay1975h commented 1 year ago

Description

Dynamic resources in Shader Model 6.6 allows you to set a static const texture using the ResourceDescriptorHeap. For example:

cbuffer Ids { int id1; };
static const Texture2D<float4> texture = ResourceDescriptorHeap[id1];

These textures are not visible in Renderdoc's texture viewer window. The only way to look at these textures right now is to open the descriptor heap and scroll until you find the correct index, which is rather troublesome. Adding these textures to the texture viewer window would help a lot for debugging.

Environment

baldurk commented 1 year ago

SM6.6 direct heap feedback is already supported but it looks like there was a regression in v1.23/v1.24 which caused resources not to properly show up in the pipeline state viewer. That commit should fix it, so you can find the accessed resources that way. I'm not sure what you mean about 'opening the descriptor heap' since there's no way to do that in RenderDoc?

Getting thumbnails in the texture viewer is more complex because they're based on reflection data, and there is no reflection data for SM6.6 heap access. This may have to be a longer-term refactor to figure out some way to represent that nicely.

jay1975h commented 1 year ago

Thanks for the fast response.

"I'm not sure what you mean about 'opening the descriptor heap' since there's no way to do that in RenderDoc?" I am looking at the descriptor heap through this window.

image

baldurk commented 1 year ago

That does not show the current contents of the descriptor heap and you should not be using it as a way to view the current bindings, that's what the pipeline state is for. Maybe I need to look at hiding that, since as it says in your screenshot that is really an internal piece of data.

baldurk commented 7 months ago

I've pushed a refactor to how RenderDoc handles descriptors, which includes more generalised support for SM6.6 access so they should now show up in the texture viewer thumbnails. This should be present in the next nightly build.