Skip to content

Commit

Permalink
Remove extern "C" from set_index_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ncharlton02 committed Dec 7, 2020
1 parent 7b886f4 commit b71c47a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
33 changes: 16 additions & 17 deletions wgpu-core/src/command/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,22 @@ impl RenderBundleEncoder {
life_guard: LifeGuard::new(desc.label.borrow_or_default()),
})
}

pub fn set_index_buffer(
&mut self,
buffer_id: id::BufferId,
index_format: wgt::IndexFormat,
offset: wgt::BufferAddress,
size: Option<wgt::BufferSize>,
) {
span!(_guard, DEBUG, "RenderBundle::set_index_buffer");
self.base.commands.push(RenderCommand::SetIndexBuffer {
buffer_id,
index_format,
offset,
size,
});
}
}

/// Error type returned from `RenderBundleEncoder::new` if the sample count is invalid.
Expand Down Expand Up @@ -1076,23 +1092,6 @@ pub mod bundle_ffi {
.push(RenderCommand::SetPipeline(pipeline_id));
}

#[no_mangle]
pub extern "C" fn wgpu_render_bundle_set_index_buffer(
bundle: &mut RenderBundleEncoder,
buffer_id: id::BufferId,
index_format: wgt::IndexFormat,
offset: BufferAddress,
size: Option<BufferSize>,
) {
span!(_guard, DEBUG, "RenderBundle::set_index_buffer");
bundle.base.commands.push(RenderCommand::SetIndexBuffer {
buffer_id,
index_format,
offset,
size,
});
}

#[no_mangle]
pub extern "C" fn wgpu_render_bundle_set_vertex_buffer(
bundle: &mut RenderBundleEncoder,
Expand Down
37 changes: 19 additions & 18 deletions wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ use crate::{
use arrayvec::ArrayVec;
use hal::command::CommandBuffer as _;
use thiserror::Error;
use wgt::{BufferAddress, BufferUsage, Color, IndexFormat, InputStepMode, TextureUsage};
use wgt::{
BufferAddress, BufferSize, BufferUsage, Color, IndexFormat, InputStepMode, TextureUsage,
};

#[cfg(any(feature = "serial-pass", feature = "replay"))]
use serde::Deserialize;
Expand Down Expand Up @@ -172,6 +174,22 @@ impl RenderPass {
target_depth_stencil: self.depth_stencil_target,
}
}

pub fn set_index_buffer(
&mut self,
buffer_id: id::BufferId,
index_format: IndexFormat,
offset: BufferAddress,
size: Option<BufferSize>,
) {
span!(_guard, DEBUG, "RenderPass::set_index_buffer");
self.base.commands.push(RenderCommand::SetIndexBuffer {
buffer_id,
index_format,
offset,
size,
});
}
}

impl fmt::Debug for RenderPass {
Expand Down Expand Up @@ -1753,23 +1771,6 @@ pub mod render_ffi {
.push(RenderCommand::SetPipeline(pipeline_id));
}

#[no_mangle]
pub extern "C" fn wgpu_render_pass_set_index_buffer(
pass: &mut RenderPass,
buffer_id: id::BufferId,
index_format: wgt::IndexFormat,
offset: BufferAddress,
size: Option<BufferSize>,
) {
span!(_guard, DEBUG, "RenderPass::set_index_buffer");
pass.base.commands.push(RenderCommand::SetIndexBuffer {
buffer_id,
index_format,
offset,
size,
});
}

#[no_mangle]
pub extern "C" fn wgpu_render_pass_set_vertex_buffer(
pass: &mut RenderPass,
Expand Down

0 comments on commit b71c47a

Please sign in to comment.