-
Notifications
You must be signed in to change notification settings - Fork 106
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
check for undefined constants instead of zero values #218
check for undefined constants instead of zero values #218
Conversation
cee035b
to
39ba477
Compare
I understand that this change was done because other implementations seem to do things this way, but to be honest this approach feels rather fragile to me. As an example, In #235 I update the And then there's the fact that there is I'm not sure what the most elegant solution would be, but I imagine that it would help a lot if we had a function to create a struct populated with these undefined-placeholders. Then here in wgpu-native we could make sure to keep that up-to-date, and save pain downstream. |
There's also some discussion here about having the default struct macros to be included in |
To work around this issue in wgpu-py I create the adapter, request its limits, and then use these as the default limits for creating devices. |
Align better with other webgpu-headers implementations for unset/undefined values.
Currently we take zero for indicating unset/undefined values. But webgpu-headers defines constants which should be used instead.
This introduces some breaking changes
WGPULimits
struct will have to be declared like this:WGPU_ARRAY_LAYER_COUNT_UNDEFINED
instead of0
forWGPUTextureViewDescriptor.arrayLayerCount
.WGPU_COPY_STRIDE_UNDEFINED
instead of0
forWGPUTextureDataLayout.bytesPerRow
&WGPUTextureDataLayout.rowsPerImage
.WGPU_MIP_LEVEL_COUNT_UNDEFINED
instead of0
forWGPUTextureViewDescriptor.mipLevelCount
.WGPU_WHOLE_MAP_SIZE
forsize
param inwgpuBufferGetMappedRange
&wgpuBufferGetConstMappedRange
.WGPU_WHOLE_SIZE
instead of0
for:size
param inwgpuCommandEncoderClearBuffer
.size
param inwgpuRenderPassEncoderSetIndexBuffer
.size
param inwgpuRenderPassEncoderSetVertexBuffer
.size
param inwgpuRenderBundleEncoderSetIndexBuffer
.size
param inwgpuRenderBundleEncoderSetVertexBuffer
.WGPUBufferBindingLayout.minBindingSize
.WGPUBindGroupEntry.size
.Fixes #214