| 249 | } |
| 250 | |
| 251 | ovrResult ovrHmdStruct::UpdateStencil(ovrEyeType view, XrVisibilityMaskTypeKHR type) |
| 252 | { |
| 253 | if (!Session) |
| 254 | return ovrError_InvalidSession; |
| 255 | |
| 256 | XR_FUNCTION(Instance, GetVisibilityMaskKHR); |
| 257 | |
| 258 | VisibilityMask& result = VisibilityMasks[view][type]; |
| 259 | XrVisibilityMaskKHR mask = XR_TYPE(VISIBILITY_MASK_KHR); |
| 260 | CHK_XR(GetVisibilityMaskKHR(Session, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, view, type, &mask)); |
| 261 | if (!mask.vertexCountOutput || !mask.indexCountOutput) |
| 262 | return ovrError_Unsupported; |
| 263 | |
| 264 | result.first.resize(mask.vertexCountOutput); |
| 265 | result.second.resize(mask.indexCountOutput); |
| 266 | |
| 267 | mask.vertexCapacityInput = (uint32_t)result.first.size(); |
| 268 | mask.vertices = result.first.data(); |
| 269 | mask.indexCapacityInput = (uint32_t)result.second.size(); |
| 270 | mask.indices = result.second.data(); |
| 271 | CHK_XR(GetVisibilityMaskKHR(Session, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, view, type, &mask)); |
| 272 | |
| 273 | if (type == XR_VISIBILITY_MASK_TYPE_LINE_LOOP_KHR && Runtime::Get().UseHack(Runtime::HACK_BROKEN_LINE_LOOP)) |
| 274 | { |
| 275 | // There are actually only 27 valid vertices in this line loop |
| 276 | result.first.resize(27); |
| 277 | result.second.resize(27); |
| 278 | } |
| 279 | return ovrSuccess; |
| 280 | } |
| 281 | |
| 282 | ovrResult ovrHmdStruct::RecenterSpace(ovrTrackingOrigin origin, XrSpace anchor, ovrPosef offset) |
| 283 | { |
no test coverage detected