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

Deduped most image/buffer copy validation #4629

Merged
merged 4 commits into from
May 21, 2024
Merged

Deduped most image/buffer copy validation #4629

merged 4 commits into from
May 21, 2024

Conversation

toji
Copy link
Member

@toji toji commented May 9, 2024

Fixes #1192

Takes a lot of the Texture<->Buffer image copy validation logic and dedups it into a single algorithm. Original issue only requested the "single-aspect" validation bits be deduped, but in the end there was a lot more shared logic between three functions that did that check that could be unified.

@toji toji requested review from kainino0x and jimblandy May 9, 2024 22:11
Copy link
Contributor

github-actions bot commented May 9, 2024

Previews, as seen when this build job started (0a2332b):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@toji
Copy link
Member Author

toji commented May 10, 2024

Oh! Also forgot to mention that I noticed that I missed updating copies.bs with my previous timelines PR, so I've made those changes as part of this PR (since it was relatively minimal)

spec/sections/copies.bs Show resolved Hide resolved
|dstTexture|.{{GPUTexture/format}}.
- That aspect must be a valid image copy destination according to [[#depth-formats]].
- Set |aspectSpecificFormat| to the [=aspect-specific format=] according to [[#depth-formats]].
- [=validating texture copy range=](|destination|, |copySize|) return `true`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This step seems to be missing now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching that. I tried so hard to make sure everything got pulled over, but with as much rearranging as it required I guess I'm not too surprised I missed a step.

spec/index.bs Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Show resolved Hide resolved
spec/index.bs Show resolved Hide resolved
spec/sections/copies.bs Outdated Show resolved Hide resolved
spec/sections/copies.bs Show resolved Hide resolved
spec/sections/copies.bs Outdated Show resolved Hide resolved
@toji toji enabled auto-merge (squash) May 21, 2024 17:59
@toji toji merged commit 3eec234 into main May 21, 2024
4 checks passed
@toji toji deleted the single-aspect branch May 21, 2024 18:01
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.

Consider deduplicating "must be a single aspect" validation
2 participants