FfxInterface
struct FfxInterfaceA structure encapsulating the interface between the core implementation of the FfxInterface and any graphics API that it should ultimately call.
This set of functions serves as an abstraction layer between FfxInterfae and the API used to implement it. While the FidelityFX SDK ships with backends for DirectX12 and Vulkan, it is possible to implement your own backend for other platforms which sit on top of your engine’s own abstraction layer. For details on the expectations of what each function should do you should refer the description of the following function pointer types: FfxCreateDeviceFunc FfxGetDeviceCapabilitiesFunc FfxDestroyDeviceFunc FfxCreateResourceFunc FfxRegisterResourceFunc FfxGetResourceFunc FfxUnregisterResourcesFunc FfxGetResourceDescriptionFunc FfxDestroyResourceFunc FfxCreatePipelineFunc FfxDestroyPipelineFunc FfxScheduleGpuJobFunc FfxExecuteGpuJobsFunc FfxBeginMarkerFunc FfxEndMarkerFunc FfxRegisterConstantBufferAllocatorFunc
Depending on the graphics API that is abstracted by the backend, it may be required that the backend is to some extent stateful. To ensure that applications retain full control to manage the memory used by the FidelityFX SDK, the scratchBuffer and scratchBufferSize fields are provided. A backend should provide a means of specifying how much scratch memory is required for its internal implementation (e.g: via a function or constant value). The application is then responsible for allocating that memory and providing it when setting up the SDK backend. Backends provided with the FidelityFX SDK do not perform dynamic memory allocations, and instead sub-allocate all memory from the scratch buffers provided.
The scratchBuffer and scratchBufferSize fields should be populated according to the requirements of each backend. For example, if using the DirectX 12 backend you should call the ffxGetScratchMemorySizeDX12 function. It is not required that custom backend implementations use a scratch buffer.
Any functional addition to this interface mandates a version bump to ensure full functionality across effects and backends.
Public Interface
Public Members:
FfxGetSDKVersionFunc fpGetSDKVersion
FfxGetSDKVersionFunc fpGetSDKVersionA callback function to query the SDK version.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 625, column 40)
FfxGetEffectGpuMemoryUsageFunc fpGetEffectGpuMemoryUsage
FfxGetEffectGpuMemoryUsageFunc fpGetEffectGpuMemoryUsageA callback function to query effect Gpu memory usage.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 626, column 40)
FfxCreateBackendContextFunc fpCreateBackendContext
FfxCreateBackendContextFunc fpCreateBackendContextA callback function to create and initialize the backend context.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 627, column 40)
FfxGetDeviceCapabilitiesFunc fpGetDeviceCapabilities
FfxGetDeviceCapabilitiesFunc fpGetDeviceCapabilitiesA callback function to query device capabilites.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 628, column 40)
FfxDestroyBackendContextFunc fpDestroyBackendContext
FfxDestroyBackendContextFunc fpDestroyBackendContextA callback function to destroy the backendcontext. This also dereferences the device.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 629, column 40)
FfxCreateResourceFunc fpCreateResource
FfxCreateResourceFunc fpCreateResourceA callback function to create a resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 630, column 40)
FfxRegisterResourceFunc fpRegisterResource
FfxRegisterResourceFunc fpRegisterResourceA callback function to register an external resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 631, column 40)
FfxGetResourceFunc fpGetResource
FfxGetResourceFunc fpGetResourceA callback function to convert an internal resource to external resource type.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 632, column 40)
FfxUnregisterResourcesFunc fpUnregisterResources
FfxUnregisterResourcesFunc fpUnregisterResourcesA callback function to unregister external resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 633, column 40)
FfxRegisterStaticResourceFunc fpRegisterStaticResource
FfxRegisterStaticResourceFunc fpRegisterStaticResourceA callback function to register a static resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 634, column 40)
FfxGetResourceDescriptionFunc fpGetResourceDescription
FfxGetResourceDescriptionFunc fpGetResourceDescriptionA callback function to retrieve a resource description.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 635, column 40)
FfxDestroyResourceFunc fpDestroyResource
FfxDestroyResourceFunc fpDestroyResourceA callback function to destroy a resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 636, column 40)
FfxMapResourceFunc fpMapResource
FfxMapResourceFunc fpMapResourceA callback function to map a resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 637, column 40)
FfxUnmapResourceFunc fpUnmapResource
FfxUnmapResourceFunc fpUnmapResourceA callback function to unmap a resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 638, column 40)
FfxStageConstantBufferDataFunc fpStageConstantBufferDataFunc
FfxStageConstantBufferDataFunc fpStageConstantBufferDataFuncA callback function to copy constant buffer data into staging memory.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 639, column 40)
FfxCreatePipelineFunc fpCreatePipeline
FfxCreatePipelineFunc fpCreatePipelineA callback function to create a render or compute pipeline.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 640, column 40)
FfxDestroyPipelineFunc fpDestroyPipeline
FfxDestroyPipelineFunc fpDestroyPipelineA callback function to destroy a render or compute pipeline.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 641, column 40)
FfxScheduleGpuJobFunc fpScheduleGpuJob
FfxScheduleGpuJobFunc fpScheduleGpuJobA callback function to schedule a render job.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 642, column 40)
FfxExecuteGpuJobsFunc fpExecuteGpuJobs
FfxExecuteGpuJobsFunc fpExecuteGpuJobsA callback function to execute all queued render jobs.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 643, column 40)
FfxBreadcrumbsAllocBlockFunc fpBreadcrumbsAllocBlock
FfxBreadcrumbsAllocBlockFunc fpBreadcrumbsAllocBlockA callback function to allocate block of memory for AMD FidelityFX Breadcrumbs Library buffer.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 646, column 40)
FfxBreadcrumbsFreeBlockFunc fpBreadcrumbsFreeBlock
FfxBreadcrumbsFreeBlockFunc fpBreadcrumbsFreeBlockA callback function to free AMD FidelityFX Breadcrumbs Library buffer.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 647, column 40)
FfxBreadcrumbsWriteFunc fpBreadcrumbsWrite
FfxBreadcrumbsWriteFunc fpBreadcrumbsWriteA callback function to write marker into AMD FidelityFX Breadcrumbs Library.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 648, column 40)
FfxBreadcrumbsPrintDeviceInfoFunc fpBreadcrumbsPrintDeviceInfo
FfxBreadcrumbsPrintDeviceInfoFunc fpBreadcrumbsPrintDeviceInfoA callback function to print active GPU info for AMD FidelityFX Breadcrumbs Library log.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 649, column 40)
FfxGetPermutationBlobByIndexFunc fpGetPermutationBlobByIndex
FfxGetPermutationBlobByIndexFunc fpGetPermutationBlobByIndexSource: sdk/include/FidelityFX/host/ffx_interface.h (line 651, column 38)
FfxSwapChainConfigureFrameGenerationFunc fpSwapChainConfigureFrameGeneration
FfxSwapChainConfigureFrameGenerationFunc fpSwapChainConfigureFrameGenerationA callback function to configure swap chain present callback.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 652, column 49)
FfxRegisterConstantBufferAllocatorFunc fpRegisterConstantBufferAllocator
FfxRegisterConstantBufferAllocatorFunc fpRegisterConstantBufferAllocatorA callback function to register a custom Thread Safe constant buffer allocator.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 654, column 45)
void * scratchBuffer
void * scratchBufferA preallocated buffer for memory utilized internally by the backend.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 656, column 39)
size_t scratchBufferSize
size_t scratchBufferSizeSize of the buffer pointed to by scratchBuffer.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 657, column 40)
FfxDevice device
FfxDevice deviceA backend specific device.
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 658, column 40)
Used By
This type is used by:
- BlurRM
- CacaoRM
- DX12Backend
- FfxBlurContextDescription
- FfxBreadcrumbsContextDescription
- FfxBrixelizerContextDescription
- FfxBrixelizerGIContextDescription
- FfxBrixelizerRawContextDescription
- FfxCacaoContextDescription
- FfxCasContextDescription
- FfxClassifierContextDescription
- FfxDenoiserContextDescription
- FfxDofContextDescription
- FfxFrameInterpolationContextDescription
- FfxFsr1ContextDescription
- FfxFsr2ContextDescription
- FfxFsr3ContextDescription
- FfxFsr3UpscalerContextDescription
- FfxLensContextDescription
- FfxLpmContextDescription
- FfxOpticalflowContextDescription
- FfxParallelSortContextDescription
- FfxSpdContextDescription
- FfxSssrContextDescription
- FfxVrsContextDescription
- GDKBackend
- HybridReflectionsRM
- HybridShadowsRenderModule
- SDKWrapper
- VKBackend
Source: sdk/include/FidelityFX/host/ffx_interface.h (line 622, column 1)