Convert MAX_MIP_LEVELS to u32

This commit is contained in:
Gabriel Majeri committed 2020-07-19 20:42:33 +03:00
1 parent e53aa70b9a
commit cbca43258f
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -55,7 +55,7 @@ fn own_label(label: &Label) -> String {
}
pub const MAX_COLOR_TARGETS: usize = 4;
pub const MAX_MIP_LEVELS: usize = 16;
pub const MAX_MIP_LEVELS: u32 = 16;
pub const MAX_VERTEX_BUFFERS: usize = 16;
pub const MAX_ANISOTROPY: u8 = 16;
pub const SHADER_STAGE_COUNT: usize = 3;
@@ -478,7 +478,7 @@ impl<B: GfxBackend> Device<B> {
let aspects = format.surface_desc().aspects;
let usage = conv::map_texture_usage(desc.usage, aspects);
let mip_level_count = desc.mip_level_count as usize;
let mip_level_count = desc.mip_level_count;
if mip_level_count >= MAX_MIP_LEVELS {
return Err(CreateTextureError::InvalidMipLevelCount(mip_level_count));
}
@@ -3055,5 +3055,5 @@ pub enum CreateTextureError {
"texture descriptor mip level count ({0}) must be less than device max mip levels ({})",
MAX_MIP_LEVELS
)]
InvalidMipLevelCount(usize),
InvalidMipLevelCount(u32),
}
+1 -1
View File
@@ -14,7 +14,7 @@ type PlaneStates = RangedStates<hal::image::Layer, Unit<TextureUse>>;
#[derive(Clone, Debug, Default, PartialEq)]
pub(crate) struct TextureState {
mips: ArrayVec<[PlaneStates; MAX_MIP_LEVELS]>,
mips: ArrayVec<[PlaneStates; MAX_MIP_LEVELS as usize]>,
/// True if we have the information about all the subresources here
full: bool,
}