-
Notifications
You must be signed in to change notification settings - Fork 24
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
OpenXR: Separate graphics handling from main OpenXR code #243
Conversation
Signed-off-by: Daniel Adams <[email protected]>
Signed-off-by: Daniel Adams <[email protected]>
pub enum GraphicsProvider {} | ||
|
||
pub trait GraphicsProviderMethods<G: Graphics> { | ||
fn enable_graphics_extensions(exts: &mut ExtensionSet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it is better if you use associated type, for example:
type GraphicsType: Graphics;
fn create_session(
device: &SurfmanDevice,
instance: &Instance,
system: SystemId,
) -> Result<(Session<Self::GraphicsType>, FrameWaiter, FrameStream<Self::GraphicsType>), Error>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the PR code is strictly equivalent, and I don't have a good sense for whether we should prefer one style over the other when there's no behaviour difference like this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I admit that I find it easy to mix up the GraphicsProvider enum and the GraphicsProviderType typedef, so maybe we should rename the second one to Backend instead?
pub enum GraphicsProvider {} | ||
|
||
pub trait GraphicsProviderMethods<G: Graphics> { | ||
fn enable_graphics_extensions(exts: &mut ExtensionSet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the PR code is strictly equivalent, and I don't have a good sense for whether we should prefer one style over the other when there's no behaviour difference like this case.
That's fair yeah, I'll adjust that today. |
Signed-off-by: Daniel Adams <[email protected]>
This removes the explicit dependency on D3D11 in the OpenXR code and should hopefully lay the groundwork for future support on other platforms like Linux or Android.