Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin-real/trunk' into feature/upgrade…
Browse files Browse the repository at this point in the history
…-to-wgpu-24.0.0

# Conflicts:
#	src/lib.rs
ygdrasil-io committed Jan 25, 2025
2 parents 452b21e + a3d1589 commit 61c9e75
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ffi/wgpu.h
Original file line number Diff line number Diff line change
@@ -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);
22 changes: 22 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 61c9e75

Please sign in to comment.