After checking for the extension, I believe I am correctly obtaining the function address via
xrGetInstanceProcAddr(xr_instance, "xrGetVisibilityMaskKHR", (PFN_xrVoidFunction*)(&ext_xrGetVisibilityMaskKHR));
and calling the function via
XrVisibilityMaskKHR VisMask;
if (ext_xrGetVisibilityMaskKHR(xr_session, app_config_view, iView, XR_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR, &VisMask) == XR_SUCCESS)
{
int debug = 0;
}
However I get the error
ERROR (OpenXR) : Invalid XrStructureType -858993460 at address 0x5e3b2a8. Expected 'XR_TYPE_VISIBILITY_MASK_KHR'.
Which does not make sense, as I have provided a structure, and it is complaining that it is expecting a structure, but XR_TYPE_VISIBILITY_MASK_KHR
is actually an enumeration, that identifies the structure I am passing down.
There no samples or code anywhere on the net demonstrating this capability so I am at a loss as to how to proceed. Clearly giving it the address of an enumeration will not work. The visibility mask is essential for performance.