Skip to content
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

Add usage to TextureViewDescriptor #6755

Merged
merged 9 commits into from
Dec 18, 2024
Merged

Conversation

sagudev
Copy link
Contributor

@sagudev sagudev commented Dec 16, 2024

Description
Spec says that we should obtain usage via TextureViewDescriptor: https://www.w3.org/TR/webgpu/#dom-gputextureviewdescriptor-usage, although by default it's is the same as in parent.

Testing
CTS run in servo: #6755 (comment)

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@sagudev
Copy link
Contributor Author

sagudev commented Dec 16, 2024

Given that hal::TextureUses are generated independently of any TextureUsage:

let usage = {

I think we just need to do validation against desc.usage when doing stuff on TextureView.

wgpu-types/src/lib.rs Outdated Show resolved Hide resolved
@sagudev sagudev force-pushed the TextureViewDesc-usage branch from abd625c to 36f7f7d Compare December 17, 2024 06:37
sagudev added a commit to sagudev/servo that referenced this pull request Dec 17, 2024
Signed-off-by: sagudev <[email protected]>
sagudev added a commit to sagudev/servo that referenced this pull request Dec 17, 2024
{"fail_fast": false, "matrix": [{"name": "WebGPU CTS", "workflow": "linux", "wpt_layout": "2020", "profile": "production", "unit_tests": false, "bencher": false, "wpt_args": "_webgpu"}]}
@sagudev
Copy link
Contributor Author

sagudev commented Dec 17, 2024

CTS run in servo:

TIMEOUT [expected OK] /_webgpu/webgpu/cts.https.html?q=webgpu:api,validation,createView:texture_view_usage:*

OK /_webgpu/webgpu/cts.https.html?q=webgpu:api,validation,resource_usages,texture,in_render_misc:subresources,texture_view_usages:*
        PASS [expected FAIL] subtest: :bindingType="color-attachment";viewUsage=1
        PASS [expected FAIL] subtest: :bindingType="color-attachment";viewUsage=2
        PASS [expected FAIL] subtest: :bindingType="color-attachment";viewUsage=4
        PASS [expected FAIL] subtest: :bindingType="color-attachment";viewUsage=8
        PASS [expected FAIL] subtest: :bindingType="sampled-texture";viewUsage=1
        PASS [expected FAIL] subtest: :bindingType="sampled-texture";viewUsage=2
        PASS [expected FAIL] subtest: :bindingType="sampled-texture";viewUsage=8
        PASS [expected FAIL] subtest: :bindingType="sampled-texture";viewUsage=16
        PASS [expected FAIL] subtest: :bindingType="writeonly-storage-texture";viewUsage=1
        PASS [expected FAIL] subtest: :bindingType="writeonly-storage-texture";viewUsage=2
        And 2 more unexpected results...

@sagudev
Copy link
Contributor Author

sagudev commented Dec 17, 2024

Servo is slow, but extending timeout and waiting half an hour gives:
1862/1862 PASS

@sagudev sagudev marked this pull request as ready for review December 17, 2024 11:02
@sagudev sagudev requested review from crowlKats and a team as code owners December 17, 2024 11:02
@sagudev sagudev requested a review from cwfitzgerald December 17, 2024 11:03
wgpu-core/src/device/resource.rs Show resolved Hide resolved
wgpu-core/src/device/resource.rs Show resolved Hide resolved
@cwfitzgerald cwfitzgerald self-assigned this Dec 17, 2024
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Looks good to me. Will let @teoxoy give final word before merging.

@cwfitzgerald cwfitzgerald assigned teoxoy and unassigned cwfitzgerald Dec 17, 2024
@sagudev sagudev force-pushed the TextureViewDesc-usage branch from 434955d to 993bb36 Compare December 18, 2024 06:04
@sagudev sagudev requested a review from teoxoy December 18, 2024 14:03
@teoxoy teoxoy merged commit d63ca09 into gfx-rs:trunk Dec 18, 2024
27 checks passed
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.

3 participants