-
Notifications
You must be signed in to change notification settings - Fork 353
Rename GPUExtent3DDict.depth to .depthOrArrayLayers #1390
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
Updates Extent3D as well, as it would be confusing if they didn't match. Keeps a placeholder "depth" member with type undefined, to prevent accidental use of a silently-ignored dictionary entry. Yes, this is weird, but WebIDL appears to allow it. If a browser implementation of WebIDL doesn't support it - Chromium's doesn't - it can be emulated by using another type (int, say) and then manually throwing a TypeError if the member is present.
|
I thought we discussed this before in the group and agreed to keep This proposal is a bit too much hand-holding for developers "remember that it is the depth or the array layer!" when instead it would be better to educate them that 2D arrays and 3D textures are mostly the same thing except for layout and the mip-levels in the Disallowing |
|
I do appreciate the rename to a more clear one. It's not a big issue for general ergonomics since most textures will not have the depth, and those who do - better know for sure what they opt into. As for disallowing "depth" at WebIDL - that seems like and overkill. If somebody doesn't read the spec, the examples, and accidentally uses "depth", the worst they are going to face is one iteration where they discover that their view creation fails and fix it. There are no spooky actions in distance here, we don't need to worry about this. |
|
Updated to .depthOrArrayLayers and removed the .depth funny business. I intend to do the .depth thing in the TypeScript bindings to achieve the same benefit for TypeScript users. That is the more reasonable place to put things like that. |
I forgot to reply about this, it would also change a multi-layer texture copy to copy only one layer (or slice). But I think it's okay. Browsers can even choose to implement warnings (by adding an |
|
meeting fyi: no objections :) |
1241: Update Extent3d::depth and Limits to latest upstream r=grovesNL a=kvark **Connections** - gpuweb/gpuweb#1390 - gpuweb/gpuweb#1328 - gpuweb/gpuweb#1163 - gpuweb/gpuweb#1274 **Description** Just an API update up to spec. **Testing** Tested on wgpu-rs examples Co-authored-by: Dzmitry Malyshau <[email protected]>
Proposal.
Updates Extent3D as well, as it would be confusing if they didn't match.
Keeps a placeholder "depth" member with type undefined, to prevent accidental use of a silently-ignored dictionary entry.Yes, this is weird, but WebIDL appears to allow it. If a browser implementation of WebIDL doesn't support it - Chromium's doesn't, unsurprisingly - it can be emulated by using another type (
intorany, say) and then manually throwing a TypeError if the member is present.See previous discussions:
#1372 (comment)
#1081 (comment)
Preview | Diff