Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use recommended swapchain sample count for OpenXR #231

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading