| 235 | |
| 236 | OVR_PUBLIC_FUNCTION(ovrResult) |
| 237 | ovr_GetTextureSwapChainBufferVk( |
| 238 | ovrSession session, |
| 239 | ovrTextureSwapChain chain, |
| 240 | int index, |
| 241 | VkImage* out_Image) |
| 242 | { |
| 243 | REV_TRACE(ovr_GetTextureSwapChainBufferDX); |
| 244 | |
| 245 | if (!session) |
| 246 | return ovrError_InvalidSession; |
| 247 | |
| 248 | if (!chain || !out_Image) |
| 249 | return ovrError_InvalidParameter; |
| 250 | |
| 251 | if (index < 0) |
| 252 | index = chain->CurrentIndex; |
| 253 | |
| 254 | TextureVk* texture = dynamic_cast<TextureVk*>(chain->Textures[index].get()); |
| 255 | if (!texture) |
| 256 | return ovrError_RuntimeException; |
| 257 | |
| 258 | *out_Image = texture->Image(); |
| 259 | |
| 260 | return ovrSuccess; |
| 261 | } |
| 262 | |
| 263 | OVR_PUBLIC_FUNCTION(ovrResult) |
| 264 | ovr_CreateMirrorTextureWithOptionsVk( |