Remove obsolete files

This commit is contained in:
Pierre Krieger 2016-01-31 13:20:32 +01:00
parent c67d3a6a93
commit fbeac0d827
10 changed files with 0 additions and 228 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
target
Cargo.lock

View File

@ -1,4 +0,0 @@
[package]
name = "vulkano"
version = "0.0.1"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]

View File

@ -1,26 +0,0 @@
use lock;
unsafe trait BufferLock {
unsafe fn get_id(&self) -> u64;
}
impl<T> BufferLock for T where T: lock::Lock<Buffer> {
}
pub struct Buffer {
id: ,
}
unsafe impl BufferLock for Buffer {
#[inline]
unsafe fn get_id(&self) -> u64 {
self.id
}
}
impl Drop for Buffer {
fn drop(&mut self) {
error::check_result(unsafe { ffi::grDestroyBuffer(self.id) }).unwrap();
}
}

View File

@ -1,98 +0,0 @@
use buffer::BufferLock;
/// Represents a prototype of a command buffer.
///
/// # Usage
///
/// ```norun
/// let commands_buffer =
/// CommandBufferBuilder::new(&device)
/// .copy_memory(..., ...)
/// .draw(...)
/// .build();
///
/// ```
///
/// # Implementation
///
/// Builds a command buffer and starts writing into it. Each function call directly adds a command
/// into the buffer.
///
/// Resources that are used are held in the `CommandBufferBuilder` and the `CommandBuffer`,
/// ensuring that they don't get destroyed as long as the command buffer is alive.
///
pub struct CommandBufferBuilder {
device: Arc<Device>,
cmd: Option<ffi::GR_CMD_BUFFER>,
memory_refs: Vec<ffi::GR_MEMORY_REF>,
buffers: Vec<Arc<BufferLock>>,
images: Vec<Arc<Image>>,
pipelines: Vec<Arc<Pipeline>>,
}
impl CommandBufferBuilder {
/// Builds a new prototype of a command buffer.
pub fn new(device: &Arc<Device>) -> CommandBufferBuilder {
let infos = ffi::GR_CMD_BUFFER_CREATE_INFO {
queueType: ffi::GR_QUEUE_UNIVERSAL,
flags: 0,
};
let cmd_buffer = unsafe {
let mut cmd = mem::uninitialized();
error::check_result(ffi::grCreateCommandBuffer(*device.get_id(),
&infos, &mut cmd)).unwrap();
cmd
};
error::check_result(unsafe { ffi::grBeginCommandBuffer(cmd_buffer, 0) }).unwrap();
CommandBufferBuilder {
device: device.clone(),
cmd: Some(cmd_buffer),
memory_refs: Vec::new(),
}
}
/// Builds the command buffer containing all the commands.
pub fn build(mut self) -> Arc<CommandBuffer> {
let cmd_buffer = self.cmd.take().unwrap();
error::check_result(unsafe { ffi::grEndCommandBuffer(cmd_buffer) }).unwrap();
Arc::new(CommandBuffer {
device: self.device.clone(),
cmd: cmd_buffer,
memory_refs: mem::replace(&mut self.memory_refs, Vec::with_capacity(0)),
buffers: mem::replace(&mut self.buffers, Vec::with_capacity(0)),
images: mem::replace(&mut self.images, Vec::with_capacity(0)),
pipelines: mem::replace(&mut self.pipelines, Vec::with_capacity(0)),
})
}
}
impl Drop for CommandBufferBuilder {
fn drop(&mut self) {
if let Some(cmd) = self.cmd {
error::check_result(unsafe { ffi::grEndCommandBuffer(cmd) }).unwrap();
error::check_result(unsafe { ffi::grDestroyObject(cmd) }).unwrap();
}
}
}
/// Represents a command buffer.
///
/// Can be submitted to a queue.
pub struct CommandBuffer {
device: Arc<Device>,
cmd: ffi::GR_CMD_BUFFER,
memory_refs: Vec<ffi::GR_MEMORY_REF>,
buffers: Vec<Arc<BufferLock>>,
images: Vec<Arc<Image>>,
pipelines: Vec<Arc<Pipeline>>,
}
impl Drop for CommandBuffer {
fn drop(&mut self) {
error::check_result(unsafe { ffi::grDestroyObject(cmd) }).unwrap();
}
}

View File

@ -1,6 +0,0 @@
use dynamic_state;
pub struct DynamicStateObjects {
}

View File

@ -1,28 +0,0 @@
/// Represents a Vulkan context.
pub struct Device {
device: ffi::GR_DEVICE,
queue: ffi::GR_QUEUE,
}
impl Device {
/// Builds a new Vulkan context for the given GPU.
pub fn new(gpu: &GpuId) -> Arc<Device> {
unimplemented!();
}
/// Enumerates the list of universal queues. These queues can do anything.
pub fn universal_queues(&self) -> UniversalQueuesIter {
unimplemented!();
}
/// Enumerates the list of compute queues.
pub fn compute_queues(&self) -> ComputeQueuesIter {
unimplemented!();
}
/// Enumerates the list of DMA queues. DMA queues can only transfer data.
pub fn dma_queues(&self) -> DmaQueueIter {
unimplemented!();
}
}

View File

@ -1,24 +0,0 @@
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum FillMode {
Solid,
Wireframe,
}
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum CullMode {
None,
Front,
Back,
}
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub struct RasterizerState {
pub fill_mode: FillMode,
pub cull_mode: CullMode,
pub front_face: TODO,
pub depth_bias: i32,
pub depth_bias_clamp: f32,
pub slope_scaled_depth_bias: f32,
}

View File

View File

@ -1,8 +0,0 @@
mod buffer;
mod command_buffer;
mod device;
mod image;
pub use self::command_buffer::CommandBufferBuilder;
pub use self::command_buffer::CommandBuffer;

View File

@ -1,32 +0,0 @@
use std::sync;
use Fence;
/// Defines a strategy for read-write access and relation with fences.
pub trait Lock<T> {
fn shared_access(&self);
fn exclusive_access(&self);
fn shared_access_until(&self, Fence);
fn exclusive_access_until(&self, Fence);
}
pub struct Mutex<T> {
inner: sync::Mutex<T>,
fence: Option<Fence>,
}
impl<T> Mutex<T> {
pub fn lock(&self) -> Result<MutexLock<T>, MutexlockError> {
self.fence.wait();
let inner = try!(self.inner.lock());
}
}
impl<T> Lock<T> for Mutex<T> {
}
pub struct MutexLock<'a, T> {
inner: sync::LockGuard<'a, T>,
}