| 781 | } |
| 782 | |
| 783 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_CommitTextureSwapChain(ovrSession session, ovrTextureSwapChain chain) |
| 784 | { |
| 785 | REV_TRACE(ovr_CommitTextureSwapChain); |
| 786 | |
| 787 | if (!chain) |
| 788 | return ovrError_InvalidParameter; |
| 789 | |
| 790 | MICROPROFILE_META_CPU("Identifier", chain->Identifier); |
| 791 | MICROPROFILE_META_CPU("CurrentIndex", chain->CurrentIndex); |
| 792 | MICROPROFILE_META_CPU("SubmitIndex", chain->SubmitIndex); |
| 793 | |
| 794 | if (chain->Length > 1 && chain->Full()) |
| 795 | return ovrError_TextureSwapChainFull; |
| 796 | |
| 797 | chain->Commit(); |
| 798 | |
| 799 | if (chain->Overlay != vr::k_ulOverlayHandleInvalid) |
| 800 | { |
| 801 | // Submit overlays on commit so we don't upload textures every frame |
| 802 | vr::Texture_t texture; |
| 803 | chain->Submit()->ToVRTexture(texture); |
| 804 | vr::VROverlay()->SetOverlayTexture(chain->Overlay, &texture); |
| 805 | } |
| 806 | |
| 807 | return ovrSuccess; |
| 808 | } |
| 809 | |
| 810 | OVR_PUBLIC_FUNCTION(void) ovr_DestroyTextureSwapChain(ovrSession session, ovrTextureSwapChain chain) |
| 811 | { |
nothing calls this directly
no test coverage detected