Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xrGetInstanceProcAddr fails with null instance getting xrCreateInstance etc #31

Closed
rpavlik opened this Issue Apr 4, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@rpavlik
Copy link
Contributor

rpavlik commented Apr 4, 2019

Per the spec, there are 3 functions for which it's legal to call get proc addr with a null instance. If you just use the exported function of xrCreateInstance, you're fine, but if you use xrGetInstanceProcAddr to retrieve that function pointer for some reason, you get:

Error [SPEC | xrGetInstanceProcAddr | VUID-xrGetInstanceProcAddr-instance-parameter] : XR_NULL_HANDLE for instance but query for xrEnumerateInstanceExtensionProperties requires a valid instance
-------------------------------------------------------------------------------
xrGetInstanceProcAddr
       When: providing a null instance
       Then: Request for xrEnumerateInstanceExtensionProperties should succeed
-------------------------------------------------------------------------------
../tests/functions/xrGetInstanceProcAddr.cpp:14
...............................................................................

../tests/functions/xrGetInstanceProcAddr.cpp:15: FAILED:
  REQUIRE( XrResultCode{XR_SUCCESS} == XrResultCode{xrGetInstanceProcAddr(nullptr, "xrEnumerateInstanceExtensionProperties", &pfn)} )
with expansion:
  XR_SUCCESS == XR_ERROR_HANDLE_INVALID

Error [SPEC | xrGetInstanceProcAddr | VUID-xrGetInstanceProcAddr-instance-parameter] : XR_NULL_HANDLE for instance but query for xrEnumerateApiLayerProperties requires a valid instance
-------------------------------------------------------------------------------
xrGetInstanceProcAddr
       When: providing a null instance
       Then: Request for xrEnumerateApiLayerProperties should succeed
-------------------------------------------------------------------------------
../tests/functions/xrGetInstanceProcAddr.cpp:18
...............................................................................

../tests/functions/xrGetInstanceProcAddr.cpp:19: FAILED:
  REQUIRE( XrResultCode{XR_SUCCESS} == XrResultCode{xrGetInstanceProcAddr(nullptr, "xrEnumerateApiLayerProperties", &pfn)} )
with expansion:
  XR_SUCCESS == XR_ERROR_HANDLE_INVALID

Error [SPEC | xrGetInstanceProcAddr | VUID-xrGetInstanceProcAddr-instance-parameter] : XR_NULL_HANDLE for instance but query for xrCreateInstance requires a valid instance
-------------------------------------------------------------------------------
xrGetInstanceProcAddr
       When: providing a null instance
       Then: Request for xrCreateInstance should succeed
-------------------------------------------------------------------------------
../tests/functions/xrGetInstanceProcAddr.cpp:22
...............................................................................

../tests/functions/xrGetInstanceProcAddr.cpp:23: FAILED:
  REQUIRE( XrResultCode{XR_SUCCESS} == XrResultCode{xrGetInstanceProcAddr(nullptr, "xrCreateInstance", &pfn)} )
with expansion:
  XR_SUCCESS == XR_ERROR_HANDLE_INVALID

cc @daveh-lunarg

@daveh-lunarg daveh-lunarg self-assigned this Apr 4, 2019

@rpavlik rpavlik changed the title xrGetInstanceProcAddr fails with null instance getting xrCreateInstance xrGetInstanceProcAddr fails with null instance getting xrCreateInstance etc Apr 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.