writer/spirv: Handle terminators in BlockStatements

Fixed: tint:922
Change-Id: Ib3815ada8bcf2d4c1f8c86d4178cd088ba071c6c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56280
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton 2021-06-29 10:23:26 +00:00 committed by Tint LUCI CQ
parent 077fe64b11
commit 4b7af8d2c9
7 changed files with 1870 additions and 5 deletions

View File

@ -89,11 +89,17 @@ bool LastIsTerminator(const ast::BlockStatement* stmts) {
}
auto* last = stmts->last();
return last->Is<ast::BreakStatement>() ||
last->Is<ast::ContinueStatement>() ||
last->Is<ast::DiscardStatement>() ||
last->Is<ast::ReturnStatement>() ||
last->Is<ast::FallthroughStatement>();
if (last->Is<ast::BreakStatement>() || last->Is<ast::ContinueStatement>() ||
last->Is<ast::DiscardStatement>() || last->Is<ast::ReturnStatement>() ||
last->Is<ast::FallthroughStatement>()) {
return true;
}
if (auto* block = last->As<ast::BlockStatement>()) {
return LastIsTerminator(block);
}
return false;
}
/// Returns the matrix type that is `type` or that is wrapped by

View File

@ -501,6 +501,38 @@ OpReturnValue %5
)");
}
TEST_F(BuilderTest, If_WithNestedBlockReturnValue) {
// if (true) {
// {
// {
// {
// return false;
// }
// }
// }
// }
// return true;
auto* if_body = Block(Block(Block(Block(Return(false)))));
auto* expr = If(Expr(true), if_body);
Func("test", {}, ty.bool_(), {expr, Return(true)}, {});
spirv::Builder& b = Build();
b.push_function(Function{});
EXPECT_TRUE(b.GenerateIfStatement(expr)) << b.error();
EXPECT_EQ(DumpInstructions(b.types()), R"(%1 = OpTypeBool
%2 = OpConstantTrue %1
%5 = OpConstantFalse %1
)");
EXPECT_EQ(DumpInstructions(b.functions()[0].instructions()),
R"(OpSelectionMerge %3 None
OpBranchConditional %2 %4 %3
%4 = OpLabel
OpReturnValue %5
%3 = OpLabel
)");
}
TEST_F(BuilderTest, If_WithLoad_Bug327) {
// var a : bool;
// if (a) {

301
test/bug/tint/922.wgsl Normal file
View File

@ -0,0 +1,301 @@
struct Mat4x4_ {
mx: vec4<f32>;
my: vec4<f32>;
mz: vec4<f32>;
mw: vec4<f32>;
};
struct Mat4x3_ {
mx: vec4<f32>;
my: vec4<f32>;
mz: vec4<f32>;
};
struct Mat4x2_ {
mx: vec4<f32>;
my: vec4<f32>;
};
[[block]]
struct ub_SceneParams {
u_Projection: Mat4x4_;
};
[[block]]
struct ub_MaterialParams {
u_TexMtx: [[stride(32)]] array<Mat4x2_,1>;
u_Misc0_: vec4<f32>;
};
[[block]]
struct ub_PacketParams {
u_PosMtx: [[stride(48)]] array<Mat4x3_,32>;
};
struct VertexOutput {
[[location(0)]] v_Color: vec4<f32>;
[[location(1)]] v_TexCoord: vec2<f32>;
[[builtin(position)]] member: vec4<f32>;
};
[[group(0), binding(0)]]
var<uniform> global: ub_SceneParams;
[[group(0), binding(1)]]
var<uniform> global1: ub_MaterialParams;
[[group(0), binding(2)]]
var<uniform> global2: ub_PacketParams;
var<private> a_Position1: vec3<f32>;
var<private> a_UV1: vec2<f32>;
var<private> a_Color1: vec4<f32>;
var<private> a_Normal1: vec3<f32>;
var<private> a_PosMtxIdx1: f32;
var<private> v_Color: vec4<f32>;
var<private> v_TexCoord: vec2<f32>;
var<private> gl_Position: vec4<f32>;
fn Mat4x3GetCol0_(m: Mat4x3_) -> vec3<f32> {
var m1: Mat4x3_;
m1 = m;
let _e2: Mat4x3_ = m1;
let _e5: Mat4x3_ = m1;
let _e8: Mat4x3_ = m1;
return vec3<f32>(_e2.mx.x, _e5.my.x, _e8.mz.x);
}
fn Mat4x3GetCol1_(m2: Mat4x3_) -> vec3<f32> {
var m3: Mat4x3_;
m3 = m2;
let _e2: Mat4x3_ = m3;
let _e5: Mat4x3_ = m3;
let _e8: Mat4x3_ = m3;
return vec3<f32>(_e2.mx.y, _e5.my.y, _e8.mz.y);
}
fn Mat4x3GetCol2_(m4: Mat4x3_) -> vec3<f32> {
var m5: Mat4x3_;
m5 = m4;
let _e2: Mat4x3_ = m5;
let _e5: Mat4x3_ = m5;
let _e8: Mat4x3_ = m5;
return vec3<f32>(_e2.mx.z, _e5.my.z, _e8.mz.z);
}
fn Mat4x3GetCol3_(m6: Mat4x3_) -> vec3<f32> {
var m7: Mat4x3_;
m7 = m6;
let _e2: Mat4x3_ = m7;
let _e5: Mat4x3_ = m7;
let _e8: Mat4x3_ = m7;
return vec3<f32>(_e2.mx.w, _e5.my.w, _e8.mz.w);
}
fn Mul(m8: Mat4x4_, v: vec4<f32>) -> vec4<f32> {
var m9: Mat4x4_;
var v1: vec4<f32>;
m9 = m8;
v1 = v;
let _e4: Mat4x4_ = m9;
let _e6: vec4<f32> = v1;
let _e8: Mat4x4_ = m9;
let _e10: vec4<f32> = v1;
let _e12: Mat4x4_ = m9;
let _e14: vec4<f32> = v1;
let _e16: Mat4x4_ = m9;
let _e18: vec4<f32> = v1;
return vec4<f32>(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14), dot(_e16.mw, _e18));
}
fn Mul1(m10: Mat4x3_, v2: vec4<f32>) -> vec3<f32> {
var m11: Mat4x3_;
var v3: vec4<f32>;
m11 = m10;
v3 = v2;
let _e4: Mat4x3_ = m11;
let _e6: vec4<f32> = v3;
let _e8: Mat4x3_ = m11;
let _e10: vec4<f32> = v3;
let _e12: Mat4x3_ = m11;
let _e14: vec4<f32> = v3;
return vec3<f32>(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14));
}
fn Mul2(m12: Mat4x2_, v4: vec4<f32>) -> vec2<f32> {
var m13: Mat4x2_;
var v5: vec4<f32>;
m13 = m12;
v5 = v4;
let _e4: Mat4x2_ = m13;
let _e6: vec4<f32> = v5;
let _e8: Mat4x2_ = m13;
let _e10: vec4<f32> = v5;
return vec2<f32>(dot(_e4.mx, _e6), dot(_e8.my, _e10));
}
fn Mul3(v6: vec3<f32>, m14: Mat4x3_) -> vec4<f32> {
var v7: vec3<f32>;
var m15: Mat4x3_;
v7 = v6;
m15 = m14;
let _e5: Mat4x3_ = m15;
let _e6: vec3<f32> = Mat4x3GetCol0_(_e5);
let _e7: vec3<f32> = v7;
let _e10: Mat4x3_ = m15;
let _e11: vec3<f32> = Mat4x3GetCol1_(_e10);
let _e12: vec3<f32> = v7;
let _e15: Mat4x3_ = m15;
let _e16: vec3<f32> = Mat4x3GetCol2_(_e15);
let _e17: vec3<f32> = v7;
let _e20: Mat4x3_ = m15;
let _e21: vec3<f32> = Mat4x3GetCol3_(_e20);
let _e22: vec3<f32> = v7;
return vec4<f32>(dot(_e6, _e7), dot(_e11, _e12), dot(_e16, _e17), dot(_e21, _e22));
}
fn _Mat4x4_(n: f32) -> Mat4x4_ {
var n1: f32;
var o: Mat4x4_;
n1 = n;
let _e4: f32 = n1;
o.mx = vec4<f32>(_e4, 0.0, 0.0, 0.0);
let _e11: f32 = n1;
o.my = vec4<f32>(0.0, _e11, 0.0, 0.0);
let _e18: f32 = n1;
o.mz = vec4<f32>(0.0, 0.0, _e18, 0.0);
let _e25: f32 = n1;
o.mw = vec4<f32>(0.0, 0.0, 0.0, _e25);
let _e27: Mat4x4_ = o;
return _e27;
}
fn _Mat4x4_1(m16: Mat4x3_) -> Mat4x4_ {
var m17: Mat4x3_;
var o1: Mat4x4_;
m17 = m16;
let _e4: Mat4x4_ = _Mat4x4_(1.0);
o1 = _e4;
let _e7: Mat4x3_ = m17;
o1.mx = _e7.mx;
let _e10: Mat4x3_ = m17;
o1.my = _e10.my;
let _e13: Mat4x3_ = m17;
o1.mz = _e13.mz;
let _e15: Mat4x4_ = o1;
return _e15;
}
fn _Mat4x4_2(m18: Mat4x2_) -> Mat4x4_ {
var m19: Mat4x2_;
var o2: Mat4x4_;
m19 = m18;
let _e4: Mat4x4_ = _Mat4x4_(1.0);
o2 = _e4;
let _e7: Mat4x2_ = m19;
o2.mx = _e7.mx;
let _e10: Mat4x2_ = m19;
o2.my = _e10.my;
let _e12: Mat4x4_ = o2;
return _e12;
}
fn _Mat4x3_(n2: f32) -> Mat4x3_ {
var n3: f32;
var o3: Mat4x3_;
n3 = n2;
let _e4: f32 = n3;
o3.mx = vec4<f32>(_e4, 0.0, 0.0, 0.0);
let _e11: f32 = n3;
o3.my = vec4<f32>(0.0, _e11, 0.0, 0.0);
let _e18: f32 = n3;
o3.mz = vec4<f32>(0.0, 0.0, _e18, 0.0);
let _e21: Mat4x3_ = o3;
return _e21;
}
fn _Mat4x3_1(m20: Mat4x4_) -> Mat4x3_ {
var m21: Mat4x4_;
var o4: Mat4x3_;
m21 = m20;
let _e4: Mat4x4_ = m21;
o4.mx = _e4.mx;
let _e7: Mat4x4_ = m21;
o4.my = _e7.my;
let _e10: Mat4x4_ = m21;
o4.mz = _e10.mz;
let _e12: Mat4x3_ = o4;
return _e12;
}
fn main1() {
var t_PosMtx: Mat4x3_;
var t_TexSpaceCoord: vec2<f32>;
let _e15: f32 = a_PosMtxIdx1;
let _e18: Mat4x3_ = global2.u_PosMtx[i32(_e15)];
t_PosMtx = _e18;
let _e23: Mat4x3_ = t_PosMtx;
let _e24: Mat4x4_ = _Mat4x4_1(_e23);
let _e25: vec3<f32> = a_Position1;
let _e29: Mat4x3_ = t_PosMtx;
let _e30: Mat4x4_ = _Mat4x4_1(_e29);
let _e31: vec3<f32> = a_Position1;
let _e34: vec4<f32> = Mul(_e30, vec4<f32>(_e31, 1.0));
let _e35: Mat4x4_ = global.u_Projection;
let _e37: Mat4x3_ = t_PosMtx;
let _e38: Mat4x4_ = _Mat4x4_1(_e37);
let _e39: vec3<f32> = a_Position1;
let _e43: Mat4x3_ = t_PosMtx;
let _e44: Mat4x4_ = _Mat4x4_1(_e43);
let _e45: vec3<f32> = a_Position1;
let _e48: vec4<f32> = Mul(_e44, vec4<f32>(_e45, 1.0));
let _e49: vec4<f32> = Mul(_e35, _e48);
gl_Position = _e49;
let _e50: vec4<f32> = a_Color1;
v_Color = _e50;
let _e52: vec4<f32> = global1.u_Misc0_;
if ((_e52.x == 2.0)) {
{
let _e59: vec3<f32> = a_Normal1;
let _e64: Mat4x2_ = global1.u_TexMtx[0];
let _e65: vec3<f32> = a_Normal1;
let _e68: vec2<f32> = Mul2(_e64, vec4<f32>(_e65, 1.0));
v_TexCoord = _e68.xy;
return;
}
} else {
{
let _e73: vec2<f32> = a_UV1;
let _e79: Mat4x2_ = global1.u_TexMtx[0];
let _e80: vec2<f32> = a_UV1;
let _e84: vec2<f32> = Mul2(_e79, vec4<f32>(_e80, 1.0, 1.0));
v_TexCoord = _e84.xy;
return;
}
}
}
[[stage(vertex)]]
fn main([[location(0)]] a_Position: vec3<f32>, [[location(1)]] a_UV: vec2<f32>, [[location(2)]] a_Color: vec4<f32>, [[location(3)]] a_Normal: vec3<f32>, [[location(4)]] a_PosMtxIdx: f32) -> VertexOutput {
a_Position1 = a_Position;
a_UV1 = a_UV;
a_Color1 = a_Color;
a_Normal1 = a_Normal;
a_PosMtxIdx1 = a_PosMtxIdx;
main1();
let _e11: vec4<f32> = v_Color;
let _e13: vec2<f32> = v_TexCoord;
let _e15: vec4<f32> = gl_Position;
return VertexOutput(_e11, _e13, _e15);
}

