xrt: Add normalized sub-image offset and size in layer data

This makes the compositor not have to care about texture size.
This commit is contained in:
Jakob Bornecrantz 2021-06-20 16:20:05 +01:00
parent ff7033e8b8
commit 7bd1dba1d8
3 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,2 @@
Send down sub-image offsets and sizes in normalised form, this makes it so that
compositor does not need to track the size of swapchains.

View file

@ -141,6 +141,8 @@ struct xrt_sub_image
uint32_t array_index;
//! The rectangle in the image to use
struct xrt_rect rect;
//! Normalized sub image coordinates and size.
struct xrt_normalized_rect norm_rect;
};
/*!

View file

@ -311,6 +311,16 @@ struct xrt_rect
struct xrt_size extent;
};
/*!
* Normalized image rectangle, coordinates and size in 0 .. 1 range.
*
* @ingroup xrt_iface math
*/
struct xrt_normalized_rect
{
float x, y, w, h;
};
/*!
* A pose composed of a position and orientation.
*