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.
|
ffxGetDeviceVK (VkDeviceContext * vkDeviceContext)
Create a “FfxDevice“ from a “VkDevice“.
|
|
ffxGetInterfaceVK ( FfxInterface * backendInterface, FfxDevice device, void* scratchBuffer, size_t scratchBufferSize, size_t maxContexts )
Populate an interface with pointers for the VK backend.
|
|
ffxGetCommandListVK (VkCommandBuffer cmdBuf)
Create a “FfxCommandList“ from a “VkCommandBuffer“.
|
|
ffxGetPipelineVK (VkPipeline pipeline)
Create a “FfxPipeline“ from a “VkPipeline“.
|
|
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.
|
ffxGetBufferResourceDescriptionVK ( const VkBuffer buffer, const VkBufferCreateInfo createInfo, FfxResourceUsage additionalUsages = FFX_RESOURCE_USAGE_READ_ONLY )
Fetch a “FfxResourceDescription“ from an existing VkBuffer.
|
|
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
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
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
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 |
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 |
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 |
ffxGetCommandListVK
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
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
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 |
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
FFX_API FfxSurfaceFormat ffxGetSurfaceFormatVK (VkFormat format)
Fetch a FfxSurfaceFormat
from a VkFormat.
Parameters:
format |
The VkFormat to convert to |
Returns:
An FfxSurfaceFormat
.
ffxGetBufferResourceDescriptionVK
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 |
createInfo |
The VkBufferCreateInfo of the buffer |
additionalUsages |
Optional |
Returns:
An FfxResourceDescription
.
ffxGetImageResourceDescriptionVK
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 |
createInfo |
The VkImageCreateInfo of the buffer |
additionalUsages |
Optional |
Returns:
An FfxResourceDescription
.
ffxGetCommandQueueVK
FFX_API FfxCommandQueue ffxGetCommandQueueVK (VkQueue commandQueue)
Fetch a FfxCommandQueue
from an existing VkQueue.
Parameters:
commandQueue |
The VkQueue to create a |
Returns:
An FfxCommandQueue
.
ffxGetSwapchainVK
FFX_API FfxSwapchain ffxGetSwapchainVK (VkSwapchainKHR swapchain)
Fetch a FfxSwapchain
from an existing VkSwapchainKHR.
Parameters:
pSwapchain |
The VkSwapchainKHR to create a |
Returns:
An FfxSwapchain
.
ffxGetVKSwapchain
FFX_API VkSwapchainKHR ffxGetVKSwapchain (FfxSwapchain ffxSwapchain)
Fetch a VkSwapchainKHR from an existing FfxSwapchain
.
Parameters:
ffxSwapchain |
The |
Returns:
An VkSwapchainKHR object.