Vulkan Backend

FidelityFX SDK native backend implementation for Vulkan.

Functions

Return type

Description

FFX_API size_t

ffxGetScratchMemorySizeVK (VkPhysicalDevice physicalDevice, size_t maxContexts)
Query how much memory is required for the Vulkan backend’s scratch buffer.

FFX_API FfxDevice

ffxGetDeviceVK (VkDeviceContext * vkDeviceContext)
Create a “FfxDevice“ from a “VkDevice“.

FFX_API FfxErrorCode

ffxGetInterfaceVK ( FfxInterface * backendInterface, FfxDevice device, void* scratchBuffer, size_t scratchBufferSize, size_t maxContexts )
Populate an interface with pointers for the VK backend.

FFX_API FfxCommandList

ffxGetCommandListVK (VkCommandBuffer cmdBuf)
Create a “FfxCommandList“ from a “VkCommandBuffer“.

FFX_API FfxPipeline

ffxGetPipelineVK (VkPipeline pipeline)
Create a “FfxPipeline“ from a “VkPipeline“.

FFX_API FfxResource

ffxGetResourceVK ( void* vkResource, FfxResourceDescription ffxResDescription, const wchar_t* ffxResName, FfxResourceStates state = FFX_RESOURCE_STATE_COMPUTE_READ )
Fetch a “FfxResource“ from a “GPUResource“.

FFX_API FfxSurfaceFormat

ffxGetSurfaceFormatVK (VkFormat format)
Fetch a “FfxSurfaceFormat“ from a VkFormat.

FFX_API FfxResourceDescription

ffxGetBufferResourceDescriptionVK ( const VkBuffer buffer, const VkBufferCreateInfo createInfo, FfxResourceUsage additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY )
Fetch a “FfxResourceDescription“ from an existing VkBuffer.

FFX_API FfxResourceDescription

ffxGetImageResourceDescriptionVK ( const VkImage image, const VkImageCreateInfo createInfo, FfxResourceUsage additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY )
Fetch a “FfxResourceDescription“ from an existing VkImage.

FFX_API FfxCommandQueue

ffxGetCommandQueueVK (VkQueue commandQueue)
Fetch a “FfxCommandQueue“ from an existing VkQueue.

FFX_API FfxSwapchain

ffxGetSwapchainVK (VkSwapchainKHR swapchain)
Fetch a “FfxSwapchain“ from an existing VkSwapchainKHR.

FFX_API VkSwapchainKHR

ffxGetVKSwapchain (FfxSwapchain ffxSwapchain)
Fetch a VkSwapchainKHR from an existing “FfxSwapchain“.

Detailed description

FidelityFX SDK native backend implementation for Vulkan.

Global functions

ffxGetScratchMemorySizeVK

Copied!

FFX_API  size_t ffxGetScratchMemorySizeVK (
    VkPhysicalDevice physicalDevice,
    size_t maxContexts
)

Query how much memory is required for the Vulkan backend’s scratch buffer.

Parameters:

physicalDevice

A pointer to the VkPhysicalDevice device.

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 VK backend.


ffxGetDeviceVK

Copied!

FFX_API  FfxDevice  ffxGetDeviceVK (VkDeviceContext * vkDeviceContext)

Create a FfxDevice from a VkDevice.

Parameters:

vkDeviceContext

A pointer to a VKDeviceContext that holds all needed information

Returns:

An abstract FidelityFX device.


ffxGetInterfaceVK

Copied!

FFX_API  FfxErrorCode  ffxGetInterfaceVK (
    FfxInterface * backendInterface,
    FfxDevice  device,
    void* scratchBuffer,
    size_t scratchBufferSize,
    size_t maxContexts
)

Populate an interface with pointers for the VK backend.

Parameters:

backendInterface

A pointer to a FfxInterface structure to populate with pointers.

device

A pointer to the VkDevice 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 scratchBuffer.

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 interface pointer was NULL.


ffxGetCommandListVK

Copied!

FFX_API  FfxCommandList  ffxGetCommandListVK (VkCommandBuffer cmdBuf)

Create a FfxCommandList from a VkCommandBuffer.

Parameters:

cmdBuf

A pointer to the Vulkan command buffer.

Returns:

An abstract FidelityFX command list.


ffxGetPipelineVK

Copied!

FFX_API  FfxPipeline  ffxGetPipelineVK (VkPipeline pipeline)

Create a FfxPipeline from a VkPipeline.

Parameters:

pipeline

A pointer to the Vulkan pipeline.

Returns:

An abstract FidelityFX pipeline.


ffxGetResourceVK

Copied!

FFX_API  FfxResource  ffxGetResourceVK (
    void* vkResource,
    FfxResourceDescription  ffxResDescription,
    const wchar_t* ffxResName,
    FfxResourceStates  state = FFX_RESOURCE_STATE_COMPUTE_READ
)

Fetch a FfxResource from a GPUResource.

Parameters:

vkResource

A pointer to the (agnostic) VK resource.

ffxResDescription

An FfxResourceDescription for the resource representation.

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.


ffxGetSurfaceFormatVK

Copied!

FFX_API  FfxSurfaceFormat  ffxGetSurfaceFormatVK (VkFormat format)

Fetch a FfxSurfaceFormat from a VkFormat.

Parameters:

format

The VkFormat to convert to FfxSurfaceFormat.

Returns:

An FfxSurfaceFormat.


ffxGetBufferResourceDescriptionVK

Copied!

FFX_API  FfxResourceDescription  ffxGetBufferResourceDescriptionVK (
    const VkBuffer buffer,
    const VkBufferCreateInfo createInfo,
    FfxResourceUsage  additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY
)

Fetch a FfxResourceDescription from an existing VkBuffer.

Parameters:

buffer

The VkBuffer resource to create a FfxResourceDescription for.

createInfo

The VkBufferCreateInfo of the buffer

additionalUsages

Optional FfxResourceUsage flags needed for select resource mapping.

Returns:

An FfxResourceDescription.


ffxGetImageResourceDescriptionVK

Copied!

FFX_API  FfxResourceDescription  ffxGetImageResourceDescriptionVK (
    const VkImage image,
    const VkImageCreateInfo createInfo,
    FfxResourceUsage  additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY
)

Fetch a FfxResourceDescription from an existing VkImage.

Parameters:

image

The VkImage resource to create a FfxResourceDescription for.

createInfo

The VkImageCreateInfo of the buffer

additionalUsages

Optional FfxResourceUsage flags needed for select resource mapping.

Returns:

An FfxResourceDescription.


ffxGetCommandQueueVK

Copied!

FFX_API  FfxCommandQueue ffxGetCommandQueueVK (VkQueue commandQueue)

Fetch a FfxCommandQueue from an existing VkQueue.

Parameters:

commandQueue

The VkQueue to create a FfxCommandQueue from.

Returns:

An FfxCommandQueue.


ffxGetSwapchainVK

Copied!

FFX_API  FfxSwapchain ffxGetSwapchainVK (VkSwapchainKHR swapchain)

Fetch a FfxSwapchain from an existing VkSwapchainKHR.

Parameters:

pSwapchain

The VkSwapchainKHR to create a FfxSwapchain from.

Returns:

An FfxSwapchain.


ffxGetVKSwapchain

Copied!

FFX_API  VkSwapchainKHR ffxGetVKSwapchain (FfxSwapchain ffxSwapchain)

Fetch a VkSwapchainKHR from an existing FfxSwapchain.

Parameters:

ffxSwapchain

The FfxSwapchain to fetch an VkSwapchainKHR from.

Returns:

An VkSwapchainKHR object.