Move more types to wgpu-types

This commit is contained in:
Joshua Groves 2020-03-27 23:25:04 -02:30
parent 6d7eca94be
commit f3bb6eb230
6 changed files with 19 additions and 20 deletions

View File

@ -11,7 +11,7 @@ use crate::{
Stored,
};
use wgt::BufferAddress;
use wgt::{BufferAddress, TextureComponentType};
use arrayvec::ArrayVec;
use gfx_descriptor::{DescriptorCounts, DescriptorSet};
@ -33,15 +33,6 @@ pub enum BindingType {
WriteonlyStorageTexture = 7,
}
#[repr(C)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub enum TextureComponentType {
Float,
Sint,
Uint,
}
#[repr(C)]
#[derive(Clone, Debug, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]

View File

@ -8,12 +8,12 @@ use crate::{
CommandBuffer,
PhantomSlice,
},
device::{all_buffer_stages, BIND_BUFFER_ALIGNMENT},
device::all_buffer_stages,
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Token},
id,
};
use wgt::{BufferAddress, BufferUsage, DynamicOffset};
use wgt::{BufferAddress, BufferUsage, DynamicOffset, BIND_BUFFER_ALIGNMENT};
use hal::command::CommandBuffer as _;
use peek_poke::{Peek, PeekCopy, Poke};

View File

@ -14,7 +14,6 @@ use crate::{
FramebufferKey,
RenderPassContext,
RenderPassKey,
BIND_BUFFER_ALIGNMENT,
MAX_VERTEX_BUFFERS,
MAX_COLOR_TARGETS,
},
@ -37,6 +36,7 @@ use wgt::{
RenderPassColorAttachmentDescriptorBase,
RenderPassDepthStencilAttachmentDescriptorBase,
TextureUsage,
BIND_BUFFER_ALIGNMENT
};
use arrayvec::ArrayVec;
use hal::command::CommandBuffer as _;

View File

@ -18,8 +18,7 @@ use crate::{
Stored,
};
use wgt::{BufferAddress, InputStepMode, TextureDimension, TextureFormat};
use wgt::{BufferAddress, InputStepMode, TextureDimension, TextureFormat, BIND_BUFFER_ALIGNMENT};
use arrayvec::ArrayVec;
use copyless::VecHelper as _;
use gfx_descriptor::DescriptorAllocator;
@ -50,9 +49,6 @@ pub const MAX_COLOR_TARGETS: usize = 4;
pub const MAX_MIP_LEVELS: usize = 16;
pub const MAX_VERTEX_BUFFERS: usize = 8;
/// Bound uniform/storage buffer offsets must be aligned to this number.
pub const BIND_BUFFER_ALIGNMENT: hal::buffer::Offset = 256;
pub fn all_buffer_stages() -> hal::pso::PipelineStage {
use hal::pso::PipelineStage as Ps;
Ps::DRAW_INDIRECT

View File

@ -4,13 +4,13 @@
use crate::{
backend,
device::{Device, BIND_BUFFER_ALIGNMENT},
device::Device,
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Input, Token},
id::{AdapterId, DeviceId},
power,
};
use wgt::{Backend, BackendBit, DeviceDescriptor, PowerPreference, RequestAdapterOptions};
use wgt::{Backend, BackendBit, DeviceDescriptor, PowerPreference, RequestAdapterOptions, BIND_BUFFER_ALIGNMENT};
#[cfg(feature = "serde")]
use serde_crate::{Deserialize, Serialize};

View File

@ -825,3 +825,15 @@ pub struct SamplerDescriptor<'a> {
pub struct CommandBufferDescriptor {
pub todo: u32,
}
#[repr(C)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum TextureComponentType {
Float,
Sint,
Uint,
}
/// Bound uniform/storage buffer offsets must be aligned to this number.
pub const BIND_BUFFER_ALIGNMENT: u64 = 256;