diff --git a/README.md b/README.md index 163d08ad..c9cfe52f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ The bindings are based on the WebGPU-native header found at `ffi/webgpu-headers/ - [cshenton/WebGPU.jl](https://github.com/cshenton/WebGPU.jl) - experimental Julia wrapper - [dvijaha/WGPUNative.jl](https://github.com/dvijaha/WGPUNative.jl) - stable Julia wrapper - [kgpu/wgpuj](https://github.com/kgpu/kgpu/tree/master/wgpuj) - Java/Kotlin wrapper -- [wgpu4k/wgpu4k](https://github.com/wgpu4k/wgpu4k) - WIP Kotlin Multi Platform wrapper +- [wgpu4k/wgpu4k](https://github.com/wgpu4k/wgpu4k) - WIP Kotlin/Multiplatform wrapper +- [karmakrafts/Multiplatform wgpu](https://git.karmakrafts.dev/kk/multiplatform-wgpu) - Kotlin/Native wrapper - [rajveermalviya/go-webgpu](https://github.com/rajveermalviya/go-webgpu) - Go wrapper - [WebGPU-C++](https://github.com/eliemichel/WebGPU-Cpp) - Auto-generated C++ wrapper (developed for the [Learn WebGPU native](https://eliemichel.github.io/LearnWebGPU) course) - [jai_wgpu_native](https://github.com/SogoCZE/jai_wgpu_native) - Raw Jai bindings diff --git a/ffi/wgpu.h b/ffi/wgpu.h index fb3aece8..b4028256 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -271,6 +271,7 @@ uint32_t wgpuGetVersion(void); void wgpuRenderPassEncoderSetPushConstants(WGPURenderPassEncoder encoder, WGPUShaderStage stages, uint32_t offset, uint32_t sizeBytes, void const * data); void wgpuComputePassEncoderSetPushConstants(WGPUComputePassEncoder encoder, uint32_t offset, uint32_t sizeBytes, void const * data); +void wgpuRenderBundleEncoderSetPushConstants(WGPURenderBundleEncoder encoder, WGPUShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const * data); void wgpuRenderPassEncoderMultiDrawIndirect(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); void wgpuRenderPassEncoderMultiDrawIndexedIndirect(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); diff --git a/src/lib.rs b/src/lib.rs index e55bfbfe..e3f1012a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4358,6 +4358,28 @@ pub unsafe extern "C" fn wgpuComputePassEncoderSetPushConstants( } } +#[no_mangle] +pub unsafe extern "C" fn wgpuRenderBundleEncoderSetPushConstants( + bundle: native::WGPURenderBundleEncoder, + stages: native::WGPUShaderStageFlags, + offset: u32, + size_bytes: u32, + data: *const u8, +) { + let bundle = bundle.as_ref().expect("invalid render bundle"); + let encoder = bundle.encoder.as_mut().expect("invalid render bundle"); + let encoder = encoder.expect("invalid render bundle"); + let encoder = encoder.as_mut().unwrap(); + + bundle_ffi::wgpu_render_bundle_set_push_constants( + encoder, + wgt::ShaderStages::from_bits(stages).expect("invalid shader stage"), + offset, + size_bytes, + data, + ); +} + #[no_mangle] pub unsafe extern "C" fn wgpuRenderPassEncoderMultiDrawIndirect( pass: native::WGPURenderPassEncoder,