“Note that common state promotion is ‘free’ in that there is no need for the GPU to perform any synchronization waits. The promotion represents the fact that resources in the COMMON state should not require additional GPU work or driver tracking to support certain accesses.”
불필요한 Resource Barrier 상태전환을 줄이고 암시적인 상태전환을 하도록 하는 것이 성능상 유리하다.
“Resources can only be ‘promoted’ out of D3D12_RESOURCE_STATE_COMMON. Similarly, resources will only ‘decay’ to D3D12_RESOURCE_STATE_COMMON.”
COMMON → (하나의 쓰기 상태 또는 복수의 읽기 상태)
암시적 전환가능 (Promotion)
“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.”
첫 접근 이후에는 배리어 필요(= NON-COMMON ↔ NON-COMMON 전환은 명시적)
State decay to common
The flip-side of common state promotion is decay back to D3D12_RESOURCE_STATE_COMMON. Resources that meet certain requirements are considered to be stateless and effectively return to the common state when the GPU finishes execution of an ExecuteCommandLists operation. Decay does not occur between command lists executed together in the same ExecuteCommandLists call.
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.
다른상태로 전환후에 다시 Common 으로 자동으로 돌아오는 경우이다.
다시 Common 으로 돌아오는 것을 decay 라고 한다.
대표적으로 Copy Queue 의 경우 초기에 COMMON 상태로 넘기면 내부적으로 알아서 COMMON → COPY_DEST → COMMON 으로 처리한다.
단 반드시 초기 상태는 COMMON 이어야한다.
<aside> 💡
암시적 전환이 되는 경우
COMMON → (하나의 쓰기 상태 또는 복수의 읽기 상태)
“첫 GPU 접근”일 때만 가능. 표에 명시된 상태들(예: PIXEL_SHADER_RESOURCE
, NON_PIXEL_SHADER_RESOURCE
, COPY_DEST
, COPY_SOURCE
등)로 암시적 승격된다.
또한 읽기 상태는 이후에 읽기 플래그를 추가로 결합하는 승격도 허용된다.
COMMON으로의 감쇠(decay): 특정 조건에서만 COMMON 으로 자동 복귀
(예: Copy 큐에서 사용한 리소스는 ExecuteCommandLists 완료 시 COMMON으로)
암시적 전환이 안 되는 경우 (= 명시적 배리어 필요)
ResourceBarrier
(transition) 가 필요하다.COPY_DEST → PIXEL_SHADER_RESOURCE
, RENDER_TARGET → UAV
같은 전환은 전부 명시적 배리어</aside>