Closed
Description
In the C API we have a few sentinel enum values that don't have equivalents in JS:
WGPUVertexStepMode_VertexBufferNotUsed
(JS hassequence<GPUVertexBufferLayout?>
) (see Some enums' sentinel 0 values are indistinguishable from "undefined" defaulting #242)WGPUTextureFormat_Undefined
inWGPUFragmentState
(Add support for null targets in WGPUFragmentState #160) (JS hassequence<GPUColorTargetState?>
)- The binding types: BufferBindingType, SamplerBindingType, TextureSampleType, StorageTextureAccess
_Undefined
(JS has the parent dictionary optional) (see Some enums' sentinel 0 values are indistinguishable from "undefined" defaulting #242) WGPUCompositeAlphaMode_Auto
We also have Undefined
variants for a bunch of enums which are used as optional-without-default in JS.
And finally, constants for sentinel values of numeric fields:
#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL)
#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL)
#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL)
#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL)
#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL)
#define WGPU_QUERY_SET_INDEX_UNDEFINED (0xffffffffUL)
#define WGPU_WHOLE_MAP_SIZE SIZE_MAX
#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL)
Should we call all of them "undefined"?
Or should we be trying to use more meaningful names, like VertexBufferNotUsed
and WHOLE_SIZE
?
Or should we have both?
Examples of meaningful names:
WGPUTextureFormat_ColorTargetNotUsed
WGPUBufferBindingType_NotUsed
WGPU_ARRAY_LAYER_COUNT_DEFAULT
or e.g.TO_END
orALL_REMAINING
WGPU_QUERY_SET_INDEX_NOT_WRITTEN