#[repr(C)]pub struct Interface {Show 14 fields
pub fpCreateBackendContext: CreateBackendContextFunc,
pub fpGetDeviceCapabilities: GetDeviceCapabilitiesFunc,
pub fpDestroyBackendContext: DestroyBackendContextFunc,
pub fpCreateResource: CreateResourceFunc,
pub fpRegisterResource: RegisterResourceFunc,
pub fpUnregisterResources: UnregisterResourcesFunc,
pub fpGetResourceDescription: GetResourceDescriptionFunc,
pub fpDestroyResource: DestroyResourceFunc,
pub fpCreatePipeline: CreatePipelineFunc,
pub fpDestroyPipeline: DestroyPipelineFunc,
pub fpScheduleGpuJob: ScheduleGpuJobFunc,
pub fpExecuteGpuJobs: ExecuteGpuJobsFunc,
pub scratchBuffer: *mut c_void,
pub scratchBufferSize: usize,
}Expand description
A structure encapsulating the interface between the core implentation of the FSR2 algorithm and any graphics API that it should ultimately call.
This set of functions serves as an abstraction layer between FSR2 and the API used to implement it. While FSR2 ships with backends for DirectX12 and Vulkan, it is possible to implement your own backend for other platforms or which sits ontop 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:
<c><i>FfxFsr2CreateDeviceFunc</i></c>
<c><i>FfxFsr2GetDeviceCapabilitiesFunc</i></c>
<c><i>FfxFsr2DestroyDeviceFunc</i></c>
<c><i>FfxFsr2CreateResourceFunc</i></c>
<c><i>FfxFsr2GetResourceDescriptionFunc</i></c>
<c><i>FfxFsr2DestroyResourceFunc</i></c>
<c><i>FfxFsr2CreatePipelineFunc</i></c>
<c><i>FfxFsr2DestroyPipelineFunc</i></c>
<c><i>FfxFsr2ScheduleGpuJobFunc</i></c>
<c><i>FfxFsr2ExecuteGpuJobsFunc</i></c>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 FSR2, the
The
@ingroup FSR2
Fields§
§fpCreateBackendContext: CreateBackendContextFunc< A callback function to create and initialize the backend context.
fpGetDeviceCapabilities: GetDeviceCapabilitiesFunc< A callback function to query device capabilites.
fpDestroyBackendContext: DestroyBackendContextFunc< A callback function to destroy the backendcontext. This also dereferences the device.
fpCreateResource: CreateResourceFunc< A callback function to create a resource.
fpRegisterResource: RegisterResourceFunc< A callback function to register an external resource.
fpUnregisterResources: UnregisterResourcesFunc< A callback function to unregister external resource.
fpGetResourceDescription: GetResourceDescriptionFunc< A callback function to retrieve a resource description.
fpDestroyResource: DestroyResourceFunc< A callback function to destroy a resource.
fpCreatePipeline: CreatePipelineFunc< A callback function to create a render or compute pipeline.
fpDestroyPipeline: DestroyPipelineFunc< A callback function to destroy a render or compute pipeline.
fpScheduleGpuJob: ScheduleGpuJobFunc< A callback function to schedule a render job.
fpExecuteGpuJobs: ExecuteGpuJobsFunc< A callback function to execute all queued render jobs.
scratchBuffer: *mut c_void< A preallocated buffer for memory utilized internally by the backend.
scratchBufferSize: usize< Size of the buffer pointed to by