Skip to content

Commit

Permalink
expose sync pipeline comp, label pipelined rendering as experimental …
Browse files Browse the repository at this point in the history
…and disable it by default
  • Loading branch information
Schmarni-Dev committed Feb 23, 2024
1 parent dbc3a1c commit 01f23e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/android/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() {
app_info: XrAppInfo {
name: "Bevy OXR Android Example".into(),
},
enable_pipelined_rendering: false,
enable_pipelined_rendering: true,
..Default::default()
})
// .add_plugins(OpenXrDebugRenderer)
Expand Down
15 changes: 12 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ pub struct OpenXrPlugin {
pub reqeusted_extensions: XrExtensions,
pub prefered_blend_mode: XrPreferdBlendMode,
pub app_info: XrAppInfo,
/// Experimental might break stuff
pub enable_pipelined_rendering: bool,
pub synchronous_pipeline_compilation: bool,
}

impl Plugin for OpenXrPlugin {
Expand Down Expand Up @@ -100,14 +102,17 @@ impl Plugin for OpenXrPlugin {
render_instance,
),
// Expose this? if yes we also have to set this in the non xr case
synchronous_pipeline_compilation: true,
synchronous_pipeline_compilation: self.synchronous_pipeline_compilation,
});
app.insert_resource(XrStatus::Disabled);
// app.world.send_event(StartXrSession);
}
Err(err) => {
warn!("OpenXR Instance Failed to initialize: {}", err);
app.add_plugins(RenderPlugin::default());
app.add_plugins(RenderPlugin {
synchronous_pipeline_compilation: self.synchronous_pipeline_compilation,
..Default::default()
});
app.insert_resource(XrStatus::NoInstance);
}
}
Expand Down Expand Up @@ -256,7 +261,9 @@ pub struct DefaultXrPlugins {
pub reqeusted_extensions: XrExtensions,
pub prefered_blend_mode: XrPreferdBlendMode,
pub app_info: XrAppInfo,
/// Experimental might break stuff
pub enable_pipelined_rendering: bool,
pub synchronous_pipeline_compilation: bool,
}
impl Default for DefaultXrPlugins {
fn default() -> Self {
Expand All @@ -270,7 +277,8 @@ impl Default for DefaultXrPlugins {
reqeusted_extensions: default(),
prefered_blend_mode: default(),
app_info: default(),
enable_pipelined_rendering: true,
enable_pipelined_rendering: false,
synchronous_pipeline_compilation: false,
}
}
}
Expand All @@ -297,6 +305,7 @@ impl PluginGroup for DefaultXrPlugins {
reqeusted_extensions: self.reqeusted_extensions,
app_info: self.app_info.clone(),
enable_pipelined_rendering: self.enable_pipelined_rendering,
synchronous_pipeline_compilation: self.synchronous_pipeline_compilation,
})
.add_after::<OpenXrPlugin, _>(XrInitPlugin)
.add(XrInputPlugin)
Expand Down

0 comments on commit 01f23e7

Please sign in to comment.