-
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
Proposal: remove Undefined from VertexStepMode and binding type enums #424
Conversation
Technically we do have "defaults" in C, in the form of the |
I very much approve this! Even in a pure C use case, I can see no use of the |
They don't map to the same JS:
|
To write that out, regardless of which way we go on removing Undefined, we could change the INIT macros from: WGPU_BIND_GROUP_LAYOUT_ENTRY_INIT { ... /*.buffer=*/WGPU_BUFFER_BINDING_LAYOUT_INIT ... };
WGPU_BUFFER_BINDING_LAYOUT_INIT { ... /*.type=*/WGPUBufferBindingType_BindingNotUsed ... }; to WGPU_BIND_GROUP_LAYOUT_ENTRY_INIT {
... /*.buffer=*/_wgpu_MAKE_INIT_STRUCT(WGPUBufferBindingLayout, {
... /*.type=*/WGPUBufferBindingType_BindingNotUsed ...
}) ...
};
WGPU_BUFFER_BINDING_LAYOUT_INIT { ... /*.type=*/WGPUBufferBindingType_Uniform ... }; so you can write: |
In #427 I did think of one small reason we might keep
That last line above would instead be: WGPU_BUFFER_BINDING_LAYOUT_INIT { ... /*.type=*/WGPUBufferBindingType_Undefined ... }; but the effect would be the same. |
Nov 21 meeting:
|
Ugh I forgot we should discuss the whole initialization thing I was talking about before I land this, will leave it on the agenda for now. |
Moved that issue to #450. |
Closing in favor of #450 |
After @beaufortfrancois started implementing
VertexBufferNotUsed
/BindingNotUsed
in Dawn I am reconsidering that we should haveUndefined
values for these enums at all. There is not really any value in them, since:Vertex
orUniform
/Float
/Filtering
/WriteOnly
undefined
toWGPUVertexStepMode_Undefined
/etc.WGPUBindGroupLayoutEntry.buffer.type
default toBindingNotUsed
but haveWGPUBufferBindingLayout.type
default toUniform
. Or just use algebraic data types, or whatever.See also PR #364; issues #234, #242
EDIT: #450 is a possible alternative to this PR