Function ovr_sys::vulkan::ovr_CreateTextureSwapChainVk [] [src]

pub unsafe extern "C" fn ovr_CreateTextureSwapChainVk(
    session: ovrSession,
    device: Device,
    desc: *const ovrTextureSwapChainDesc,
    out_TextureSwapChain: *mut ovrTextureSwapChain
) -> ovrResult

Create Texture Swap Chain suitable for use with Vulkan

in session Specifies an ovrSession previously returned by ovr_Create.

in device Specifies the application's Device to create resources with.

in desc Specifies requested texture properties. See notes for more info about texture format.

out out_TextureSwapChain Returns the created ovrTextureSwapChain, which will be valid upon a successful return value, else it will be NULL. This texture chain must be eventually destroyed via ovr_DestroyTextureSwapChain before destroying the session with ovr_Destroy.

Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information.

Note: The texture format provided in desc should be thought of as the format the distortion-compositor will use for the ShaderResourceView when reading the contents of the texture. To that end, it is highly recommended that the application requests texture swapchain formats that are in sRGB-space (e.g. OVR_FORMAT_R8G8B8A8_UNORM_SRGB) as the compositor does sRGB-correct rendering. As such, the compositor relies on the GPU's hardware sampler to do the sRGB-to-linear conversion. If the application still prefers to render to a linear format (e.g. OVR_FORMAT_R8G8B8A8_UNORM) while handling the linear-to-gamma conversion via SPIRV code, then the application must still request the corresponding sRGB format and also use the ovrTextureMisc_DX_Typeless flag in the ovrTextureSwapChainDesc's Flag field. This will allow the application to create a RenderTargetView that is the desired linear format while the compositor continues to treat it as sRGB. Failure to do so will cause the compositor to apply unexpected gamma conversions leading to gamma-curve artifacts. The ovrTextureMisc_DX_Typeless flag for depth buffer formats (e.g. OVR_FORMAT_D32_FLOAT) is ignored as they are always converted to be typeless.

see ovr_GetTextureSwapChainLength, ovr_GetTextureSwapChainCurrentIndex, ovr_GetTextureSwapChainDesc, ovr_GetTextureSwapChainBufferVk, ovr_DestroyTextureSwapChain