mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Add missing render pass methods
This commit is contained in:
21
ffi/wgpu.h
21
ffi/wgpu.h
@@ -848,6 +848,17 @@ void wgpu_render_pass_draw(WGPURawRenderPass *pass,
|
||||
uint32_t first_vertex,
|
||||
uint32_t first_instance);
|
||||
|
||||
void wgpu_render_pass_draw_indexed(WGPURawRenderPass *pass,
|
||||
uint32_t index_count,
|
||||
uint32_t instance_count,
|
||||
uint32_t first_index,
|
||||
int32_t base_vertex,
|
||||
uint32_t first_instance);
|
||||
|
||||
void wgpu_render_pass_draw_indexed_indirect(WGPURawRenderPass *pass,
|
||||
WGPUBufferId buffer_id,
|
||||
WGPUBufferAddress offset);
|
||||
|
||||
void wgpu_render_pass_draw_indirect(WGPURawRenderPass *pass,
|
||||
WGPUBufferId buffer_id,
|
||||
WGPUBufferAddress offset);
|
||||
@@ -878,11 +889,11 @@ void wgpu_render_pass_set_index_buffer(WGPURawRenderPass *pass,
|
||||
|
||||
void wgpu_render_pass_set_pipeline(WGPURawRenderPass *pass, WGPURenderPipelineId pipeline_id);
|
||||
|
||||
void wgpu_render_pass_set_scissor(WGPURawRenderPass *pass,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t w,
|
||||
uint32_t h);
|
||||
void wgpu_render_pass_set_scissor_rect(WGPURawRenderPass *pass,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t w,
|
||||
uint32_t h);
|
||||
|
||||
void wgpu_render_pass_set_stencil_reference(WGPURawRenderPass *pass, uint32_t value);
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ impl<F> Global<F> {
|
||||
}
|
||||
}
|
||||
|
||||
mod ffi {
|
||||
pub mod compute_ffi {
|
||||
use super::{
|
||||
ComputeCommand,
|
||||
super::{PhantomSlice, RawPass},
|
||||
|
||||
@@ -1096,7 +1096,7 @@ impl<F> Global<F> {
|
||||
}
|
||||
}
|
||||
|
||||
mod ffi {
|
||||
pub mod render_ffi {
|
||||
use super::{
|
||||
RenderCommand,
|
||||
super::{PhantomSlice, RawRenderPass, Rect},
|
||||
@@ -1204,7 +1204,7 @@ mod ffi {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_set_scissor(
|
||||
pub unsafe extern "C" fn wgpu_render_pass_set_scissor_rect(
|
||||
pass: &mut RawRenderPass,
|
||||
x: u32,
|
||||
y: u32,
|
||||
@@ -1230,6 +1230,24 @@ mod ffi {
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_draw_indexed(
|
||||
pass: &mut RawRenderPass,
|
||||
index_count: u32,
|
||||
instance_count: u32,
|
||||
first_index: u32,
|
||||
base_vertex: i32,
|
||||
first_instance: u32,
|
||||
) {
|
||||
pass.raw.encode(&RenderCommand::DrawIndexed {
|
||||
index_count,
|
||||
instance_count,
|
||||
first_index,
|
||||
base_vertex,
|
||||
first_instance,
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_draw_indirect(
|
||||
pass: &mut RawRenderPass,
|
||||
@@ -1242,6 +1260,18 @@ mod ffi {
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_draw_indexed_indirect(
|
||||
pass: &mut RawRenderPass,
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
pass.raw.encode(&RenderCommand::DrawIndexedIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_execute_bundles(
|
||||
_pass: &mut RawRenderPass,
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
|
||||
use crate::GLOBAL;
|
||||
|
||||
pub use core::command::{
|
||||
wgpu_command_encoder_begin_compute_pass,
|
||||
wgpu_command_encoder_begin_render_pass,
|
||||
compute_ffi::*,
|
||||
render_ffi::*,
|
||||
};
|
||||
|
||||
use core::{gfx_select, id};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user