MCPcopy Create free account
hub / github.com/LibreVR/Revive / UpdateStencil

Method UpdateStencil

ReviveXR/Session.cpp:251–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251ovrResult 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
282ovrResult ovrHmdStruct::RecenterSpace(ovrTrackingOrigin origin, XrSpace anchor, ovrPosef offset)
283{

Callers 1

ovr_GetSessionStatusFunction · 0.80

Calls 2

sizeMethod · 0.80
UseHackMethod · 0.45

Tested by

no test coverage detected