mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 17:19:11 +01:00
Restructure the repo to host multiple crates
This commit is contained in:
1 parent
de806ee108
commit
9ecc25e907
21 files changed
+56
-49
No files matched your search
@@ -0,0 +1,25 @@
|
||||
use hal;
|
||||
|
||||
use {CommandBuffer, CommandBufferHandle, ComputePassHandle};
|
||||
|
||||
|
||||
pub struct ComputePass<B: hal::Backend> {
|
||||
raw: B::CommandBuffer,
|
||||
}
|
||||
|
||||
pub extern "C"
|
||||
fn compute_pass_dispatch(
|
||||
pass: ComputePassHandle, groups_x: u32, groups_y: u32, groups_z: u32
|
||||
) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub extern "C"
|
||||
fn compute_pass_end(pass: ComputePassHandle) -> CommandBufferHandle {
|
||||
match pass.unbox() {
|
||||
Some(pass) => CommandBufferHandle::new(CommandBuffer {
|
||||
raw: pass.raw,
|
||||
}),
|
||||
None => CommandBufferHandle::null(),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
mod compute;
|
||||
mod render;
|
||||
|
||||
pub use self::compute::*;
|
||||
pub use self::render::*;
|
||||
|
||||
use hal;
|
||||
|
||||
use {BufferHandle, Color, CommandBufferHandle, ComputePassHandle, Origin3d,
|
||||
RenderPassHandle, TextureViewHandle, TextureHandle};
|
||||
|
||||
|
||||
#[repr(C)]
|
||||
pub enum LoadOp {
|
||||
Clear = 0,
|
||||
Load = 1,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub enum StoreOp {
|
||||
Store = 0,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct RenderPassColorAttachmentDescriptor {
|
||||
pub attachment: TextureViewHandle,
|
||||
pub load_op: LoadOp,
|
||||
pub store_op: StoreOp,
|
||||
pub clear_color: Color,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct RenderPassDepthStencilAttachmentDescriptor {
|
||||
pub attachment: TextureViewHandle,
|
||||
pub depth_load_op: LoadOp,
|
||||
pub depth_store_op: StoreOp,
|
||||
pub clear_depth: f32,
|
||||
pub stencil_load_op: LoadOp,
|
||||
pub stencil_store_op: StoreOp,
|
||||
pub clear_stencil: u32,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct RenderPassDescriptor<'a> {
|
||||
pub color_attachments: &'a [RenderPassColorAttachmentDescriptor],
|
||||
pub depth_stencil_attachment: RenderPassDepthStencilAttachmentDescriptor,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct BufferCopyView {
|
||||
pub buffer: BufferHandle,
|
||||
pub offset: u32,
|
||||
pub row_pitch: u32,
|
||||
pub image_height: u32,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct TextureCopyView {
|
||||
pub texture: TextureHandle,
|
||||
pub level: u32,
|
||||
pub slice: u32,
|
||||
pub origin: Origin3d,
|
||||
//TODO: pub aspect: TextureAspect,
|
||||
}
|
||||
|
||||
pub struct CommandBuffer<B: hal::Backend> {
|
||||
raw: B::CommandBuffer,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct CommandBufferDescriptor;
|
||||
|
||||
pub extern "C"
|
||||
fn command_buffer_begin_render_pass(
|
||||
command_buffer: CommandBufferHandle
|
||||
) -> RenderPassHandle {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub extern "C"
|
||||
fn command_buffer_begin_compute_pass(
|
||||
) -> ComputePassHandle {
|
||||
unimplemented!()
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
use hal;
|
||||
|
||||
use {CommandBuffer, CommandBufferHandle, RenderPassHandle};
|
||||
|
||||
|
||||
pub struct RenderPass<B: hal::Backend> {
|
||||
raw: B::CommandBuffer,
|
||||
}
|
||||
|
||||
pub extern "C"
|
||||
fn render_pass_draw(
|
||||
pass: RenderPassHandle, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32
|
||||
) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub extern "C"
|
||||
fn render_pass_draw_indexed(
|
||||
pass: RenderPassHandle, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32
|
||||
) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub extern "C"
|
||||
fn render_pass_end(pass: RenderPassHandle) -> CommandBufferHandle {
|
||||
match pass.unbox() {
|
||||
Some(pass) => CommandBufferHandle::new(CommandBuffer {
|
||||
raw: pass.raw,
|
||||
}),
|
||||
None => CommandBufferHandle::null(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user