-
Notifications
You must be signed in to change notification settings - Fork 948
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
[metal] set the image stride to zero when updating a single layer of a 3D texture #4154
Conversation
a28e28c
to
d6e4482
Compare
a68dc10
to
ca7abcb
Compare
It seems that Metal's validation errors don't surface in CI. |
Ah, I think I see why. Is there a way to run the tests under xcode (in CI)? I think we should do that. |
We need to set the env var METAL_DEVICE_WRAPPER_TYPE=1 - we should do it in the test harness before wgpu is initialized so they get enabled locally too. |
@@ -51,9 +51,16 @@ fn write_texture_subset_2d() { | |||
|
|||
ctx.queue.submit(None); | |||
|
|||
let read_buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor { | |||
let read_buffer_0 = ctx.device.create_buffer(&wgpu::BufferDescriptor { |
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.
would imho be nice to parameterize this test to have it both do a full update and two piecewise.
The second one can then point to this PR, pointing out that it protects against regressing this
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 can probably trigger the validation error with a simpler test case.
Will try to do that instead as opposed to modifying this one.
Wouldn't that require #3873? I can add it in CI for now though. |
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 like the idea of separating out the test case. The code changes look good.
2c5966e
to
ee10bb6
Compare
Besides some other validation errors that we get when I enabled metal's validation, I can't seem to get metal's validation to trigger for this specific case. Maybe newer versions don't care but older do? |
@teoxoy No, you can just add the env var around here https://github.com/gfx-rs/wgpu/blob/trunk/tests/src/lib.rs#L328 As for what to do - split this however you feel is best, as long as at the end we end up:
We're where we need to be :) |
@cwfitzgerald question about the env variable: |
I have no idea why we used this, I think this might be what xcode uses? I'm not particularly strongly either way, as long as it does what we want. |
#3873 now includes both |
@teoxoy what's the status on this? |
From my testing I did at the time, I couldn't produce the validation error I was expecting by not setting We ran into the validation error for If someone more familiar with macOS/Metal could help on this front that would be great but it seems that this issue isn't a high priority right now. I mainly left this open and as draft to remind me to look at it at some later time but closing it and opening an issue sounds like the better approach. |
Checklist
cargo clippy
.cargo clippy --target wasm32-unknown-unknown
if applicable.Connections
Follow up to #3063.
Description
See #3063 (comment).
Testing
Test has been modified.