From 7779d270640f3c7d5bf4826b7ce68b1b7cbc9848 Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Tue, 23 Jul 2024 11:33:26 -0500 Subject: [PATCH] Clarify xrEnumerateInstanceExtensionProperties for API layers Per https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#api-initialization , this function *can* be called before calling `xrCreateInstance`. > This function may: be called before an instance has been created; implementations must: not assume an instance exists. Concretely, a bug in past versions of the Ultraleap API layer crashed if an instance had not been created. --- specification/loader/api_layer.adoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/specification/loader/api_layer.adoc b/specification/loader/api_layer.adoc index b954c84f4..bb413bb83 100644 --- a/specification/loader/api_layer.adoc +++ b/specification/loader/api_layer.adoc @@ -692,8 +692,11 @@ Therefore, it must follow some conventions and rules defined below: contents of the instance extensions it supports. ** If "layerName" is NULL and: *** It is an explicit API layer, it must: not fill in any data. -*** It is an implicit API layer, it must: add it's own instance extension - contents to the list of extensions. +*** It is an implicit API layer and: +**** an `XrInstance` has been created but not destroyed, it must: add its own + instance extension contents to the list of extensions. +**** no `XrInstance` has been created, or all have been destroyed, it must: + return only its own instance extension contents. * For any OpenXR command the API layer intercepts, `xrGetInstanceProcAddr` must: return a pointer to a local entry point. ** Otherwise it returns the value obtained by calling down the instance call