mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Move more types to wgpu-types
This commit is contained in:
parent
6d7eca94be
commit
f3bb6eb230
@ -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"))]
|
||||
|
@ -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};
|
||||
|
||||
|
@ -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 _;
|
||||
|
@ -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
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user