DX12 Backend
FidelityFX SDK native backend implementation for DirectX 12.
Modules
Functions
Return type |
Description |
---|---|
FFX_API size_t |
ffxGetScratchMemorySizeDX12 (size_t maxContexts)
Query how much memory is required for the DirectX 12 backend’s scratch buffer.
|
ffxGetDeviceDX12 (ID3D12Device* device)
Create a “FfxDevice“ from a “ID3D12Device“.
|
|
ffxGetInterfaceDX12 ( FfxInterface * backendInterface, FfxDevice device, void* scratchBuffer, size_t scratchBufferSize, size_t maxContexts )
Populate an interface with pointers for the DX12 backend.
|
|
ffxGetCommandListDX12 (ID3D12CommandList* cmdList)
Create a “FfxCommandList“ from a “ID3D12CommandList“.
|
|
ffxGetPipelineDX12 (ID3D12PipelineState* pipelineState)
Create a “FfxPipeline“ from a “ID3D12PipelineState“.
|
|
ffxGetResourceDX12 ( const ID3D12Resource* dx12Resource, FfxResourceDescription ffxResDescription, const wchar_t* ffxResName, FfxResourceStates state = FFX_RESOURCE_STATE_COMPUTE_READ )
Fetch a “FfxResource“ from a “GPUResource“.
|
|
ffxLoadPixDll (const wchar_t* pixDllPath)
Loads PIX runtime dll to allow SDK calls to show up in Microsoft PIX.
|
|
FFX_API FfxSurfaceFormat |
ffxGetSurfaceFormatDX12 (DXGI_FORMAT format)
Fetch a “FfxSurfaceFormat“ from a DXGI_FORMAT.
|
FFX_API DXGI_FORMAT |
ffxGetDX12FormatFromSurfaceFormat (FfxSurfaceFormat surfaceFormat)
Fetch a DXGI_FORMAT from a “FfxSurfaceFormat“.
|
ffxGetResourceDescriptionDX12 ( const ID3D12Resource* pResource, FfxResourceUsage additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY )
Fetch a “FfxResourceDescription“ from an existing ID3D12Resource.
|
|
FFX_API FfxCommandQueue |
ffxGetCommandQueueDX12 (ID3D12CommandQueue* pCommandQueue)
Fetch a “FfxCommandQueue“ from an existing ID3D12CommandQueue.
|
FFX_API FfxSwapchain |
ffxGetSwapchainDX12 (IDXGISwapChain4* pSwapchain)
Fetch a “FfxSwapchain“ from an existing IDXGISwapChain4.
|
FFX_API IDXGISwapChain4* |
ffxGetDX12SwapchainPtr (FfxSwapchain ffxSwapchain)
Fetch a IDXGISwapChain4 from an existing “FfxSwapchain“.
|
Detailed description
FidelityFX SDK native backend implementation for DirectX 12.
Global functions
ffxGetScratchMemorySizeDX12
FFX_API size_t ffxGetScratchMemorySizeDX12 (size_t maxContexts)
Query how much memory is required for the DirectX 12 backend’s scratch buffer.
Parameters:
maxContexts |
The maximum number of simultaneous effect contexts that will share the backend. (Note that some effects contain internal contexts which count towards this maximum) |
Returns:
The size (in bytes) of the required scratch memory buffer for the DX12 backend.
ffxGetDeviceDX12
Create a FfxDevice
from a ID3D12Device
.
Parameters:
device |
A pointer to the DirectX12 device. |
Returns:
An abstract FidelityFX device.
ffxGetInterfaceDX12
FFX_API FfxErrorCode ffxGetInterfaceDX12 (
FfxInterface * backendInterface,
FfxDevice device,
void* scratchBuffer,
size_t scratchBufferSize,
size_t maxContexts
)
Populate an interface with pointers for the DX12 backend.
Parameters:
backendInterface |
A pointer to a |
device |
A pointer to the DirectX12 device. |
scratchBuffer |
A pointer to a buffer of memory which can be used by the DirectX(R)12 backend. |
scratchBufferSize |
The size (in bytes) of the buffer pointed to by |
maxContexts |
The maximum number of simultaneous effect contexts that will share the backend. (Note that some effects contain internal contexts which count towards this maximum) |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_CODE_INVALID_POINTER |
The |
ffxGetCommandListDX12
FFX_API FfxCommandList ffxGetCommandListDX12 (ID3D12CommandList* cmdList)
Create a FfxCommandList
from a ID3D12CommandList
.
Parameters:
cmdList |
A pointer to the DirectX12 command list. |
Returns:
An abstract FidelityFX command list.
ffxGetPipelineDX12
FFX_API FfxPipeline ffxGetPipelineDX12 (ID3D12PipelineState* pipelineState)
Create a FfxPipeline
from a ID3D12PipelineState
.
Parameters:
pipelineState |
A pointer to the DirectX12 pipeline state. |
Returns:
An abstract FidelityFX pipeline.
ffxGetResourceDX12
FFX_API FfxResource ffxGetResourceDX12 (
const ID3D12Resource* dx12Resource,
FfxResourceDescription ffxResDescription,
const wchar_t* ffxResName,
FfxResourceStates state = FFX_RESOURCE_STATE_COMPUTE_READ
)
Fetch a FfxResource
from a GPUResource
.
Parameters:
dx12Resource |
A pointer to the DX12 resource. |
ffxResDescription |
An |
ffxResName |
(optional) A name string to identify the resource in debug mode. |
state |
The state the resource is currently in. |
Returns:
An abstract FidelityFX resources.
ffxLoadPixDll
FFX_API FfxErrorCode ffxLoadPixDll (const wchar_t* pixDllPath)
Loads PIX runtime dll to allow SDK calls to show up in Microsoft PIX.
Parameters:
pixDllPath |
The path to the DLL to load. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_PATH |
Could not load the DLL using the provided path. |
FFX_ERROR_BACKEND_API_ERROR |
Could not get proc addresses for PIXBeginEvent and/or PIXEndEvent |
ffxGetSurfaceFormatDX12
FFX_API FfxSurfaceFormat ffxGetSurfaceFormatDX12 (DXGI_FORMAT format)
Fetch a FfxSurfaceFormat
from a DXGI_FORMAT.
Parameters:
format |
The DXGI_FORMAT to convert to |
Returns:
An FfxSurfaceFormat
.
ffxGetDX12FormatFromSurfaceFormat
FFX_API DXGI_FORMAT ffxGetDX12FormatFromSurfaceFormat (FfxSurfaceFormat surfaceFormat)
Fetch a DXGI_FORMAT from a FfxSurfaceFormat
.
Parameters:
surfaceFormat |
The |
Returns:
An DXGI_FORMAT.
ffxGetResourceDescriptionDX12
FFX_API FfxResourceDescription ffxGetResourceDescriptionDX12 (
const ID3D12Resource* pResource,
FfxResourceUsage additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY
)
Fetch a FfxResourceDescription
from an existing ID3D12Resource.
Parameters:
pResource |
The ID3D12Resource resource to create a |
additionalUsages |
Optional |
Returns:
An FfxResourceDescription
.
ffxGetCommandQueueDX12
FFX_API FfxCommandQueue ffxGetCommandQueueDX12 (ID3D12CommandQueue* pCommandQueue)
Fetch a FfxCommandQueue
from an existing ID3D12CommandQueue.
Parameters:
pCommandQueue |
The ID3D12CommandQueue to create a |
Returns:
An FfxCommandQueue
.
ffxGetSwapchainDX12
FFX_API FfxSwapchain ffxGetSwapchainDX12 (IDXGISwapChain4* pSwapchain)
Fetch a FfxSwapchain
from an existing IDXGISwapChain4.
Parameters:
pSwapchain |
The IDXGISwapChain4 to create a |
Returns:
An FfxSwapchain
.
ffxGetDX12SwapchainPtr
FFX_API IDXGISwapChain4* ffxGetDX12SwapchainPtr (FfxSwapchain ffxSwapchain)
Fetch a IDXGISwapChain4 from an existing FfxSwapchain
.
Parameters:
ffxSwapchain |
The |
Returns:
An IDXGISwapChain4 object.