diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index 5bd7eafb1a..4a37e358ec 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -1219,7 +1219,7 @@ pub mod bundle_ffi { use super::{RenderBundleEncoder, RenderCommand}; use crate::{id, RawString}; use std::{convert::TryInto, slice}; - use wgt::{BufferAddress, BufferSize, DynamicOffset}; + use wgt::{BufferAddress, BufferSize, DynamicOffset, IndexFormat}; /// # Safety /// @@ -1283,6 +1283,17 @@ pub mod bundle_ffi { }); } + #[no_mangle] + pub extern "C" fn wgpu_render_bundle_set_index_buffer( + encoder: &mut RenderBundleEncoder, + buffer: id::BufferId, + index_format: IndexFormat, + offset: BufferAddress, + size: Option, + ) { + encoder.set_index_buffer(buffer, index_format, offset, size); + } + /// # Safety /// /// This function is unsafe as there is no guarantee that the given pointer is diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 2cd83a178f..0e08d37728 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -2005,7 +2005,7 @@ pub mod render_ffi { }; use crate::{id, RawString}; use std::{convert::TryInto, ffi, num::NonZeroU32, slice}; - use wgt::{BufferAddress, BufferSize, Color, DynamicOffset}; + use wgt::{BufferAddress, BufferSize, Color, DynamicOffset, IndexFormat}; /// # Safety /// @@ -2068,6 +2068,17 @@ pub mod render_ffi { }); } + #[no_mangle] + pub extern "C" fn wgpu_render_pass_set_index_buffer( + pass: &mut RenderPass, + buffer: id::BufferId, + index_format: IndexFormat, + offset: BufferAddress, + size: Option, + ) { + pass.set_index_buffer(buffer, index_format, offset, size); + } + #[no_mangle] pub extern "C" fn wgpu_render_pass_set_blend_constant(pass: &mut RenderPass, color: &Color) { pass.base