Skip to content

Commit

Permalink
Log message consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
SafariMonkey committed Dec 10, 2023
1 parent 58ec187 commit 163e4a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/graphics/d3d12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ pub fn initialize_xr_graphics(
&enabled_extensions,
&[],
)?;
info!("created instance");
info!("created OpenXR instance");
let instance_props = xr_instance.properties()?;
let xr_system_id = xr_instance.system(xr::FormFactor::HEAD_MOUNTED_DISPLAY)?;
info!("created system");
info!("created OpenXR system");
let system_props = xr_instance.system_properties(xr_system_id).unwrap();
info!(
"loaded OpenXR runtime: {} {} {}",
Expand Down Expand Up @@ -114,7 +114,7 @@ pub fn initialize_xr_graphics(
desc.AdapterLuid.HighPart == reqs.adapter_luid.HighPart
&& desc.AdapterLuid.LowPart == reqs.adapter_luid.LowPart
})
.context("Failed to find DXGI adapter matching LUID provided by runtime")?;
.context("failed to find DXGI adapter matching LUID provided by runtime")?;

let wgpu_instance =
unsafe { wgpu::Instance::from_hal::<wgpu_hal::api::Dx12>(wgpu_raw_instance) };
Expand Down Expand Up @@ -170,7 +170,7 @@ pub fn initialize_xr_graphics(
let handle = wrapper.get_handle();
wgpu_instance
.create_surface(&handle)
.expect("Failed to create wgpu surface")
.expect("failed to create wgpu surface")
});

let (wgpu_format, d3d12_format) = surface
Expand All @@ -186,7 +186,7 @@ pub fn initialize_xr_graphics(
let first_supported_format = runtime_supported_formats
.into_iter()
.find_map(|d| surface_supported_formats.get(&d).map(|w|(*w, d)))
.context("Could not find runtime-supported format that was also supported on the surface \
.context("could not find runtime-supported format that was also supported on the surface \
and that we know how to convert")?;
Ok(first_supported_format)
})
Expand Down Expand Up @@ -240,7 +240,7 @@ pub fn initialize_xr_graphics(
wgpu_device.create_texture_from_hal::<Dx12>(
wgpu_hal_texture,
&wgpu::TextureDescriptor {
label: Some("VR Swapchain"),
label: Some("bevy_openxr swapchain"),
size: wgpu::Extent3d {
width: resolution.x,
height: resolution.y,
Expand Down
20 changes: 10 additions & 10 deletions src/graphics/vulkan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn initialize_xr_graphics(
use wgpu_hal::{api::Vulkan as V, Api};

assert!(available_extensions.khr_vulkan_enable2);
info!("available xr exts: {:#?}", available_extensions);
info!("available OpenXR extensions: {:#?}", available_extensions);

let mut enabled_extensions = xr::ExtensionSet::default();
enabled_extensions.khr_vulkan_enable2 = true;
Expand All @@ -55,7 +55,7 @@ pub fn initialize_xr_graphics(
// enabled_extensions.ext_hand_joints_motion_range = available_extensions.ext_hand_joints_motion_range;

let available_layers = xr_entry.enumerate_layers()?;
info!("available xr layers: {:#?}", available_layers);
info!("available OpenXR layers: {:#?}", available_layers);

let xr_instance = xr_entry.create_instance(
&xr::ApplicationInfo {
Expand All @@ -65,10 +65,10 @@ pub fn initialize_xr_graphics(
&enabled_extensions,
&[],
)?;
info!("created instance");
info!("created OpenXR instance");
let instance_props = xr_instance.properties()?;
let xr_system_id = xr_instance.system(xr::FormFactor::HEAD_MOUNTED_DISPLAY)?;
info!("created system");
info!("created OpenXR system");
let system_props = xr_instance.system_properties(xr_system_id).unwrap();
info!(
"loaded OpenXR runtime: {} {} {}",
Expand Down Expand Up @@ -115,7 +115,7 @@ pub fn initialize_xr_graphics(
ash::extensions::khr::TimelineSemaphore::name(),
];
info!(
"creating vulkan instance with these extensions: {:#?}",
"creating Vulkan instance with these extensions: {:#?}",
extensions
);

Expand All @@ -139,7 +139,7 @@ pub fn initialize_xr_graphics(
.enabled_extension_names(&extensions_cchar) as *const _
as *const _,
)
.context("XR error creating Vulkan instance")
.context("OpenXR error creating Vulkan instance")
.unwrap()
.map_err(vk::Result::from_raw)
.context("Vulkan error creating Vulkan instance")
Expand All @@ -150,7 +150,7 @@ pub fn initialize_xr_graphics(
vk::Instance::from_raw(vk_instance as _),
)
};
info!("created vulkan instance");
info!("created Vulkan instance");

let vk_instance_ptr = vk_instance.handle().as_raw() as *const c_void;

Expand Down Expand Up @@ -223,7 +223,7 @@ pub fn initialize_xr_graphics(
vk_physical_device.as_raw() as _,
&info as *const _ as *const _,
)
.context("XR error creating Vulkan device")?
.context("OpenXR error creating Vulkan device")?
.map_err(vk::Result::from_raw)
.context("Vulkan error creating Vulkan device")?;

Expand Down Expand Up @@ -348,7 +348,7 @@ pub fn initialize_xr_graphics(
<V as Api>::Device::texture_from_raw(
color_image,
&wgpu_hal::TextureDescriptor {
label: Some("VR Swapchain"),
label: Some("bevy_openxr swapchain"), // unused internally
size: wgpu::Extent3d {
width: resolution.x,
height: resolution.y,
Expand All @@ -370,7 +370,7 @@ pub fn initialize_xr_graphics(
wgpu_device.create_texture_from_hal::<V>(
wgpu_hal_texture,
&wgpu::TextureDescriptor {
label: Some("VR Swapchain"),
label: Some("bevy_openxr swapchain"),
size: wgpu::Extent3d {
width: resolution.x,
height: resolution.y,
Expand Down

0 comments on commit 163e4a7

Please sign in to comment.