-
Notifications
You must be signed in to change notification settings - Fork 23
OpenXR: Separate graphics handling from main OpenXR code #243
Conversation
Signed-off-by: Daniel Adams <msub2official@gmail.com>
Signed-off-by: Daniel Adams <msub2official@gmail.com>
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 <msub2official@gmail.com>
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.