mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Obtain memory properties
This commit is contained in:
parent
edc8980a9a
commit
7d8577cb90
@ -1,5 +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(),
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use hal;
|
||||
|
||||
use {CommandBufferHandle, RenderPassHandle};
|
||||
use {CommandBuffer, CommandBufferHandle, RenderPassHandle};
|
||||
|
||||
|
||||
pub struct RenderPass<B: hal::Backend> {
|
||||
@ -23,5 +23,10 @@ fn render_pass_draw_indexed(
|
||||
|
||||
pub extern "C"
|
||||
fn render_pass_end(pass: RenderPassHandle) -> CommandBufferHandle {
|
||||
unimplemented!()
|
||||
match pass.unbox() {
|
||||
Some(pass) => CommandBufferHandle::new(CommandBuffer {
|
||||
raw: pass.raw,
|
||||
}),
|
||||
None => CommandBufferHandle::null(),
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
use hal::{self, Device as _Device};
|
||||
use memory;
|
||||
|
||||
use {BufferHandle, CommandBufferHandle, DeviceHandle};
|
||||
|
||||
@ -17,6 +18,7 @@ pub struct CommandBufferDescriptor {
|
||||
|
||||
pub struct Device<B: hal::Backend> {
|
||||
pub gpu: hal::Gpu<B>,
|
||||
pub memory_properties: hal::MemoryProperties,
|
||||
}
|
||||
|
||||
pub struct Buffer<B: hal::Backend> {
|
||||
|
@ -61,5 +61,6 @@ fn adapter_create_device(
|
||||
let gpu = adapter.physical_device.open(&[(queue_family, &[1f32])]).unwrap();
|
||||
DeviceHandle::new(Device {
|
||||
gpu,
|
||||
memory_properties: adapter.physical_device.memory_properties(),
|
||||
})
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ extern crate gfx_backend_vulkan as back;
|
||||
extern crate gfx_backend_dx12 as back;
|
||||
#[cfg(feature = "gfx-backend-metal")]
|
||||
extern crate gfx_backend_metal as back;
|
||||
extern crate gfx_memory as memory;
|
||||
|
||||
mod command;
|
||||
mod device;
|
||||
|
Loading…
Reference in New Issue
Block a user