| 207 | |
| 208 | OVR_PUBLIC_FUNCTION(ovrResult) |
| 209 | ovr_CreateTextureSwapChainVk( |
| 210 | ovrSession session, |
| 211 | VkDevice device, |
| 212 | const ovrTextureSwapChainDesc* desc, |
| 213 | ovrTextureSwapChain* out_TextureSwapChain) |
| 214 | { |
| 215 | REV_TRACE(ovr_CreateTextureSwapChainVk); |
| 216 | |
| 217 | if (!session) |
| 218 | return ovrError_InvalidSession; |
| 219 | |
| 220 | if (!device || !desc || !out_TextureSwapChain || desc->Type != ovrTexture_2D) |
| 221 | return ovrError_InvalidParameter; |
| 222 | |
| 223 | CompositorVk* compositor = dynamic_cast<CompositorVk*>(session->Compositor.get()); |
| 224 | |
| 225 | if (!compositor) |
| 226 | return ovrError_RuntimeException; |
| 227 | |
| 228 | compositor->SetDevice(device); |
| 229 | |
| 230 | if (session->Compositor->GetAPI() != vr::TextureType_Vulkan) |
| 231 | return ovrError_RuntimeException; |
| 232 | |
| 233 | return session->Compositor->CreateTextureSwapChain(desc, out_TextureSwapChain); |
| 234 | } |
| 235 | |
| 236 | OVR_PUBLIC_FUNCTION(ovrResult) |
| 237 | ovr_GetTextureSwapChainBufferVk( |
nothing calls this directly
no test coverage detected