From 9b4c460aef6f3680c20040815fc6b04bdfdbe181 Mon Sep 17 00:00:00 2001 From: Username-Leon Date: Thu, 6 Nov 2025 18:49:46 +0100 Subject: [PATCH 1/5] Add .gitignore --- .gitignore | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c25314 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# Generated by Cargo +# will have compiled files and executables +debug +target + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# Generated by cargo mutants +# Contains mutation testing data +**/mutants.out*/ + +# RustRover +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ \ No newline at end of file From f992438fb8596058dabcc7596a6ba4ee31209bbb Mon Sep 17 00:00:00 2001 From: Username-Leon Date: Thu, 6 Nov 2025 18:52:57 +0100 Subject: [PATCH 2/5] Add LUID check --- src/vulkan.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vulkan.rs b/src/vulkan.rs index 7b2eaba..695746e 100644 --- a/src/vulkan.rs +++ b/src/vulkan.rs @@ -82,7 +82,11 @@ impl crate::Device { return Err(crate::DeviceCreateError::MissingFeature); }; let device = unsafe { - oidn::sys::oidnNewDeviceByUUID((&vk_desc.device_uuid) as *const _ as *const _) + if vk_desc.device_luid_valid == vk::TRUE { + oidn::sys::oidnNewDeviceByLUID((&vk_desc.device_luid) as *const _ as *const _) + } else { + oidn::sys::oidnNewDeviceByUUID((&vk_desc.device_uuid) as *const _ as *const _) + } }; Self::new_from_raw_oidn_adapter(device, adapter, desc, |flag| { let oidn_supports_win32 = From 0b87558b979eb1879625fe0f7574110426dd962c Mon Sep 17 00:00:00 2001 From: Username-Leon Date: Thu, 6 Nov 2025 19:05:06 +0100 Subject: [PATCH 3/5] Small fix --- src/vulkan.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vulkan.rs b/src/vulkan.rs index 695746e..e775e27 100644 --- a/src/vulkan.rs +++ b/src/vulkan.rs @@ -82,11 +82,14 @@ impl crate::Device { return Err(crate::DeviceCreateError::MissingFeature); }; let device = unsafe { - if vk_desc.device_luid_valid == vk::TRUE { - oidn::sys::oidnNewDeviceByLUID((&vk_desc.device_luid) as *const _ as *const _) - } else { - oidn::sys::oidnNewDeviceByUUID((&vk_desc.device_uuid) as *const _ as *const _) + let mut dev_raw: oidn::sys::OIDNDevice = std::ptr::null_mut(); + if dev_raw.is_null() && vk_desc.device_luid_valid == vk::TRUE { + dev_raw = oidn::sys::oidnNewDeviceByLUID((&vk_desc.device_luid) as *const _ as *const _) } + if dev_raw.is_null() { + dev_raw = oidn::sys::oidnNewDeviceByUUID((&vk_desc.device_uuid) as *const _ as *const _) + } + dev_raw }; Self::new_from_raw_oidn_adapter(device, adapter, desc, |flag| { let oidn_supports_win32 = From 3d1272ee18198ce445b52117c83673473aaf8486 Mon Sep 17 00:00:00 2001 From: Username-Leon Date: Thu, 6 Nov 2025 20:06:47 +0100 Subject: [PATCH 4/5] Fix formatting --- src/vulkan.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vulkan.rs b/src/vulkan.rs index e775e27..fe569b8 100644 --- a/src/vulkan.rs +++ b/src/vulkan.rs @@ -84,10 +84,12 @@ impl crate::Device { let device = unsafe { let mut dev_raw: oidn::sys::OIDNDevice = std::ptr::null_mut(); if dev_raw.is_null() && vk_desc.device_luid_valid == vk::TRUE { - dev_raw = oidn::sys::oidnNewDeviceByLUID((&vk_desc.device_luid) as *const _ as *const _) + dev_raw = + oidn::sys::oidnNewDeviceByLUID((&vk_desc.device_luid) as *const _ as *const _) } if dev_raw.is_null() { - dev_raw = oidn::sys::oidnNewDeviceByUUID((&vk_desc.device_uuid) as *const _ as *const _) + dev_raw = + oidn::sys::oidnNewDeviceByUUID((&vk_desc.device_uuid) as *const _ as *const _) } dev_raw }; From 3b8683c777c8d3e101ec6fde868c11dfd423d7cc Mon Sep 17 00:00:00 2001 From: Username-Leon Date: Thu, 6 Nov 2025 21:06:28 +0100 Subject: [PATCH 5/5] Remove .gitignore --- .gitignore | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5c25314..0000000 --- a/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Cargo -# will have compiled files and executables -debug -target - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb - -# Generated by cargo mutants -# Contains mutation testing data -**/mutants.out*/ - -# RustRover -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file