Hi @billkris:
1) You mention above
Quote
A resource in the COMMON state can be incrementally promoted to multiple read-only states without the need for explicit resource barriers. Such resources will also decay back to COMMON when the associated ExecuteCommandLists operation completes.
I have seen this mentioned in the documentation (i.e., the multiple read-only or 1 write state limitation). Is this true of any resource or perhaps just buffers and allow_simultaneous_access textures? I found the documentation to be unclear on this point, especially since it later describes a case that requires an explicit barrier which I interpret to be "promotion to multiple read-only states"?
Quote
When this access occurs the promotion acts like an implicit resource barrier. For subsequent accesses, resource barriers will be required to change the resource state if necessary. For example, if a resource in the common state is promoted to PIXEL_SHADER_RESOURCE in a Draw call and is then used as a copy source, a resource state transition barrier from PIXEL_SHADER_RESOURCE to COPY_SOURCE is needed.
Since both of the latter states are included in GENERIC_READ, I had assumed a barrier would not be needed for the second transition either (based on the multiple read-only, 1 write state rule), yet the word 'needed' seems to contradict my assumption.
2) About Decay of a non-simultaneous access textures, something you discussed in your 2nd paragraph above, I have some questions. I find the "4th Decay condition" in the documentation to be slightly unclear, and also somewhat at odds with another nearby statement:
Quote
The following resources will decay when an ExecuteCommandLists operation is completed on the GPU:
* Resources being accessed on a Copy queue, or
* Buffer resources on any queue type, or
* Texture resources on any queue type that have the D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS flag set, or
* Any resource implicitly promoted to a read-only state.
Like common state promotion, the decay is free in that no additional synchronization is needed. Combining common state promotion and decay can help to eliminate many unnecessary ResourceBarrier transitions. In some cases, this can provide significant performance improvements.
Resources will decay to the common state regardless of whether they were explicitly transitioned using resource barriers or implicitly promoted.
I'll list a few examples...
Example 2A) (Your example) A non-simul-access texture promoting to COPY_DEST on a DIRECT (or COMPUTE) queue, I would completely agree that the documentation is quite clear that it would not decay to COMMON. So no question about this case.
Example 2B) A non-simul-access texture implicitly promoting to multiple read-only states on a DIRECT (or COMPUTE) queue, I assume this WILL decay although the documentation seems to imply there can be at most one promotion. My latest interpretation is that as long is there is no promotion to a writable state, then decay will happen.
Example 2C) A non-simul-access texture explicitly transitioned to a read-only state on a DIRECT (or COMPUTE) queue. I'm unsure if an explicit use of a resource barrier would prevent the decay. The documentation seems to say implicit promotion is required, but then later that implicit promotion should not be a requirement (see the highlighted lines in the quote above).
Example 2D) A non-simul-access texture implicitly promoted to a read-only state and then explicitly transitioned to another read-only state on a DIRECT (or COMPUTE) queue. Here too, as in the previous case I'm unsure if an explicit use of a resource barrier at any point would prevent the decay.
I guess I feel the 4th rule of Decay (in the quote above) needs clarification. What happens if explicit barriers are used? What happens if multiple implicit transitions occur to read-only states? What if there is a mixture? What if it is transitioned to a writable state but then back to a read-only state? My current assumption is that regardless of its final state, if it ever gets transitioned to a writable state then decay won't happen but I'm not fully sure.
3) I'm not sure if you're in a position to know this, but I'll keep my fingers crossed. I find that the D3D12 debug validation layer tells me different things on different devices. For example, when testing Promotion and Decay, cases that pass without any error on the MS Reference D3D12 device (and which I strongly feel are correct) report intermittent D3D12 Errors on my GPU (Nv GTX 1070 tested on many recent driver versions). Are drivers known to be buggy in this area? The problems I have seen reported by the GPU are intermittent but frequent cases where the Debug layer claims an "allow-simul-access" texture does not Decay To COMMON. I have not seen evidence the operations fail, only that the debug layer reports state inconsistency errors.