| 917 | } |
| 918 | |
| 919 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitFrame2(ovrSession session, long long frameIndex, const ovrViewScaleDesc* viewScaleDesc, |
| 920 | ovrLayerHeader const * const * layerPtrList, unsigned int layerCount) |
| 921 | { |
| 922 | REV_TRACE(ovr_SubmitFrame); |
| 923 | MICROPROFILE_META_CPU("Submit Frame", (int)frameIndex); |
| 924 | |
| 925 | if (!session || !session->Compositor) |
| 926 | return ovrError_InvalidSession; |
| 927 | |
| 928 | if (frameIndex == 0) |
| 929 | frameIndex = session->FrameIndex; |
| 930 | |
| 931 | // Use our own intermediate compositor to convert the frame to OpenVR. |
| 932 | session->Compositor->SetTimingMode(vr::VRCompositorTimingMode_Implicit); |
| 933 | ovrResult result = session->Compositor->EndFrame(session, frameIndex, viewScaleDesc, layerPtrList, layerCount); |
| 934 | if (OVR_SUCCESS(result)) |
| 935 | { |
| 936 | // Begin the next frame |
| 937 | session->Compositor->WaitToBeginFrame(session, frameIndex + 1); |
| 938 | session->Compositor->BeginFrame(session, frameIndex + 1); |
| 939 | } |
| 940 | return result; |
| 941 | } |
| 942 | |
| 943 | typedef struct OVR_ALIGNAS(4) ovrViewScaleDesc1_ { |
| 944 | ovrVector3f HmdToEyeOffset[ovrEye_Count]; ///< Translation of each eye. |
no test coverage detected