View File

@ -0,0 +1,316 @@
struct Mat4x4_ {
float4 mx;
float4 my;
float4 mz;
float4 mw;
};
struct Mat4x3_ {
float4 mx;
float4 my;
float4 mz;
};
struct Mat4x2_ {
float4 mx;
float4 my;
};
Mat4x4_ tint_symbol_7(uint4 buffer[4], uint offset) {
const int scalar_offset = ((offset + 0u)) / 4;
const int scalar_offset_1 = ((offset + 16u)) / 4;
const int scalar_offset_2 = ((offset + 32u)) / 4;
const int scalar_offset_3 = ((offset + 48u)) / 4;
const Mat4x4_ tint_symbol_10 = {asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])};
return tint_symbol_10;
}
Mat4x2_ tint_symbol_9(uint4 buffer[3], uint offset) {
const int scalar_offset_4 = ((offset + 0u)) / 4;
const int scalar_offset_5 = ((offset + 16u)) / 4;
const Mat4x2_ tint_symbol_11 = {asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])};
return tint_symbol_11;
}
Mat4x3_ tint_symbol_5(uint4 buffer[96], uint offset) {
const int scalar_offset_6 = ((offset + 0u)) / 4;
const int scalar_offset_7 = ((offset + 16u)) / 4;
const int scalar_offset_8 = ((offset + 32u)) / 4;
const Mat4x3_ tint_symbol_12 = {asfloat(buffer[scalar_offset_6 / 4]), asfloat(buffer[scalar_offset_7 / 4]), asfloat(buffer[scalar_offset_8 / 4])};
return tint_symbol_12;
}
struct VertexOutput {
float4 v_Color;
float2 v_TexCoord;
float4 member;
};
cbuffer cbuffer_global : register(b0, space0) {
uint4 global[4];
};
cbuffer cbuffer_global1 : register(b1, space0) {
uint4 global1[3];
};
cbuffer cbuffer_global2 : register(b2, space0) {
uint4 global2[96];
};
static float3 a_Position1 = float3(0.0f, 0.0f, 0.0f);
static float2 a_UV1 = float2(0.0f, 0.0f);
static float4 a_Color1 = float4(0.0f, 0.0f, 0.0f, 0.0f);
static float3 a_Normal1 = float3(0.0f, 0.0f, 0.0f);
static float a_PosMtxIdx1 = 0.0f;
static float4 v_Color = float4(0.0f, 0.0f, 0.0f, 0.0f);
static float2 v_TexCoord = float2(0.0f, 0.0f);
static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f);
float3 Mat4x3GetCol0_(Mat4x3_ m) {
Mat4x3_ m1 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m1 = m;
const Mat4x3_ _e2 = m1;
const Mat4x3_ _e5 = m1;
const Mat4x3_ _e8 = m1;
return float3(_e2.mx.x, _e5.my.x, _e8.mz.x);
}
float3 Mat4x3GetCol1_(Mat4x3_ m2) {
Mat4x3_ m3 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m3 = m2;
const Mat4x3_ _e2 = m3;
const Mat4x3_ _e5 = m3;
const Mat4x3_ _e8 = m3;
return float3(_e2.mx.y, _e5.my.y, _e8.mz.y);
}
float3 Mat4x3GetCol2_(Mat4x3_ m4) {
Mat4x3_ m5 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m5 = m4;
const Mat4x3_ _e2 = m5;
const Mat4x3_ _e5 = m5;
const Mat4x3_ _e8 = m5;
return float3(_e2.mx.z, _e5.my.z, _e8.mz.z);
}
float3 Mat4x3GetCol3_(Mat4x3_ m6) {
Mat4x3_ m7 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m7 = m6;
const Mat4x3_ _e2 = m7;
const Mat4x3_ _e5 = m7;
const Mat4x3_ _e8 = m7;
return float3(_e2.mx.w, _e5.my.w, _e8.mz.w);
}
float4 Mul(Mat4x4_ m8, float4 v) {
Mat4x4_ m9 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
float4 v1 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m9 = m8;
v1 = v;
const Mat4x4_ _e4 = m9;
const float4 _e6 = v1;
const Mat4x4_ _e8 = m9;
const float4 _e10 = v1;
const Mat4x4_ _e12 = m9;
const float4 _e14 = v1;
const Mat4x4_ _e16 = m9;
const float4 _e18 = v1;
return float4(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14), dot(_e16.mw, _e18));
}
float3 Mul1(Mat4x3_ m10, float4 v2) {
Mat4x3_ m11 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
float4 v3 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m11 = m10;
v3 = v2;
const Mat4x3_ _e4 = m11;
const float4 _e6 = v3;
const Mat4x3_ _e8 = m11;
const float4 _e10 = v3;
const Mat4x3_ _e12 = m11;
const float4 _e14 = v3;
return float3(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14));
}
float2 Mul2(Mat4x2_ m12, float4 v4) {
Mat4x2_ m13 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
float4 v5 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m13 = m12;
v5 = v4;
const Mat4x2_ _e4 = m13;
const float4 _e6 = v5;
const Mat4x2_ _e8 = m13;
const float4 _e10 = v5;
return float2(dot(_e4.mx, _e6), dot(_e8.my, _e10));
}
float4 Mul3(float3 v6, Mat4x3_ m14) {
float3 v7 = float3(0.0f, 0.0f, 0.0f);
Mat4x3_ m15 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
v7 = v6;
m15 = m14;
const Mat4x3_ _e5 = m15;
const float3 _e6 = Mat4x3GetCol0_(_e5);
const float3 _e7 = v7;
const Mat4x3_ _e10 = m15;
const float3 _e11 = Mat4x3GetCol1_(_e10);
const float3 _e12 = v7;
const Mat4x3_ _e15 = m15;
const float3 _e16 = Mat4x3GetCol2_(_e15);
const float3 _e17 = v7;
const Mat4x3_ _e20 = m15;
const float3 _e21 = Mat4x3GetCol3_(_e20);
const float3 _e22 = v7;
return float4(dot(_e6, _e7), dot(_e11, _e12), dot(_e16, _e17), dot(_e21, _e22));
}
Mat4x4_ _Mat4x4_(float n) {
float n1 = 0.0f;
Mat4x4_ o = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
n1 = n;
const float _e4 = n1;
o.mx = float4(_e4, 0.0f, 0.0f, 0.0f);
const float _e11 = n1;
o.my = float4(0.0f, _e11, 0.0f, 0.0f);
const float _e18 = n1;
o.mz = float4(0.0f, 0.0f, _e18, 0.0f);
const float _e25 = n1;
o.mw = float4(0.0f, 0.0f, 0.0f, _e25);
const Mat4x4_ _e27 = o;
return _e27;
}
Mat4x4_ _Mat4x4_1(Mat4x3_ m16) {
Mat4x3_ m17 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
Mat4x4_ o1 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m17 = m16;
const Mat4x4_ _e4 = _Mat4x4_(1.0f);
o1 = _e4;
const Mat4x3_ _e7 = m17;
o1.mx = _e7.mx;
const Mat4x3_ _e10 = m17;
o1.my = _e10.my;
const Mat4x3_ _e13 = m17;
o1.mz = _e13.mz;
const Mat4x4_ _e15 = o1;
return _e15;
}
Mat4x4_ _Mat4x4_2(Mat4x2_ m18) {
Mat4x2_ m19 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
Mat4x4_ o2 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m19 = m18;
const Mat4x4_ _e4 = _Mat4x4_(1.0f);
o2 = _e4;
const Mat4x2_ _e7 = m19;
o2.mx = _e7.mx;
const Mat4x2_ _e10 = m19;
o2.my = _e10.my;
const Mat4x4_ _e12 = o2;
return _e12;
}
Mat4x3_ _Mat4x3_(float n2) {
float n3 = 0.0f;
Mat4x3_ o3 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
n3 = n2;
const float _e4 = n3;
o3.mx = float4(_e4, 0.0f, 0.0f, 0.0f);
const float _e11 = n3;
o3.my = float4(0.0f, _e11, 0.0f, 0.0f);
const float _e18 = n3;
o3.mz = float4(0.0f, 0.0f, _e18, 0.0f);
const Mat4x3_ _e21 = o3;
return _e21;
}
Mat4x3_ _Mat4x3_1(Mat4x4_ m20) {
Mat4x4_ m21 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
Mat4x3_ o4 = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
m21 = m20;
const Mat4x4_ _e4 = m21;
o4.mx = _e4.mx;
const Mat4x4_ _e7 = m21;
o4.my = _e7.my;
const Mat4x4_ _e10 = m21;
o4.mz = _e10.mz;
const Mat4x3_ _e12 = o4;
return _e12;
}
void main1() {
Mat4x3_ t_PosMtx = {float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)};
float2 t_TexSpaceCoord = float2(0.0f, 0.0f);
const float _e15 = a_PosMtxIdx1;
const Mat4x3_ _e18 = tint_symbol_5(global2, (48u * uint(int(_e15))));
t_PosMtx = _e18;
const Mat4x3_ _e23 = t_PosMtx;
const Mat4x4_ _e24 = _Mat4x4_1(_e23);
const float3 _e25 = a_Position1;
const Mat4x3_ _e29 = t_PosMtx;
const Mat4x4_ _e30 = _Mat4x4_1(_e29);
const float3 _e31 = a_Position1;
const float4 _e34 = Mul(_e30, float4(_e31, 1.0f));
const Mat4x4_ _e35 = tint_symbol_7(global, 0u);
const Mat4x3_ _e37 = t_PosMtx;
const Mat4x4_ _e38 = _Mat4x4_1(_e37);
const float3 _e39 = a_Position1;
const Mat4x3_ _e43 = t_PosMtx;
const Mat4x4_ _e44 = _Mat4x4_1(_e43);
const float3 _e45 = a_Position1;
const float4 _e48 = Mul(_e44, float4(_e45, 1.0f));
const float4 _e49 = Mul(_e35, _e48);
gl_Position = _e49;
const float4 _e50 = a_Color1;
v_Color = _e50;
const int scalar_offset_9 = (32u) / 4;
const float4 _e52 = asfloat(global1[scalar_offset_9 / 4]);
if ((_e52.x == 2.0f)) {
{
const float3 _e59 = a_Normal1;
const Mat4x2_ _e64 = tint_symbol_9(global1, (32u * uint(0)));
const float3 _e65 = a_Normal1;
const float2 _e68 = Mul2(_e64, float4(_e65, 1.0f));
v_TexCoord = _e68.xy;
return;
}
} else {
{
const float2 _e73 = a_UV1;
const Mat4x2_ _e79 = tint_symbol_9(global1, (32u * uint(0)));
const float2 _e80 = a_UV1;
const float2 _e84 = Mul2(_e79, float4(_e80, 1.0f, 1.0f));
v_TexCoord = _e84.xy;
return;
}
}
}
struct tint_symbol_1 {
float3 a_Position : TEXCOORD0;
float2 a_UV : TEXCOORD1;
float4 a_Color : TEXCOORD2;
float3 a_Normal : TEXCOORD3;
float a_PosMtxIdx : TEXCOORD4;
};
struct tint_symbol_2 {
float4 v_Color : TEXCOORD0;
float2 v_TexCoord : TEXCOORD1;
float4 member : SV_Position;
};
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
const float3 a_Position = tint_symbol.a_Position;
const float2 a_UV = tint_symbol.a_UV;
const float4 a_Color = tint_symbol.a_Color;
const float3 a_Normal = tint_symbol.a_Normal;
const float a_PosMtxIdx = tint_symbol.a_PosMtxIdx;
a_Position1 = a_Position;
a_UV1 = a_UV;
a_Color1 = a_Color;
a_Normal1 = a_Normal;
a_PosMtxIdx1 = a_PosMtxIdx;
main1();
const float4 _e11 = v_Color;
const float2 _e13 = v_TexCoord;
const float4 _e15 = gl_Position;
const VertexOutput tint_symbol_3 = {_e11, _e13, _e15};
const tint_symbol_2 tint_symbol_13 = {tint_symbol_3.v_Color, tint_symbol_3.v_TexCoord, tint_symbol_3.member};
return tint_symbol_13;
}

