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.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!