Skip to content

FfxInterface

struct FfxInterface

A 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 fpGetSDKVersion

A callback function to query the SDK version.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 625, column 40)

FfxGetEffectGpuMemoryUsageFunc fpGetEffectGpuMemoryUsage

FfxGetEffectGpuMemoryUsageFunc fpGetEffectGpuMemoryUsage

A callback function to query effect Gpu memory usage.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 626, column 40)

FfxCreateBackendContextFunc fpCreateBackendContext

FfxCreateBackendContextFunc fpCreateBackendContext

A callback function to create and initialize the backend context.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 627, column 40)

FfxGetDeviceCapabilitiesFunc fpGetDeviceCapabilities

FfxGetDeviceCapabilitiesFunc fpGetDeviceCapabilities

A callback function to query device capabilites.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 628, column 40)

FfxDestroyBackendContextFunc fpDestroyBackendContext

FfxDestroyBackendContextFunc fpDestroyBackendContext

A 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 fpCreateResource

A callback function to create a resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 630, column 40)

FfxRegisterResourceFunc fpRegisterResource

FfxRegisterResourceFunc fpRegisterResource

A callback function to register an external resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 631, column 40)

FfxGetResourceFunc fpGetResource

FfxGetResourceFunc fpGetResource

A 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 fpUnregisterResources

A callback function to unregister external resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 633, column 40)

FfxRegisterStaticResourceFunc fpRegisterStaticResource

FfxRegisterStaticResourceFunc fpRegisterStaticResource

A callback function to register a static resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 634, column 40)

FfxGetResourceDescriptionFunc fpGetResourceDescription

FfxGetResourceDescriptionFunc fpGetResourceDescription

A callback function to retrieve a resource description.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 635, column 40)

FfxDestroyResourceFunc fpDestroyResource

FfxDestroyResourceFunc fpDestroyResource

A callback function to destroy a resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 636, column 40)

FfxMapResourceFunc fpMapResource

FfxMapResourceFunc fpMapResource

A callback function to map a resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 637, column 40)

FfxUnmapResourceFunc fpUnmapResource

FfxUnmapResourceFunc fpUnmapResource

A callback function to unmap a resource.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 638, column 40)

FfxStageConstantBufferDataFunc fpStageConstantBufferDataFunc

FfxStageConstantBufferDataFunc fpStageConstantBufferDataFunc

A 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 fpCreatePipeline

A callback function to create a render or compute pipeline.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 640, column 40)

FfxDestroyPipelineFunc fpDestroyPipeline

FfxDestroyPipelineFunc fpDestroyPipeline

A callback function to destroy a render or compute pipeline.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 641, column 40)

FfxScheduleGpuJobFunc fpScheduleGpuJob

FfxScheduleGpuJobFunc fpScheduleGpuJob

A callback function to schedule a render job.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 642, column 40)

FfxExecuteGpuJobsFunc fpExecuteGpuJobs

FfxExecuteGpuJobsFunc fpExecuteGpuJobs

A callback function to execute all queued render jobs.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 643, column 40)

FfxBreadcrumbsAllocBlockFunc fpBreadcrumbsAllocBlock

FfxBreadcrumbsAllocBlockFunc fpBreadcrumbsAllocBlock

A 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 fpBreadcrumbsFreeBlock

A callback function to free AMD FidelityFX Breadcrumbs Library buffer.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 647, column 40)

FfxBreadcrumbsWriteFunc fpBreadcrumbsWrite

FfxBreadcrumbsWriteFunc fpBreadcrumbsWrite

A 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 fpBreadcrumbsPrintDeviceInfo

A 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 fpGetPermutationBlobByIndex

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 651, column 38)

FfxSwapChainConfigureFrameGenerationFunc fpSwapChainConfigureFrameGeneration

FfxSwapChainConfigureFrameGenerationFunc fpSwapChainConfigureFrameGeneration

A callback function to configure swap chain present callback.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 652, column 49)

FfxRegisterConstantBufferAllocatorFunc fpRegisterConstantBufferAllocator

FfxRegisterConstantBufferAllocatorFunc fpRegisterConstantBufferAllocator

A 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 * scratchBuffer

A 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 scratchBufferSize

Size of the buffer pointed to by scratchBuffer.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 657, column 40)

FfxDevice device

FfxDevice device

A backend specific device.

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 658, column 40)

Used By

This type is used by:

Source: sdk/include/FidelityFX/host/ffx_interface.h (line 622, column 1)