st/oxr: don't run the timestamp conversion in a loop

This commit is contained in:
Christoph Haag 2022-03-03 01:42:35 +01:00
parent 075fde3613
commit b863aa2629

View file

@ -1278,32 +1278,29 @@ oxr_session_frame_end(struct oxr_logger *log, struct oxr_session *sess, const Xr
const XrCompositionLayerBaseHeader *layer = frameEndInfo->layers[i];
assert(layer != NULL);
int64_t timestamp =
time_state_ts_to_monotonic_ns(sess->sys->inst->timekeeping, frameEndInfo->displayTime);
switch (layer->type) {
case XR_TYPE_COMPOSITION_LAYER_PROJECTION:
submit_projection_layer(sess, xc, log, (XrCompositionLayerProjection *)layer, xdev, &inv_offset,
timestamp);
display_time_ns);
break;
case XR_TYPE_COMPOSITION_LAYER_QUAD:
submit_quad_layer(sess, xc, log, (XrCompositionLayerQuad *)layer, xdev, &inv_offset, timestamp);
submit_quad_layer(sess, xc, log, (XrCompositionLayerQuad *)layer, xdev, &inv_offset, display_time_ns);
break;
case XR_TYPE_COMPOSITION_LAYER_CUBE_KHR:
submit_cube_layer(sess, xc, log, (XrCompositionLayerCubeKHR *)layer, xdev, &inv_offset,
timestamp);
display_time_ns);
break;
case XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR:
submit_cylinder_layer(sess, xc, log, (XrCompositionLayerCylinderKHR *)layer, xdev, &inv_offset,
timestamp);
display_time_ns);
break;
case XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR:
submit_equirect1_layer(sess, xc, log, (XrCompositionLayerEquirectKHR *)layer, xdev, &inv_offset,
timestamp);
display_time_ns);
break;
case XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR:
submit_equirect2_layer(sess, xc, log, (XrCompositionLayerEquirect2KHR *)layer, xdev,
&inv_offset, timestamp);
&inv_offset, display_time_ns);
break;
default: assert(false && "invalid layer type");
}