Skip to content

Commit

Permalink
Use recommended swapchain sample count for OpenXR
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Adams <[email protected]>
  • Loading branch information
msub2 committed Jul 27, 2024
1 parent 89d7027 commit 625ff64
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webxr/openxr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ struct SharedData {
secondary_blend_mode: Option<EnvironmentBlendMode>,
frame_state: Option<FrameState>,
space: Space,
swapchain_sample_count: u32,
}

struct OpenXrLayerManager {
Expand Down Expand Up @@ -549,13 +550,14 @@ impl LayerManagerAPI<SurfmanGL> for OpenXrLayerManager {
})?;
let format = pick_format(&formats);
let texture_size = init.texture_size(&data.viewports());
let sample_count = data.swapchain_sample_count;
let swapchain_create_info = SwapchainCreateInfo {
create_flags: SwapchainCreateFlags::EMPTY,
usage_flags: SwapchainUsageFlags::COLOR_ATTACHMENT | SwapchainUsageFlags::SAMPLED,
width: texture_size.width as u32,
height: texture_size.height as u32,
format,
sample_count: 1,
sample_count,
face_count: 1,
array_size: 1,
mip_count: 1,
Expand Down Expand Up @@ -971,6 +973,8 @@ impl OpenXrDevice {
right_view_configuration.recommended_image_rect_height,
);

let swapchain_sample_count = left_view_configuration.recommended_swapchain_sample_count;

let secondary_active = false;
let (secondary, secondary_blend_mode) = if supports_secondary {
let view_configuration = *instance
Expand Down Expand Up @@ -1045,6 +1049,7 @@ impl OpenXrDevice {
secondary_active,
primary_blend_mode,
secondary_blend_mode,
swapchain_sample_count,
});
drop(data);

Expand Down

0 comments on commit 625ff64

Please sign in to comment.