// d3d12umddi.h
typedef enum D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_TYPE {
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_DISCARD,
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_PRESERVE,
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_CLEAR,
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_NO_ACCESS,
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_RESUME_WRITING,
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_RESUME_LOCAL_READ
} ;
View the official Windows Driver Kit DDI referenceNo description available.
Declares the type of resource access for the call to PFND3D12DDI_BEGIN_RENDER_PASS.
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_DISCARDIndicates that the application does not have any dependency on the prior contents of the resource.
A given implementation may return the previously-written contents, or it may return uninitialized data. However, reading from the resource must not produce a GPU hang, the 'read' may only return undefined data in the worst case. A read is defined as a traditional:
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_PRESERVEIndicates that the application has a dependency on the prior contents of the resource, and the contents must be loaded from main memory.
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_CLEARIndicates that the application has a dependency on the resource being cleared to a specific (app-provided) color.
[!NOTE] This clear occurs whether or not the resource has interacted with anything beyond the Render Pass.
The API will allow the application to specify the clear values in the call to PFND3D12DDI_BEGIN_RENDER_PASS, via the D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS structure.
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_NO_ACCESSIndicates that the resource will not be read from or written to during the Render Pass. This value also indicates whether the depth/stencil plane for a DSV (Data Source View) was not accessed.
[!IMPORTANT] This field must be paired with the D3D12DDI_RENDER_PASS_ENDING_ACCESS_NO_ACCESS flag in D3D12DDI_RENDER_PASS_ENDING_ACCESS_TYPE.
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_RESUME_WRITINGIndicates that the application is to resume writing in the following conditions:
The writing in the resuming Render Pass occurs right after the writing in the suspending Render Pass. The intent of this flag is to allow writes to the same Render Target in order to span multiple command lists, and without flushing any on-chip caches. Writing may resume from a Render Pass in a separate Command List, as long as the suspending/resuming Command Lists are executed (back to back) in the same ExecuteCommandLists group.
D3D12DDI_RENDER_PASS_BEGINNING_ACCESS_RESUME_LOCAL_READIndicates that the application wants to read from a resource that was previously and immediately written to by the GPU (i.e. still potentially in tile cache), and will be read from in a pixel-local fashion (i.e. reads will always be on the exact output pixel, or adjacent pixels).
This enumeration value, paired with D3D12DDI_RENDER_PASS_ENDING_ACCESS_SUSPEND_LOCAL_READ value in the D3D12DDI_RENDER_PASS_ENDING_ACCESS_TYPE enumeration, is to allow resources to be read from, when possible, without issuing a flush between two subsequent Render Pass operations.
Specifically, the application warrants:
The kernel size of the read (how many surrounding pixels are needed) are specified at PFND3D12DDI_BEGIN_RENDER_PASS time, through the AdditionalWidth/AdditionalHeight fields on D3D12_RENDER_PASS_BEGINNING_ACCESS_RESUME_LOCAL_READ_PARAMETERS. The AdditionalWidth/AdditionalHeight parameters must match those on the previous D3D12DDI_RENDER_PASS_ENDING_ACCESS_SUSPEND_LOCAL_READ_PARAMETERS.