View File

@ -0,0 +1,299 @@
#include <metal_stdlib>
using namespace metal;
struct Mat4x4_ {
/* 0x0000 */ packed_float4 mx;
/* 0x0010 */ packed_float4 my;
/* 0x0020 */ packed_float4 mz;
/* 0x0030 */ packed_float4 mw;
};
struct Mat4x3_ {
/* 0x0000 */ packed_float4 mx;
/* 0x0010 */ packed_float4 my;
/* 0x0020 */ packed_float4 mz;
};
struct Mat4x2_ {
/* 0x0000 */ packed_float4 mx;
/* 0x0010 */ packed_float4 my;
};
struct ub_SceneParams {
/* 0x0000 */ Mat4x4_ u_Projection;
};
struct tint_array_wrapper {
/* 0x0000 */ Mat4x2_ arr[1];
};
struct ub_MaterialParams {
/* 0x0000 */ tint_array_wrapper u_TexMtx;
/* 0x0020 */ packed_float4 u_Misc0_;
};
struct tint_array_wrapper_1 {
/* 0x0000 */ Mat4x3_ arr[32];
};
struct ub_PacketParams {
/* 0x0000 */ tint_array_wrapper_1 u_PosMtx;
};
struct VertexOutput {
float4 v_Color;
float2 v_TexCoord;
float4 member;
};
struct tint_symbol_2 {
float3 a_Position [[attribute(0)]];
float2 a_UV [[attribute(1)]];
float4 a_Color [[attribute(2)]];
float3 a_Normal [[attribute(3)]];
float a_PosMtxIdx [[attribute(4)]];
};
struct tint_symbol_3 {
float4 v_Color [[user(locn0)]];
float2 v_TexCoord [[user(locn1)]];
float4 member [[position]];
};
float3 Mat4x3GetCol0_(Mat4x3_ m) {
Mat4x3_ m1 = {};
m1 = m;
Mat4x3_ const _e2 = m1;
Mat4x3_ const _e5 = m1;
Mat4x3_ const _e8 = m1;
return float3(_e2.mx.x, _e5.my.x, _e8.mz.x);
}
float3 Mat4x3GetCol1_(Mat4x3_ m2) {
Mat4x3_ m3 = {};
m3 = m2;
Mat4x3_ const _e2 = m3;
Mat4x3_ const _e5 = m3;
Mat4x3_ const _e8 = m3;
return float3(_e2.mx.y, _e5.my.y, _e8.mz.y);
}
float3 Mat4x3GetCol2_(Mat4x3_ m4) {
Mat4x3_ m5 = {};
m5 = m4;
Mat4x3_ const _e2 = m5;
Mat4x3_ const _e5 = m5;
Mat4x3_ const _e8 = m5;
return float3(_e2.mx.z, _e5.my.z, _e8.mz.z);
}
float3 Mat4x3GetCol3_(Mat4x3_ m6) {
Mat4x3_ m7 = {};
m7 = m6;
Mat4x3_ const _e2 = m7;
Mat4x3_ const _e5 = m7;
Mat4x3_ const _e8 = m7;
return float3(_e2.mx.w, _e5.my.w, _e8.mz.w);
}
float4 Mul(Mat4x4_ m8, float4 v) {
Mat4x4_ m9 = {};
float4 v1 = 0.0f;
m9 = m8;
v1 = v;
Mat4x4_ const _e4 = m9;
float4 const _e6 = v1;
Mat4x4_ const _e8 = m9;
float4 const _e10 = v1;
Mat4x4_ const _e12 = m9;
float4 const _e14 = v1;
Mat4x4_ const _e16 = m9;
float4 const _e18 = v1;
return float4(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14), dot(_e16.mw, _e18));
}
float3 Mul1(Mat4x3_ m10, float4 v2) {
Mat4x3_ m11 = {};
float4 v3 = 0.0f;
m11 = m10;
v3 = v2;
Mat4x3_ const _e4 = m11;
float4 const _e6 = v3;
Mat4x3_ const _e8 = m11;
float4 const _e10 = v3;
Mat4x3_ const _e12 = m11;
float4 const _e14 = v3;
return float3(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14));
}
float2 Mul2(Mat4x2_ m12, float4 v4) {
Mat4x2_ m13 = {};
float4 v5 = 0.0f;
m13 = m12;
v5 = v4;
Mat4x2_ const _e4 = m13;
float4 const _e6 = v5;
Mat4x2_ const _e8 = m13;
float4 const _e10 = v5;
return float2(dot(_e4.mx, _e6), dot(_e8.my, _e10));
}
float4 Mul3(float3 v6, Mat4x3_ m14) {
float3 v7 = 0.0f;
Mat4x3_ m15 = {};
v7 = v6;
m15 = m14;
Mat4x3_ const _e5 = m15;
float3 const _e6 = Mat4x3GetCol0_(_e5);
float3 const _e7 = v7;
Mat4x3_ const _e10 = m15;
float3 const _e11 = Mat4x3GetCol1_(_e10);
float3 const _e12 = v7;
Mat4x3_ const _e15 = m15;
float3 const _e16 = Mat4x3GetCol2_(_e15);
float3 const _e17 = v7;
Mat4x3_ const _e20 = m15;
float3 const _e21 = Mat4x3GetCol3_(_e20);
float3 const _e22 = v7;
return float4(dot(_e6, _e7), dot(_e11, _e12), dot(_e16, _e17), dot(_e21, _e22));
}
Mat4x4_ _Mat4x4_(float n) {
float n1 = 0.0f;
Mat4x4_ o = {};
n1 = n;
float const _e4 = n1;
o.mx = float4(_e4, 0.0f, 0.0f, 0.0f);
float const _e11 = n1;
o.my = float4(0.0f, _e11, 0.0f, 0.0f);
float const _e18 = n1;
o.mz = float4(0.0f, 0.0f, _e18, 0.0f);
float const _e25 = n1;
o.mw = float4(0.0f, 0.0f, 0.0f, _e25);
Mat4x4_ const _e27 = o;
return _e27;
}
Mat4x4_ _Mat4x4_1(Mat4x3_ m16) {
Mat4x3_ m17 = {};
Mat4x4_ o1 = {};
m17 = m16;
Mat4x4_ const _e4 = _Mat4x4_(1.0f);
o1 = _e4;
Mat4x3_ const _e7 = m17;
o1.mx = _e7.mx;
Mat4x3_ const _e10 = m17;
o1.my = _e10.my;
Mat4x3_ const _e13 = m17;
o1.mz = _e13.mz;
Mat4x4_ const _e15 = o1;
return _e15;
}
Mat4x4_ _Mat4x4_2(Mat4x2_ m18) {
Mat4x2_ m19 = {};
Mat4x4_ o2 = {};
m19 = m18;
Mat4x4_ const _e4 = _Mat4x4_(1.0f);
o2 = _e4;
Mat4x2_ const _e7 = m19;
o2.mx = _e7.mx;
Mat4x2_ const _e10 = m19;
o2.my = _e10.my;
Mat4x4_ const _e12 = o2;
return _e12;
}
Mat4x3_ _Mat4x3_(float n2) {
float n3 = 0.0f;
Mat4x3_ o3 = {};
n3 = n2;
float const _e4 = n3;
o3.mx = float4(_e4, 0.0f, 0.0f, 0.0f);
float const _e11 = n3;
o3.my = float4(0.0f, _e11, 0.0f, 0.0f);
float const _e18 = n3;
o3.mz = float4(0.0f, 0.0f, _e18, 0.0f);
Mat4x3_ const _e21 = o3;
return _e21;
}
Mat4x3_ _Mat4x3_1(Mat4x4_ m20) {
Mat4x4_ m21 = {};
Mat4x3_ o4 = {};
m21 = m20;
Mat4x4_ const _e4 = m21;
o4.mx = _e4.mx;
Mat4x4_ const _e7 = m21;
o4.my = _e7.my;
Mat4x4_ const _e10 = m21;
o4.mz = _e10.mz;
Mat4x3_ const _e12 = o4;
return _e12;
}
void main1(constant ub_PacketParams& global2, constant ub_SceneParams& global, constant ub_MaterialParams& global1, thread float* const tint_symbol_6, thread float3* const tint_symbol_7, thread float4* const tint_symbol_8, thread float4* const tint_symbol_9, thread float4* const tint_symbol_10, thread float3* const tint_symbol_11, thread float2* const tint_symbol_12, thread float2* const tint_symbol_13) {
Mat4x3_ t_PosMtx = {};
float2 t_TexSpaceCoord = 0.0f;
float const _e15 = *(tint_symbol_6);
Mat4x3_ const _e18 = global2.u_PosMtx.arr[int(_e15)];
t_PosMtx = _e18;
Mat4x3_ const _e23 = t_PosMtx;
Mat4x4_ const _e24 = _Mat4x4_1(_e23);
float3 const _e25 = *(tint_symbol_7);
Mat4x3_ const _e29 = t_PosMtx;
Mat4x4_ const _e30 = _Mat4x4_1(_e29);
float3 const _e31 = *(tint_symbol_7);
float4 const _e34 = Mul(_e30, float4(_e31, 1.0f));
Mat4x4_ const _e35 = global.u_Projection;
Mat4x3_ const _e37 = t_PosMtx;
Mat4x4_ const _e38 = _Mat4x4_1(_e37);
float3 const _e39 = *(tint_symbol_7);
Mat4x3_ const _e43 = t_PosMtx;
Mat4x4_ const _e44 = _Mat4x4_1(_e43);
float3 const _e45 = *(tint_symbol_7);
float4 const _e48 = Mul(_e44, float4(_e45, 1.0f));
float4 const _e49 = Mul(_e35, _e48);
*(tint_symbol_8) = _e49;
float4 const _e50 = *(tint_symbol_9);
*(tint_symbol_10) = _e50;
float4 const _e52 = global1.u_Misc0_;
if ((_e52.x == 2.0f)) {
{
float3 const _e59 = *(tint_symbol_11);
Mat4x2_ const _e64 = global1.u_TexMtx.arr[0];
float3 const _e65 = *(tint_symbol_11);
float2 const _e68 = Mul2(_e64, float4(_e65, 1.0f));
*(tint_symbol_12) = _e68.xy;
return;
}
} else {
{
float2 const _e73 = *(tint_symbol_13);
Mat4x2_ const _e79 = global1.u_TexMtx.arr[0];
float2 const _e80 = *(tint_symbol_13);
float2 const _e84 = Mul2(_e79, float4(_e80, 1.0f, 1.0f));
*(tint_symbol_12) = _e84.xy;
return;
}
}
}
vertex tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1 [[stage_in]], constant ub_PacketParams& global2 [[buffer(2)]], constant ub_SceneParams& global [[buffer(0)]], constant ub_MaterialParams& global1 [[buffer(1)]]) {
thread float3 tint_symbol_14 = 0.0f;
thread float2 tint_symbol_15 = 0.0f;
thread float4 tint_symbol_16 = 0.0f;
thread float3 tint_symbol_17 = 0.0f;
thread float tint_symbol_18 = 0.0f;
thread float4 tint_symbol_19 = 0.0f;
thread float4 tint_symbol_20 = 0.0f;
thread float2 tint_symbol_21 = 0.0f;
float3 const a_Position = tint_symbol_1.a_Position;
float2 const a_UV = tint_symbol_1.a_UV;
float4 const a_Color = tint_symbol_1.a_Color;
float3 const a_Normal = tint_symbol_1.a_Normal;
float const a_PosMtxIdx = tint_symbol_1.a_PosMtxIdx;
tint_symbol_14 = a_Position;
tint_symbol_15 = a_UV;
tint_symbol_16 = a_Color;
tint_symbol_17 = a_Normal;
tint_symbol_18 = a_PosMtxIdx;
main1(global2, global, global1, &(tint_symbol_18), &(tint_symbol_14), &(tint_symbol_19), &(tint_symbol_16), &(tint_symbol_20), &(tint_symbol_17), &(tint_symbol_21), &(tint_symbol_15));
float4 const _e11 = tint_symbol_20;
float2 const _e13 = tint_symbol_21;
float4 const _e15 = tint_symbol_19;
VertexOutput const tint_symbol_4 = {.v_Color=_e11, .v_TexCoord=_e13, .member=_e15};
tint_symbol_3 const tint_symbol_5 = {.v_Color=tint_symbol_4.v_Color, .v_TexCoord=tint_symbol_4.v_TexCoord, .member=tint_symbol_4.member};
return tint_symbol_5;
}

