[wgsl] remove outerProduct (#2535)

This commit is contained in:
Teodor Tanasoaia
2023-10-05 19:14:52 +02:00
committed by GitHub
parent 6668d0694c
commit f37db5affc
4 changed files with 13 additions and 18 deletions

View File

@@ -1529,7 +1529,6 @@ impl<W: Write> Writer<W> {
Mf::Pow => Function::Regular("pow"),
// geometry
Mf::Dot => Function::Regular("dot"),
Mf::Outer => Function::Regular("outerProduct"),
Mf::Cross => Function::Regular("cross"),
Mf::Distance => Function::Regular("distance"),
Mf::Length => Function::Regular("length"),
@@ -1568,7 +1567,7 @@ impl<W: Write> Writer<W> {
Mf::Unpack2x16snorm => Function::Regular("unpack2x16snorm"),
Mf::Unpack2x16unorm => Function::Regular("unpack2x16unorm"),
Mf::Unpack2x16float => Function::Regular("unpack2x16float"),
Mf::Inverse => {
Mf::Inverse | Mf::Outer => {
return Err(Error::UnsupportedMathFunction(fun));
}
};

View File

@@ -180,7 +180,6 @@ pub fn map_standard_fun(word: &str) -> Option<crate::MathFunction> {
"pow" => Mf::Pow,
// geometry
"dot" => Mf::Dot,
"outerProduct" => Mf::Outer,
"cross" => Mf::Cross,
"distance" => Mf::Distance,
"length" => Mf::Length,

View File

@@ -44,7 +44,8 @@ void main() {
vec4 minOut = min(a, b);
vec4 reflectOut = reflect(a, b);
vec3 crossOut = cross(a.xyz, b.xyz);
mat4 outerProductOut = outerProduct(a, b);
// TODO: support outerProduct function in wgsl output
// mat4 outerProductOut = outerProduct(a, b);
float distanceOut = distance(a, b);
vec4 stepOut = step(a, b);
// TODO: support out params in wgsl output

View File

@@ -39,7 +39,6 @@ fn main_1() {
var minOut: vec4<f32>;
var reflectOut: vec4<f32>;
var crossOut: vec3<f32>;
var outerProductOut: mat4x4<f32>;
var distanceOut: f32;
var stepOut: vec4<f32>;
var ldexpOut: f32;
@@ -146,22 +145,19 @@ fn main_1() {
crossOut = cross(_e205.xyz, _e207.xyz);
let _e213 = a;
let _e214 = b;
outerProductOut = outerProduct(_e213, _e214);
distanceOut = distance(_e213, _e214);
let _e219 = a;
let _e220 = b;
distanceOut = distance(_e219, _e220);
let _e225 = a;
let _e226 = b;
stepOut = step(_e225, _e226);
let _e229 = a;
stepOut = step(_e219, _e220);
let _e223 = a;
let _e226 = a;
let _e228 = i;
ldexpOut = ldexp(_e226.x, _e228);
let _e232 = a;
let _e234 = i;
ldexpOut = ldexp(_e232.x, _e234);
let _e238 = a;
rad = radians(_e238);
let _e241 = a;
let _e243 = a;
deg = degrees(_e243.x);
rad = radians(_e232);
let _e235 = a;
let _e237 = a;
deg = degrees(_e237.x);
smoothStepScalar = smoothstep(0.0, 1.0, 0.5);
smoothStepVector = smoothstep(vec4(0.0), vec4(1.0), vec4(0.5));
smoothStepMixed = smoothstep(vec4(0.0), vec4(1.0), vec4(0.5));