Closed godlikepanos closed 1 month ago
This looks to be working as intended.
At EID 659 you have a Barrier call which transitions ShadowAtlas
and passes the D3D12_TEXTURE_BARRIER_FLAG_DISCARD
flag which discards the texture contents. RenderDoc highlights this by filling the texture with a pattern exactly to show you that this bug exists so that you can fix it instead of relying on undefined textures contents. It use UNDEFINED IMG
to distinguish from a call to DiscardResource
.
Barrier(...)
pCommandList RenderGraph cmdb 5-6 🔗
NumBarrierGroups 2
pBarrierGroups D3D12_BARRIER_GROUP[2]
[0] D3D12_BARRIER_GROUP()
Type D3D12_BARRIER_TYPE_TEXTURE
NumBarriers 12
pTextureBarriers D3D12_TEXTURE_BARRIER[12]
[0] D3D12_TEXTURE_BARRIER()
[1] D3D12_TEXTURE_BARRIER()
[2] D3D12_TEXTURE_BARRIER()
SyncBefore D3D12_BARRIER_SYNC_DEPTH_STENCIL
SyncAfter D3D12_BARRIER_SYNC_COMPUTE_SHADING
AccessBefore D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE
AccessAfter D3D12_BARRIER_ACCESS_SHADER_RESOURCE
LayoutBefore D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE
LayoutAfter D3D12_BARRIER_LAYOUT_SHADER_RESOURCE
pResource ShadowAtlas 🔗
Subresources D3D12_BARRIER_SUBRESOURCE_RANGE()
Flags D3D12_TEXTURE_BARRIER_FLAG_DISCARD <--
oops. You are right. One structure wasn't properly initialized.
Description
I have an application that uses D3D12's enhanced barriers and renderpasses. In my captures and in the texture viewer I see a lot of "undefinedimg" and I'm not sure these come from. For example I have a depth texture that is used like this:
When I click on the dispatch and try to view the inputs this texture appears full of undefinedimg which I don't think it's correct.
Steps to reproduce
This is a capture that exhibits the problem: https://drive.google.com/file/d/1bccfKskWqvhSAORcgmHal6-uEdFlLbIl/view?usp=sharing (Captured on nVidia 4080)
If you search for a resource named "ShadowAtlas" you will see the case I described above.
Environment