| 1162 | } |
| 1163 | |
| 1164 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitFrame2(ovrSession session, long long frameIndex, const ovrViewScaleDesc* viewScaleDesc, |
| 1165 | ovrLayerHeader const * const * layerPtrList, unsigned int layerCount) |
| 1166 | { |
| 1167 | REV_TRACE(ovr_SubmitFrame); |
| 1168 | MICROPROFILE_META_CPU("Submit Frame", (int)frameIndex); |
| 1169 | |
| 1170 | if (!session) |
| 1171 | return ovrError_InvalidSession; |
| 1172 | |
| 1173 | long long currentIndex = (*session->CurrentFrame).frameIndex; |
| 1174 | if (frameIndex <= 0) |
| 1175 | frameIndex = currentIndex; |
| 1176 | |
| 1177 | // Some older games submit frames redundantly, so we discard old frames in the legacy call |
| 1178 | if (frameIndex >= currentIndex) |
| 1179 | CHK_OVR(ovr_EndFrame(session, frameIndex, viewScaleDesc, layerPtrList, layerCount)); |
| 1180 | CHK_OVR(ovr_WaitToBeginFrame(session, frameIndex + 1)); |
| 1181 | CHK_OVR(ovr_BeginFrame(session, frameIndex + 1)); |
| 1182 | return frameIndex < currentIndex ? ovrSuccess_NotVisible : ovrSuccess; |
| 1183 | } |
| 1184 | |
| 1185 | typedef struct OVR_ALIGNAS(4) ovrViewScaleDesc1_ { |
| 1186 | ovrVector3f HmdToEyeOffset[ovrEye_Count]; ///< Translation of each eye. |
no test coverage detected