microsoft / D3D12TranslationLayer

A library containing utilities for mapping higher-level graphics work to D3D12
MIT License
327 stars 47 forks source link

The transition from exclusive state to shared state must be accompanied by copying of actual state values. #57

Open IvanPopov opened 2 years ago

IvanPopov commented 2 years ago

https://github.com/microsoft/D3D12TranslationLayer/blob/4a4b40d9c91a9ac8ef728a6e1254c896895c2d43/src/ResourceState.cpp#L105

Most of the time, resources are exclusive and they make the transition on first use to another queue, tipically during PostSubmitUpdateState() -> SetSharedResourceState(). Does I undertand right that we have to copy actual exclusive state to shared in order to be sure that next transition as shared resource will be with correct state "before" ?

jenatali commented 2 years ago

Shared resource states are only used on resources that are "simultaneous access." For these resources, states "decay" to COMMON at the end of every ExecuteCommandLists group. A shared state means that no barriers have actually been issued, but the resource has been read from in a "promotable" way. So, no, I don't think anything is missing here.