From 0e66453e6fd0c8168efc6f15e5d5f73072e221b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Br=C3=B6nneg=C3=A5rd?= <1162652+rasmusgo@users.noreply.github.com> Date: Wed, 24 Apr 2024 23:24:15 +0200 Subject: [PATCH] Hide commands related to openxr_loader_negotiation.h --- generator/src/main.rs | 7 ++++++- openxr/src/generated.rs | 19 ------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/generator/src/main.rs b/generator/src/main.rs index 2df9bd33..999d534e 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -1308,8 +1308,13 @@ impl Parser { /// Generate high-level code #[allow(clippy::cognitive_complexity)] // TODO fn generate_hl(&self) -> TokenStream { + const BLACKLISTED_COMMANDS: [&str; 3] = [ + "xrNegotiateLoaderRuntimeInterface", + "xrNegotiateLoaderApiLayerInterface", + "xrCreateApiLayerInstance", + ]; let (instance_pfn_fields, instance_pfn_inits) = self.commands.iter().map(|(name, command)| { - if command.extension.is_some() { + if command.extension.is_some() || BLACKLISTED_COMMANDS.contains(&name.as_str()) { return (quote! {}, quote! {}); } let pfn_ident = xr_command_name(name); diff --git a/openxr/src/generated.rs b/openxr/src/generated.rs index 6d502704..52032acc 100644 --- a/openxr/src/generated.rs +++ b/openxr/src/generated.rs @@ -3305,9 +3305,6 @@ pub mod raw { use sys::pfn; #[derive(Copy, Clone)] pub struct Instance { - pub negotiate_loader_runtime_interface: pfn::NegotiateLoaderRuntimeInterface, - pub negotiate_loader_api_layer_interface: pfn::NegotiateLoaderApiLayerInterface, - pub create_api_layer_instance: pfn::CreateApiLayerInstance, pub get_instance_proc_addr: pfn::GetInstanceProcAddr, pub enumerate_api_layer_properties: pfn::EnumerateApiLayerProperties, pub enumerate_instance_extension_properties: pfn::EnumerateInstanceExtensionProperties, @@ -3373,22 +3370,6 @@ pub mod raw { #[doc = r" `instance` must be a valid instance handle."] pub unsafe fn load(entry: &Entry, instance: sys::Instance) -> Result { Ok(Self { - negotiate_loader_runtime_interface: mem::transmute(entry.get_instance_proc_addr( - instance, - CStr::from_bytes_with_nul_unchecked(b"xrNegotiateLoaderRuntimeInterface\0"), - )?), - negotiate_loader_api_layer_interface: mem::transmute( - entry.get_instance_proc_addr( - instance, - CStr::from_bytes_with_nul_unchecked( - b"xrNegotiateLoaderApiLayerInterface\0", - ), - )?, - ), - create_api_layer_instance: mem::transmute(entry.get_instance_proc_addr( - instance, - CStr::from_bytes_with_nul_unchecked(b"xrCreateApiLayerInstance\0"), - )?), get_instance_proc_addr: mem::transmute(entry.get_instance_proc_addr( instance, CStr::from_bytes_with_nul_unchecked(b"xrGetInstanceProcAddr\0"),