update synchronization, fix last errors in wgc

This commit is contained in:
Dzmitry Malyshau committed 2021-06-08 02:03:44 -04:00
1 parent 0a82c232ba
commit ff2a3e84fc
16 files changed
+253 -255

No files matched your search

-40
View File
@@ -106,10 +106,8 @@ pub fn check_texture_dimension_size(
limits: &wgt::Limits,
) -> Result<(), resource::TextureDimensionError> {
use resource::{TextureDimensionError as Tde, TextureErrorDimension as Ted};
use std::convert::TryInto;
use wgt::TextureDimension::*;
let layers = depth_or_array_layers.try_into().unwrap_or(!0);
let (extent_limits, sample_limit) = match dimension {
D1 => (
[
@@ -155,41 +153,3 @@ pub fn check_texture_dimension_size(
Ok(())
}
pub fn map_color_f32(color: &wgt::Color) -> [f32; 4] {
[
color.r as f32,
color.g as f32,
color.b as f32,
color.a as f32,
]
}
pub fn map_color_i32(color: &wgt::Color) -> [i32; 4] {
[
color.r as i32,
color.g as i32,
color.b as i32,
color.a as i32,
]
}
pub fn map_color_u32(color: &wgt::Color) -> [u32; 4] {
[
color.r as u32,
color.g as u32,
color.b as u32,
color.a as u32,
]
}
/// Take `value` and round it up to the nearest alignment `alignment`.
///
/// ```text
/// (0, 3) -> 0
/// (1, 3) -> 3
/// (2, 3) -> 3
/// (3, 3) -> 3
/// (4, 3) -> 6
/// ...
pub fn align_up(value: u32, alignment: u32) -> u32 {
((value + alignment - 1) / alignment) * alignment
}