-
Notifications
You must be signed in to change notification settings - Fork 353
Add algorithm for GPUTexture.createView() #1406
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
Conversation
Kangz
left a comment
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.
LGTM
kainino0x
left a comment
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.
Sorry for the delay, here are some comments for a followup :)
| - If |this|.{{GPUTexture/[[dimension]]}} is | ||
| <dl class="switch"> | ||
| : {{GPUTextureDimension/"1d"}} | ||
| :: Let |arrayCount| be |this|.{{GPUTexture/[[textureSize]]}}.[=Extent3D/depth=]. |
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.
nit: This is a little misleading since we don't have 1d-array textures. If this were encapsulated in an algorithm (see below) then I would explicitly call out that texture.textureSize.depth is expected to be 1.
| set |resolved|.{{GPUTextureViewDescriptor/dimension}} to {{GPUTextureViewDimension/"1d"}}. | ||
| - If |texture|.{{GPUTexture/[[dimension]]}} is {{GPUTextureDimension/"2d"}}: | ||
| - If |texture|.{{GPUTexture/[[textureSize]]}}.[=Extent3D/depth=] is greater than `1` | ||
| and |resolved|.{{GPUTextureViewDescriptor/arrayLayerCount}} is greater than `1`, |
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.
Found another thing while reviewing a CTS change.
The meaning here has changed from the original (before this PR), though that was outdated because it special-cased 0. I think this should be refactored to say:
- If texture.dimension is 2d:
- If texture.textureSize.depth is 1 or (the original, pre-defaulting) arrayLayerCount is defined, view dimension is 2d.
- else view dimension is 2d-array.
Pretty sure that's the original intent. Though it's kind of weird? Maybe it should have been:
- If texture.dimension is 2d:
- If texture.textureSize.depth is 1 or (the original, pre-defaulting) arrayLayerCount is 1, view dimension is 2d.
- else view dimension is 2d-array.
This PR adds unimplemented tests for the `textureNumSamples` builtin. Issue gpuweb#1265
Fixes #1397
Preview | Diff