mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-23 15:23:33 +00:00
Allow stepping on floats in the validator (#724)
This commit is contained in:
parent
285a855e19
commit
daf4c82376
@ -280,7 +280,7 @@ impl<'a, W> Writer<'a, W> {
|
||||
}
|
||||
}
|
||||
|
||||
fn varying_required_features(&mut self, binding: Option<&Binding>, ty: Handle<Type>) {
|
||||
fn varying_required_features(&mut self, binding: Option<&Binding>, ty: Handle<Type>) {
|
||||
match self.module.types[ty].inner {
|
||||
crate::TypeInner::Struct { ref members, .. } => {
|
||||
for member in members {
|
||||
@ -290,9 +290,11 @@ impl<'a, W> Writer<'a, W> {
|
||||
_ => {
|
||||
if let Some(&Binding::Location(_, Some(interpolation))) = binding {
|
||||
match interpolation {
|
||||
Interpolation::Linear => self.features.request(Features::NOPERSPECTIVE_QUALIFIER),
|
||||
Interpolation::Linear => {
|
||||
self.features.request(Features::NOPERSPECTIVE_QUALIFIER)
|
||||
}
|
||||
Interpolation::Sample => self.features.request(Features::SAMPLE_QUALIFIER),
|
||||
_ => ()
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -949,7 +949,7 @@ impl super::Validator {
|
||||
_ => return Err(ExpressionError::InvalidArgumentType(fun, 0, arg)),
|
||||
}
|
||||
}
|
||||
Mf::Atan2 | Mf::Pow | Mf::Distance => {
|
||||
Mf::Atan2 | Mf::Pow | Mf::Distance | Mf::Step => {
|
||||
let arg1_ty = match (arg1_ty, arg2_ty) {
|
||||
(Some(ty1), None) => ty1,
|
||||
_ => return Err(ExpressionError::WrongArgumentCount(fun)),
|
||||
@ -1006,7 +1006,7 @@ impl super::Validator {
|
||||
));
|
||||
}
|
||||
}
|
||||
Mf::Dot | Mf::Outer | Mf::Cross | Mf::Step | Mf::Reflect => {
|
||||
Mf::Dot | Mf::Outer | Mf::Cross | Mf::Reflect => {
|
||||
let arg1_ty = match (arg1_ty, arg2_ty) {
|
||||
(Some(ty1), None) => ty1,
|
||||
_ => return Err(ExpressionError::WrongArgumentCount(fun)),
|
||||
|
@ -35,7 +35,7 @@ struct Parameters {
|
||||
msl_custom: bool,
|
||||
#[cfg_attr(not(feature = "glsl-out"), allow(dead_code))]
|
||||
#[serde(default)]
|
||||
glsl_desktop_version: Option<u16>
|
||||
glsl_desktop_version: Option<u16>,
|
||||
}
|
||||
|
||||
#[allow(dead_code, unused_variables)]
|
||||
@ -225,7 +225,10 @@ fn convert_wgsl() {
|
||||
("image-copy", Targets::METAL),
|
||||
("texture-array", Targets::SPIRV | Targets::METAL),
|
||||
("operators", Targets::SPIRV | Targets::METAL | Targets::GLSL),
|
||||
("interpolate", Targets::SPIRV | Targets::METAL | Targets::GLSL),
|
||||
(
|
||||
"interpolate",
|
||||
Targets::SPIRV | Targets::METAL | Targets::GLSL,
|
||||
),
|
||||
];
|
||||
|
||||
for &(name, targets) in inputs.iter() {
|
||||
|
Loading…
Reference in New Issue
Block a user