View File

@ -0,0 +1,614 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 383
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %main "main" %tint_pointsize %tint_symbol %tint_symbol_1 %tint_symbol_2 %tint_symbol_3 %tint_symbol_4 %tint_symbol_6 %tint_symbol_7 %tint_symbol_8
OpName %tint_pointsize "tint_pointsize"
OpName %ub_SceneParams "ub_SceneParams"
OpMemberName %ub_SceneParams 0 "u_Projection"
OpName %Mat4x4_ "Mat4x4_"
OpMemberName %Mat4x4_ 0 "mx"
OpMemberName %Mat4x4_ 1 "my"
OpMemberName %Mat4x4_ 2 "mz"
OpMemberName %Mat4x4_ 3 "mw"
OpName %global "global"
OpName %ub_MaterialParams "ub_MaterialParams"
OpMemberName %ub_MaterialParams 0 "u_TexMtx"
OpName %Mat4x2_ "Mat4x2_"
OpMemberName %Mat4x2_ 0 "mx"
OpMemberName %Mat4x2_ 1 "my"
OpMemberName %ub_MaterialParams 1 "u_Misc0_"
OpName %global1 "global1"
OpName %ub_PacketParams "ub_PacketParams"
OpMemberName %ub_PacketParams 0 "u_PosMtx"
OpName %Mat4x3_ "Mat4x3_"
OpMemberName %Mat4x3_ 0 "mx"
OpMemberName %Mat4x3_ 1 "my"
OpMemberName %Mat4x3_ 2 "mz"
OpName %global2 "global2"
OpName %a_Position1 "a_Position1"
OpName %a_UV1 "a_UV1"
OpName %a_Color1 "a_Color1"
OpName %a_Normal1 "a_Normal1"
OpName %a_PosMtxIdx1 "a_PosMtxIdx1"
OpName %v_Color "v_Color"
OpName %v_TexCoord "v_TexCoord"
OpName %gl_Position "gl_Position"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_4 "tint_symbol_4"
OpName %tint_symbol_6 "tint_symbol_6"
OpName %tint_symbol_7 "tint_symbol_7"
OpName %tint_symbol_8 "tint_symbol_8"
OpName %Mat4x3GetCol0_ "Mat4x3GetCol0_"
OpName %m "m"
OpName %m1 "m1"
OpName %Mat4x3GetCol1_ "Mat4x3GetCol1_"
OpName %m2 "m2"
OpName %m3 "m3"
OpName %Mat4x3GetCol2_ "Mat4x3GetCol2_"
OpName %m4 "m4"
OpName %m5 "m5"
OpName %Mat4x3GetCol3_ "Mat4x3GetCol3_"
OpName %m6 "m6"
OpName %m7 "m7"
OpName %Mul "Mul"
OpName %m8 "m8"
OpName %v "v"
OpName %m9 "m9"
OpName %v1 "v1"
OpName %Mul1 "Mul1"
OpName %m10 "m10"
OpName %v2 "v2"
OpName %m11 "m11"
OpName %v3 "v3"
OpName %Mul2 "Mul2"
OpName %m12 "m12"
OpName %v4 "v4"
OpName %m13 "m13"
OpName %v5 "v5"
OpName %Mul3 "Mul3"
OpName %v6 "v6"
OpName %m14 "m14"
OpName %v7 "v7"
OpName %m15 "m15"
OpName %_Mat4x4_ "_Mat4x4_"
OpName %n "n"
OpName %n1 "n1"
OpName %o "o"
OpName %_Mat4x4_1 "_Mat4x4_1"
OpName %m16 "m16"
OpName %m17 "m17"
OpName %o1 "o1"
OpName %_Mat4x4_2 "_Mat4x4_2"
OpName %m18 "m18"
OpName %m19 "m19"
OpName %o2 "o2"
OpName %_Mat4x3_ "_Mat4x3_"
OpName %n2 "n2"
OpName %n3 "n3"
OpName %o3 "o3"
OpName %_Mat4x3_1 "_Mat4x3_1"
OpName %m20 "m20"
OpName %m21 "m21"
OpName %o4 "o4"
OpName %main1 "main1"
OpName %t_PosMtx "t_PosMtx"
OpName %t_TexSpaceCoord "t_TexSpaceCoord"
OpName %VertexOutput "VertexOutput"
OpMemberName %VertexOutput 0 "v_Color"
OpMemberName %VertexOutput 1 "v_TexCoord"
OpMemberName %VertexOutput 2 "member"
OpName %tint_symbol_9 "tint_symbol_9"
OpName %tint_symbol_5 "tint_symbol_5"
OpName %main "main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %ub_SceneParams Block
OpMemberDecorate %ub_SceneParams 0 Offset 0
OpMemberDecorate %Mat4x4_ 0 Offset 0
OpMemberDecorate %Mat4x4_ 1 Offset 16
OpMemberDecorate %Mat4x4_ 2 Offset 32
OpMemberDecorate %Mat4x4_ 3 Offset 48
OpDecorate %global NonWritable
OpDecorate %global DescriptorSet 0
OpDecorate %global Binding 0
OpDecorate %ub_MaterialParams Block
OpMemberDecorate %ub_MaterialParams 0 Offset 0
OpMemberDecorate %Mat4x2_ 0 Offset 0
OpMemberDecorate %Mat4x2_ 1 Offset 16
OpDecorate %_arr_Mat4x2__uint_1 ArrayStride 32
OpMemberDecorate %ub_MaterialParams 1 Offset 32
OpDecorate %global1 NonWritable
OpDecorate %global1 DescriptorSet 0
OpDecorate %global1 Binding 1
OpDecorate %ub_PacketParams Block
OpMemberDecorate %ub_PacketParams 0 Offset 0
OpMemberDecorate %Mat4x3_ 0 Offset 0
OpMemberDecorate %Mat4x3_ 1 Offset 16
OpMemberDecorate %Mat4x3_ 2 Offset 32
OpDecorate %_arr_Mat4x3__uint_32 ArrayStride 48
OpDecorate %global2 NonWritable
OpDecorate %global2 DescriptorSet 0
OpDecorate %global2 Binding 2
OpDecorate %tint_symbol Location 0
OpDecorate %tint_symbol_1 Location 1
OpDecorate %tint_symbol_2 Location 2
OpDecorate %tint_symbol_3 Location 3
OpDecorate %tint_symbol_4 Location 4
OpDecorate %tint_symbol_6 Location 0
OpDecorate %tint_symbol_7 Location 1
OpDecorate %tint_symbol_8 BuiltIn Position
OpMemberDecorate %VertexOutput 0 Offset 0
OpMemberDecorate %VertexOutput 1 Offset 16
OpMemberDecorate %VertexOutput 2 Offset 32
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
%v4float = OpTypeVector %float 4
%Mat4x4_ = OpTypeStruct %v4float %v4float %v4float %v4float
%ub_SceneParams = OpTypeStruct %Mat4x4_
%_ptr_Uniform_ub_SceneParams = OpTypePointer Uniform %ub_SceneParams
%global = OpVariable %_ptr_Uniform_ub_SceneParams Uniform
%Mat4x2_ = OpTypeStruct %v4float %v4float
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_arr_Mat4x2__uint_1 = OpTypeArray %Mat4x2_ %uint_1
%ub_MaterialParams = OpTypeStruct %_arr_Mat4x2__uint_1 %v4float
%_ptr_Uniform_ub_MaterialParams = OpTypePointer Uniform %ub_MaterialParams
%global1 = OpVariable %_ptr_Uniform_ub_MaterialParams Uniform
%Mat4x3_ = OpTypeStruct %v4float %v4float %v4float
%uint_32 = OpConstant %uint 32
%_arr_Mat4x3__uint_32 = OpTypeArray %Mat4x3_ %uint_32
%ub_PacketParams = OpTypeStruct %_arr_Mat4x3__uint_32
%_ptr_Uniform_ub_PacketParams = OpTypePointer Uniform %ub_PacketParams
%global2 = OpVariable %_ptr_Uniform_ub_PacketParams Uniform
%v3float = OpTypeVector %float 3
%_ptr_Private_v3float = OpTypePointer Private %v3float
%26 = OpConstantNull %v3float
%a_Position1 = OpVariable %_ptr_Private_v3float Private %26
%v2float = OpTypeVector %float 2
%_ptr_Private_v2float = OpTypePointer Private %v2float
%30 = OpConstantNull %v2float
%a_UV1 = OpVariable %_ptr_Private_v2float Private %30
%_ptr_Private_v4float = OpTypePointer Private %v4float
%33 = OpConstantNull %v4float
%a_Color1 = OpVariable %_ptr_Private_v4float Private %33
%a_Normal1 = OpVariable %_ptr_Private_v3float Private %26
%_ptr_Private_float = OpTypePointer Private %float
%a_PosMtxIdx1 = OpVariable %_ptr_Private_float Private %4
%v_Color = OpVariable %_ptr_Private_v4float Private %33
%v_TexCoord = OpVariable %_ptr_Private_v2float Private %30
%gl_Position = OpVariable %_ptr_Private_v4float Private %33
%_ptr_Input_v3float = OpTypePointer Input %v3float
%tint_symbol = OpVariable %_ptr_Input_v3float Input
%_ptr_Input_v2float = OpTypePointer Input %v2float
%tint_symbol_1 = OpVariable %_ptr_Input_v2float Input
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol_2 = OpVariable %_ptr_Input_v4float Input
%tint_symbol_3 = OpVariable %_ptr_Input_v3float Input
%_ptr_Input_float = OpTypePointer Input %float
%tint_symbol_4 = OpVariable %_ptr_Input_float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_6 = OpVariable %_ptr_Output_v4float Output %33
%_ptr_Output_v2float = OpTypePointer Output %v2float
%tint_symbol_7 = OpVariable %_ptr_Output_v2float Output %30
%tint_symbol_8 = OpVariable %_ptr_Output_v4float Output %33
%54 = OpTypeFunction %v3float %Mat4x3_
%_ptr_Function_Mat4x3_ = OpTypePointer Function %Mat4x3_
%60 = OpConstantNull %Mat4x3_
%113 = OpTypeFunction %v4float %Mat4x4_ %v4float
%_ptr_Function_Mat4x4_ = OpTypePointer Function %Mat4x4_
%120 = OpConstantNull %Mat4x4_
%_ptr_Function_v4float = OpTypePointer Function %v4float
%140 = OpTypeFunction %v3float %Mat4x3_ %v4float
%160 = OpTypeFunction %v2float %Mat4x2_ %v4float
%_ptr_Function_Mat4x2_ = OpTypePointer Function %Mat4x2_
%167 = OpConstantNull %Mat4x2_
%178 = OpTypeFunction %v4float %v3float %Mat4x3_
%_ptr_Function_v3float = OpTypePointer Function %v3float
%203 = OpTypeFunction %Mat4x4_ %float
%_ptr_Function_float = OpTypePointer Function %float
%uint_0 = OpConstant %uint 0
%float_0 = OpConstant %float 0
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%227 = OpTypeFunction %Mat4x4_ %Mat4x3_
%float_1 = OpConstant %float 1
%245 = OpTypeFunction %Mat4x4_ %Mat4x2_
%259 = OpTypeFunction %Mat4x3_ %float
%275 = OpTypeFunction %Mat4x3_ %Mat4x4_
%void = OpTypeVoid
%291 = OpTypeFunction %void
%_ptr_Function_v2float = OpTypePointer Function %v2float
%int = OpTypeInt 32 1
%_ptr_Uniform_Mat4x3_ = OpTypePointer Uniform %Mat4x3_
%_ptr_Uniform_Mat4x4_ = OpTypePointer Uniform %Mat4x4_
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_2 = OpConstant %float 2
%bool = OpTypeBool
%int_0 = OpConstant %int 0
%_ptr_Uniform_Mat4x2_ = OpTypePointer Uniform %Mat4x2_
%VertexOutput = OpTypeStruct %v4float %v2float %v4float
%362 = OpTypeFunction %void %VertexOutput
%Mat4x3GetCol0_ = OpFunction %v3float None %54
%m = OpFunctionParameter %Mat4x3_
%57 = OpLabel
%m1 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %m1 %m
%61 = OpLoad %Mat4x3_ %m1
%62 = OpLoad %Mat4x3_ %m1
%63 = OpLoad %Mat4x3_ %m1
%64 = OpCompositeExtract %v4float %61 0
%65 = OpCompositeExtract %float %64 0
%66 = OpCompositeExtract %v4float %62 1
%67 = OpCompositeExtract %float %66 0
%68 = OpCompositeExtract %v4float %63 2
%69 = OpCompositeExtract %float %68 0
%70 = OpCompositeConstruct %v3float %65 %67 %69
OpReturnValue %70
OpFunctionEnd
%Mat4x3GetCol1_ = OpFunction %v3float None %54
%m2 = OpFunctionParameter %Mat4x3_
%73 = OpLabel
%m3 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %m3 %m2
%75 = OpLoad %Mat4x3_ %m3
%76 = OpLoad %Mat4x3_ %m3
%77 = OpLoad %Mat4x3_ %m3
%78 = OpCompositeExtract %v4float %75 0
%79 = OpCompositeExtract %float %78 1
%80 = OpCompositeExtract %v4float %76 1
%81 = OpCompositeExtract %float %80 1
%82 = OpCompositeExtract %v4float %77 2
%83 = OpCompositeExtract %float %82 1
%84 = OpCompositeConstruct %v3float %79 %81 %83
OpReturnValue %84
OpFunctionEnd
%Mat4x3GetCol2_ = OpFunction %v3float None %54
%m4 = OpFunctionParameter %Mat4x3_
%87 = OpLabel
%m5 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %m5 %m4
%89 = OpLoad %Mat4x3_ %m5
%90 = OpLoad %Mat4x3_ %m5
%91 = OpLoad %Mat4x3_ %m5
%92 = OpCompositeExtract %v4float %89 0
%93 = OpCompositeExtract %float %92 2
%94 = OpCompositeExtract %v4float %90 1
%95 = OpCompositeExtract %float %94 2
%96 = OpCompositeExtract %v4float %91 2
%97 = OpCompositeExtract %float %96 2
%98 = OpCompositeConstruct %v3float %93 %95 %97
OpReturnValue %98
OpFunctionEnd
%Mat4x3GetCol3_ = OpFunction %v3float None %54
%m6 = OpFunctionParameter %Mat4x3_
%101 = OpLabel
%m7 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %m7 %m6
%103 = OpLoad %Mat4x3_ %m7
%104 = OpLoad %Mat4x3_ %m7
%105 = OpLoad %Mat4x3_ %m7
%106 = OpCompositeExtract %v4float %103 0
%107 = OpCompositeExtract %float %106 3
%108 = OpCompositeExtract %v4float %104 1
%109 = OpCompositeExtract %float %108 3
%110 = OpCompositeExtract %v4float %105 2
%111 = OpCompositeExtract %float %110 3
%112 = OpCompositeConstruct %v3float %107 %109 %111
OpReturnValue %112
OpFunctionEnd
%Mul = OpFunction %v4float None %113
%m8 = OpFunctionParameter %Mat4x4_
%v = OpFunctionParameter %v4float
%117 = OpLabel
%m9 = OpVariable %_ptr_Function_Mat4x4_ Function %120
%v1 = OpVariable %_ptr_Function_v4float Function %33
OpStore %m9 %m8
OpStore %v1 %v
%123 = OpLoad %Mat4x4_ %m9
%124 = OpLoad %v4float %v1
%125 = OpLoad %Mat4x4_ %m9
%126 = OpLoad %v4float %v1
%127 = OpLoad %Mat4x4_ %m9
%128 = OpLoad %v4float %v1
%129 = OpLoad %Mat4x4_ %m9
%130 = OpLoad %v4float %v1
%132 = OpCompositeExtract %v4float %123 0
%131 = OpDot %float %132 %124
%134 = OpCompositeExtract %v4float %125 1
%133 = OpDot %float %134 %126
%136 = OpCompositeExtract %v4float %127 2
%135 = OpDot %float %136 %128
%138 = OpCompositeExtract %v4float %129 3
%137 = OpDot %float %138 %130
%139 = OpCompositeConstruct %v4float %131 %133 %135 %137
OpReturnValue %139
OpFunctionEnd
%Mul1 = OpFunction %v3float None %140
%m10 = OpFunctionParameter %Mat4x3_
%v2 = OpFunctionParameter %v4float
%144 = OpLabel
%m11 = OpVariable %_ptr_Function_Mat4x3_ Function %60
%v3 = OpVariable %_ptr_Function_v4float Function %33
OpStore %m11 %m10
OpStore %v3 %v2
%147 = OpLoad %Mat4x3_ %m11
%148 = OpLoad %v4float %v3
%149 = OpLoad %Mat4x3_ %m11
%150 = OpLoad %v4float %v3
%151 = OpLoad %Mat4x3_ %m11
%152 = OpLoad %v4float %v3
%154 = OpCompositeExtract %v4float %147 0
%153 = OpDot %float %154 %148
%156 = OpCompositeExtract %v4float %149 1
%155 = OpDot %float %156 %150
%158 = OpCompositeExtract %v4float %151 2
%157 = OpDot %float %158 %152
%159 = OpCompositeConstruct %v3float %153 %155 %157
OpReturnValue %159
OpFunctionEnd
%Mul2 = OpFunction %v2float None %160
%m12 = OpFunctionParameter %Mat4x2_
%v4 = OpFunctionParameter %v4float
%164 = OpLabel
%m13 = OpVariable %_ptr_Function_Mat4x2_ Function %167
%v5 = OpVariable %_ptr_Function_v4float Function %33
OpStore %m13 %m12
OpStore %v5 %v4
%169 = OpLoad %Mat4x2_ %m13
%170 = OpLoad %v4float %v5
%171 = OpLoad %Mat4x2_ %m13
%172 = OpLoad %v4float %v5
%174 = OpCompositeExtract %v4float %169 0
%173 = OpDot %float %174 %170
%176 = OpCompositeExtract %v4float %171 1
%175 = OpDot %float %176 %172
%177 = OpCompositeConstruct %v2float %173 %175
OpReturnValue %177
OpFunctionEnd
%Mul3 = OpFunction %v4float None %178
%v6 = OpFunctionParameter %v3float
%m14 = OpFunctionParameter %Mat4x3_
%182 = OpLabel
%v7 = OpVariable %_ptr_Function_v3float Function %26
%m15 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %v7 %v6
OpStore %m15 %m14
%186 = OpLoad %Mat4x3_ %m15
%187 = OpFunctionCall %v3float %Mat4x3GetCol0_ %186
%188 = OpLoad %v3float %v7
%189 = OpLoad %Mat4x3_ %m15
%190 = OpFunctionCall %v3float %Mat4x3GetCol1_ %189
%191 = OpLoad %v3float %v7
%192 = OpLoad %Mat4x3_ %m15
%193 = OpFunctionCall %v3float %Mat4x3GetCol2_ %192
%194 = OpLoad %v3float %v7
%195 = OpLoad %Mat4x3_ %m15
%196 = OpFunctionCall %v3float %Mat4x3GetCol3_ %195
%197 = OpLoad %v3float %v7
%198 = OpDot %float %187 %188
%199 = OpDot %float %190 %191
%200 = OpDot %float %193 %194
%201 = OpDot %float %196 %197
%202 = OpCompositeConstruct %v4float %198 %199 %200 %201
OpReturnValue %202
OpFunctionEnd
%_Mat4x4_ = OpFunction %Mat4x4_ None %203
%n = OpFunctionParameter %float
%206 = OpLabel
%n1 = OpVariable %_ptr_Function_float Function %4
%o = OpVariable %_ptr_Function_Mat4x4_ Function %120
OpStore %n1 %n
%210 = OpLoad %float %n1
%212 = OpAccessChain %_ptr_Function_v4float %o %uint_0
%214 = OpCompositeConstruct %v4float %210 %float_0 %float_0 %float_0
OpStore %212 %214
%215 = OpLoad %float %n1
%216 = OpAccessChain %_ptr_Function_v4float %o %uint_1
%217 = OpCompositeConstruct %v4float %float_0 %215 %float_0 %float_0
OpStore %216 %217
%218 = OpLoad %float %n1
%220 = OpAccessChain %_ptr_Function_v4float %o %uint_2
%221 = OpCompositeConstruct %v4float %float_0 %float_0 %218 %float_0
OpStore %220 %221
%222 = OpLoad %float %n1
%224 = OpAccessChain %_ptr_Function_v4float %o %uint_3
%225 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %222
OpStore %224 %225
%226 = OpLoad %Mat4x4_ %o
OpReturnValue %226
OpFunctionEnd
%_Mat4x4_1 = OpFunction %Mat4x4_ None %227
%m16 = OpFunctionParameter %Mat4x3_
%230 = OpLabel
%m17 = OpVariable %_ptr_Function_Mat4x3_ Function %60
%o1 = OpVariable %_ptr_Function_Mat4x4_ Function %120
OpStore %m17 %m16
%233 = OpFunctionCall %Mat4x4_ %_Mat4x4_ %float_1
OpStore %o1 %233
%235 = OpLoad %Mat4x3_ %m17
%236 = OpAccessChain %_ptr_Function_v4float %o1 %uint_0
%237 = OpCompositeExtract %v4float %235 0
OpStore %236 %237
%238 = OpLoad %Mat4x3_ %m17
%239 = OpAccessChain %_ptr_Function_v4float %o1 %uint_1
%240 = OpCompositeExtract %v4float %238 1
OpStore %239 %240
%241 = OpLoad %Mat4x3_ %m17
%242 = OpAccessChain %_ptr_Function_v4float %o1 %uint_2
%243 = OpCompositeExtract %v4float %241 2
OpStore %242 %243
%244 = OpLoad %Mat4x4_ %o1
OpReturnValue %244
OpFunctionEnd
%_Mat4x4_2 = OpFunction %Mat4x4_ None %245
%m18 = OpFunctionParameter %Mat4x2_
%248 = OpLabel
%m19 = OpVariable %_ptr_Function_Mat4x2_ Function %167
%o2 = OpVariable %_ptr_Function_Mat4x4_ Function %120
OpStore %m19 %m18
%251 = OpFunctionCall %Mat4x4_ %_Mat4x4_ %float_1
OpStore %o2 %251
%252 = OpLoad %Mat4x2_ %m19
%253 = OpAccessChain %_ptr_Function_v4float %o2 %uint_0
%254 = OpCompositeExtract %v4float %252 0
OpStore %253 %254
%255 = OpLoad %Mat4x2_ %m19
%256 = OpAccessChain %_ptr_Function_v4float %o2 %uint_1
%257 = OpCompositeExtract %v4float %255 1
OpStore %256 %257
%258 = OpLoad %Mat4x4_ %o2
OpReturnValue %258
OpFunctionEnd
%_Mat4x3_ = OpFunction %Mat4x3_ None %259
%n2 = OpFunctionParameter %float
%262 = OpLabel
%n3 = OpVariable %_ptr_Function_float Function %4
%o3 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %n3 %n2
%265 = OpLoad %float %n3
%266 = OpAccessChain %_ptr_Function_v4float %o3 %uint_0
%267 = OpCompositeConstruct %v4float %265 %float_0 %float_0 %float_0
OpStore %266 %267
%268 = OpLoad %float %n3
%269 = OpAccessChain %_ptr_Function_v4float %o3 %uint_1
%270 = OpCompositeConstruct %v4float %float_0 %268 %float_0 %float_0
OpStore %269 %270
%271 = OpLoad %float %n3
%272 = OpAccessChain %_ptr_Function_v4float %o3 %uint_2
%273 = OpCompositeConstruct %v4float %float_0 %float_0 %271 %float_0
OpStore %272 %273
%274 = OpLoad %Mat4x3_ %o3
OpReturnValue %274
OpFunctionEnd
%_Mat4x3_1 = OpFunction %Mat4x3_ None %275
%m20 = OpFunctionParameter %Mat4x4_
%278 = OpLabel
%m21 = OpVariable %_ptr_Function_Mat4x4_ Function %120
%o4 = OpVariable %_ptr_Function_Mat4x3_ Function %60
OpStore %m21 %m20
%281 = OpLoad %Mat4x4_ %m21
%282 = OpAccessChain %_ptr_Function_v4float %o4 %uint_0
%283 = OpCompositeExtract %v4float %281 0
OpStore %282 %283
%284 = OpLoad %Mat4x4_ %m21
%285 = OpAccessChain %_ptr_Function_v4float %o4 %uint_1
%286 = OpCompositeExtract %v4float %284 1
OpStore %285 %286
%287 = OpLoad %Mat4x4_ %m21
%288 = OpAccessChain %_ptr_Function_v4float %o4 %uint_2
%289 = OpCompositeExtract %v4float %287 2
OpStore %288 %289
%290 = OpLoad %Mat4x3_ %o4
OpReturnValue %290
OpFunctionEnd
%main1 = OpFunction %void None %291
%294 = OpLabel
%t_PosMtx = OpVariable %_ptr_Function_Mat4x3_ Function %60
%t_TexSpaceCoord = OpVariable %_ptr_Function_v2float Function %30
%298 = OpLoad %float %a_PosMtxIdx1
%299 = OpConvertFToS %int %298
%302 = OpAccessChain %_ptr_Uniform_Mat4x3_ %global2 %uint_0 %299
%303 = OpLoad %Mat4x3_ %302
OpStore %t_PosMtx %303
%304 = OpLoad %Mat4x3_ %t_PosMtx
%305 = OpFunctionCall %Mat4x4_ %_Mat4x4_1 %304
%306 = OpLoad %v3float %a_Position1
%307 = OpLoad %Mat4x3_ %t_PosMtx
%308 = OpFunctionCall %Mat4x4_ %_Mat4x4_1 %307
%309 = OpLoad %v3float %a_Position1
%311 = OpCompositeExtract %float %309 0
%312 = OpCompositeExtract %float %309 1
%313 = OpCompositeExtract %float %309 2
%314 = OpCompositeConstruct %v4float %311 %312 %313 %float_1
%310 = OpFunctionCall %v4float %Mul %308 %314
%316 = OpAccessChain %_ptr_Uniform_Mat4x4_ %global %uint_0
%317 = OpLoad %Mat4x4_ %316
%318 = OpLoad %Mat4x3_ %t_PosMtx
%319 = OpFunctionCall %Mat4x4_ %_Mat4x4_1 %318
%320 = OpLoad %v3float %a_Position1
%321 = OpLoad %Mat4x3_ %t_PosMtx
%322 = OpFunctionCall %Mat4x4_ %_Mat4x4_1 %321
%323 = OpLoad %v3float %a_Position1
%325 = OpCompositeExtract %float %323 0
%326 = OpCompositeExtract %float %323 1
%327 = OpCompositeExtract %float %323 2
%328 = OpCompositeConstruct %v4float %325 %326 %327 %float_1
%324 = OpFunctionCall %v4float %Mul %322 %328
%329 = OpFunctionCall %v4float %Mul %317 %324
OpStore %gl_Position %329
%330 = OpLoad %v4float %a_Color1
OpStore %v_Color %330
%332 = OpAccessChain %_ptr_Uniform_v4float %global1 %uint_1
%333 = OpLoad %v4float %332
%334 = OpCompositeExtract %float %333 0
%336 = OpFOrdEqual %bool %334 %float_2
OpSelectionMerge %338 None
OpBranchConditional %336 %339 %340
%339 = OpLabel
%341 = OpLoad %v3float %a_Normal1
%344 = OpAccessChain %_ptr_Uniform_Mat4x2_ %global1 %uint_0 %int_0
%345 = OpLoad %Mat4x2_ %344
%346 = OpLoad %v3float %a_Normal1
%348 = OpCompositeExtract %float %346 0
%349 = OpCompositeExtract %float %346 1
%350 = OpCompositeExtract %float %346 2
%351 = OpCompositeConstruct %v4float %348 %349 %350 %float_1
%347 = OpFunctionCall %v2float %Mul2 %345 %351
%352 = OpVectorShuffle %v2float %347 %347 0 1
OpStore %v_TexCoord %352
OpReturn
%340 = OpLabel
%353 = OpLoad %v2float %a_UV1
%354 = OpAccessChain %_ptr_Uniform_Mat4x2_ %global1 %uint_0 %int_0
%355 = OpLoad %Mat4x2_ %354
%356 = OpLoad %v2float %a_UV1
%358 = OpCompositeExtract %float %356 0
%359 = OpCompositeExtract %float %356 1
%360 = OpCompositeConstruct %v4float %358 %359 %float_1 %float_1
%357 = OpFunctionCall %v2float %Mul2 %355 %360
%361 = OpVectorShuffle %v2float %357 %357 0 1
OpStore %v_TexCoord %361
OpReturn
%338 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_9 = OpFunction %void None %362
%tint_symbol_5 = OpFunctionParameter %VertexOutput
%366 = OpLabel
%367 = OpCompositeExtract %v4float %tint_symbol_5 0
OpStore %tint_symbol_6 %367
%368 = OpCompositeExtract %v2float %tint_symbol_5 1
OpStore %tint_symbol_7 %368
%369 = OpCompositeExtract %v4float %tint_symbol_5 2
OpStore %tint_symbol_8 %369
OpReturn
OpFunctionEnd
%main = OpFunction %void None %291
%371 = OpLabel
OpStore %tint_pointsize %float_1
%372 = OpLoad %v3float %tint_symbol
OpStore %a_Position1 %372
%373 = OpLoad %v2float %tint_symbol_1
OpStore %a_UV1 %373
%374 = OpLoad %v4float %tint_symbol_2
OpStore %a_Color1 %374
%375 = OpLoad %v3float %tint_symbol_3
OpStore %a_Normal1 %375
%376 = OpLoad %float %tint_symbol_4
OpStore %a_PosMtxIdx1 %376
%377 = OpFunctionCall %void %main1
%378 = OpLoad %v4float %v_Color
%379 = OpLoad %v2float %v_TexCoord
%380 = OpLoad %v4float %gl_Position
%382 = OpCompositeConstruct %VertexOutput %378 %379 %380
%381 = OpFunctionCall %void %tint_symbol_9 %382
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,297 @@
struct Mat4x4_ {
mx : vec4<f32>;
my : vec4<f32>;
mz : vec4<f32>;
mw : vec4<f32>;
};
struct Mat4x3_ {
mx : vec4<f32>;
my : vec4<f32>;
mz : vec4<f32>;
};
struct Mat4x2_ {
mx : vec4<f32>;
my : vec4<f32>;
};
[[block]]
struct ub_SceneParams {
u_Projection : Mat4x4_;
};
[[block]]
struct ub_MaterialParams {
u_TexMtx : [[stride(32)]] array<Mat4x2_, 1>;
u_Misc0_ : vec4<f32>;
};
[[block]]
struct ub_PacketParams {
u_PosMtx : [[stride(48)]] array<Mat4x3_, 32>;
};
struct VertexOutput {
[[location(0)]]
v_Color : vec4<f32>;
[[location(1)]]
v_TexCoord : vec2<f32>;
[[builtin(position)]]
member : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> global : ub_SceneParams;
[[group(0), binding(1)]] var<uniform> global1 : ub_MaterialParams;
[[group(0), binding(2)]] var<uniform> global2 : ub_PacketParams;
var<private> a_Position1 : vec3<f32>;
var<private> a_UV1 : vec2<f32>;
var<private> a_Color1 : vec4<f32>;
var<private> a_Normal1 : vec3<f32>;
var<private> a_PosMtxIdx1 : f32;
var<private> v_Color : vec4<f32>;
var<private> v_TexCoord : vec2<f32>;
var<private> gl_Position : vec4<f32>;
fn Mat4x3GetCol0_(m : Mat4x3_) -> vec3<f32> {
var m1 : Mat4x3_;
m1 = m;
let _e2 : Mat4x3_ = m1;
let _e5 : Mat4x3_ = m1;
let _e8 : Mat4x3_ = m1;
return vec3<f32>(_e2.mx.x, _e5.my.x, _e8.mz.x);
}
fn Mat4x3GetCol1_(m2 : Mat4x3_) -> vec3<f32> {
var m3 : Mat4x3_;
m3 = m2;
let _e2 : Mat4x3_ = m3;
let _e5 : Mat4x3_ = m3;
let _e8 : Mat4x3_ = m3;
return vec3<f32>(_e2.mx.y, _e5.my.y, _e8.mz.y);
}
fn Mat4x3GetCol2_(m4 : Mat4x3_) -> vec3<f32> {
var m5 : Mat4x3_;
m5 = m4;
let _e2 : Mat4x3_ = m5;
let _e5 : Mat4x3_ = m5;
let _e8 : Mat4x3_ = m5;
return vec3<f32>(_e2.mx.z, _e5.my.z, _e8.mz.z);
}
fn Mat4x3GetCol3_(m6 : Mat4x3_) -> vec3<f32> {
var m7 : Mat4x3_;
m7 = m6;
let _e2 : Mat4x3_ = m7;
let _e5 : Mat4x3_ = m7;
let _e8 : Mat4x3_ = m7;
return vec3<f32>(_e2.mx.w, _e5.my.w, _e8.mz.w);
}
fn Mul(m8 : Mat4x4_, v : vec4<f32>) -> vec4<f32> {
var m9 : Mat4x4_;
var v1 : vec4<f32>;
m9 = m8;
v1 = v;
let _e4 : Mat4x4_ = m9;
let _e6 : vec4<f32> = v1;
let _e8 : Mat4x4_ = m9;
let _e10 : vec4<f32> = v1;
let _e12 : Mat4x4_ = m9;
let _e14 : vec4<f32> = v1;
let _e16 : Mat4x4_ = m9;
let _e18 : vec4<f32> = v1;
return vec4<f32>(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14), dot(_e16.mw, _e18));
}
fn Mul1(m10 : Mat4x3_, v2 : vec4<f32>) -> vec3<f32> {
var m11 : Mat4x3_;
var v3 : vec4<f32>;
m11 = m10;
v3 = v2;
let _e4 : Mat4x3_ = m11;
let _e6 : vec4<f32> = v3;
let _e8 : Mat4x3_ = m11;
let _e10 : vec4<f32> = v3;
let _e12 : Mat4x3_ = m11;
let _e14 : vec4<f32> = v3;
return vec3<f32>(dot(_e4.mx, _e6), dot(_e8.my, _e10), dot(_e12.mz, _e14));
}
fn Mul2(m12 : Mat4x2_, v4 : vec4<f32>) -> vec2<f32> {
var m13 : Mat4x2_;
var v5 : vec4<f32>;
m13 = m12;
v5 = v4;
let _e4 : Mat4x2_ = m13;
let _e6 : vec4<f32> = v5;
let _e8 : Mat4x2_ = m13;
let _e10 : vec4<f32> = v5;
return vec2<f32>(dot(_e4.mx, _e6), dot(_e8.my, _e10));
}
fn Mul3(v6 : vec3<f32>, m14 : Mat4x3_) -> vec4<f32> {
var v7 : vec3<f32>;
var m15 : Mat4x3_;
v7 = v6;
m15 = m14;
let _e5 : Mat4x3_ = m15;
let _e6 : vec3<f32> = Mat4x3GetCol0_(_e5);
let _e7 : vec3<f32> = v7;
let _e10 : Mat4x3_ = m15;
let _e11 : vec3<f32> = Mat4x3GetCol1_(_e10);
let _e12 : vec3<f32> = v7;
let _e15 : Mat4x3_ = m15;
let _e16 : vec3<f32> = Mat4x3GetCol2_(_e15);
let _e17 : vec3<f32> = v7;
let _e20 : Mat4x3_ = m15;
let _e21 : vec3<f32> = Mat4x3GetCol3_(_e20);
let _e22 : vec3<f32> = v7;
return vec4<f32>(dot(_e6, _e7), dot(_e11, _e12), dot(_e16, _e17), dot(_e21, _e22));
}
fn _Mat4x4_(n : f32) -> Mat4x4_ {
var n1 : f32;
var o : Mat4x4_;
n1 = n;
let _e4 : f32 = n1;
o.mx = vec4<f32>(_e4, 0.0, 0.0, 0.0);
let _e11 : f32 = n1;
o.my = vec4<f32>(0.0, _e11, 0.0, 0.0);
let _e18 : f32 = n1;
o.mz = vec4<f32>(0.0, 0.0, _e18, 0.0);
let _e25 : f32 = n1;
o.mw = vec4<f32>(0.0, 0.0, 0.0, _e25);
let _e27 : Mat4x4_ = o;
return _e27;
}
fn _Mat4x4_1(m16 : Mat4x3_) -> Mat4x4_ {
var m17 : Mat4x3_;
var o1 : Mat4x4_;
m17 = m16;
let _e4 : Mat4x4_ = _Mat4x4_(1.0);
o1 = _e4;
let _e7 : Mat4x3_ = m17;
o1.mx = _e7.mx;
let _e10 : Mat4x3_ = m17;
o1.my = _e10.my;
let _e13 : Mat4x3_ = m17;
o1.mz = _e13.mz;
let _e15 : Mat4x4_ = o1;
return _e15;
}
fn _Mat4x4_2(m18 : Mat4x2_) -> Mat4x4_ {
var m19 : Mat4x2_;
var o2 : Mat4x4_;
m19 = m18;
let _e4 : Mat4x4_ = _Mat4x4_(1.0);
o2 = _e4;
let _e7 : Mat4x2_ = m19;
o2.mx = _e7.mx;
let _e10 : Mat4x2_ = m19;
o2.my = _e10.my;
let _e12 : Mat4x4_ = o2;
return _e12;
}
fn _Mat4x3_(n2 : f32) -> Mat4x3_ {
var n3 : f32;
var o3 : Mat4x3_;
n3 = n2;
let _e4 : f32 = n3;
o3.mx = vec4<f32>(_e4, 0.0, 0.0, 0.0);
let _e11 : f32 = n3;
o3.my = vec4<f32>(0.0, _e11, 0.0, 0.0);
let _e18 : f32 = n3;
o3.mz = vec4<f32>(0.0, 0.0, _e18, 0.0);
let _e21 : Mat4x3_ = o3;
return _e21;
}
fn _Mat4x3_1(m20 : Mat4x4_) -> Mat4x3_ {
var m21 : Mat4x4_;
var o4 : Mat4x3_;
m21 = m20;
let _e4 : Mat4x4_ = m21;
o4.mx = _e4.mx;
let _e7 : Mat4x4_ = m21;
o4.my = _e7.my;
let _e10 : Mat4x4_ = m21;
o4.mz = _e10.mz;
let _e12 : Mat4x3_ = o4;
return _e12;
}
fn main1() {
var t_PosMtx : Mat4x3_;
var t_TexSpaceCoord : vec2<f32>;
let _e15 : f32 = a_PosMtxIdx1;
let _e18 : Mat4x3_ = global2.u_PosMtx[i32(_e15)];
t_PosMtx = _e18;
let _e23 : Mat4x3_ = t_PosMtx;
let _e24 : Mat4x4_ = _Mat4x4_1(_e23);
let _e25 : vec3<f32> = a_Position1;
let _e29 : Mat4x3_ = t_PosMtx;
let _e30 : Mat4x4_ = _Mat4x4_1(_e29);
let _e31 : vec3<f32> = a_Position1;
let _e34 : vec4<f32> = Mul(_e30, vec4<f32>(_e31, 1.0));
let _e35 : Mat4x4_ = global.u_Projection;
let _e37 : Mat4x3_ = t_PosMtx;
let _e38 : Mat4x4_ = _Mat4x4_1(_e37);
let _e39 : vec3<f32> = a_Position1;
let _e43 : Mat4x3_ = t_PosMtx;
let _e44 : Mat4x4_ = _Mat4x4_1(_e43);
let _e45 : vec3<f32> = a_Position1;
let _e48 : vec4<f32> = Mul(_e44, vec4<f32>(_e45, 1.0));
let _e49 : vec4<f32> = Mul(_e35, _e48);
gl_Position = _e49;
let _e50 : vec4<f32> = a_Color1;
v_Color = _e50;
let _e52 : vec4<f32> = global1.u_Misc0_;
if ((_e52.x == 2.0)) {
{
let _e59 : vec3<f32> = a_Normal1;
let _e64 : Mat4x2_ = global1.u_TexMtx[0];
let _e65 : vec3<f32> = a_Normal1;
let _e68 : vec2<f32> = Mul2(_e64, vec4<f32>(_e65, 1.0));
v_TexCoord = _e68.xy;
return;
}
} else {
{
let _e73 : vec2<f32> = a_UV1;
let _e79 : Mat4x2_ = global1.u_TexMtx[0];
let _e80 : vec2<f32> = a_UV1;
let _e84 : vec2<f32> = Mul2(_e79, vec4<f32>(_e80, 1.0, 1.0));
v_TexCoord = _e84.xy;
return;
}
}
}
[[stage(vertex)]]
fn main([[location(0)]] a_Position : vec3<f32>, [[location(1)]] a_UV : vec2<f32>, [[location(2)]] a_Color : vec4<f32>, [[location(3)]] a_Normal : vec3<f32>, [[location(4)]] a_PosMtxIdx : f32) -> VertexOutput {
a_Position1 = a_Position;
a_UV1 = a_UV;
a_Color1 = a_Color;
a_Normal1 = a_Normal;
a_PosMtxIdx1 = a_PosMtxIdx;
main1();
let _e11 : vec4<f32> = v_Color;
let _e13 : vec2<f32> = v_TexCoord;
let _e15 : vec4<f32> = gl_Position;
return VertexOutput(_e11, _e13, _e15);
}