-
Notifications
You must be signed in to change notification settings - Fork 45
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
Naming conventions for extension structs and implementation-specific extensions #212
Comments
For ergonomics it seems that typing
So the list would become:
WDYT? |
webgpu.h meeting resolution (OUTDATED):
See also #214 about enum range reservations. |
Feedback that eliding "Descriptor" from the extension struct names is confusing: |
Jul 18 meeting:
(I'll expand out that proposal in a followup comment) |
Rough proposal:
Other examples of how extensions could be named:
|
My understanding was that we'd fold DepthClipControl into PrimitiveState with #311 |
Yes we're folding it, but that's just for the explanation of the new naming rules. |
Oh yes, I intended to note that but forgot. Edited above. |
I believe we can close this issue after #320 gets merged. |
You're right, thanks! |
Applying this naming convention to Dawn we are finding we don't know how to name:
Marked the ones I like personally with ⭐. |
Adding the namespace in C++ is cool, but could be mildly difficult to do in Dawn, though it's not breaking for webgpu.h so it's ok to do later. That said I really don't understand why we need a New enums and their enum values:
New methods and new objects
|
The Khronos-like style makes it so when something gets promoted to core, only the suffix is removed. I don't have that much preference, but we do have the problem that one of the blocks is for |
|
TBH |
Just wanted to check in and see if we've decided on a naming convention yet. |
FWIW, my personal opinion: Spontaneously I would have opted for @Kangz' proposal (and agree that a |
Nov 25 meeting:
Dawn hasn't implemented suffixes yet, and I checked and wgpu-native has not yet either. So @Kangz since you prefer
The only specific reason I see to adopt it is that the un-suffixed version of the name (if something becomes core) is exactly the same except for the very end. But that's not significantly different from removing the prefix between WGPU and the rest of the name. Otherwise just because it is familiar to GL/Vulkan developers.
I was pretty sure about this but I should have checked :) Vulkan does this when adding a new enum: I suppose we could have inferred we wanted to use that style from the fact that we said "vulkan style", but we came to a different conclusion anyway, so no problem. |
Updated #214 accordingly |
Just thinking a little bit more about adding new values to existing enums and new methods to existing objects, they still get sandwiched which I like a bit less than having suffixes always at the end. Also wanted to point out:
We don't currently separate the type name from the method name so this would look instead like
... unless we insert the underscores specifically for the case where we are adding methods to existing objects. |
Yeah I think |
Ack. |
To go through everything, for the record, does this seem right?
|
It does! |
I totally forgot the code generator actually implements the suffixing, so we need to fix that. (It's not used in this repo so it doesn't affect the core |
To better align with webgpu-native#212
We should define some naming conventions for both standardized extension structs and implementation-specific extensions. Right now we have the following (inconsistent) names:
WGPUPrimitiveState
extensions:WGPUPrimitiveDepthClipControl
WGPURenderPassDescriptor
extensions:WGPURenderPassDescriptorMaxDrawCount
WGPUShaderModuleDescriptor
extensions:WGPUShaderModuleSPIRVDescriptor
WGPUShaderModuleWGSLDescriptor
WGPUSurfaceDescriptor
extensions:WGPUSurfaceDescriptorFromAndroidNativeWindow
WGPUSurfaceDescriptorFromCanvasHTMLSelector
WGPUSurfaceDescriptorFromMetalLayer
WGPUSurfaceDescriptorFromWaylandSurface
WGPUSurfaceDescriptorFromWindowsHWND
WGPUSurfaceDescriptorFromXcbWindow
WGPUSurfaceDescriptorFromXlibWindow
Additionally for Dawn we might want things like
WGPUSomeDescriptorNewFeatureDAWN
? (though idk what the naming would be for wgpu-native)The text was updated successfully, but these errors were encountered: