st/oxr: Calculate normalized sub-image offsets and sizes

This commit is contained in:
Jakob Bornecrantz 2021-06-20 16:20:38 +01:00
parent 390b06b22a
commit 9e5df0f504
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1 @@
OpenXR: Fill in normalised sub-image offsets and sizes.

View file

@ -149,6 +149,10 @@ fill_in_sub_image(const struct oxr_swapchain *sc, const XrSwapchainSubImage *oxr
xsub->image_index = sc->released.index;
xsub->array_index = oxr_sub->imageArrayIndex;
xsub->rect = *rect;
xsub->norm_rect.w = rect->extent.w / (double)sc->width;
xsub->norm_rect.h = rect->extent.h / (double)sc->height;
xsub->norm_rect.x = rect->offset.w / (double)sc->width;
xsub->norm_rect.y = rect->offset.h / (double)sc->height;
}