Skip to content

Add support for Background and Utility application types - #330

Open
openglfreak wants to merge 3 commits into
Supreeeme:mainfrom
openglfreak:headless
Open

Add support for Background and Utility application types#330
openglfreak wants to merge 3 commits into
Supreeeme:mainfrom
openglfreak:headless

Conversation

@openglfreak

Copy link
Copy Markdown

No description provided.

impl GraphicsBackend for GlData {
type Api = xr::OpenGL;
type OpenVrTexture = gl::types::GLuint;
type Format = u32;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format can be pulled from the Api so I don't think it necessarily needs to be another associated type.

Comment thread src/openxr_data.rs
Comment on lines +127 to +130
vr::EVRApplicationType::Utility => {
supported_exts.mnd_headless && supported_exts.khr_convert_timespec_time
}
vr::EVRApplicationType::Background => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vr::EVRApplicationType::Utility => {
supported_exts.mnd_headless && supported_exts.khr_convert_timespec_time
}
vr::EVRApplicationType::Background => {
vr::EVRApplicationType::Utility | vr::EVRApplicationType::Background => {

Comment thread src/openxr_data.rs
Comment on lines +148 to +149
exts.mnd_headless = supported_exts.mnd_headless;
exts.khr_convert_timespec_time = supported_exts.khr_convert_timespec_time;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exts.mnd_headless = supported_exts.mnd_headless;
exts.khr_convert_timespec_time = supported_exts.khr_convert_timespec_time;
exts.mnd_headless = true;
exts.khr_convert_timespec_time = true;

}

fn to_openxr_format(_format: Self::Format) -> <Self::Api as xr::Graphics>::Format {
panic!()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
panic!()
unimplemented!()

Comment on lines +75 to +88
/*let raw_format = 0u32;
let format = *unsafe { &raw_format as &xr::headless::HeadlessFormat };
xr::SwapchainCreateInfo {
create_flags: xr::SwapchainCreateFlags::EMPTY,
usage_flags: xr::SwapchainUsageFlags::TRANSFER_DST,
format,
sample_count: 1,
width: 0u32,
height: 0u32,
face_count: 1,
array_size: 2,
mip_count: 1,
}*/
panic!();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*let raw_format = 0u32;
let format = *unsafe { &raw_format as &xr::headless::HeadlessFormat };
xr::SwapchainCreateInfo {
create_flags: xr::SwapchainCreateFlags::EMPTY,
usage_flags: xr::SwapchainUsageFlags::TRANSFER_DST,
format,
sample_count: 1,
width: 0u32,
height: 0u32,
face_count: 1,
array_size: 2,
mip_count: 1,
}*/
panic!();
unimplemented!()

}
}

impl GraphicsBackend for HeadlessData {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the GraphicsBackend functions should essentially be a noop for HeadlessData, because nothing should be rendered in a headless session. This begs the question, should HeadlessData even exist? It seems more like the GraphicalSession inside of SessionData should just be made into an Option<GraphicalSession>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants