FfxInterface
FfxInterface
FidelityFX SDK function signatures and core defines requiring overrides for backend implementation.
Defines
FFX_SDK_VERSION_MAJOR
#define FFX_SDK_VERSION_MAJOR (1)
FidelityFX SDK major version.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 50, column 9)
FFX_SDK_VERSION_MINOR
#define FFX_SDK_VERSION_MINOR (1)
FidelityFX SDK minor version.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 55, column 9)
FFX_SDK_VERSION_PATCH
#define FFX_SDK_VERSION_PATCH (4)
FidelityFX SDK patch version.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 60, column 9)
FFX_SDK_MAKE_VERSION
#define FFX_SDK_MAKE_VERSION(major, minor, patch) ( ( major <<22 ) | ( minor <<12 ) | patch )
Macro to pack a FidelityFX SDK version id together.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 65, column 9)
Typedefs
FfxPass
typedef uint32_t FfxPass
Stand in type for FfxPass.
These will be defined for each effect individually (i.e. FfxFsr2Pass). They are used to fetch the proper blob index to build effect shaders
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 73, column 18)
FfxGetSDKVersionFunc
typedef FfxVersionNumber(* FfxGetSDKVersionFunc) (FfxInterface *backendInterface)
Get the SDK version of the backend context.
Returns: The SDK version a backend was built with.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 83, column 9)
FfxGetEffectGpuMemoryUsageFunc
typedef FfxErrorCode(* FfxGetEffectGpuMemoryUsageFunc) (FfxInterface *backendInterface, FfxUInt32 effectContextId, FfxEffectMemoryUsage *outVramUsage)
Get effect VRAM usage.
Newer effects may require support that legacy versions of the SDK will not be able to provide. A version query is thus required to ensure an effect component will always be paired with a backend which will support all needed functionality.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 102, column 9)
FfxCreateBackendContextFunc
typedef FfxErrorCode(* FfxCreateBackendContextFunc) (FfxInterface *backendInterface, FfxEffect effect, FfxEffectBindlessConfig *bindlessConfig, FfxUInt32 *effectContextId)
Create and initialize the backend context.
The callback function sets up the backend context for rendering. It will create or reference the device and create required internal data structures.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 120, column 9)
FfxGetDeviceCapabilitiesFunc
typedef FfxErrorCode(* FfxGetDeviceCapabilitiesFunc) (FfxInterface *backendInterface, FfxDeviceCapabilities *outDeviceCapabilities)
Get a list of capabilities of the device.
When creating an FfxEffectContext it is desirable for the FFX core implementation to be aware of certain characteristics of the platform that is being targetted. This is because some optimizations which FFX SDK attempts to perform are more effective on certain classes of hardware than others, or are not supported by older hardware. In order to avoid cases where optimizations actually have the effect of decreasing performance, or reduce the breadth of support provided by FFX SDK, the FFX interface queries the capabilities of the device to make such decisions.
For target platforms with fixed hardware support you need not implement this callback function by querying the device, but instead may hardcore what features are available on the platform.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 150, column 9)
FfxDestroyBackendContextFunc
typedef FfxErrorCode(* FfxDestroyBackendContextFunc) (FfxInterface *backendInterface, FfxUInt32 effectContextId)
Destroy the backend context and dereference the device.
This function is called when the FfxEffectContext is destroyed.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 167, column 9)
FfxCreateResourceFunc
typedef FfxErrorCode(* FfxCreateResourceFunc) (FfxInterface *backendInterface, const FfxCreateResourceDescription *createResourceDescription, FfxUInt32 effectContextId, FfxResourceInternal *outResource)
Create a resource.
This callback is intended for the backend to create internal resources.
Please note: It is also possible that the creation of resources might itself cause additional resources to be created by simply calling the FfxCreateResourceFunc function pointer again. This is useful when handling the initial creation of resources which must be initialized. The flow in such a case would be an initial call to create the CPU-side resource, another to create the GPU-side resource, and then a call to schedule a copy render job to move the data between the two. Typically this type of function call flow is only seen during the creation of an FfxEffectContext.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 196, column 9)
FfxRegisterResourceFunc
typedef FfxErrorCode(* FfxRegisterResourceFunc) (FfxInterface *backendInterface, const FfxResource *inResource, FfxUInt32 effectContextId, FfxResourceInternal *outResource)
Register a resource in the backend for the current frame.
Since the FfxInterface and the backends are not aware how many different resources will get passed in over time, it’s not safe to register all resources simultaneously in the backend. Also passed resources may not be valid after the dispatch call. As a result it’s safest to register them as FfxResourceInternal and clear them at the end of the dispatch call.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 222, column 9)
FfxGetResourceFunc
typedef FfxResource(* FfxGetResourceFunc) (FfxInterface *backendInterface, FfxResourceInternal resource)
Get an FfxResource from an FfxResourceInternal resource.
At times it is necessary to create an FfxResource representation of an internally created resource in order to register it with a child effect context. This function sets up the FfxResource needed to register.
Returns: An FfxResource built from the internal resource
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 243, column 9)
FfxUnregisterResourcesFunc
typedef FfxErrorCode(* FfxUnregisterResourcesFunc) (FfxInterface *backendInterface, FfxCommandList commandList, FfxUInt32 effectContextId)
Unregister all temporary FfxResourceInternal from the backend.
Unregister FfxResourceInternal referencing resources passed to a function as a parameter.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 262, column 9)
FfxRegisterStaticResourceFunc
typedef FfxErrorCode(* FfxRegisterStaticResourceFunc) (FfxInterface *backendInterface, const FfxStaticResourceDescription *desc, FfxUInt32 effectContextId)
Register a resource in the static bindless table of the backend.
A static resource will persist in their respective bindless table until it is overwritten by a different resource at the same index. The calling code must take care not to immediately register a new resource at an index that might be in use by an in-flight frame.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 284, column 9)
FfxGetResourceDescriptionFunc
typedef FfxResourceDescription(* FfxGetResourceDescriptionFunc) (FfxInterface *backendInterface, FfxResourceInternal resource)
Retrieve a FfxResourceDescription matching a FfxResource structure.
Returns: A description of the resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 298, column 9)
FfxDestroyResourceFunc
typedef FfxErrorCode(* FfxDestroyResourceFunc) (FfxInterface *backendInterface, FfxResourceInternal resource, FfxUInt32 effectContextId)
Destroy a resource.
This callback is intended for the backend to release an internal resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 316, column 9)
FfxMapResourceFunc
typedef FfxErrorCode(* FfxMapResourceFunc) (FfxInterface *backendInterface, FfxResourceInternal resource, void **ptr)
Map resource memory.
Maps the memory of the resource to a pointer and returns it.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 335, column 9)
FfxUnmapResourceFunc
typedef FfxErrorCode(* FfxUnmapResourceFunc) (FfxInterface *backendInterface, FfxResourceInternal resource)
Unmap resource memory.
Unmaps previously mapped memory of a resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 350, column 9)
FfxStageConstantBufferDataFunc
typedef FfxErrorCode(* FfxStageConstantBufferDataFunc) (FfxInterface *backendInterface, void *data, FfxUInt32 size, FfxConstantBuffer *constantBuffer)
Destroy a resource.
This callback is intended for the backend to release an internal resource.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 365, column 9)
FfxCreatePipelineFunc
typedef FfxErrorCode(* FfxCreatePipelineFunc) (FfxInterface *backendInterface, FfxEffect effect, FfxPass pass, uint32_t permutationOptions, const FfxPipelineDescription *pipelineDescription, FfxUInt32 effectContextId, FfxPipelineState *outPipeline)
Create a render pipeline.
A rendering pipeline contains the shader as well as resource bindpoints and samplers.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 388, column 9)
FfxDestroyPipelineFunc
typedef FfxErrorCode(* FfxDestroyPipelineFunc) (FfxInterface *backendInterface, FfxPipelineState *pipeline, FfxUInt32 effectContextId)
Destroy a render pipeline.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 416, column 9)
FfxScheduleGpuJobFunc
typedef FfxErrorCode(* FfxScheduleGpuJobFunc) (FfxInterface *backendInterface, const FfxGpuJobDescription *job)
Schedule a render job to be executed on the next call of FfxExecuteGpuJobsFunc.
Render jobs can perform one of three different tasks: clear, copy or compute dispatches.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 436, column 9)
FfxExecuteGpuJobsFunc
typedef FfxErrorCode(* FfxExecuteGpuJobsFunc) (FfxInterface *backendInterface, FfxCommandList commandList, FfxUInt32 effectContextId)
Execute scheduled render jobs on the comandList provided.
The recording of the graphics API commands should take place in this callback function, the render jobs which were previously enqueued (via callbacks made to FfxScheduleGpuJobFunc) should be processed in the order they were received. Advanced users might choose to reorder the rendering jobs, but should do so with care to respect the resource dependencies.
Depending on the precise contents of FfxDispatchDescription a different number of render jobs might have previously been enqueued (for example if sharpening is toggled on and off).
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 463, column 9)
FfxBreadcrumbsAllocBlockFunc
typedef FfxErrorCode(* FfxBreadcrumbsAllocBlockFunc) (FfxInterface *backendInterface, uint64_t blockBytes, FfxBreadcrumbsBlockData *blockData)
Allocate AMD FidelityFX Breadcrumbs Library markers buffer.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 513, column 9)
FfxBreadcrumbsFreeBlockFunc
typedef void(* FfxBreadcrumbsFreeBlockFunc) (FfxInterface *backendInterface, FfxBreadcrumbsBlockData *blockData)
Deallocate AMD FidelityFX Breadcrumbs Library markers buffer.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 525, column 9)
FfxBreadcrumbsWriteFunc
typedef void(* FfxBreadcrumbsWriteFunc) (FfxInterface *backendInterface, FfxCommandList commandList, uint32_t value, uint64_t gpuLocation, void *gpuBuffer, bool isBegin)
Write marker to AMD FidelityFX Breadcrumbs Library buffer on the comandList provided.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 540, column 9)
FfxBreadcrumbsPrintDeviceInfoFunc
typedef void(* FfxBreadcrumbsPrintDeviceInfoFunc) (FfxInterface *backendInterface, FfxAllocationCallbacks *allocs, bool extendedInfo, char **printBuffer, size_t *printSize)
Printing GPU specific info to the AMD FidelityFX Breadcrumbs Library status buffer.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 558, column 9)
FfxRegisterConstantBufferAllocatorFunc
typedef void(* FfxRegisterConstantBufferAllocatorFunc) (FfxInterface *backendInterface, FfxConstantBufferAllocator constantAllocator)
Register a Thread Safe constant buffer allocator to be used by the backend.
Source: sdk/include/FidelityFX/host/ffx_interface.h
(line 572, column 9)