-
Notifications
You must be signed in to change notification settings - Fork 936
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
More as_hal() methods #3966
More as_hal() methods #3966
Conversation
Open question: How to ensure textures are kept alive while native/non-wgpu render work takes place? |
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.
Minus nits, lets just get this in, we can improve the apis later.
|
||
/// # Safety | ||
/// - The raw command encoder handle must not be manually destroyed | ||
pub unsafe fn command_encoder_as_hal_mut< |
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 I need to add the not wasm #cfg's here, and in a few other places?
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.
We should
@@ -79,7 +79,7 @@ impl<A: hal::Api> CommandEncoder<A> { | |||
} | |||
} | |||
|
|||
fn open(&mut self) -> &mut A::CommandEncoder { | |||
pub fn open(&mut self) -> &mut A::CommandEncoder { |
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.
Did I need to make this method public, and CommandBuffer.encoder pub(crate)? Not sure.
Poke - need to rebase and fix CI. |
I've rebased, but not quite sure what cfg's to add where. It seems inconsistent, not all existing as_hal methods have them, and I'm not sure which crates need it or not. Also, not sure what cfg to use - it seems like some of them allow webgl or emscripten? Those seem wrong, surely it's supposed to be |
Both emscripten and webgl are |
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.
Look ma, a review
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.
Seem to have some CI issues.
Can we add 2 more methods?
|
I don't have the time or motivation to work on this anymore (this was originally intended for use with DLSS, but I gave up on that idea). Ideally someone will take up #4067. |
Checklist
cargo clippy
.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown
if applicable.Description
Texture::as_hal()
callback to return a value, matching other as_hal callbacksTextureView::as_hal()
CommandEncoder::as_hal_mut()
(closes Allow hooking into command buffers on a backend-specific basis #3517)Adapter::texture_format_as_hal()