odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.89k stars 606 forks source link

vendor/wgpu: RenderPassEncoderSetPushConstants should take a rawptr instead of cstring #3915

Closed tadeohepperle closed 3 months ago

tadeohepperle commented 3 months ago

There is this function here in vendor/wgpu:

RenderPassEncoderSetPushConstants :: proc(encoder: RenderPassEncoder, stages: ShaderStageFlags, offset: u32, sizeBytes: u32, data: cstring)

I don't think the cstring type here makes sense (we provide the sizeBytes anyway and a push constant ptr should not rely on zero termination), a rawptr should be more fitting according to the official headers:

https://github.com/gfx-rs/wgpu-native/blob/a1ede115d0d669b88b34447e58752335cb882e61/ffi/wgpu.h#L273