gfx-rs / wgpu-native

Native WebGPU implementation based on wgpu-core
Apache License 2.0
871 stars 104 forks source link

Const-ness issues in push constants API #345

Closed lisyarus closed 9 months ago

lisyarus commented 10 months ago

I've notices two const-related problems in the API related to push constants:

1) WGPUPipelineLayoutExtras::pushConstantRanges is a non-const pointer, while it seems to be a read-only value 2) The data argument of wgpuRenderPassEncoderSetPushConstants is a non-const void*, while this data is also read-only.

The latter one even looks like void * const data, as if someone applied const to the wrong side of the pointer.

Is there any reason these pointers are non-const?