Tint/transform: make AddBlockAttribute always do wrapping if possible

This CL make transform AddBlockAttribute always try to wrap types used
by buffer variables into a struct, in order to generate valid GLSL code
for assigning one buffer struct variable to another buffer struct
variable.

Fixed: tint:1735
Change-Id: I009d8a9ca7ecea1dc0ad6164275c964a18acb33f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108023
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This commit is contained in:
Zhaoming Jiang 2022-11-02 02:25:38 +00:00 committed by Dawn LUCI CQ
parent 2bea9055f4
commit 6ab5d3c151
465 changed files with 15681 additions and 12853 deletions

View File

@ -27,19 +27,6 @@ TINT_INSTANTIATE_TYPEINFO(tint::transform::AddBlockAttribute::BlockAttribute);
namespace tint::transform {
namespace {
bool IsUsedAsNonBuffer(const std::unordered_set<tint::ast::AddressSpace>& uses) {
for (auto use : uses) {
if (!ast::IsHostShareable(use)) {
return true;
}
}
return false;
}
} // namespace
AddBlockAttribute::AddBlockAttribute() = default;
AddBlockAttribute::~AddBlockAttribute() = default;
@ -47,25 +34,6 @@ AddBlockAttribute::~AddBlockAttribute() = default;
void AddBlockAttribute::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
auto& sem = ctx.src->Sem();
// Collect the set of structs that are nested in other types.
utils::Hashset<const sem::Struct*, 8> nested_structs;
for (auto* ty : ctx.src->Types()) {
Switch(
ty,
[&](const sem::Array* arr) {
if (auto* nested_str = arr->ElemType()->As<sem::Struct>()) {
nested_structs.Add(nested_str);
}
},
[&](const sem::Struct* str) {
for (auto* member : str->Members()) {
if (auto* nested_str = member->Type()->As<sem::Struct>()) {
nested_structs.Add(nested_str);
}
}
});
}
// A map from a type in the source program to a block-decorated wrapper that contains it in the
// destination program.
utils::Hashmap<const sem::Type*, const ast::Struct*, 8> wrapper_structs;
@ -80,16 +48,18 @@ void AddBlockAttribute::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
auto* ty = var->Type()->UnwrapRef();
auto* str = ty->As<sem::Struct>();
bool needs_wrapping =
!str || // Type is not a structure
nested_structs.Contains(str) || // Structure is nested by another type
IsUsedAsNonBuffer(str->AddressSpaceUsage()); // Structure is used as a non-buffer usage
// Always try to wrap the buffer type into a struct. We can not do so only if it is a struct
// but without a fixed footprint, i.e. contains a runtime-sized array as its member. Note
// that such struct type can be only used as storage buffer variables' type. Also note that
// any buffer struct type that may be nested by another type must have a fixed footprint,
// therefore will be wrapped.
bool needs_wrapping = !str || // Type is not a structure
str->HasFixedFootprint(); // Struct has a fixed footprint
if (needs_wrapping) {
const char* kMemberName = "inner";
// This is a non-struct or a struct that is nested somewhere else, so we
// need to wrap it first.
auto* wrapper = wrapper_structs.GetOrCreate(ty, [&] {
auto* block = ctx.dst->ASTNodes().Create<BlockAttribute>(ctx.dst->ID(),
ctx.dst->AllocateNodeID());

View File

@ -22,11 +22,8 @@
namespace tint::transform {
/// AddBlockAttribute is a transform that adds an
/// `@internal(block)` attribute to any structure that is used as the
/// store type of a buffer. If that structure is nested inside another structure
/// or an array, then it is wrapped inside another structure which gets the
/// `@internal(block)` attribute instead.
/// AddBlockAttribute is a transform that wrap the store type of a buffer into a struct if possible,
/// then adds an `@internal(block)` attribute to the wrapper struct.
class AddBlockAttribute final : public Castable<AddBlockAttribute, Transform> {
public:
/// BlockAttribute is an InternalAttribute that is used to decorate a

View File

@ -200,6 +200,85 @@ fn main() {
EXPECT_EQ(expect, str(got));
}
TEST_F(AddBlockAttributeTest, BasicStruct_Storage_AccessRoot) {
auto* src = R"(
struct S {
f : f32,
};
@group(0) @binding(0)
var<storage, read_write> s : S;
@fragment
fn main() {
let f = s;
}
)";
auto* expect = R"(
struct S {
f : f32,
}
@internal(block)
struct s_block {
inner : S,
}
@group(0) @binding(0) var<storage, read_write> s : s_block;
@fragment
fn main() {
let f = s.inner;
}
)";
auto got = Run<AddBlockAttribute>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(AddBlockAttributeTest, BasicStruct_Storage_TwoUsage_AccessRoot) {
auto* src = R"(
struct S {
f : f32,
};
@group(0) @binding(0)
var<storage, read_write> in : S;
@group(0) @binding(1)
var<storage, read_write> out : S;
@compute @workgroup_size(1)
fn main() {
out = in;
}
)";
auto* expect = R"(
struct S {
f : f32,
}
@internal(block)
struct in_block {
inner : S,
}
@group(0) @binding(0) var<storage, read_write> in : in_block;
@group(0) @binding(1) var<storage, read_write> out : in_block;
@compute @workgroup_size(1)
fn main() {
out.inner = in.inner;
}
)";
auto got = Run<AddBlockAttribute>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(AddBlockAttributeTest, BasicStruct_AccessField) {
auto* src = R"(
struct S {
@ -215,16 +294,20 @@ fn main() {
}
)";
auto* expect = R"(
@internal(block)
struct S {
f : f32,
}
@group(0) @binding(0) var<uniform> u : S;
@internal(block)
struct u_block {
inner : S,
}
@group(0) @binding(0) var<uniform> u : u_block;
@fragment
fn main() {
let f = u.f;
let f = u.inner.f;
}
)";
@ -280,16 +363,20 @@ fn main() {
auto* expect = R"(
enable chromium_experimental_push_constant;
@internal(block)
struct S {
f : f32,
}
var<push_constant> u : S;
@internal(block)
struct u_block {
inner : S,
}
var<push_constant> u : u_block;
@fragment
fn main() {
let f = u.f;
let f = u.inner.f;
}
)";
@ -321,16 +408,20 @@ struct Inner {
f : f32,
}
@internal(block)
struct Outer {
i : Inner,
}
@group(0) @binding(0) var<uniform> u : Outer;
@internal(block)
struct u_block {
inner : Outer,
}
@group(0) @binding(0) var<uniform> u : u_block;
@fragment
fn main() {
let f = u.i.f;
let f = u.inner.i.f;
}
)";
@ -366,12 +457,16 @@ struct Inner {
f : f32,
}
@internal(block)
struct Outer {
i : Inner,
}
@group(0) @binding(0) var<uniform> u0 : Outer;
@internal(block)
struct u0_block {
inner : Outer,
}
@group(0) @binding(0) var<uniform> u0 : u0_block;
@internal(block)
struct u1_block {
@ -382,7 +477,7 @@ struct u1_block {
@fragment
fn main() {
let f0 = u0.i.f;
let f0 = u0.inner.i.f;
let f1 = u1.inner.f;
}
)";
@ -474,12 +569,16 @@ struct Inner {
f : f32,
}
@internal(block)
struct S {
i : Inner,
}
@group(0) @binding(0) var<uniform> u0 : S;
@internal(block)
struct u0_block {
inner : S,
}
@group(0) @binding(0) var<uniform> u0 : u0_block;
@internal(block)
struct u1_block {
@ -492,7 +591,7 @@ struct u1_block {
@fragment
fn main() {
let f0 = u0.i.f;
let f0 = u0.inner.i.f;
let f1 = u1.inner.f;
let f2 = u2.inner.f;
}
@ -621,14 +720,18 @@ struct Inner {
type MyInner = Inner;
@internal(block)
struct Outer {
i : MyInner,
}
type MyOuter = Outer;
@group(0) @binding(0) var<uniform> u0 : MyOuter;
@internal(block)
struct u0_block {
inner : Outer,
}
@group(0) @binding(0) var<uniform> u0 : u0_block;
@internal(block)
struct u1_block {
@ -639,7 +742,7 @@ struct u1_block {
@fragment
fn main() {
let f0 = u0.i.f;
let f0 = u0.inner.i.f;
let f1 = u1.inner.f;
}
)";
@ -678,7 +781,7 @@ struct Inner {
auto* expect = R"(
@fragment
fn main() {
let f0 = u0.i.f;
let f0 = u0.inner.i.f;
let f1 = u1.inner.f;
}
@ -691,11 +794,15 @@ struct u1_block {
type MyInner = Inner;
@group(0) @binding(0) var<uniform> u0 : MyOuter;
@internal(block)
struct u0_block {
inner : Outer,
}
@group(0) @binding(0) var<uniform> u0 : u0_block;
type MyOuter = Outer;
@internal(block)
struct Outer {
i : MyInner,
}
@ -810,18 +917,22 @@ fn main() {
}
)";
auto* expect = R"(
@internal(block) @internal(block)
struct S {
f : f32,
}
@group(0) @binding(0) var<uniform> u : S;
@internal(block)
struct u_block {
inner : S,
}
@group(0) @binding(1) var<storage, read_write> s : S;
@group(0) @binding(0) var<uniform> u : u_block;
@group(0) @binding(1) var<storage, read_write> s : u_block;
@fragment
fn main() {
s = u;
s.inner = u.inner;
}
)";
@ -850,5 +961,65 @@ fn main() {
EXPECT_EQ(expect, str(got));
}
TEST_F(AddBlockAttributeTest, StorageBufferWithRuntimeArray) {
auto* src = R"(
struct S {
f : f32,
}
struct SWithArr {
f : f32,
arr : array<f32>,
}
@group(0) @binding(0)
var<storage, read> in_1 : S;
@group(0) @binding(1)
var<storage, read> in_2 : SWithArr;
@group(1) @binding(0)
var<storage, read_write> out : SWithArr;
@fragment
fn main() {
out.f = in_1.f;
out.arr[0] = in_2.arr[1];
}
)";
auto* expect = R"(
struct S {
f : f32,
}
@internal(block) @internal(block)
struct SWithArr {
f : f32,
arr : array<f32>,
}
@internal(block)
struct in_1_block {
inner : S,
}
@group(0) @binding(0) var<storage, read> in_1 : in_1_block;
@group(0) @binding(1) var<storage, read> in_2 : SWithArr;
@group(1) @binding(0) var<storage, read_write> out : SWithArr;
@fragment
fn main() {
out.f = in_1.inner.f;
out.arr[0] = in_2.arr[1];
}
)";
auto got = Run<AddBlockAttribute>(src);
EXPECT_EQ(expect, str(got));
}
} // namespace
} // namespace tint::transform

View File

@ -462,13 +462,17 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Attribute_EntryPoint_With_RW_Storage
EXPECT_EQ(gen.result(), R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
int a;
float b;
};
layout(binding = 0, std430) buffer coord_block_ssbo {
Data inner;
} coord;
void frag_main() {
float v = coord.b;
float v = coord.inner.b;
return;
}
@ -506,13 +510,17 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Attribute_EntryPoint_With_RO_Storage
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
int a;
float b;
};
layout(binding = 0, std430) buffer coord_block_ssbo {
Data inner;
} coord;
void frag_main() {
float v = coord.b;
float v = coord.inner.b;
return;
}
@ -547,13 +555,17 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Attribute_EntryPoint_With_WO_Storage
EXPECT_EQ(gen.result(), R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
int a;
float b;
};
layout(binding = 0, std430) buffer coord_block_ssbo {
Data inner;
} coord;
void frag_main() {
coord.b = 2.0f;
coord.inner.b = 2.0f;
return;
}
@ -588,13 +600,17 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Attribute_EntryPoint_With_StorageBuf
EXPECT_EQ(gen.result(), R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
int a;
float b;
};
layout(binding = 0, std430) buffer coord_block_ssbo {
Data inner;
} coord;
void frag_main() {
coord.b = 2.0f;
coord.inner.b = 2.0f;
return;
}
@ -678,12 +694,16 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Attribute_Called_By_EntryPoint_With_
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer S_ssbo {
struct S {
float x;
};
layout(binding = 0, std430) buffer coord_block_ssbo {
S inner;
} coord;
float sub_func(float param) {
return coord.x;
return coord.inner.x;
}
void frag_main() {
@ -895,12 +915,16 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Multiple_EntryPoint_With_Same_Module
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#version 310 es
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
float d;
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void a() {
float v = data.d;
float v = data.inner.d;
return;
}
@ -910,7 +934,7 @@ void main() {
return;
}
void b() {
float v = data.d;
float v = data.inner.d;
return;
}

View File

@ -179,27 +179,27 @@ TEST_P(GlslGeneratorImplTest_MemberAccessor_StorageBufferLoad, Test) {
INSTANTIATE_TEST_SUITE_P(GlslGeneratorImplTest_MemberAccessor,
GlslGeneratorImplTest_MemberAccessor_StorageBufferLoad,
testing::Values(TypeCase{ty_u32, "data.b"},
TypeCase{ty_f32, "data.b"},
TypeCase{ty_i32, "data.b"},
TypeCase{ty_vec2<u32>, "data.b"},
TypeCase{ty_vec2<f32>, "data.b"},
TypeCase{ty_vec2<i32>, "data.b"},
TypeCase{ty_vec3<u32>, "data.b"},
TypeCase{ty_vec3<f32>, "data.b"},
TypeCase{ty_vec3<i32>, "data.b"},
TypeCase{ty_vec4<u32>, "data.b"},
TypeCase{ty_vec4<f32>, "data.b"},
TypeCase{ty_vec4<i32>, "data.b"},
TypeCase{ty_mat2x2<f32>, "data.b"},
TypeCase{ty_mat2x3<f32>, "data.b"},
TypeCase{ty_mat2x4<f32>, "data.b"},
TypeCase{ty_mat3x2<f32>, "data.b"},
TypeCase{ty_mat3x3<f32>, "data.b"},
TypeCase{ty_mat3x4<f32>, "data.b"},
TypeCase{ty_mat4x2<f32>, "data.b"},
TypeCase{ty_mat4x3<f32>, "data.b"},
TypeCase{ty_mat4x4<f32>, "data.b"}));
testing::Values(TypeCase{ty_u32, "data.inner.b"},
TypeCase{ty_f32, "data.inner.b"},
TypeCase{ty_i32, "data.inner.b"},
TypeCase{ty_vec2<u32>, "data.inner.b"},
TypeCase{ty_vec2<f32>, "data.inner.b"},
TypeCase{ty_vec2<i32>, "data.inner.b"},
TypeCase{ty_vec3<u32>, "data.inner.b"},
TypeCase{ty_vec3<f32>, "data.inner.b"},
TypeCase{ty_vec3<i32>, "data.inner.b"},
TypeCase{ty_vec4<u32>, "data.inner.b"},
TypeCase{ty_vec4<f32>, "data.inner.b"},
TypeCase{ty_vec4<i32>, "data.inner.b"},
TypeCase{ty_mat2x2<f32>, "data.inner.b"},
TypeCase{ty_mat2x3<f32>, "data.inner.b"},
TypeCase{ty_mat2x4<f32>, "data.inner.b"},
TypeCase{ty_mat3x2<f32>, "data.inner.b"},
TypeCase{ty_mat3x3<f32>, "data.inner.b"},
TypeCase{ty_mat3x4<f32>, "data.inner.b"},
TypeCase{ty_mat4x2<f32>, "data.inner.b"},
TypeCase{ty_mat4x3<f32>, "data.inner.b"},
TypeCase{ty_mat4x4<f32>, "data.inner.b"}));
using GlslGeneratorImplTest_MemberAccessor_StorageBufferStore =
GlslGeneratorImplTest_MemberAccessorWithParam<TypeCase>;
@ -231,27 +231,27 @@ TEST_P(GlslGeneratorImplTest_MemberAccessor_StorageBufferStore, Test) {
INSTANTIATE_TEST_SUITE_P(GlslGeneratorImplTest_MemberAccessor,
GlslGeneratorImplTest_MemberAccessor_StorageBufferStore,
testing::Values(TypeCase{ty_u32, "data.b = value"},
TypeCase{ty_f32, "data.b = value"},
TypeCase{ty_i32, "data.b = value"},
TypeCase{ty_vec2<u32>, "data.b = value"},
TypeCase{ty_vec2<f32>, "data.b = value"},
TypeCase{ty_vec2<i32>, "data.b = value"},
TypeCase{ty_vec3<u32>, "data.b = value"},
TypeCase{ty_vec3<f32>, "data.b = value"},
TypeCase{ty_vec3<i32>, "data.b = value"},
TypeCase{ty_vec4<u32>, "data.b = value"},
TypeCase{ty_vec4<f32>, "data.b = value"},
TypeCase{ty_vec4<i32>, "data.b = value"},
TypeCase{ty_mat2x2<f32>, "data.b = value"},
TypeCase{ty_mat2x3<f32>, "data.b = value"},
TypeCase{ty_mat2x4<f32>, "data.b = value"},
TypeCase{ty_mat3x2<f32>, "data.b = value"},
TypeCase{ty_mat3x3<f32>, "data.b = value"},
TypeCase{ty_mat3x4<f32>, "data.b = value"},
TypeCase{ty_mat4x2<f32>, "data.b = value"},
TypeCase{ty_mat4x3<f32>, "data.b = value"},
TypeCase{ty_mat4x4<f32>, "data.b = value"}));
testing::Values(TypeCase{ty_u32, "data.inner.b = value"},
TypeCase{ty_f32, "data.inner.b = value"},
TypeCase{ty_i32, "data.inner.b = value"},
TypeCase{ty_vec2<u32>, "data.inner.b = value"},
TypeCase{ty_vec2<f32>, "data.inner.b = value"},
TypeCase{ty_vec2<i32>, "data.inner.b = value"},
TypeCase{ty_vec3<u32>, "data.inner.b = value"},
TypeCase{ty_vec3<f32>, "data.inner.b = value"},
TypeCase{ty_vec3<i32>, "data.inner.b = value"},
TypeCase{ty_vec4<u32>, "data.inner.b = value"},
TypeCase{ty_vec4<f32>, "data.inner.b = value"},
TypeCase{ty_vec4<i32>, "data.inner.b = value"},
TypeCase{ty_mat2x2<f32>, "data.inner.b = value"},
TypeCase{ty_mat2x3<f32>, "data.inner.b = value"},
TypeCase{ty_mat2x4<f32>, "data.inner.b = value"},
TypeCase{ty_mat3x2<f32>, "data.inner.b = value"},
TypeCase{ty_mat3x3<f32>, "data.inner.b = value"},
TypeCase{ty_mat3x4<f32>, "data.inner.b = value"},
TypeCase{ty_mat4x2<f32>, "data.inner.b = value"},
TypeCase{ty_mat4x3<f32>, "data.inner.b = value"},
TypeCase{ty_mat4x4<f32>, "data.inner.b = value"}));
TEST_F(GlslGeneratorImplTest_MemberAccessor, StorageBuffer_Store_Matrix_Empty) {
// struct Data {
@ -277,16 +277,20 @@ TEST_F(GlslGeneratorImplTest_MemberAccessor, StorageBuffer_Store_Matrix_Empty) {
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
int a;
uint pad;
uint pad_1;
uint pad_2;
mat2x3 b;
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
data.b = mat2x3(vec3(0.0f), vec3(0.0f));
data.inner.b = mat2x3(vec3(0.0f), vec3(0.0f));
}
void main() {
@ -321,16 +325,20 @@ TEST_F(GlslGeneratorImplTest_MemberAccessor, StorageBuffer_Load_Matrix_Single_El
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
float z;
uint pad;
uint pad_1;
uint pad_2;
mat4x3 a;
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
float x = data.a[2][1];
float x = data.inner.a[2][1];
}
void main() {
@ -365,13 +373,17 @@ TEST_F(GlslGeneratorImplTest_MemberAccessor,
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
float z;
int a[5];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
int x = data.a[2];
int x = data.inner.a[2];
}
void main() {
@ -409,16 +421,20 @@ TEST_F(GlslGeneratorImplTest_MemberAccessor,
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
float z;
int a[5];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
int a = 2;
int b = 4;
int c = 3;
int x = data.a[((a + b) - c)];
int x = data.inner.a[((a + b) - c)];
}
void main() {
@ -452,13 +468,17 @@ TEST_F(GlslGeneratorImplTest_MemberAccessor, StorageBuffer_Store_ToArray) {
R"(#version 310 es
precision mediump float;
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
float z;
int a[5];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
data.a[2] = 2;
data.inner.a[2] = 2;
}
void main() {
@ -508,12 +528,16 @@ struct Inner {
uint pad_1;
};
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
Inner c[4];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
vec3 x = data.c[2].b;
vec3 x = data.inner.c[2].b;
}
void main() {
@ -565,12 +589,16 @@ struct Inner {
uint pad_1;
};
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
Inner c[4];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
vec2 x = data.c[2].b.xy;
vec2 x = data.inner.c[2].b.xy;
}
void main() {
@ -623,12 +651,16 @@ struct Inner {
uint pad_1;
};
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
Inner c[4];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
float x = data.c[2].b.g;
float x = data.inner.c[2].b.g;
}
void main() {
@ -680,12 +712,16 @@ struct Inner {
uint pad_1;
};
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
Inner c[4];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
float x = data.c[2].b[1];
float x = data.inner.c[2].b[1];
}
void main() {
@ -736,12 +772,16 @@ struct Inner {
uint pad_1;
};
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
Inner c[4];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
data.c[2].b = vec3(1.0f, 2.0f, 3.0f);
data.inner.c[2].b = vec3(1.0f, 2.0f, 3.0f);
}
void main() {
@ -793,12 +833,16 @@ struct Inner {
uint pad_1;
};
layout(binding = 0, std430) buffer Data_ssbo {
struct Data {
Inner c[4];
};
layout(binding = 0, std430) buffer data_block_ssbo {
Data inner;
} data;
void tint_symbol() {
data.c[2].b.y = 1.0f;
data.inner.c[2].b.y = 1.0f;
}
void main() {

View File

@ -3340,25 +3340,26 @@ TEST_F(BuiltinBuilderTest, Call_AtomicLoad) {
ASSERT_EQ(b.functions().size(), 1_u);
auto* expected_types = R"(%4 = OpTypeInt 32 0
%5 = OpTypeInt 32 1
%3 = OpTypeStruct %4 %5
auto* expected_types = R"(%5 = OpTypeInt 32 0
%6 = OpTypeInt 32 1
%4 = OpTypeStruct %5 %6
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%11 = OpConstant %4 1
%12 = OpConstant %4 0
%14 = OpTypePointer StorageBuffer %4
%18 = OpTypePointer StorageBuffer %5
%8 = OpTypeVoid
%7 = OpTypeFunction %8
%12 = OpConstant %5 1
%13 = OpConstant %5 0
%15 = OpTypePointer StorageBuffer %5
%19 = OpTypePointer StorageBuffer %6
)";
auto got_types = DumpInstructions(b.types());
EXPECT_EQ(expected_types, got_types);
auto* expected_instructions = R"(%15 = OpAccessChain %14 %1 %12
%10 = OpAtomicLoad %4 %15 %11 %12
%19 = OpAccessChain %18 %1 %11
%16 = OpAtomicLoad %5 %19 %11 %12
auto* expected_instructions = R"(%16 = OpAccessChain %15 %1 %13 %13
%11 = OpAtomicLoad %5 %16 %12 %13
%20 = OpAccessChain %19 %1 %13 %12
%17 = OpAtomicLoad %6 %20 %12 %13
OpReturn
)";
auto got_instructions = DumpInstructions(b.functions()[0].instructions());
@ -3405,34 +3406,35 @@ TEST_F(BuiltinBuilderTest, Call_AtomicStore) {
ASSERT_EQ(b.functions().size(), 1_u);
auto* expected_types = R"(%4 = OpTypeInt 32 0
%5 = OpTypeInt 32 1
%3 = OpTypeStruct %4 %5
auto* expected_types = R"(%5 = OpTypeInt 32 0
%6 = OpTypeInt 32 1
%4 = OpTypeStruct %5 %6
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%10 = OpConstant %4 1
%12 = OpTypePointer Function %4
%13 = OpConstantNull %4
%14 = OpConstant %5 2
%16 = OpTypePointer Function %5
%17 = OpConstantNull %5
%19 = OpConstant %4 0
%21 = OpTypePointer StorageBuffer %4
%26 = OpTypePointer StorageBuffer %5
%8 = OpTypeVoid
%7 = OpTypeFunction %8
%11 = OpConstant %5 1
%13 = OpTypePointer Function %5
%14 = OpConstantNull %5
%15 = OpConstant %6 2
%17 = OpTypePointer Function %6
%18 = OpConstantNull %6
%20 = OpConstant %5 0
%22 = OpTypePointer StorageBuffer %5
%27 = OpTypePointer StorageBuffer %6
)";
auto got_types = DumpInstructions(b.types());
EXPECT_EQ(expected_types, got_types);
auto* expected_instructions = R"(OpStore %11 %10
OpStore %15 %14
%22 = OpAccessChain %21 %1 %19
%23 = OpLoad %4 %11
OpAtomicStore %22 %10 %19 %23
%27 = OpAccessChain %26 %1 %10
%28 = OpLoad %5 %15
OpAtomicStore %27 %10 %19 %28
auto* expected_instructions = R"(OpStore %12 %11
OpStore %16 %15
%23 = OpAccessChain %22 %1 %20 %20
%24 = OpLoad %5 %12
OpAtomicStore %23 %11 %20 %24
%28 = OpAccessChain %27 %1 %20 %11
%29 = OpLoad %6 %16
OpAtomicStore %28 %11 %20 %29
OpReturn
)";
auto got_instructions = DumpInstructions(b.functions()[0].instructions());
@ -3475,28 +3477,29 @@ TEST_P(Builtin_Builder_AtomicRMW_i32, Test) {
ASSERT_EQ(b.functions().size(), 1_u);
std::string expected_types = R"(%4 = OpTypeInt 32 1
std::string expected_types = R"(%5 = OpTypeInt 32 1
%4 = OpTypeStruct %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%6 = OpTypeVoid
%5 = OpTypeFunction %6
%9 = OpConstant %4 10
%11 = OpTypePointer Function %4
%12 = OpConstantNull %4
%14 = OpTypeInt 32 0
%15 = OpConstant %14 1
%16 = OpConstant %14 0
%18 = OpTypePointer StorageBuffer %4
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%10 = OpConstant %5 10
%12 = OpTypePointer Function %5
%13 = OpConstantNull %5
%15 = OpTypeInt 32 0
%16 = OpConstant %15 1
%17 = OpConstant %15 0
%19 = OpTypePointer StorageBuffer %5
)";
auto got_types = DumpInstructions(b.types());
EXPECT_EQ(expected_types, got_types);
std::string expected_instructions = R"(OpStore %10 %9
%19 = OpAccessChain %18 %1 %16
%20 = OpLoad %4 %10
std::string expected_instructions = R"(OpStore %11 %10
%20 = OpAccessChain %19 %1 %17 %17
%21 = OpLoad %5 %11
)";
expected_instructions += "%13 = " + GetParam().op + " %4 %19 %15 %16 %20\n";
expected_instructions += "%14 = " + GetParam().op + " %5 %20 %16 %17 %21\n";
expected_instructions += "OpReturn\n";
auto got_instructions = DumpInstructions(b.functions()[0].instructions());
@ -3547,27 +3550,28 @@ TEST_P(Builtin_Builder_AtomicRMW_u32, Test) {
ASSERT_EQ(b.functions().size(), 1_u);
std::string expected_types = R"(%4 = OpTypeInt 32 0
std::string expected_types = R"(%5 = OpTypeInt 32 0
%4 = OpTypeStruct %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%6 = OpTypeVoid
%5 = OpTypeFunction %6
%9 = OpConstant %4 10
%11 = OpTypePointer Function %4
%12 = OpConstantNull %4
%14 = OpConstant %4 1
%15 = OpConstant %4 0
%17 = OpTypePointer StorageBuffer %4
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%10 = OpConstant %5 10
%12 = OpTypePointer Function %5
%13 = OpConstantNull %5
%15 = OpConstant %5 1
%16 = OpConstant %5 0
%18 = OpTypePointer StorageBuffer %5
)";
auto got_types = DumpInstructions(b.types());
EXPECT_EQ(expected_types, got_types);
std::string expected_instructions = R"(OpStore %10 %9
%18 = OpAccessChain %17 %1 %15
%19 = OpLoad %4 %10
std::string expected_instructions = R"(OpStore %11 %10
%19 = OpAccessChain %18 %1 %16 %16
%20 = OpLoad %5 %11
)";
expected_instructions += "%13 = " + GetParam().op + " %4 %18 %14 %15 %19\n";
expected_instructions += "%14 = " + GetParam().op + " %5 %19 %15 %16 %20\n";
expected_instructions += "OpReturn\n";
auto got_instructions = DumpInstructions(b.functions()[0].instructions());
@ -3624,35 +3628,36 @@ TEST_F(BuiltinBuilderTest, Call_AtomicExchange) {
ASSERT_EQ(b.functions().size(), 1_u);
auto* expected_types = R"(%4 = OpTypeInt 32 0
%5 = OpTypeInt 32 1
%3 = OpTypeStruct %4 %5
auto* expected_types = R"(%5 = OpTypeInt 32 0
%6 = OpTypeInt 32 1
%4 = OpTypeStruct %5 %6
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%10 = OpConstant %4 10
%12 = OpTypePointer Function %4
%13 = OpConstantNull %4
%14 = OpConstant %5 10
%16 = OpTypePointer Function %5
%17 = OpConstantNull %5
%19 = OpConstant %4 1
%20 = OpConstant %4 0
%22 = OpTypePointer StorageBuffer %4
%27 = OpTypePointer StorageBuffer %5
%8 = OpTypeVoid
%7 = OpTypeFunction %8
%11 = OpConstant %5 10
%13 = OpTypePointer Function %5
%14 = OpConstantNull %5
%15 = OpConstant %6 10
%17 = OpTypePointer Function %6
%18 = OpConstantNull %6
%20 = OpConstant %5 1
%21 = OpConstant %5 0
%23 = OpTypePointer StorageBuffer %5
%28 = OpTypePointer StorageBuffer %6
)";
auto got_types = DumpInstructions(b.types());
EXPECT_EQ(expected_types, got_types);
auto* expected_instructions = R"(OpStore %11 %10
OpStore %15 %14
%23 = OpAccessChain %22 %1 %20
%24 = OpLoad %4 %11
%18 = OpAtomicExchange %4 %23 %19 %20 %24
%28 = OpAccessChain %27 %1 %19
%29 = OpLoad %5 %15
%25 = OpAtomicExchange %5 %28 %19 %20 %29
auto* expected_instructions = R"(OpStore %12 %11
OpStore %16 %15
%24 = OpAccessChain %23 %1 %21 %21
%25 = OpLoad %5 %12
%19 = OpAtomicExchange %5 %24 %20 %21 %25
%29 = OpAccessChain %28 %1 %21 %20
%30 = OpLoad %6 %16
%26 = OpAtomicExchange %6 %29 %20 %21 %30
OpReturn
)";
auto got_instructions = DumpInstructions(b.functions()[0].instructions());
@ -3697,36 +3702,37 @@ TEST_F(BuiltinBuilderTest, Call_AtomicCompareExchangeWeak) {
ASSERT_EQ(b.functions().size(), 1_u);
auto* expected_types = R"(%4 = OpTypeInt 32 0
%5 = OpTypeInt 32 1
%3 = OpTypeStruct %4 %5
auto* expected_types = R"(%5 = OpTypeInt 32 0
%6 = OpTypeInt 32 1
%4 = OpTypeStruct %5 %6
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%12 = OpTypeBool
%11 = OpTypeStruct %4 %12
%13 = OpConstant %4 1
%14 = OpConstant %4 0
%16 = OpTypePointer StorageBuffer %4
%18 = OpConstant %4 20
%19 = OpConstant %4 10
%23 = OpTypeStruct %5 %12
%25 = OpTypePointer StorageBuffer %5
%27 = OpConstant %5 20
%28 = OpConstant %5 10
%8 = OpTypeVoid
%7 = OpTypeFunction %8
%13 = OpTypeBool
%12 = OpTypeStruct %5 %13
%14 = OpConstant %5 1
%15 = OpConstant %5 0
%17 = OpTypePointer StorageBuffer %5
%19 = OpConstant %5 20
%20 = OpConstant %5 10
%24 = OpTypeStruct %6 %13
%26 = OpTypePointer StorageBuffer %6
%28 = OpConstant %6 20
%29 = OpConstant %6 10
)";
auto got_types = DumpInstructions(b.types());
EXPECT_EQ(expected_types, got_types);
auto* expected_instructions = R"(%17 = OpAccessChain %16 %1 %14
%20 = OpAtomicCompareExchange %4 %17 %13 %14 %14 %18 %19
%21 = OpIEqual %12 %20 %19
%10 = OpCompositeConstruct %11 %20 %21
%26 = OpAccessChain %25 %1 %13
%29 = OpAtomicCompareExchange %5 %26 %13 %14 %14 %27 %28
%30 = OpIEqual %12 %29 %28
%22 = OpCompositeConstruct %23 %29 %30
auto* expected_instructions = R"(%18 = OpAccessChain %17 %1 %15 %15
%21 = OpAtomicCompareExchange %5 %18 %14 %15 %15 %19 %20
%22 = OpIEqual %13 %21 %20
%11 = OpCompositeConstruct %12 %21 %22
%27 = OpAccessChain %26 %1 %15 %14
%30 = OpAtomicCompareExchange %6 %27 %14 %15 %15 %28 %29
%31 = OpIEqual %13 %30 %29
%23 = OpCompositeConstruct %24 %30 %31
OpReturn
)";
auto got_instructions = DumpInstructions(b.functions()[0].instructions());

View File

@ -228,46 +228,50 @@ TEST_F(BuilderTest, Emit_Multiple_EntryPoint_With_Same_ModuleVar) {
ASSERT_TRUE(b.Build());
EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %7 "a"
OpEntryPoint GLCompute %17 "b"
OpExecutionMode %7 LocalSize 1 1 1
OpExecutionMode %17 LocalSize 1 1 1
OpName %3 "Data"
OpMemberName %3 0 "d"
OpEntryPoint GLCompute %8 "a"
OpEntryPoint GLCompute %18 "b"
OpExecutionMode %8 LocalSize 1 1 1
OpExecutionMode %18 LocalSize 1 1 1
OpName %3 "data_block"
OpMemberName %3 0 "inner"
OpName %4 "Data"
OpMemberName %4 0 "d"
OpName %1 "data"
OpName %7 "a"
OpName %14 "v"
OpName %17 "b"
OpName %21 "v"
OpName %8 "a"
OpName %15 "v"
OpName %18 "b"
OpName %22 "v"
OpDecorate %3 Block
OpMemberDecorate %3 0 Offset 0
OpMemberDecorate %4 0 Offset 0
OpDecorate %1 Binding 0
OpDecorate %1 DescriptorSet 0
%4 = OpTypeFloat 32
%5 = OpTypeFloat 32
%4 = OpTypeStruct %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%6 = OpTypeVoid
%5 = OpTypeFunction %6
%9 = OpTypeInt 32 0
%10 = OpConstant %9 0
%11 = OpTypePointer StorageBuffer %4
%15 = OpTypePointer Function %4
%16 = OpConstantNull %4
%7 = OpFunction %6 None %5
%8 = OpLabel
%14 = OpVariable %15 Function %16
%12 = OpAccessChain %11 %1 %10
%13 = OpLoad %4 %12
OpStore %14 %13
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%10 = OpTypeInt 32 0
%11 = OpConstant %10 0
%12 = OpTypePointer StorageBuffer %5
%16 = OpTypePointer Function %5
%17 = OpConstantNull %5
%8 = OpFunction %7 None %6
%9 = OpLabel
%15 = OpVariable %16 Function %17
%13 = OpAccessChain %12 %1 %11 %11
%14 = OpLoad %5 %13
OpStore %15 %14
OpReturn
OpFunctionEnd
%17 = OpFunction %6 None %5
%18 = OpLabel
%21 = OpVariable %15 Function %16
%19 = OpAccessChain %11 %1 %10
%20 = OpLoad %4 %19
OpStore %21 %20
%18 = OpFunction %7 None %6
%19 = OpLabel
%22 = OpVariable %16 Function %17
%20 = OpAccessChain %12 %1 %11 %11
%21 = OpLoad %5 %20
OpStore %22 %21
OpReturn
OpFunctionEnd
)");

View File

@ -316,23 +316,27 @@ TEST_F(BuilderTest, GlobalVar_DeclReadOnly) {
EXPECT_EQ(DumpInstructions(b.annots()), R"(OpDecorate %3 Block
OpMemberDecorate %3 0 Offset 0
OpMemberDecorate %3 1 Offset 4
OpMemberDecorate %4 0 Offset 0
OpMemberDecorate %4 1 Offset 4
OpDecorate %1 NonWritable
OpDecorate %1 Binding 0
OpDecorate %1 DescriptorSet 0
)");
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "A"
OpMemberName %3 0 "a"
OpMemberName %3 1 "b"
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "b_block"
OpMemberName %3 0 "inner"
OpName %4 "A"
OpMemberName %4 0 "a"
OpMemberName %4 1 "b"
OpName %1 "b"
OpName %7 "unused_entry_point"
OpName %8 "unused_entry_point"
)");
EXPECT_EQ(DumpInstructions(b.types()), R"(%4 = OpTypeInt 32 1
%3 = OpTypeStruct %4 %4
EXPECT_EQ(DumpInstructions(b.types()), R"(%5 = OpTypeInt 32 1
%4 = OpTypeStruct %5 %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%6 = OpTypeVoid
%5 = OpTypeFunction %6
%7 = OpTypeVoid
%6 = OpTypeFunction %7
)");
}
@ -354,21 +358,25 @@ TEST_F(BuilderTest, GlobalVar_TypeAliasDeclReadOnly) {
EXPECT_EQ(DumpInstructions(b.annots()), R"(OpDecorate %3 Block
OpMemberDecorate %3 0 Offset 0
OpMemberDecorate %4 0 Offset 0
OpDecorate %1 NonWritable
OpDecorate %1 Binding 0
OpDecorate %1 DescriptorSet 0
)");
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "A"
OpMemberName %3 0 "a"
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "b_block"
OpMemberName %3 0 "inner"
OpName %4 "A"
OpMemberName %4 0 "a"
OpName %1 "b"
OpName %7 "unused_entry_point"
OpName %8 "unused_entry_point"
)");
EXPECT_EQ(DumpInstructions(b.types()), R"(%4 = OpTypeInt 32 1
EXPECT_EQ(DumpInstructions(b.types()), R"(%5 = OpTypeInt 32 1
%4 = OpTypeStruct %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%6 = OpTypeVoid
%5 = OpTypeFunction %6
%7 = OpTypeVoid
%6 = OpTypeFunction %7
)");
}
@ -390,21 +398,25 @@ TEST_F(BuilderTest, GlobalVar_TypeAliasAssignReadOnly) {
EXPECT_EQ(DumpInstructions(b.annots()), R"(OpDecorate %3 Block
OpMemberDecorate %3 0 Offset 0
OpMemberDecorate %4 0 Offset 0
OpDecorate %1 NonWritable
OpDecorate %1 Binding 0
OpDecorate %1 DescriptorSet 0
)");
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "A"
OpMemberName %3 0 "a"
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "b_block"
OpMemberName %3 0 "inner"
OpName %4 "A"
OpMemberName %4 0 "a"
OpName %1 "b"
OpName %7 "unused_entry_point"
OpName %8 "unused_entry_point"
)");
EXPECT_EQ(DumpInstructions(b.types()), R"(%4 = OpTypeInt 32 1
EXPECT_EQ(DumpInstructions(b.types()), R"(%5 = OpTypeInt 32 1
%4 = OpTypeStruct %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%6 = OpTypeVoid
%5 = OpTypeFunction %6
%7 = OpTypeVoid
%6 = OpTypeFunction %7
)");
}
@ -428,25 +440,29 @@ TEST_F(BuilderTest, GlobalVar_TwoVarDeclReadOnly) {
EXPECT_EQ(DumpInstructions(b.annots()),
R"(OpDecorate %3 Block
OpMemberDecorate %3 0 Offset 0
OpMemberDecorate %4 0 Offset 0
OpDecorate %1 NonWritable
OpDecorate %1 DescriptorSet 0
OpDecorate %1 Binding 0
OpDecorate %5 DescriptorSet 1
OpDecorate %5 Binding 0
OpDecorate %6 DescriptorSet 1
OpDecorate %6 Binding 0
)");
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "A"
OpMemberName %3 0 "a"
EXPECT_EQ(DumpInstructions(b.debug()), R"(OpName %3 "b_block"
OpMemberName %3 0 "inner"
OpName %4 "A"
OpMemberName %4 0 "a"
OpName %1 "b"
OpName %5 "c"
OpName %8 "unused_entry_point"
OpName %6 "c"
OpName %9 "unused_entry_point"
)");
EXPECT_EQ(DumpInstructions(b.types()), R"(%4 = OpTypeInt 32 1
EXPECT_EQ(DumpInstructions(b.types()), R"(%5 = OpTypeInt 32 1
%4 = OpTypeStruct %5
%3 = OpTypeStruct %4
%2 = OpTypePointer StorageBuffer %3
%1 = OpVariable %2 StorageBuffer
%5 = OpVariable %2 StorageBuffer
%7 = OpTypeVoid
%6 = OpTypeFunction %7
%6 = OpVariable %2 StorageBuffer
%8 = OpTypeVoid
%7 = OpTypeFunction %8
)");
}

View File

@ -8,6 +8,10 @@ struct S {
ivec4 arr[4];
};
struct S_nested {
int arr[4][3][2];
};
ivec4 src_private[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
shared ivec4 src_workgroup[4];
layout(binding = 0, std140) uniform src_uniform_block_ubo {
@ -22,8 +26,8 @@ layout(binding = 2, std430) buffer src_uniform_block_ssbo_1 {
S inner;
} dst;
layout(binding = 3, std430) buffer S_nested_ssbo {
int arr[4][3][2];
layout(binding = 3, std430) buffer dst_nested_block_ssbo {
S_nested inner;
} dst_nested;
ivec4[4] ret_arr() {
@ -53,6 +57,6 @@ void foo(ivec4 src_param[4]) {
dst.inner.arr = src_uniform.inner.arr;
dst.inner.arr = src_storage.inner.arr;
int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
dst_nested.arr = src_nested;
dst_nested.inner.arr = src_nested;
}

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 79
; Bound: 80
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -16,6 +16,8 @@
OpName %src_uniform "src_uniform"
OpName %src_storage "src_storage"
OpName %dst "dst"
OpName %dst_nested_block "dst_nested_block"
OpMemberName %dst_nested_block 0 "inner"
OpName %S_nested "S_nested"
OpMemberName %S_nested 0 "arr"
OpName %dst_nested "dst_nested"
@ -37,7 +39,8 @@
OpDecorate %src_storage Binding 1
OpDecorate %dst DescriptorSet 0
OpDecorate %dst Binding 2
OpDecorate %S_nested Block
OpDecorate %dst_nested_block Block
OpMemberDecorate %dst_nested_block 0 Offset 0
OpMemberDecorate %S_nested 0 Offset 0
OpDecorate %_arr_int_uint_2 ArrayStride 4
OpDecorate %_arr__arr_int_uint_2_uint_3 ArrayStride 8
@ -67,77 +70,78 @@
%_arr__arr_int_uint_2_uint_3 = OpTypeArray %_arr_int_uint_2 %uint_3
%_arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypeArray %_arr__arr_int_uint_2_uint_3 %uint_4
%S_nested = OpTypeStruct %_arr__arr__arr_int_uint_2_uint_3_uint_4
%_ptr_StorageBuffer_S_nested = OpTypePointer StorageBuffer %S_nested
%dst_nested = OpVariable %_ptr_StorageBuffer_S_nested StorageBuffer
%dst_nested_block = OpTypeStruct %S_nested
%_ptr_StorageBuffer_dst_nested_block = OpTypePointer StorageBuffer %dst_nested_block
%dst_nested = OpVariable %_ptr_StorageBuffer_dst_nested_block StorageBuffer
%void = OpTypeVoid
%26 = OpTypeFunction %void
%30 = OpTypeFunction %_arr_v4int_uint_4
%33 = OpTypeFunction %S
%36 = OpConstantNull %S
%37 = OpTypeFunction %void %_arr_v4int_uint_4
%27 = OpTypeFunction %void
%31 = OpTypeFunction %_arr_v4int_uint_4
%34 = OpTypeFunction %S
%37 = OpConstantNull %S
%38 = OpTypeFunction %void %_arr_v4int_uint_4
%_ptr_Function__arr_v4int_uint_4 = OpTypePointer Function %_arr_v4int_uint_4
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer__arr_v4int_uint_4 = OpTypePointer StorageBuffer %_arr_v4int_uint_4
%int_1 = OpConstant %int 1
%47 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%48 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%int_2 = OpConstant %int 2
%49 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
%50 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
%int_3 = OpConstant %int 3
%51 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3
%52 = OpConstantComposite %_arr_v4int_uint_4 %47 %49 %51 %51
%52 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3
%53 = OpConstantComposite %_arr_v4int_uint_4 %48 %50 %52 %52
%_ptr_Uniform__arr_v4int_uint_4 = OpTypePointer Uniform %_arr_v4int_uint_4
%_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4
%75 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
%76 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
%_ptr_StorageBuffer__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer StorageBuffer %_arr__arr__arr_int_uint_2_uint_3_uint_4
%unused_entry_point = OpFunction %void None %26
%29 = OpLabel
%unused_entry_point = OpFunction %void None %27
%30 = OpLabel
OpReturn
OpFunctionEnd
%ret_arr = OpFunction %_arr_v4int_uint_4 None %30
%32 = OpLabel
%ret_arr = OpFunction %_arr_v4int_uint_4 None %31
%33 = OpLabel
OpReturnValue %8
OpFunctionEnd
%ret_struct_arr = OpFunction %S None %33
%35 = OpLabel
OpReturnValue %36
%ret_struct_arr = OpFunction %S None %34
%36 = OpLabel
OpReturnValue %37
OpFunctionEnd
%foo = OpFunction %void None %37
%foo = OpFunction %void None %38
%src_param = OpFunctionParameter %_arr_v4int_uint_4
%40 = OpLabel
%41 = OpLabel
%src_function = OpVariable %_ptr_Function__arr_v4int_uint_4 Function %8
%src_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %75
%45 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
OpStore %45 %52
%53 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
OpStore %53 %src_param
%54 = OpFunctionCall %_arr_v4int_uint_4 %ret_arr
%55 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
OpStore %55 %54
%src_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %76
%46 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
OpStore %46 %53
%54 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
OpStore %54 %src_param
%55 = OpFunctionCall %_arr_v4int_uint_4 %ret_arr
%56 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
OpStore %56 %8
OpStore %56 %55
%57 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%58 = OpLoad %_arr_v4int_uint_4 %src_function
OpStore %57 %58
%59 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%60 = OpLoad %_arr_v4int_uint_4 %src_private
OpStore %59 %60
%61 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%62 = OpLoad %_arr_v4int_uint_4 %src_workgroup
OpStore %61 %62
%63 = OpFunctionCall %S %ret_struct_arr
%64 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%65 = OpCompositeExtract %_arr_v4int_uint_4 %63 0
OpStore %64 %65
%66 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%68 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %src_uniform %uint_0 %uint_0
%69 = OpLoad %_arr_v4int_uint_4 %68
OpStore %66 %69
%70 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%71 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %src_storage %uint_0 %uint_0
%72 = OpLoad %_arr_v4int_uint_4 %71
OpStore %70 %72
%77 = OpAccessChain %_ptr_StorageBuffer__arr__arr__arr_int_uint_2_uint_3_uint_4 %dst_nested %uint_0
%78 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %src_nested
OpStore %77 %78
OpStore %57 %8
%58 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%59 = OpLoad %_arr_v4int_uint_4 %src_function
OpStore %58 %59
%60 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%61 = OpLoad %_arr_v4int_uint_4 %src_private
OpStore %60 %61
%62 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%63 = OpLoad %_arr_v4int_uint_4 %src_workgroup
OpStore %62 %63
%64 = OpFunctionCall %S %ret_struct_arr
%65 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%66 = OpCompositeExtract %_arr_v4int_uint_4 %64 0
OpStore %65 %66
%67 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%69 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %src_uniform %uint_0 %uint_0
%70 = OpLoad %_arr_v4int_uint_4 %69
OpStore %67 %70
%71 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %dst %uint_0 %uint_0
%72 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %src_storage %uint_0 %uint_0
%73 = OpLoad %_arr_v4int_uint_4 %72
OpStore %71 %73
%78 = OpAccessChain %_ptr_StorageBuffer__arr__arr__arr_int_uint_2_uint_3_uint_4 %dst_nested %uint_0 %uint_0
%79 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %src_nested
OpStore %78 %79
OpReturn
OpFunctionEnd

View File

@ -29,18 +29,22 @@ struct strided_arr_1 {
uint pad_20;
};
layout(binding = 0, std430) buffer S_ssbo {
struct S {
strided_arr_1 a[4];
};
layout(binding = 0, std430) buffer s_block_ssbo {
S inner;
} s;
void f_1() {
strided_arr_1 x_19[4] = s.a;
strided_arr x_24[3][2] = s.a[3].el;
strided_arr x_28[2] = s.a[3].el[2];
float x_32 = s.a[3].el[2][1].el;
strided_arr_1 x_19[4] = s.inner.a;
strided_arr x_24[3][2] = s.inner.a[3].el;
strided_arr x_28[2] = s.inner.a[3].el[2];
float x_32 = s.inner.a[3].el[2][1].el;
strided_arr_1 tint_symbol[4] = strided_arr_1[4](strided_arr_1(strided_arr[3][2](strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u))), 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u), strided_arr_1(strided_arr[3][2](strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u))), 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u), strided_arr_1(strided_arr[3][2](strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u))), 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u), strided_arr_1(strided_arr[3][2](strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u)), strided_arr[2](strided_arr(0.0f, 0u), strided_arr(0.0f, 0u))), 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u));
s.a = tint_symbol;
s.a[3].el[2][1].el = 5.0f;
s.inner.a = tint_symbol;
s.inner.a[3].el[2][1].el = 5.0f;
return;
}

View File

@ -1,12 +1,14 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 42
; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %s_block "s_block"
OpMemberName %s_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "a"
OpName %strided_arr_1 "strided_arr_1"
@ -16,7 +18,8 @@
OpName %s "s"
OpName %f_1 "f_1"
OpName %f "f"
OpDecorate %S Block
OpDecorate %s_block Block
OpMemberDecorate %s_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %strided_arr_1 0 Offset 0
OpMemberDecorate %strided_arr 0 Offset 0
@ -36,10 +39,11 @@
%uint_4 = OpConstant %uint 4
%_arr_strided_arr_1_uint_4 = OpTypeArray %strided_arr_1 %uint_4
%S = OpTypeStruct %_arr_strided_arr_1_uint_4
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%s = OpVariable %_ptr_StorageBuffer_S StorageBuffer
%s_block = OpTypeStruct %S
%_ptr_StorageBuffer_s_block = OpTypePointer StorageBuffer %s_block
%s = OpVariable %_ptr_StorageBuffer_s_block StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%15 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer__arr_strided_arr_1_uint_4 = OpTypePointer StorageBuffer %_arr_strided_arr_1_uint_4
%int = OpTypeInt 32 1
@ -49,26 +53,26 @@
%_ptr_StorageBuffer__arr_strided_arr_uint_2 = OpTypePointer StorageBuffer %_arr_strided_arr_uint_2
%int_1 = OpConstant %int 1
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%36 = OpConstantNull %_arr_strided_arr_1_uint_4
%37 = OpConstantNull %_arr_strided_arr_1_uint_4
%float_5 = OpConstant %float 5
%f_1 = OpFunction %void None %14
%17 = OpLabel
%20 = OpAccessChain %_ptr_StorageBuffer__arr_strided_arr_1_uint_4 %s %uint_0
%21 = OpLoad %_arr_strided_arr_1_uint_4 %20
%25 = OpAccessChain %_ptr_StorageBuffer__arr__arr_strided_arr_uint_2_uint_3 %s %uint_0 %int_3 %uint_0
%26 = OpLoad %_arr__arr_strided_arr_uint_2_uint_3 %25
%29 = OpAccessChain %_ptr_StorageBuffer__arr_strided_arr_uint_2 %s %uint_0 %int_3 %uint_0 %int_2
%30 = OpLoad %_arr_strided_arr_uint_2 %29
%33 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_3 %uint_0 %int_2 %int_1 %uint_0
%34 = OpLoad %float %33
%35 = OpAccessChain %_ptr_StorageBuffer__arr_strided_arr_1_uint_4 %s %uint_0
OpStore %35 %36
%37 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_3 %uint_0 %int_2 %int_1 %uint_0
OpStore %37 %float_5
%f_1 = OpFunction %void None %15
%18 = OpLabel
%21 = OpAccessChain %_ptr_StorageBuffer__arr_strided_arr_1_uint_4 %s %uint_0 %uint_0
%22 = OpLoad %_arr_strided_arr_1_uint_4 %21
%26 = OpAccessChain %_ptr_StorageBuffer__arr__arr_strided_arr_uint_2_uint_3 %s %uint_0 %uint_0 %int_3 %uint_0
%27 = OpLoad %_arr__arr_strided_arr_uint_2_uint_3 %26
%30 = OpAccessChain %_ptr_StorageBuffer__arr_strided_arr_uint_2 %s %uint_0 %uint_0 %int_3 %uint_0 %int_2
%31 = OpLoad %_arr_strided_arr_uint_2 %30
%34 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %uint_0 %int_3 %uint_0 %int_2 %int_1 %uint_0
%35 = OpLoad %float %34
%36 = OpAccessChain %_ptr_StorageBuffer__arr_strided_arr_1_uint_4 %s %uint_0 %uint_0
OpStore %36 %37
%38 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %uint_0 %int_3 %uint_0 %int_2 %int_1 %uint_0
OpStore %38 %float_5
OpReturn
OpFunctionEnd
%f = OpFunction %void None %14
%40 = OpLabel
%41 = OpFunctionCall %void %f_1
%f = OpFunction %void None %15
%41 = OpLabel
%42 = OpFunctionCall %void %f_1
OpReturn
OpFunctionEnd

View File

@ -4,7 +4,7 @@ struct Inner {
int x;
};
layout(binding = 0, std430) buffer S_ssbo {
struct S {
ivec3 a;
int b;
uvec3 c;
@ -16,19 +16,23 @@ layout(binding = 0, std430) buffer S_ssbo {
Inner i;
Inner j[4];
uint pad;
};
layout(binding = 0, std430) buffer s_block_ssbo {
S inner;
} s;
void tint_symbol() {
ivec3 a = s.a;
int b = s.b;
uvec3 c = s.c;
uint d = s.d;
vec3 e = s.e;
float f = s.f;
mat2x3 g = s.g;
mat3x2 h = s.h;
Inner i = s.i;
Inner j[4] = s.j;
ivec3 a = s.inner.a;
int b = s.inner.b;
uvec3 c = s.inner.c;
uint d = s.inner.d;
vec3 e = s.inner.e;
float f = s.inner.f;
mat2x3 g = s.inner.g;
mat3x2 h = s.inner.h;
Inner i = s.inner.i;
Inner j[4] = s.inner.j;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,12 +1,14 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 59
; Bound: 60
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %s_block "s_block"
OpMemberName %s_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "a"
OpMemberName %S 1 "b"
@ -22,7 +24,8 @@
OpMemberName %S 9 "j"
OpName %s "s"
OpName %main "main"
OpDecorate %S Block
OpDecorate %s_block Block
OpMemberDecorate %s_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 12
OpMemberDecorate %S 2 Offset 16
@ -55,10 +58,11 @@
%uint_4 = OpConstant %uint 4
%_arr_Inner_uint_4 = OpTypeArray %Inner %uint_4
%S = OpTypeStruct %v3int %int %v3uint %uint %v3float %float %mat2v3float %mat3v2float %Inner %_arr_Inner_uint_4
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%s = OpVariable %_ptr_StorageBuffer_S StorageBuffer
%s_block = OpTypeStruct %S
%_ptr_StorageBuffer_s_block = OpTypePointer StorageBuffer %s_block
%s = OpVariable %_ptr_StorageBuffer_s_block StorageBuffer
%void = OpTypeVoid
%16 = OpTypeFunction %void
%17 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
%uint_1 = OpConstant %uint 1
@ -78,27 +82,27 @@
%_ptr_StorageBuffer_Inner = OpTypePointer StorageBuffer %Inner
%uint_9 = OpConstant %uint 9
%_ptr_StorageBuffer__arr_Inner_uint_4 = OpTypePointer StorageBuffer %_arr_Inner_uint_4
%main = OpFunction %void None %16
%19 = OpLabel
%22 = OpAccessChain %_ptr_StorageBuffer_v3int %s %uint_0
%23 = OpLoad %v3int %22
%26 = OpAccessChain %_ptr_StorageBuffer_int %s %uint_1
%27 = OpLoad %int %26
%30 = OpAccessChain %_ptr_StorageBuffer_v3uint %s %uint_2
%31 = OpLoad %v3uint %30
%34 = OpAccessChain %_ptr_StorageBuffer_uint %s %uint_3
%35 = OpLoad %uint %34
%37 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_4
%38 = OpLoad %v3float %37
%41 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_5
%42 = OpLoad %float %41
%45 = OpAccessChain %_ptr_StorageBuffer_mat2v3float %s %uint_6
%46 = OpLoad %mat2v3float %45
%49 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %s %uint_7
%50 = OpLoad %mat3v2float %49
%53 = OpAccessChain %_ptr_StorageBuffer_Inner %s %uint_8
%54 = OpLoad %Inner %53
%57 = OpAccessChain %_ptr_StorageBuffer__arr_Inner_uint_4 %s %uint_9
%58 = OpLoad %_arr_Inner_uint_4 %57
%main = OpFunction %void None %17
%20 = OpLabel
%23 = OpAccessChain %_ptr_StorageBuffer_v3int %s %uint_0 %uint_0
%24 = OpLoad %v3int %23
%27 = OpAccessChain %_ptr_StorageBuffer_int %s %uint_0 %uint_1
%28 = OpLoad %int %27
%31 = OpAccessChain %_ptr_StorageBuffer_v3uint %s %uint_0 %uint_2
%32 = OpLoad %v3uint %31
%35 = OpAccessChain %_ptr_StorageBuffer_uint %s %uint_0 %uint_3
%36 = OpLoad %uint %35
%38 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %uint_4
%39 = OpLoad %v3float %38
%42 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %uint_5
%43 = OpLoad %float %42
%46 = OpAccessChain %_ptr_StorageBuffer_mat2v3float %s %uint_0 %uint_6
%47 = OpLoad %mat2v3float %46
%50 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %s %uint_0 %uint_7
%51 = OpLoad %mat3v2float %50
%54 = OpAccessChain %_ptr_StorageBuffer_Inner %s %uint_0 %uint_8
%55 = OpLoad %Inner %54
%58 = OpAccessChain %_ptr_StorageBuffer__arr_Inner_uint_4 %s %uint_0 %uint_9
%59 = OpLoad %_arr_Inner_uint_4 %58
OpReturn
OpFunctionEnd

View File

@ -4,7 +4,7 @@ struct Inner {
int x;
};
layout(binding = 0, std430) buffer S_ssbo {
struct S {
ivec3 a;
int b;
uvec3 c;
@ -16,21 +16,25 @@ layout(binding = 0, std430) buffer S_ssbo {
Inner i;
Inner j[4];
uint pad;
};
layout(binding = 0, std430) buffer s_block_ssbo {
S inner;
} s;
void tint_symbol() {
s.a = ivec3(0);
s.b = 0;
s.c = uvec3(0u);
s.d = 0u;
s.e = vec3(0.0f);
s.f = 0.0f;
s.g = mat2x3(vec3(0.0f), vec3(0.0f));
s.h = mat3x2(vec2(0.0f), vec2(0.0f), vec2(0.0f));
s.inner.a = ivec3(0);
s.inner.b = 0;
s.inner.c = uvec3(0u);
s.inner.d = 0u;
s.inner.e = vec3(0.0f);
s.inner.f = 0.0f;
s.inner.g = mat2x3(vec3(0.0f), vec3(0.0f));
s.inner.h = mat3x2(vec2(0.0f), vec2(0.0f), vec2(0.0f));
Inner tint_symbol_1 = Inner(0);
s.i = tint_symbol_1;
s.inner.i = tint_symbol_1;
Inner tint_symbol_2[4] = Inner[4](Inner(0), Inner(0), Inner(0), Inner(0));
s.j = tint_symbol_2;
s.inner.j = tint_symbol_2;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,12 +1,14 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 59
; Bound: 60
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %s_block "s_block"
OpMemberName %s_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "a"
OpMemberName %S 1 "b"
@ -22,7 +24,8 @@
OpMemberName %S 9 "j"
OpName %s "s"
OpName %main "main"
OpDecorate %S Block
OpDecorate %s_block Block
OpMemberDecorate %s_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 12
OpMemberDecorate %S 2 Offset 16
@ -54,60 +57,61 @@
%uint_4 = OpConstant %uint 4
%_arr_Inner_uint_4 = OpTypeArray %Inner %uint_4
%S = OpTypeStruct %v3int %int %v3uint %uint %v3float %float %mat2v3float %mat3v2float %Inner %_arr_Inner_uint_4
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%s = OpVariable %_ptr_StorageBuffer_S StorageBuffer
%s_block = OpTypeStruct %S
%_ptr_StorageBuffer_s_block = OpTypePointer StorageBuffer %s_block
%s = OpVariable %_ptr_StorageBuffer_s_block StorageBuffer
%void = OpTypeVoid
%16 = OpTypeFunction %void
%17 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
%23 = OpConstantNull %v3int
%24 = OpConstantNull %v3int
%uint_1 = OpConstant %uint 1
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%27 = OpConstantNull %int
%28 = OpConstantNull %int
%uint_2 = OpConstant %uint 2
%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
%31 = OpConstantNull %v3uint
%32 = OpConstantNull %v3uint
%uint_3 = OpConstant %uint 3
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%35 = OpConstantNull %uint
%36 = OpConstantNull %uint
%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
%38 = OpConstantNull %v3float
%39 = OpConstantNull %v3float
%uint_5 = OpConstant %uint 5
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%42 = OpConstantNull %float
%43 = OpConstantNull %float
%uint_6 = OpConstant %uint 6
%_ptr_StorageBuffer_mat2v3float = OpTypePointer StorageBuffer %mat2v3float
%46 = OpConstantNull %mat2v3float
%47 = OpConstantNull %mat2v3float
%uint_7 = OpConstant %uint 7
%_ptr_StorageBuffer_mat3v2float = OpTypePointer StorageBuffer %mat3v2float
%50 = OpConstantNull %mat3v2float
%51 = OpConstantNull %mat3v2float
%uint_8 = OpConstant %uint 8
%_ptr_StorageBuffer_Inner = OpTypePointer StorageBuffer %Inner
%54 = OpConstantNull %Inner
%55 = OpConstantNull %Inner
%uint_9 = OpConstant %uint 9
%_ptr_StorageBuffer__arr_Inner_uint_4 = OpTypePointer StorageBuffer %_arr_Inner_uint_4
%58 = OpConstantNull %_arr_Inner_uint_4
%main = OpFunction %void None %16
%19 = OpLabel
%22 = OpAccessChain %_ptr_StorageBuffer_v3int %s %uint_0
OpStore %22 %23
%26 = OpAccessChain %_ptr_StorageBuffer_int %s %uint_1
OpStore %26 %27
%30 = OpAccessChain %_ptr_StorageBuffer_v3uint %s %uint_2
OpStore %30 %31
%34 = OpAccessChain %_ptr_StorageBuffer_uint %s %uint_3
OpStore %34 %35
%37 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_4
OpStore %37 %38
%41 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_5
OpStore %41 %42
%45 = OpAccessChain %_ptr_StorageBuffer_mat2v3float %s %uint_6
OpStore %45 %46
%49 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %s %uint_7
OpStore %49 %50
%53 = OpAccessChain %_ptr_StorageBuffer_Inner %s %uint_8
OpStore %53 %54
%57 = OpAccessChain %_ptr_StorageBuffer__arr_Inner_uint_4 %s %uint_9
OpStore %57 %58
%59 = OpConstantNull %_arr_Inner_uint_4
%main = OpFunction %void None %17
%20 = OpLabel
%23 = OpAccessChain %_ptr_StorageBuffer_v3int %s %uint_0 %uint_0
OpStore %23 %24
%27 = OpAccessChain %_ptr_StorageBuffer_int %s %uint_0 %uint_1
OpStore %27 %28
%31 = OpAccessChain %_ptr_StorageBuffer_v3uint %s %uint_0 %uint_2
OpStore %31 %32
%35 = OpAccessChain %_ptr_StorageBuffer_uint %s %uint_0 %uint_3
OpStore %35 %36
%38 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %uint_4
OpStore %38 %39
%42 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %uint_5
OpStore %42 %43
%46 = OpAccessChain %_ptr_StorageBuffer_mat2v3float %s %uint_0 %uint_6
OpStore %46 %47
%50 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %s %uint_0 %uint_7
OpStore %50 %51
%54 = OpAccessChain %_ptr_StorageBuffer_Inner %s %uint_0 %uint_8
OpStore %54 %55
%58 = OpAccessChain %_ptr_StorageBuffer__arr_Inner_uint_4 %s %uint_0 %uint_9
OpStore %58 %59
OpReturn
OpFunctionEnd

View File

@ -1,21 +1,23 @@
SKIP: FAILED
#version 310 es
struct Inner {
float f;
};
layout(binding = 0, std430) buffer S_ssbo {
struct S {
Inner inner;
};
layout(binding = 0, std430) buffer tint_symbol_block_ssbo {
S inner;
} tint_symbol;
layout(binding = 1, std430) buffer S_ssbo_1 {
Inner inner;
layout(binding = 1, std430) buffer tint_symbol_block_ssbo_1 {
S inner;
} tint_symbol_1;
void tint_symbol_2() {
tint_symbol_1 = tint_symbol;
tint_symbol_1.inner = tint_symbol.inner;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
@ -23,10 +25,3 @@ void main() {
tint_symbol_2();
return;
}
Error parsing GLSL shader:
ERROR: 0:16: 'assign' : cannot convert from 'layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer structure{ global highp float f} inner}' to 'layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer structure{ global highp float f} inner}'
ERROR: 0:16: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,12 +1,14 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 12
; Bound: 18
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %in_block "in_block"
OpMemberName %in_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "inner"
OpName %Inner "Inner"
@ -14,7 +16,8 @@
OpName %in "in"
OpName %out "out"
OpName %main "main"
OpDecorate %S Block
OpDecorate %in_block Block
OpMemberDecorate %in_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %Inner 0 Offset 0
OpDecorate %in NonWritable
@ -25,14 +28,20 @@
%float = OpTypeFloat 32
%Inner = OpTypeStruct %float
%S = OpTypeStruct %Inner
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%in = OpVariable %_ptr_StorageBuffer_S StorageBuffer
%out = OpVariable %_ptr_StorageBuffer_S StorageBuffer
%in_block = OpTypeStruct %S
%_ptr_StorageBuffer_in_block = OpTypePointer StorageBuffer %in_block
%in = OpVariable %_ptr_StorageBuffer_in_block StorageBuffer
%out = OpVariable %_ptr_StorageBuffer_in_block StorageBuffer
%void = OpTypeVoid
%7 = OpTypeFunction %void
%main = OpFunction %void None %7
%10 = OpLabel
%11 = OpLoad %S %in
OpStore %out %11
%8 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%main = OpFunction %void None %8
%11 = OpLabel
%15 = OpAccessChain %_ptr_StorageBuffer_S %out %uint_0
%16 = OpAccessChain %_ptr_StorageBuffer_S %in %uint_0
%17 = OpLoad %S %16
OpStore %15 %17
OpReturn
OpFunctionEnd

View File

@ -34,27 +34,35 @@ struct Inner_std140 {
ivec4 k[4];
};
layout(binding = 0, std140) uniform S_std140_ubo {
struct S {
Inner arr[8];
};
struct S_std140 {
Inner_std140 arr[8];
};
layout(binding = 0, std140) uniform s_block_std140_ubo {
S_std140 inner;
} s;
mat3x2 load_s_arr_p0_j(uint p0) {
mat3x2 load_s_inner_arr_p0_j(uint p0) {
uint s_save = p0;
return mat3x2(s.arr[s_save].j_0, s.arr[s_save].j_1, s.arr[s_save].j_2);
return mat3x2(s.inner.arr[s_save].j_0, s.inner.arr[s_save].j_1, s.inner.arr[s_save].j_2);
}
void tint_symbol(uint idx) {
ivec3 a = s.arr[idx].a;
int b = s.arr[idx].b;
uvec3 c = s.arr[idx].c;
uint d = s.arr[idx].d;
vec3 e = s.arr[idx].e;
float f = s.arr[idx].f;
ivec2 g = s.arr[idx].g;
ivec2 h = s.arr[idx].h;
mat2x3 i = s.arr[idx].i;
mat3x2 j = load_s_arr_p0_j(uint(idx));
ivec4 k[4] = s.arr[idx].k;
ivec3 a = s.inner.arr[idx].a;
int b = s.inner.arr[idx].b;
uvec3 c = s.inner.arr[idx].c;
uint d = s.inner.arr[idx].d;
vec3 e = s.inner.arr[idx].e;
float f = s.inner.arr[idx].f;
ivec2 g = s.inner.arr[idx].g;
ivec2 h = s.inner.arr[idx].h;
mat2x3 i = s.inner.arr[idx].i;
mat3x2 j = load_s_inner_arr_p0_j(uint(idx));
ivec4 k[4] = s.inner.arr[idx].k;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,13 +1,15 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 92
; Bound: 93
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %idx_1
OpExecutionMode %main LocalSize 1 1 1
OpName %idx_1 "idx_1"
OpName %s_block_std140 "s_block_std140"
OpMemberName %s_block_std140 0 "inner"
OpName %S_std140 "S_std140"
OpMemberName %S_std140 0 "arr"
OpName %Inner_std140 "Inner_std140"
@ -25,13 +27,14 @@
OpMemberName %Inner_std140 11 "j_2"
OpMemberName %Inner_std140 12 "k"
OpName %s "s"
OpName %load_s_arr_p0_j "load_s_arr_p0_j"
OpName %load_s_inner_arr_p0_j "load_s_inner_arr_p0_j"
OpName %p0 "p0"
OpName %main_inner "main_inner"
OpName %idx "idx"
OpName %main "main"
OpDecorate %idx_1 BuiltIn LocalInvocationIndex
OpDecorate %S_std140 Block
OpDecorate %s_block_std140 Block
OpMemberDecorate %s_block_std140 0 Offset 0
OpMemberDecorate %S_std140 0 Offset 0
OpMemberDecorate %Inner_std140 0 Offset 0
OpMemberDecorate %Inner_std140 1 Offset 12
@ -71,10 +74,11 @@
%uint_8 = OpConstant %uint 8
%_arr_Inner_std140_uint_8 = OpTypeArray %Inner_std140 %uint_8
%S_std140 = OpTypeStruct %_arr_Inner_std140_uint_8
%_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
%s = OpVariable %_ptr_Uniform_S_std140 Uniform
%s_block_std140 = OpTypeStruct %S_std140
%_ptr_Uniform_s_block_std140 = OpTypePointer Uniform %s_block_std140
%s = OpVariable %_ptr_Uniform_s_block_std140 Uniform
%mat3v2float = OpTypeMatrix %v2float 3
%21 = OpTypeFunction %mat3v2float %uint
%22 = OpTypeFunction %mat3v2float %uint
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_Inner_std140 = OpTypePointer Uniform %Inner_std140
%uint_9 = OpConstant %uint 9
@ -82,7 +86,7 @@
%uint_10 = OpConstant %uint 10
%uint_11 = OpConstant %uint 11
%void = OpTypeVoid
%44 = OpTypeFunction %void %uint
%45 = OpTypeFunction %void %uint
%_ptr_Uniform_v3int = OpTypePointer Uniform %v3int
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_int = OpTypePointer Uniform %int
@ -99,49 +103,49 @@
%_ptr_Uniform_mat2v3float = OpTypePointer Uniform %mat2v3float
%uint_12 = OpConstant %uint 12
%_ptr_Uniform__arr_v4int_uint_4 = OpTypePointer Uniform %_arr_v4int_uint_4
%87 = OpTypeFunction %void
%load_s_arr_p0_j = OpFunction %mat3v2float None %21
%88 = OpTypeFunction %void
%load_s_inner_arr_p0_j = OpFunction %mat3v2float None %22
%p0 = OpFunctionParameter %uint
%25 = OpLabel
%29 = OpAccessChain %_ptr_Uniform_Inner_std140 %s %uint_0 %p0
%33 = OpAccessChain %_ptr_Uniform_v2float %29 %uint_9
%34 = OpLoad %v2float %33
%37 = OpAccessChain %_ptr_Uniform_v2float %29 %uint_10
%38 = OpLoad %v2float %37
%41 = OpAccessChain %_ptr_Uniform_v2float %29 %uint_11
%42 = OpLoad %v2float %41
%43 = OpCompositeConstruct %mat3v2float %34 %38 %42
OpReturnValue %43
%26 = OpLabel
%30 = OpAccessChain %_ptr_Uniform_Inner_std140 %s %uint_0 %uint_0 %p0
%34 = OpAccessChain %_ptr_Uniform_v2float %30 %uint_9
%35 = OpLoad %v2float %34
%38 = OpAccessChain %_ptr_Uniform_v2float %30 %uint_10
%39 = OpLoad %v2float %38
%42 = OpAccessChain %_ptr_Uniform_v2float %30 %uint_11
%43 = OpLoad %v2float %42
%44 = OpCompositeConstruct %mat3v2float %35 %39 %43
OpReturnValue %44
OpFunctionEnd
%main_inner = OpFunction %void None %44
%main_inner = OpFunction %void None %45
%idx = OpFunctionParameter %uint
%48 = OpLabel
%50 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0 %idx %uint_0
%51 = OpLoad %v3int %50
%54 = OpAccessChain %_ptr_Uniform_int %s %uint_0 %idx %uint_1
%55 = OpLoad %int %54
%58 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_0 %idx %uint_2
%59 = OpLoad %v3uint %58
%62 = OpAccessChain %_ptr_Uniform_uint %s %uint_0 %idx %uint_3
%63 = OpLoad %uint %62
%65 = OpAccessChain %_ptr_Uniform_v3float %s %uint_0 %idx %uint_4
%66 = OpLoad %v3float %65
%69 = OpAccessChain %_ptr_Uniform_float %s %uint_0 %idx %uint_5
%70 = OpLoad %float %69
%73 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %idx %uint_6
%74 = OpLoad %v2int %73
%76 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %idx %uint_7
%77 = OpLoad %v2int %76
%79 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_0 %idx %uint_8
%80 = OpLoad %mat2v3float %79
%81 = OpFunctionCall %mat3v2float %load_s_arr_p0_j %idx
%85 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %s %uint_0 %idx %uint_12
%86 = OpLoad %_arr_v4int_uint_4 %85
%49 = OpLabel
%51 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0 %uint_0 %idx %uint_0
%52 = OpLoad %v3int %51
%55 = OpAccessChain %_ptr_Uniform_int %s %uint_0 %uint_0 %idx %uint_1
%56 = OpLoad %int %55
%59 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_0 %uint_0 %idx %uint_2
%60 = OpLoad %v3uint %59
%63 = OpAccessChain %_ptr_Uniform_uint %s %uint_0 %uint_0 %idx %uint_3
%64 = OpLoad %uint %63
%66 = OpAccessChain %_ptr_Uniform_v3float %s %uint_0 %uint_0 %idx %uint_4
%67 = OpLoad %v3float %66
%70 = OpAccessChain %_ptr_Uniform_float %s %uint_0 %uint_0 %idx %uint_5
%71 = OpLoad %float %70
%74 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %uint_0 %idx %uint_6
%75 = OpLoad %v2int %74
%77 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %uint_0 %idx %uint_7
%78 = OpLoad %v2int %77
%80 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_0 %uint_0 %idx %uint_8
%81 = OpLoad %mat2v3float %80
%82 = OpFunctionCall %mat3v2float %load_s_inner_arr_p0_j %idx
%86 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %s %uint_0 %uint_0 %idx %uint_12
%87 = OpLoad %_arr_v4int_uint_4 %86
OpReturn
OpFunctionEnd
%main = OpFunction %void None %87
%89 = OpLabel
%91 = OpLoad %uint %idx_1
%90 = OpFunctionCall %void %main_inner %91
%main = OpFunction %void None %88
%90 = OpLabel
%92 = OpLoad %uint %idx_1
%91 = OpFunctionCall %void %main_inner %92
OpReturn
OpFunctionEnd

View File

@ -7,7 +7,24 @@ struct Inner {
uint pad_2;
};
layout(binding = 0, std140) uniform S_std140_ubo {
struct S {
ivec3 a;
int b;
uvec3 c;
uint d;
vec3 e;
float f;
ivec2 g;
ivec2 h;
mat2x3 i;
mat3x2 j;
uint pad_3;
uint pad_4;
Inner k;
Inner l[4];
};
struct S_std140 {
ivec3 a;
int b;
uvec3 c;
@ -24,25 +41,29 @@ layout(binding = 0, std140) uniform S_std140_ubo {
uint pad_4;
Inner k;
Inner l[4];
};
layout(binding = 0, std140) uniform s_block_std140_ubo {
S_std140 inner;
} s;
mat3x2 load_s_j() {
return mat3x2(s.j_0, s.j_1, s.j_2);
mat3x2 load_s_inner_j() {
return mat3x2(s.inner.j_0, s.inner.j_1, s.inner.j_2);
}
void tint_symbol() {
ivec3 a = s.a;
int b = s.b;
uvec3 c = s.c;
uint d = s.d;
vec3 e = s.e;
float f = s.f;
ivec2 g = s.g;
ivec2 h = s.h;
mat2x3 i = s.i;
mat3x2 j = load_s_j();
Inner k = s.k;
Inner l[4] = s.l;
ivec3 a = s.inner.a;
int b = s.inner.b;
uvec3 c = s.inner.c;
uint d = s.inner.d;
vec3 e = s.inner.e;
float f = s.inner.f;
ivec2 g = s.inner.g;
ivec2 h = s.inner.h;
mat2x3 i = s.inner.i;
mat3x2 j = load_s_inner_j();
Inner k = s.inner.k;
Inner l[4] = s.inner.l;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,12 +1,14 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 82
; Bound: 85
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %s_block_std140 "s_block_std140"
OpMemberName %s_block_std140 0 "inner"
OpName %S_std140 "S_std140"
OpMemberName %S_std140 0 "a"
OpMemberName %S_std140 1 "b"
@ -25,9 +27,10 @@
OpMemberName %Inner 0 "x"
OpMemberName %S_std140 13 "l"
OpName %s "s"
OpName %load_s_j "load_s_j"
OpName %load_s_inner_j "load_s_inner_j"
OpName %main "main"
OpDecorate %S_std140 Block
OpDecorate %s_block_std140 Block
OpMemberDecorate %s_block_std140 0 Offset 0
OpMemberDecorate %S_std140 0 Offset 0
OpMemberDecorate %S_std140 1 Offset 12
OpMemberDecorate %S_std140 2 Offset 16
@ -62,17 +65,19 @@
%uint_4 = OpConstant %uint 4
%_arr_Inner_uint_4 = OpTypeArray %Inner %uint_4
%S_std140 = OpTypeStruct %v3int %int %v3uint %uint %v3float %float %v2int %v2int %mat2v3float %v2float %v2float %v2float %Inner %_arr_Inner_uint_4
%_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
%s = OpVariable %_ptr_Uniform_S_std140 Uniform
%s_block_std140 = OpTypeStruct %S_std140
%_ptr_Uniform_s_block_std140 = OpTypePointer Uniform %s_block_std140
%s = OpVariable %_ptr_Uniform_s_block_std140 Uniform
%mat3v2float = OpTypeMatrix %v2float 3
%16 = OpTypeFunction %mat3v2float
%17 = OpTypeFunction %mat3v2float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
%uint_9 = OpConstant %uint 9
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%uint_10 = OpConstant %uint 10
%uint_11 = OpConstant %uint 11
%void = OpTypeVoid
%35 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%39 = OpTypeFunction %void
%_ptr_Uniform_v3int = OpTypePointer Uniform %v3int
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_int = OpTypePointer Uniform %int
@ -92,41 +97,42 @@
%_ptr_Uniform_Inner = OpTypePointer Uniform %Inner
%uint_13 = OpConstant %uint 13
%_ptr_Uniform__arr_Inner_uint_4 = OpTypePointer Uniform %_arr_Inner_uint_4
%load_s_j = OpFunction %mat3v2float None %16
%19 = OpLabel
%24 = OpAccessChain %_ptr_Uniform_v2float %s %uint_9
%25 = OpLoad %v2float %24
%28 = OpAccessChain %_ptr_Uniform_v2float %s %uint_10
%load_s_inner_j = OpFunction %mat3v2float None %17
%20 = OpLabel
%24 = OpAccessChain %_ptr_Uniform_S_std140 %s %uint_0
%28 = OpAccessChain %_ptr_Uniform_v2float %24 %uint_9
%29 = OpLoad %v2float %28
%32 = OpAccessChain %_ptr_Uniform_v2float %s %uint_11
%32 = OpAccessChain %_ptr_Uniform_v2float %24 %uint_10
%33 = OpLoad %v2float %32
%34 = OpCompositeConstruct %mat3v2float %25 %29 %33
OpReturnValue %34
%36 = OpAccessChain %_ptr_Uniform_v2float %24 %uint_11
%37 = OpLoad %v2float %36
%38 = OpCompositeConstruct %mat3v2float %29 %33 %37
OpReturnValue %38
OpFunctionEnd
%main = OpFunction %void None %35
%38 = OpLabel
%41 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0
%42 = OpLoad %v3int %41
%45 = OpAccessChain %_ptr_Uniform_int %s %uint_1
%46 = OpLoad %int %45
%49 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_2
%50 = OpLoad %v3uint %49
%53 = OpAccessChain %_ptr_Uniform_uint %s %uint_3
%54 = OpLoad %uint %53
%56 = OpAccessChain %_ptr_Uniform_v3float %s %uint_4
%57 = OpLoad %v3float %56
%60 = OpAccessChain %_ptr_Uniform_float %s %uint_5
%61 = OpLoad %float %60
%64 = OpAccessChain %_ptr_Uniform_v2int %s %uint_6
%65 = OpLoad %v2int %64
%67 = OpAccessChain %_ptr_Uniform_v2int %s %uint_7
%main = OpFunction %void None %39
%42 = OpLabel
%44 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0 %uint_0
%45 = OpLoad %v3int %44
%48 = OpAccessChain %_ptr_Uniform_int %s %uint_0 %uint_1
%49 = OpLoad %int %48
%52 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_0 %uint_2
%53 = OpLoad %v3uint %52
%56 = OpAccessChain %_ptr_Uniform_uint %s %uint_0 %uint_3
%57 = OpLoad %uint %56
%59 = OpAccessChain %_ptr_Uniform_v3float %s %uint_0 %uint_4
%60 = OpLoad %v3float %59
%63 = OpAccessChain %_ptr_Uniform_float %s %uint_0 %uint_5
%64 = OpLoad %float %63
%67 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %uint_6
%68 = OpLoad %v2int %67
%71 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_8
%72 = OpLoad %mat2v3float %71
%73 = OpFunctionCall %mat3v2float %load_s_j
%76 = OpAccessChain %_ptr_Uniform_Inner %s %uint_12
%77 = OpLoad %Inner %76
%80 = OpAccessChain %_ptr_Uniform__arr_Inner_uint_4 %s %uint_13
%81 = OpLoad %_arr_Inner_uint_4 %80
%70 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %uint_7
%71 = OpLoad %v2int %70
%74 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_0 %uint_8
%75 = OpLoad %mat2v3float %74
%76 = OpFunctionCall %mat3v2float %load_s_inner_j
%79 = OpAccessChain %_ptr_Uniform_Inner %s %uint_0 %uint_12
%80 = OpLoad %Inner %79
%83 = OpAccessChain %_ptr_Uniform__arr_Inner_uint_4 %s %uint_0 %uint_13
%84 = OpLoad %_arr_Inner_uint_4 %83
OpReturn
OpFunctionEnd

View File

@ -1,6 +1,6 @@
#version 310 es
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
uint numTriangles;
uint gridSize;
uint puuuuuuuuuuuuuuuuad1;
@ -9,6 +9,25 @@ layout(binding = 0, std140) uniform Uniforms_ubo {
uint pad;
vec3 bbMax;
uint pad_1;
};
struct Dbg {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
layout(binding = 10, std430) buffer U32s_ssbo {
@ -27,30 +46,19 @@ layout(binding = 21, std430) buffer AI32s_ssbo {
int values[];
} LUT;
layout(binding = 50, std430) buffer Dbg_ssbo {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
layout(binding = 50, std430) buffer dbg_block_ssbo {
Dbg inner;
} dbg;
vec3 toVoxelPos(vec3 position) {
vec3 bbMin = vec3(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z);
vec3 bbMax = vec3(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z);
vec3 bbMin = vec3(uniforms.inner.bbMin.x, uniforms.inner.bbMin.y, uniforms.inner.bbMin.z);
vec3 bbMax = vec3(uniforms.inner.bbMax.x, uniforms.inner.bbMax.y, uniforms.inner.bbMax.z);
vec3 bbSize = (bbMin - bbMin);
float cubeSize = max(max(bbMax.x, bbMax.y), bbSize.z);
float gridSize = float(uniforms.gridSize);
float gx = ((cubeSize * (position.x - uniforms.bbMin.x)) / cubeSize);
float gy = ((gx * (position.y - uniforms.bbMin.y)) / gridSize);
float gz = ((gridSize * (position.z - uniforms.bbMin.z)) / gridSize);
float gridSize = float(uniforms.inner.gridSize);
float gx = ((cubeSize * (position.x - uniforms.inner.bbMin.x)) / cubeSize);
float gy = ((gx * (position.y - uniforms.inner.bbMin.y)) / gridSize);
float gz = ((gridSize * (position.z - uniforms.inner.bbMin.z)) / gridSize);
return vec3(gz, gz, gz);
}
@ -65,8 +73,8 @@ vec3 loadPosition(uint vertexIndex) {
}
void doIgnore() {
uint g43 = uniforms.numTriangles;
uint kj6 = dbg.value1;
uint g43 = uniforms.inner.numTriangles;
uint kj6 = dbg.inner.value1;
uint b53 = atomicOr(counters.values[0], 0u);
uint rwg = indices.values[0];
float rb5 = positions.values[0];
@ -75,7 +83,7 @@ void doIgnore() {
void main_count(uvec3 GlobalInvocationID) {
uint triangleIndex = GlobalInvocationID.x;
if ((triangleIndex >= uniforms.numTriangles)) {
if ((triangleIndex >= uniforms.inner.numTriangles)) {
return;
}
doIgnore();
@ -87,7 +95,7 @@ void main_count(uvec3 GlobalInvocationID) {
vec3 p2 = loadPosition(i2);
vec3 center = (((p0 + p2) + p1) / 3.0f);
vec3 voxelPos = toVoxelPos(p1);
uint lIndex = toIndex1D(uniforms.gridSize, p0);
uint lIndex = toIndex1D(uniforms.inner.gridSize, p0);
int triangleOffset = atomicAdd(LUT.values[i1], 1);
}

View File

@ -1,14 +1,16 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 273
; Bound: 275
; Schema: 0
OpCapability Shader
%67 = OpExtInstImport "GLSL.std.450"
%69 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main_count "main_count" %GlobalInvocationID_1
OpExecutionMode %main_count LocalSize 128 1 1
OpName %GlobalInvocationID_1 "GlobalInvocationID_1"
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "numTriangles"
OpMemberName %Uniforms 1 "gridSize"
@ -29,6 +31,8 @@
OpName %AI32s "AI32s"
OpMemberName %AI32s 0 "values"
OpName %LUT "LUT"
OpName %dbg_block "dbg_block"
OpMemberName %dbg_block 0 "inner"
OpName %Dbg "Dbg"
OpMemberName %Dbg 0 "offsetCounter"
OpMemberName %Dbg 1 "pad0"
@ -89,7 +93,8 @@
OpName %triangleOffset "triangleOffset"
OpName %main_count "main_count"
OpDecorate %GlobalInvocationID_1 BuiltIn GlobalInvocationId
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpMemberDecorate %Uniforms 2 Offset 8
@ -119,7 +124,8 @@
OpDecorate %_runtimearr_int ArrayStride 4
OpDecorate %LUT Binding 21
OpDecorate %LUT DescriptorSet 0
OpDecorate %Dbg Block
OpDecorate %dbg_block Block
OpMemberDecorate %dbg_block 0 Offset 0
OpMemberDecorate %Dbg 0 Offset 0
OpMemberDecorate %Dbg 1 Offset 4
OpMemberDecorate %Dbg 2 Offset 8
@ -141,8 +147,9 @@
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%Uniforms = OpTypeStruct %uint %uint %uint %uint %v3float %v3float
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%_runtimearr_uint = OpTypeRuntimeArray %uint
%U32s = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_U32s = OpTypePointer StorageBuffer %U32s
@ -161,293 +168,294 @@
%_ptr_StorageBuffer_AI32s = OpTypePointer StorageBuffer %AI32s
%LUT = OpVariable %_ptr_StorageBuffer_AI32s StorageBuffer
%Dbg = OpTypeStruct %uint %uint %uint %uint %uint %uint %uint %uint %float %float %float %float
%_ptr_StorageBuffer_Dbg = OpTypePointer StorageBuffer %Dbg
%dbg = OpVariable %_ptr_StorageBuffer_Dbg StorageBuffer
%dbg_block = OpTypeStruct %Dbg
%_ptr_StorageBuffer_dbg_block = OpTypePointer StorageBuffer %dbg_block
%dbg = OpVariable %_ptr_StorageBuffer_dbg_block StorageBuffer
%void = OpTypeVoid
%30 = OpTypeFunction %void
%34 = OpTypeFunction %v3float %v3float
%uint_4 = OpConstant %uint 4
%32 = OpTypeFunction %void
%36 = OpTypeFunction %v3float %v3float
%uint_0 = OpConstant %uint 0
%uint_4 = OpConstant %uint 4
%_ptr_Uniform_float = OpTypePointer Uniform %float
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%52 = OpConstantNull %v3float
%54 = OpConstantNull %v3float
%uint_5 = OpConstant %uint 5
%_ptr_Function_float = OpTypePointer Function %float
%77 = OpConstantNull %float
%79 = OpConstantNull %float
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%114 = OpTypeFunction %uint %uint %v3float
%116 = OpTypeFunction %uint %uint %v3float
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
%122 = OpConstantNull %v3uint
%124 = OpConstantNull %v3uint
%_ptr_Function_uint = OpTypePointer Function %uint
%135 = OpTypeFunction %v3uint %uint %uint
%143 = OpConstantNull %uint
%156 = OpTypeFunction %v3float %uint
%137 = OpTypeFunction %v3uint %uint %uint
%145 = OpConstantNull %uint
%158 = OpTypeFunction %v3float %uint
%uint_3 = OpConstant %uint 3
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%188 = OpConstantNull %int
%190 = OpConstantNull %int
%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%_ptr_Function_int = OpTypePointer Function %int
%204 = OpTypeFunction %void %v3uint
%206 = OpTypeFunction %void %v3uint
%bool = OpTypeBool
%float_3 = OpConstant %float 3
%int_1 = OpConstant %int 1
%marg8uintin = OpFunction %void None %30
%33 = OpLabel
%marg8uintin = OpFunction %void None %32
%35 = OpLabel
OpReturn
OpFunctionEnd
%toVoxelPos = OpFunction %v3float None %34
%toVoxelPos = OpFunction %v3float None %36
%position = OpFunctionParameter %v3float
%37 = OpLabel
%bbMin = OpVariable %_ptr_Function_v3float Function %52
%bbMax = OpVariable %_ptr_Function_v3float Function %52
%bbSize = OpVariable %_ptr_Function_v3float Function %52
%cubeSize = OpVariable %_ptr_Function_float Function %77
%gridSize = OpVariable %_ptr_Function_float Function %77
%gx = OpVariable %_ptr_Function_float Function %77
%gy = OpVariable %_ptr_Function_float Function %77
%gz = OpVariable %_ptr_Function_float Function %77
%41 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_0
%42 = OpLoad %float %41
%44 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_1
%45 = OpLoad %float %44
%47 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_2
%48 = OpLoad %float %47
%49 = OpCompositeConstruct %v3float %42 %45 %48
OpStore %bbMin %49
%54 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_5 %uint_0
%55 = OpLoad %float %54
%56 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_5 %uint_1
%39 = OpLabel
%bbMin = OpVariable %_ptr_Function_v3float Function %54
%bbMax = OpVariable %_ptr_Function_v3float Function %54
%bbSize = OpVariable %_ptr_Function_v3float Function %54
%cubeSize = OpVariable %_ptr_Function_float Function %79
%gridSize = OpVariable %_ptr_Function_float Function %79
%gx = OpVariable %_ptr_Function_float Function %79
%gy = OpVariable %_ptr_Function_float Function %79
%gz = OpVariable %_ptr_Function_float Function %79
%43 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_0
%44 = OpLoad %float %43
%46 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_1
%47 = OpLoad %float %46
%49 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_2
%50 = OpLoad %float %49
%51 = OpCompositeConstruct %v3float %44 %47 %50
OpStore %bbMin %51
%56 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_0
%57 = OpLoad %float %56
%58 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_5 %uint_2
%58 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_1
%59 = OpLoad %float %58
%60 = OpCompositeConstruct %v3float %55 %57 %59
OpStore %bbMax %60
%62 = OpLoad %v3float %bbMin
%63 = OpLoad %v3float %bbMin
%64 = OpFSub %v3float %62 %63
OpStore %bbSize %64
%70 = OpAccessChain %_ptr_Function_float %bbMax %uint_0
%71 = OpLoad %float %70
%72 = OpAccessChain %_ptr_Function_float %bbMax %uint_1
%60 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_2
%61 = OpLoad %float %60
%62 = OpCompositeConstruct %v3float %57 %59 %61
OpStore %bbMax %62
%64 = OpLoad %v3float %bbMin
%65 = OpLoad %v3float %bbMin
%66 = OpFSub %v3float %64 %65
OpStore %bbSize %66
%72 = OpAccessChain %_ptr_Function_float %bbMax %uint_0
%73 = OpLoad %float %72
%68 = OpExtInst %float %67 NMax %71 %73
%74 = OpAccessChain %_ptr_Function_float %bbSize %uint_2
%74 = OpAccessChain %_ptr_Function_float %bbMax %uint_1
%75 = OpLoad %float %74
%66 = OpExtInst %float %67 NMax %68 %75
OpStore %cubeSize %66
%80 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%81 = OpLoad %uint %80
%78 = OpConvertUToF %float %81
OpStore %gridSize %78
%83 = OpLoad %float %cubeSize
%84 = OpCompositeExtract %float %position 0
%85 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_0
%86 = OpLoad %float %85
%87 = OpFSub %float %84 %86
%88 = OpFMul %float %83 %87
%89 = OpLoad %float %cubeSize
%90 = OpFDiv %float %88 %89
OpStore %gx %90
%92 = OpLoad %float %gx
%93 = OpCompositeExtract %float %position 1
%94 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_1
%95 = OpLoad %float %94
%96 = OpFSub %float %93 %95
%97 = OpFMul %float %92 %96
%98 = OpLoad %float %gridSize
%99 = OpFDiv %float %97 %98
OpStore %gy %99
%101 = OpLoad %float %gridSize
%102 = OpCompositeExtract %float %position 2
%103 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_2
%104 = OpLoad %float %103
%105 = OpFSub %float %102 %104
%106 = OpFMul %float %101 %105
%107 = OpLoad %float %gridSize
%108 = OpFDiv %float %106 %107
OpStore %gz %108
%110 = OpLoad %float %gz
%111 = OpLoad %float %gz
%70 = OpExtInst %float %69 NMax %73 %75
%76 = OpAccessChain %_ptr_Function_float %bbSize %uint_2
%77 = OpLoad %float %76
%68 = OpExtInst %float %69 NMax %70 %77
OpStore %cubeSize %68
%82 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%83 = OpLoad %uint %82
%80 = OpConvertUToF %float %83
OpStore %gridSize %80
%85 = OpLoad %float %cubeSize
%86 = OpCompositeExtract %float %position 0
%87 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_0
%88 = OpLoad %float %87
%89 = OpFSub %float %86 %88
%90 = OpFMul %float %85 %89
%91 = OpLoad %float %cubeSize
%92 = OpFDiv %float %90 %91
OpStore %gx %92
%94 = OpLoad %float %gx
%95 = OpCompositeExtract %float %position 1
%96 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_1
%97 = OpLoad %float %96
%98 = OpFSub %float %95 %97
%99 = OpFMul %float %94 %98
%100 = OpLoad %float %gridSize
%101 = OpFDiv %float %99 %100
OpStore %gy %101
%103 = OpLoad %float %gridSize
%104 = OpCompositeExtract %float %position 2
%105 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_2
%106 = OpLoad %float %105
%107 = OpFSub %float %104 %106
%108 = OpFMul %float %103 %107
%109 = OpLoad %float %gridSize
%110 = OpFDiv %float %108 %109
OpStore %gz %110
%112 = OpLoad %float %gz
%113 = OpCompositeConstruct %v3float %110 %111 %112
OpReturnValue %113
%113 = OpLoad %float %gz
%114 = OpLoad %float %gz
%115 = OpCompositeConstruct %v3float %112 %113 %114
OpReturnValue %115
OpFunctionEnd
%toIndex1D = OpFunction %uint None %114
%toIndex1D = OpFunction %uint None %116
%gridSize_0 = OpFunctionParameter %uint
%voxelPos = OpFunctionParameter %v3float
%118 = OpLabel
%icoord = OpVariable %_ptr_Function_v3uint Function %122
%119 = OpConvertFToU %v3uint %voxelPos
OpStore %icoord %119
%124 = OpAccessChain %_ptr_Function_uint %icoord %uint_0
%125 = OpLoad %uint %124
%126 = OpAccessChain %_ptr_Function_uint %icoord %uint_1
%120 = OpLabel
%icoord = OpVariable %_ptr_Function_v3uint Function %124
%121 = OpConvertFToU %v3uint %voxelPos
OpStore %icoord %121
%126 = OpAccessChain %_ptr_Function_uint %icoord %uint_0
%127 = OpLoad %uint %126
%128 = OpIMul %uint %gridSize_0 %127
%129 = OpIAdd %uint %125 %128
%130 = OpIMul %uint %gridSize_0 %gridSize_0
%131 = OpAccessChain %_ptr_Function_uint %icoord %uint_2
%132 = OpLoad %uint %131
%133 = OpIMul %uint %130 %132
%134 = OpIAdd %uint %129 %133
OpReturnValue %134
%128 = OpAccessChain %_ptr_Function_uint %icoord %uint_1
%129 = OpLoad %uint %128
%130 = OpIMul %uint %gridSize_0 %129
%131 = OpIAdd %uint %127 %130
%132 = OpIMul %uint %gridSize_0 %gridSize_0
%133 = OpAccessChain %_ptr_Function_uint %icoord %uint_2
%134 = OpLoad %uint %133
%135 = OpIMul %uint %132 %134
%136 = OpIAdd %uint %131 %135
OpReturnValue %136
OpFunctionEnd
%toIndex4D = OpFunction %v3uint None %135
%toIndex4D = OpFunction %v3uint None %137
%gridSize_1 = OpFunctionParameter %uint
%index = OpFunctionParameter %uint
%139 = OpLabel
%z = OpVariable %_ptr_Function_uint Function %143
%y = OpVariable %_ptr_Function_uint Function %143
%x = OpVariable %_ptr_Function_uint Function %143
%140 = OpIMul %uint %index %index
%141 = OpUDiv %uint %gridSize_1 %140
OpStore %z %141
%144 = OpIMul %uint %gridSize_1 %gridSize_1
%145 = OpLoad %uint %z
%146 = OpIMul %uint %144 %145
%147 = OpISub %uint %gridSize_1 %146
%148 = OpUDiv %uint %147 %gridSize_1
OpStore %y %148
%150 = OpUMod %uint %index %gridSize_1
OpStore %x %150
%152 = OpLoad %uint %z
%153 = OpLoad %uint %y
%154 = OpLoad %uint %y
%155 = OpCompositeConstruct %v3uint %152 %153 %154
OpReturnValue %155
%141 = OpLabel
%z = OpVariable %_ptr_Function_uint Function %145
%y = OpVariable %_ptr_Function_uint Function %145
%x = OpVariable %_ptr_Function_uint Function %145
%142 = OpIMul %uint %index %index
%143 = OpUDiv %uint %gridSize_1 %142
OpStore %z %143
%146 = OpIMul %uint %gridSize_1 %gridSize_1
%147 = OpLoad %uint %z
%148 = OpIMul %uint %146 %147
%149 = OpISub %uint %gridSize_1 %148
%150 = OpUDiv %uint %149 %gridSize_1
OpStore %y %150
%152 = OpUMod %uint %index %gridSize_1
OpStore %x %152
%154 = OpLoad %uint %z
%155 = OpLoad %uint %y
%156 = OpLoad %uint %y
%157 = OpCompositeConstruct %v3uint %154 %155 %156
OpReturnValue %157
OpFunctionEnd
%loadPosition = OpFunction %v3float None %156
%loadPosition = OpFunction %v3float None %158
%vertexIndex = OpFunctionParameter %uint
%159 = OpLabel
%position_0 = OpVariable %_ptr_Function_v3float Function %52
%161 = OpIMul %uint %uint_3 %vertexIndex
%162 = OpIAdd %uint %161 %143
%164 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %162
%165 = OpLoad %float %164
%166 = OpIMul %uint %uint_3 %vertexIndex
%167 = OpIAdd %uint %166 %uint_1
%168 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %167
%169 = OpLoad %float %168
%170 = OpIMul %uint %uint_3 %vertexIndex
%171 = OpIAdd %uint %170 %uint_2
%172 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %171
%173 = OpLoad %float %172
%174 = OpCompositeConstruct %v3float %165 %169 %173
OpStore %position_0 %174
%176 = OpLoad %v3float %position_0
OpReturnValue %176
%161 = OpLabel
%position_0 = OpVariable %_ptr_Function_v3float Function %54
%163 = OpIMul %uint %uint_3 %vertexIndex
%164 = OpIAdd %uint %163 %145
%166 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %164
%167 = OpLoad %float %166
%168 = OpIMul %uint %uint_3 %vertexIndex
%169 = OpIAdd %uint %168 %uint_1
%170 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %169
%171 = OpLoad %float %170
%172 = OpIMul %uint %uint_3 %vertexIndex
%173 = OpIAdd %uint %172 %uint_2
%174 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %173
%175 = OpLoad %float %174
%176 = OpCompositeConstruct %v3float %167 %171 %175
OpStore %position_0 %176
%178 = OpLoad %v3float %position_0
OpReturnValue %178
OpFunctionEnd
%doIgnore = OpFunction %void None %30
%178 = OpLabel
%g43 = OpVariable %_ptr_Function_uint Function %143
%kj6 = OpVariable %_ptr_Function_uint Function %143
%b53 = OpVariable %_ptr_Function_uint Function %143
%rwg = OpVariable %_ptr_Function_uint Function %143
%rb5 = OpVariable %_ptr_Function_float Function %77
%g55 = OpVariable %_ptr_Function_int Function %188
%179 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%180 = OpLoad %uint %179
OpStore %g43 %180
%183 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_5
%184 = OpLoad %uint %183
OpStore %kj6 %184
%190 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %188
%186 = OpAtomicLoad %uint %190 %uint_1 %uint_0
OpStore %b53 %186
%192 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %188
%193 = OpLoad %uint %192
OpStore %rwg %193
%195 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %188
%196 = OpLoad %float %195
OpStore %rb5 %196
%201 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %188
%198 = OpAtomicLoad %int %201 %uint_1 %uint_0
OpStore %g55 %198
%doIgnore = OpFunction %void None %32
%180 = OpLabel
%g43 = OpVariable %_ptr_Function_uint Function %145
%kj6 = OpVariable %_ptr_Function_uint Function %145
%b53 = OpVariable %_ptr_Function_uint Function %145
%rwg = OpVariable %_ptr_Function_uint Function %145
%rb5 = OpVariable %_ptr_Function_float Function %79
%g55 = OpVariable %_ptr_Function_int Function %190
%181 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%182 = OpLoad %uint %181
OpStore %g43 %182
%185 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_0 %uint_5
%186 = OpLoad %uint %185
OpStore %kj6 %186
%192 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %190
%188 = OpAtomicLoad %uint %192 %uint_1 %uint_0
OpStore %b53 %188
%194 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %190
%195 = OpLoad %uint %194
OpStore %rwg %195
%197 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %190
%198 = OpLoad %float %197
OpStore %rb5 %198
%203 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %190
%200 = OpAtomicLoad %int %203 %uint_1 %uint_0
OpStore %g55 %200
OpReturn
OpFunctionEnd
%main_count_inner = OpFunction %void None %204
%main_count_inner = OpFunction %void None %206
%GlobalInvocationID = OpFunctionParameter %v3uint
%207 = OpLabel
%triangleIndex = OpVariable %_ptr_Function_uint Function %143
%i0 = OpVariable %_ptr_Function_uint Function %143
%i1 = OpVariable %_ptr_Function_uint Function %143
%i2 = OpVariable %_ptr_Function_uint Function %143
%p0 = OpVariable %_ptr_Function_v3float Function %52
%p1 = OpVariable %_ptr_Function_v3float Function %52
%p2 = OpVariable %_ptr_Function_v3float Function %52
%252 = OpVariable %_ptr_Function_v3float Function %52
%center = OpVariable %_ptr_Function_v3float Function %52
%voxelPos_0 = OpVariable %_ptr_Function_v3float Function %52
%lIndex = OpVariable %_ptr_Function_uint Function %143
%triangleOffset = OpVariable %_ptr_Function_int Function %188
%208 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %triangleIndex %208
%210 = OpLoad %uint %triangleIndex
%211 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%212 = OpLoad %uint %211
%213 = OpUGreaterThanEqual %bool %210 %212
OpSelectionMerge %215 None
OpBranchConditional %213 %216 %215
%216 = OpLabel
%209 = OpLabel
%triangleIndex = OpVariable %_ptr_Function_uint Function %145
%i0 = OpVariable %_ptr_Function_uint Function %145
%i1 = OpVariable %_ptr_Function_uint Function %145
%i2 = OpVariable %_ptr_Function_uint Function %145
%p0 = OpVariable %_ptr_Function_v3float Function %54
%p1 = OpVariable %_ptr_Function_v3float Function %54
%p2 = OpVariable %_ptr_Function_v3float Function %54
%254 = OpVariable %_ptr_Function_v3float Function %54
%center = OpVariable %_ptr_Function_v3float Function %54
%voxelPos_0 = OpVariable %_ptr_Function_v3float Function %54
%lIndex = OpVariable %_ptr_Function_uint Function %145
%triangleOffset = OpVariable %_ptr_Function_int Function %190
%210 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %triangleIndex %210
%212 = OpLoad %uint %triangleIndex
%213 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%214 = OpLoad %uint %213
%215 = OpUGreaterThanEqual %bool %212 %214
OpSelectionMerge %217 None
OpBranchConditional %215 %218 %217
%218 = OpLabel
OpReturn
%215 = OpLabel
%217 = OpFunctionCall %void %doIgnore
%218 = OpLoad %uint %triangleIndex
%219 = OpIMul %uint %uint_3 %218
%220 = OpIAdd %uint %219 %143
%221 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %220
%222 = OpLoad %uint %221
OpStore %i0 %222
%224 = OpLoad %uint %i0
%225 = OpIMul %uint %uint_3 %224
%226 = OpIAdd %uint %225 %uint_1
%227 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %226
%228 = OpLoad %uint %227
OpStore %i1 %228
%230 = OpLoad %uint %i0
%231 = OpIMul %uint %uint_3 %230
%232 = OpIAdd %uint %231 %uint_2
%233 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %232
%234 = OpLoad %uint %233
OpStore %i2 %234
%237 = OpLoad %uint %i0
%236 = OpFunctionCall %v3float %loadPosition %237
OpStore %p0 %236
%240 = OpLoad %uint %i0
%239 = OpFunctionCall %v3float %loadPosition %240
OpStore %p1 %239
%243 = OpLoad %uint %i2
%242 = OpFunctionCall %v3float %loadPosition %243
OpStore %p2 %242
%245 = OpLoad %v3float %p0
%246 = OpLoad %v3float %p2
%247 = OpFAdd %v3float %245 %246
%248 = OpLoad %v3float %p1
%217 = OpLabel
%219 = OpFunctionCall %void %doIgnore
%220 = OpLoad %uint %triangleIndex
%221 = OpIMul %uint %uint_3 %220
%222 = OpIAdd %uint %221 %145
%223 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %222
%224 = OpLoad %uint %223
OpStore %i0 %224
%226 = OpLoad %uint %i0
%227 = OpIMul %uint %uint_3 %226
%228 = OpIAdd %uint %227 %uint_1
%229 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %228
%230 = OpLoad %uint %229
OpStore %i1 %230
%232 = OpLoad %uint %i0
%233 = OpIMul %uint %uint_3 %232
%234 = OpIAdd %uint %233 %uint_2
%235 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %234
%236 = OpLoad %uint %235
OpStore %i2 %236
%239 = OpLoad %uint %i0
%238 = OpFunctionCall %v3float %loadPosition %239
OpStore %p0 %238
%242 = OpLoad %uint %i0
%241 = OpFunctionCall %v3float %loadPosition %242
OpStore %p1 %241
%245 = OpLoad %uint %i2
%244 = OpFunctionCall %v3float %loadPosition %245
OpStore %p2 %244
%247 = OpLoad %v3float %p0
%248 = OpLoad %v3float %p2
%249 = OpFAdd %v3float %247 %248
%253 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
%251 = OpFDiv %v3float %249 %253
OpStore %center %251
%256 = OpLoad %v3float %p1
%255 = OpFunctionCall %v3float %toVoxelPos %256
OpStore %voxelPos_0 %255
%259 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%260 = OpLoad %uint %259
%261 = OpLoad %v3float %p0
%258 = OpFunctionCall %uint %toIndex1D %260 %261
OpStore %lIndex %258
%265 = OpLoad %uint %i1
%266 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %265
%263 = OpAtomicIAdd %int %266 %uint_1 %uint_0 %int_1
OpStore %triangleOffset %263
%250 = OpLoad %v3float %p1
%251 = OpFAdd %v3float %249 %250
%255 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
%253 = OpFDiv %v3float %251 %255
OpStore %center %253
%258 = OpLoad %v3float %p1
%257 = OpFunctionCall %v3float %toVoxelPos %258
OpStore %voxelPos_0 %257
%261 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%262 = OpLoad %uint %261
%263 = OpLoad %v3float %p0
%260 = OpFunctionCall %uint %toIndex1D %262 %263
OpStore %lIndex %260
%267 = OpLoad %uint %i1
%268 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %267
%265 = OpAtomicIAdd %int %268 %uint_1 %uint_0 %int_1
OpStore %triangleOffset %265
OpReturn
OpFunctionEnd
%main_count = OpFunction %void None %30
%270 = OpLabel
%272 = OpLoad %v3uint %GlobalInvocationID_1
%271 = OpFunctionCall %void %main_count_inner %272
%main_count = OpFunction %void None %32
%272 = OpLabel
%274 = OpLoad %v3uint %GlobalInvocationID_1
%273 = OpFunctionCall %void %main_count_inner %274
OpReturn
OpFunctionEnd

View File

@ -8,7 +8,11 @@ layout(binding = 0, std430) buffer v_block_ssbo {
int inner[1000000];
} v;
layout(binding = 1, std430) buffer A_ssbo {
struct A {
float a[1000000];
};
layout(binding = 1, std430) buffer b_block_ssbo {
A inner;
} b;

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 17
; Bound: 18
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -10,6 +10,8 @@
OpName %v_block "v_block"
OpMemberName %v_block 0 "inner"
OpName %v "v"
OpName %b_block "b_block"
OpMemberName %b_block 0 "inner"
OpName %A "A"
OpMemberName %A 0 "a"
OpName %b "b"
@ -20,7 +22,8 @@
OpDecorate %v NonWritable
OpDecorate %v DescriptorSet 0
OpDecorate %v Binding 0
OpDecorate %A Block
OpDecorate %b_block Block
OpMemberDecorate %b_block 0 Offset 0
OpMemberDecorate %A 0 Offset 0
OpDecorate %_arr_float_uint_1000000 ArrayStride 4
OpDecorate %b NonWritable
@ -36,11 +39,12 @@
%float = OpTypeFloat 32
%_arr_float_uint_1000000 = OpTypeArray %float %uint_1000000
%A = OpTypeStruct %_arr_float_uint_1000000
%_ptr_StorageBuffer_A = OpTypePointer StorageBuffer %A
%b = OpVariable %_ptr_StorageBuffer_A StorageBuffer
%b_block = OpTypeStruct %A
%_ptr_StorageBuffer_b_block = OpTypePointer StorageBuffer %b_block
%b = OpVariable %_ptr_StorageBuffer_b_block StorageBuffer
%void = OpTypeVoid
%13 = OpTypeFunction %void
%unused_entry_point = OpFunction %void None %13
%16 = OpLabel
%14 = OpTypeFunction %void
%unused_entry_point = OpFunction %void None %14
%17 = OpLabel
OpReturn
OpFunctionEnd

View File

@ -1,9 +1,13 @@
#version 310 es
layout(location = 0) out vec2 texcoords_1;
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
vec2 u_scale;
vec2 u_offset;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
struct VertexOutputs {
@ -15,11 +19,11 @@ VertexOutputs vs_main(uint VertexIndex) {
vec2 texcoord[3] = vec2[3](vec2(-0.5f, 0.0f), vec2(1.5f, 0.0f), vec2(0.5f, 2.0f));
VertexOutputs tint_symbol = VertexOutputs(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
tint_symbol.position = vec4(((texcoord[VertexIndex] * 2.0f) - vec2(1.0f)), 0.0f, 1.0f);
bool flipY = (uniforms.u_scale.y < 0.0f);
bool flipY = (uniforms.inner.u_scale.y < 0.0f);
if (flipY) {
tint_symbol.texcoords = ((((texcoord[VertexIndex] * uniforms.u_scale) + uniforms.u_offset) * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f));
tint_symbol.texcoords = ((((texcoord[VertexIndex] * uniforms.inner.u_scale) + uniforms.inner.u_offset) * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f));
} else {
tint_symbol.texcoords = ((((texcoord[VertexIndex] * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f)) * uniforms.u_scale) + uniforms.u_offset);
tint_symbol.texcoords = ((((texcoord[VertexIndex] * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f)) * uniforms.inner.u_scale) + uniforms.inner.u_offset);
}
return tint_symbol;
}

View File

@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 133
; Bound: 134
; Schema: 0
OpCapability Shader
%117 = OpExtInstImport "GLSL.std.450"
%118 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vs_main "vs_main" %VertexIndex_1 %texcoords_1 %position_1 %vertex_point_size
OpEntryPoint Fragment %fs_main "fs_main" %texcoord_1 %value
@ -15,6 +15,8 @@
OpName %vertex_point_size "vertex_point_size"
OpName %texcoord_1 "texcoord_1"
OpName %value "value"
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "u_scale"
OpMemberName %Uniforms 1 "u_offset"
@ -42,7 +44,8 @@
OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %texcoord_1 Location 0
OpDecorate %value Location 0
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 8
OpDecorate %uniforms NonWritable
@ -74,143 +77,144 @@
%texcoord_1 = OpVariable %_ptr_Input_v2float Input
%value = OpVariable %_ptr_Output_v4float Output %12
%Uniforms = OpTypeStruct %v2float %v2float
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%24 = OpTypeSampler
%_ptr_UniformConstant_24 = OpTypePointer UniformConstant %24
%mySampler = OpVariable %_ptr_UniformConstant_24 UniformConstant
%27 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_27 = OpTypePointer UniformConstant %27
%myTexture = OpVariable %_ptr_UniformConstant_27 UniformConstant
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%25 = OpTypeSampler
%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
%mySampler = OpVariable %_ptr_UniformConstant_25 UniformConstant
%28 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_28 = OpTypePointer UniformConstant %28
%myTexture = OpVariable %_ptr_UniformConstant_28 UniformConstant
%VertexOutputs = OpTypeStruct %v2float %v4float
%28 = OpTypeFunction %VertexOutputs %uint
%29 = OpTypeFunction %VertexOutputs %uint
%uint_3 = OpConstant %uint 3
%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
%float_n0_5 = OpConstant %float -0.5
%36 = OpConstantComposite %v2float %float_n0_5 %15
%37 = OpConstantComposite %v2float %float_n0_5 %15
%float_1_5 = OpConstant %float 1.5
%38 = OpConstantComposite %v2float %float_1_5 %15
%39 = OpConstantComposite %v2float %float_1_5 %15
%float_0_5 = OpConstant %float 0.5
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_0_5 %float_2
%42 = OpConstantComposite %_arr_v2float_uint_3 %36 %38 %41
%42 = OpConstantComposite %v2float %float_0_5 %float_2
%43 = OpConstantComposite %_arr_v2float_uint_3 %37 %39 %42
%_ptr_Function__arr_v2float_uint_3 = OpTypePointer Function %_arr_v2float_uint_3
%45 = OpConstantNull %_arr_v2float_uint_3
%46 = OpConstantNull %_arr_v2float_uint_3
%_ptr_Function_VertexOutputs = OpTypePointer Function %VertexOutputs
%48 = OpConstantNull %VertexOutputs
%49 = OpConstantNull %VertexOutputs
%uint_1 = OpConstant %uint 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_v2float = OpTypePointer Function %v2float
%float_1 = OpConstant %float 1
%57 = OpConstantComposite %v2float %float_1 %float_1
%58 = OpConstantComposite %v2float %float_1 %float_1
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%70 = OpConstantNull %bool
%71 = OpConstantNull %bool
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_n1 = OpConstant %float -1
%86 = OpConstantComposite %v2float %float_1 %float_n1
%88 = OpConstantComposite %v2float %15 %float_1
%87 = OpConstantComposite %v2float %float_1 %float_n1
%89 = OpConstantComposite %v2float %15 %float_1
%void = OpTypeVoid
%102 = OpTypeFunction %void
%112 = OpTypeFunction %v4float %v2float
%103 = OpTypeFunction %void
%113 = OpTypeFunction %v4float %v2float
%v2bool = OpTypeVector %bool 2
%vs_main_inner = OpFunction %VertexOutputs None %28
%vs_main_inner = OpFunction %VertexOutputs None %29
%VertexIndex = OpFunctionParameter %uint
%32 = OpLabel
%texcoord = OpVariable %_ptr_Function__arr_v2float_uint_3 Function %45
%output = OpVariable %_ptr_Function_VertexOutputs Function %48
%flipY = OpVariable %_ptr_Function_bool Function %70
OpStore %texcoord %42
%51 = OpAccessChain %_ptr_Function_v4float %output %uint_1
%53 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
%54 = OpLoad %v2float %53
%55 = OpVectorTimesScalar %v2float %54 %float_2
%58 = OpFSub %v2float %55 %57
%59 = OpCompositeExtract %float %58 0
%60 = OpCompositeExtract %float %58 1
%61 = OpCompositeConstruct %v4float %59 %60 %15 %float_1
OpStore %51 %61
%64 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_1
%65 = OpLoad %float %64
%66 = OpFOrdLessThan %bool %65 %15
OpStore %flipY %66
%71 = OpLoad %bool %flipY
OpSelectionMerge %72 None
OpBranchConditional %71 %73 %74
%73 = OpLabel
%75 = OpAccessChain %_ptr_Function_v2float %output %uint_0
%76 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
%77 = OpLoad %v2float %76
%79 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0
%80 = OpLoad %v2float %79
%81 = OpFMul %v2float %77 %80
%82 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_1
%83 = OpLoad %v2float %82
%84 = OpFAdd %v2float %81 %83
%87 = OpFMul %v2float %84 %86
%89 = OpFAdd %v2float %87 %88
OpStore %75 %89
OpBranch %72
%33 = OpLabel
%texcoord = OpVariable %_ptr_Function__arr_v2float_uint_3 Function %46
%output = OpVariable %_ptr_Function_VertexOutputs Function %49
%flipY = OpVariable %_ptr_Function_bool Function %71
OpStore %texcoord %43
%52 = OpAccessChain %_ptr_Function_v4float %output %uint_1
%54 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
%55 = OpLoad %v2float %54
%56 = OpVectorTimesScalar %v2float %55 %float_2
%59 = OpFSub %v2float %56 %58
%60 = OpCompositeExtract %float %59 0
%61 = OpCompositeExtract %float %59 1
%62 = OpCompositeConstruct %v4float %60 %61 %15 %float_1
OpStore %52 %62
%65 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_0 %uint_1
%66 = OpLoad %float %65
%67 = OpFOrdLessThan %bool %66 %15
OpStore %flipY %67
%72 = OpLoad %bool %flipY
OpSelectionMerge %73 None
OpBranchConditional %72 %74 %75
%74 = OpLabel
%90 = OpAccessChain %_ptr_Function_v2float %output %uint_0
%91 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
%92 = OpLoad %v2float %91
%93 = OpFMul %v2float %92 %86
%94 = OpFAdd %v2float %93 %88
%95 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0
%96 = OpLoad %v2float %95
%97 = OpFMul %v2float %94 %96
%98 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_1
%99 = OpLoad %v2float %98
%100 = OpFAdd %v2float %97 %99
OpStore %90 %100
OpBranch %72
%72 = OpLabel
%101 = OpLoad %VertexOutputs %output
OpReturnValue %101
%76 = OpAccessChain %_ptr_Function_v2float %output %uint_0
%77 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
%78 = OpLoad %v2float %77
%80 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0 %uint_0
%81 = OpLoad %v2float %80
%82 = OpFMul %v2float %78 %81
%83 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0 %uint_1
%84 = OpLoad %v2float %83
%85 = OpFAdd %v2float %82 %84
%88 = OpFMul %v2float %85 %87
%90 = OpFAdd %v2float %88 %89
OpStore %76 %90
OpBranch %73
%75 = OpLabel
%91 = OpAccessChain %_ptr_Function_v2float %output %uint_0
%92 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
%93 = OpLoad %v2float %92
%94 = OpFMul %v2float %93 %87
%95 = OpFAdd %v2float %94 %89
%96 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0 %uint_0
%97 = OpLoad %v2float %96
%98 = OpFMul %v2float %95 %97
%99 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0 %uint_1
%100 = OpLoad %v2float %99
%101 = OpFAdd %v2float %98 %100
OpStore %91 %101
OpBranch %73
%73 = OpLabel
%102 = OpLoad %VertexOutputs %output
OpReturnValue %102
OpFunctionEnd
%vs_main = OpFunction %void None %102
%105 = OpLabel
%107 = OpLoad %uint %VertexIndex_1
%106 = OpFunctionCall %VertexOutputs %vs_main_inner %107
%108 = OpCompositeExtract %v2float %106 0
OpStore %texcoords_1 %108
%109 = OpCompositeExtract %v4float %106 1
OpStore %position_1 %109
%vs_main = OpFunction %void None %103
%106 = OpLabel
%108 = OpLoad %uint %VertexIndex_1
%107 = OpFunctionCall %VertexOutputs %vs_main_inner %108
%109 = OpCompositeExtract %v2float %107 0
OpStore %texcoords_1 %109
%110 = OpCompositeExtract %v4float %107 1
OpStore %position_1 %110
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%tint_discard_func = OpFunction %void None %102
%111 = OpLabel
%tint_discard_func = OpFunction %void None %103
%112 = OpLabel
OpKill
OpFunctionEnd
%fs_main_inner = OpFunction %v4float None %112
%fs_main_inner = OpFunction %v4float None %113
%texcoord_0 = OpFunctionParameter %v2float
%115 = OpLabel
%116 = OpLabel
%clampedTexcoord = OpVariable %_ptr_Function_v2float Function %8
%srcColor = OpVariable %_ptr_Function_v4float Function %12
%116 = OpExtInst %v2float %117 NClamp %texcoord_0 %8 %57
OpStore %clampedTexcoord %116
%121 = OpLoad %v2float %clampedTexcoord
%122 = OpFOrdEqual %v2bool %121 %texcoord_0
%120 = OpAll %bool %122
%119 = OpLogicalNot %bool %120
OpSelectionMerge %124 None
OpBranchConditional %119 %125 %124
%125 = OpLabel
%126 = OpFunctionCall %void %tint_discard_func
%117 = OpExtInst %v2float %118 NClamp %texcoord_0 %8 %58
OpStore %clampedTexcoord %117
%122 = OpLoad %v2float %clampedTexcoord
%123 = OpFOrdEqual %v2bool %122 %texcoord_0
%121 = OpAll %bool %123
%120 = OpLogicalNot %bool %121
OpSelectionMerge %125 None
OpBranchConditional %120 %126 %125
%126 = OpLabel
%127 = OpFunctionCall %void %tint_discard_func
OpReturnValue %12
%124 = OpLabel
%125 = OpLabel
OpStore %srcColor %12
%128 = OpLoad %v4float %srcColor
OpReturnValue %128
%129 = OpLoad %v4float %srcColor
OpReturnValue %129
OpFunctionEnd
%fs_main = OpFunction %void None %102
%130 = OpLabel
%132 = OpLoad %v2float %texcoord_1
%131 = OpFunctionCall %v4float %fs_main_inner %132
OpStore %value %131
%fs_main = OpFunction %void None %103
%131 = OpLabel
%133 = OpLoad %v2float %texcoord_1
%132 = OpFunctionCall %v4float %fs_main_inner %133
OpStore %value %132
OpReturn
OpFunctionEnd

View File

@ -1,23 +1,31 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
void f() {
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
result.tint_symbol = s.data[ubo.dynamic_idx];
result.inner.tint_symbol = s.data[ubo.inner.dynamic_idx];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,15 +1,19 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 28
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -17,12 +21,14 @@
OpName %S "S"
OpMemberName %S 0 "data"
OpName %s "s"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -30,31 +36,33 @@
OpDecorate %_arr_int_uint_64 ArrayStride 4
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%void = OpTypeVoid
%8 = OpTypeFunction %void
%10 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Function_S = OpTypePointer Function %S
%18 = OpConstantNull %S
%20 = OpConstantNull %S
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Function_int = OpTypePointer Function %int
%f = OpFunction %void None %8
%11 = OpLabel
%s = OpVariable %_ptr_Function_S Function %18
%21 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_Function_int %s %uint_0 %24
%27 = OpLoad %int %26
OpStore %21 %27
%f = OpFunction %void None %10
%13 = OpLabel
%s = OpVariable %_ptr_Function_S Function %20
%23 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%25 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%26 = OpLoad %int %25
%28 = OpAccessChain %_ptr_Function_int %s %uint_0 %26
%29 = OpLoad %int %28
OpStore %23 %29
OpReturn
OpFunctionEnd

View File

@ -1,23 +1,31 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
void f() {
result.tint_symbol = s.data[ubo.dynamic_idx];
result.inner.tint_symbol = s.data[ubo.inner.dynamic_idx];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,15 +1,19 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 28
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -17,12 +21,14 @@
OpMemberName %S 0 "data"
OpName %s "s"
OpName %f "f"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -30,31 +36,33 @@
OpDecorate %_arr_int_uint_64 ArrayStride 4
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Private_S = OpTypePointer Private %S
%14 = OpConstantNull %S
%s = OpVariable %_ptr_Private_S Private %14
%16 = OpConstantNull %S
%s = OpVariable %_ptr_Private_S Private %16
%void = OpTypeVoid
%15 = OpTypeFunction %void
%17 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Private_int = OpTypePointer Private %int
%f = OpFunction %void None %15
%18 = OpLabel
%21 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_Private_int %s %uint_0 %24
%27 = OpLoad %int %26
OpStore %21 %27
%f = OpFunction %void None %17
%20 = OpLabel
%23 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%25 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%26 = OpLoad %int %25
%28 = OpAccessChain %_ptr_Private_int %s %uint_0 %26
%29 = OpLoad %int %28
OpStore %23 %29
OpReturn
OpFunctionEnd

View File

@ -1,22 +1,34 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
layout(binding = 2, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 2, std430) buffer result_block_ssbo {
Result inner;
} result;
layout(binding = 1, std430) buffer SSBO_ssbo {
struct SSBO {
int data[4];
};
layout(binding = 1, std430) buffer ssbo_block_ssbo {
SSBO inner;
} ssbo;
void f() {
result.tint_symbol = ssbo.data[ubo.dynamic_idx];
result.inner.tint_symbol = ssbo.inner.data[ubo.inner.dynamic_idx];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,61 +1,73 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 26
; Bound: 29
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
OpName %ssbo_block "ssbo_block"
OpMemberName %ssbo_block 0 "inner"
OpName %SSBO "SSBO"
OpMemberName %SSBO 0 "data"
OpName %ssbo "ssbo"
OpName %f "f"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 2
OpDecorate %SSBO Block
OpDecorate %ssbo_block Block
OpMemberDecorate %ssbo_block 0 Offset 0
OpMemberDecorate %SSBO 0 Offset 0
OpDecorate %_arr_int_uint_4 ArrayStride 4
OpDecorate %ssbo DescriptorSet 0
OpDecorate %ssbo Binding 1
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_int_uint_4 = OpTypeArray %int %uint_4
%SSBO = OpTypeStruct %_arr_int_uint_4
%_ptr_StorageBuffer_SSBO = OpTypePointer StorageBuffer %SSBO
%ssbo = OpVariable %_ptr_StorageBuffer_SSBO StorageBuffer
%ssbo_block = OpTypeStruct %SSBO
%_ptr_StorageBuffer_ssbo_block = OpTypePointer StorageBuffer %ssbo_block
%ssbo = OpVariable %_ptr_StorageBuffer_ssbo_block StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%17 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%_ptr_Uniform_int = OpTypePointer Uniform %int
%f = OpFunction %void None %14
%17 = OpLabel
%20 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%22 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%23 = OpLoad %int %22
%24 = OpAccessChain %_ptr_StorageBuffer_int %ssbo %uint_0 %23
%25 = OpLoad %int %24
OpStore %20 %25
%f = OpFunction %void None %17
%20 = OpLabel
%23 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%25 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%26 = OpLoad %int %25
%27 = OpAccessChain %_ptr_StorageBuffer_int %ssbo %uint_0 %uint_0 %26
%28 = OpLoad %int %27
OpStore %23 %28
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,27 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
ivec4 data[4];
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
layout(binding = 2, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 2, std430) buffer result_block_ssbo {
Result inner;
} result;
void f() {
result.tint_symbol = ubo.data[ubo.dynamic_idx].x;
result.inner.tint_symbol = ubo.inner.data[ubo.inner.dynamic_idx].x;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,28 +1,34 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Bound: 27
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "data"
OpMemberName %UBO 1 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
OpName %f "f"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %_arr_v4int_uint_4 ArrayStride 16
OpMemberDecorate %UBO 1 Offset 64
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 2
@ -32,24 +38,26 @@
%uint_4 = OpConstant %uint 4
%_arr_v4int_uint_4 = OpTypeArray %v4int %uint_4
%UBO = OpTypeStruct %_arr_v4int_uint_4 %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%void = OpTypeVoid
%12 = OpTypeFunction %void
%14 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_int = OpTypePointer Uniform %int
%f = OpFunction %void None %12
%15 = OpLabel
%18 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%21 = OpAccessChain %_ptr_Uniform_int %ubo %uint_1
%22 = OpLoad %int %21
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %22 %uint_0
%f = OpFunction %void None %14
%17 = OpLabel
%20 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_1
%24 = OpLoad %int %23
OpStore %18 %24
%25 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0 %24 %uint_0
%26 = OpLoad %int %25
OpStore %20 %26
OpReturn
OpFunctionEnd

View File

@ -1,18 +1,26 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
shared S s;
@ -24,7 +32,7 @@ void f(uint local_invocation_index) {
}
}
barrier();
result.tint_symbol = s.data[ubo.dynamic_idx];
result.inner.tint_symbol = s.data[ubo.inner.dynamic_idx];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,16 +1,20 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 57
; Bound: 59
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f" %local_invocation_index_1
OpExecutionMode %f LocalSize 1 1 1
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -22,12 +26,14 @@
OpName %idx "idx"
OpName %f "f"
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -38,70 +44,72 @@
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Workgroup_S = OpTypePointer Workgroup %S
%s = OpVariable %_ptr_Workgroup_S Workgroup
%void = OpTypeVoid
%16 = OpTypeFunction %void %uint
%18 = OpTypeFunction %void %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%23 = OpConstantNull %uint
%25 = OpConstantNull %uint
%bool = OpTypeBool
%uint_0 = OpConstant %uint 0
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%38 = OpConstantNull %int
%40 = OpConstantNull %int
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%_ptr_Uniform_int = OpTypePointer Uniform %int
%52 = OpTypeFunction %void
%f_inner = OpFunction %void None %16
%54 = OpTypeFunction %void
%f_inner = OpFunction %void None %18
%local_invocation_index = OpFunctionParameter %uint
%20 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %23
%22 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %25
OpStore %idx %local_invocation_index
OpBranch %24
%24 = OpLabel
OpLoopMerge %25 %26 None
OpBranch %27
%27 = OpLabel
%29 = OpLoad %uint %idx
%30 = OpULessThan %bool %29 %uint_64
%28 = OpLogicalNot %bool %30
OpSelectionMerge %32 None
OpBranchConditional %28 %33 %32
%33 = OpLabel
OpBranch %25
%32 = OpLabel
%34 = OpLoad %uint %idx
%37 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %34
OpStore %37 %38
OpBranch %26
%26 = OpLabel
%39 = OpLoad %uint %idx
%41 = OpIAdd %uint %39 %uint_1
OpStore %idx %41
OpBranch %24
%25 = OpLabel
OpLoopMerge %27 %28 None
OpBranch %29
%29 = OpLabel
%31 = OpLoad %uint %idx
%32 = OpULessThan %bool %31 %uint_64
%30 = OpLogicalNot %bool %32
OpSelectionMerge %34 None
OpBranchConditional %30 %35 %34
%35 = OpLabel
OpBranch %27
%34 = OpLabel
%36 = OpLoad %uint %idx
%39 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %36
OpStore %39 %40
OpBranch %28
%28 = OpLabel
%41 = OpLoad %uint %idx
%43 = OpIAdd %uint %41 %uint_1
OpStore %idx %43
OpBranch %26
%27 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%46 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%48 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%49 = OpLoad %int %48
%50 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %49
%48 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%50 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%51 = OpLoad %int %50
OpStore %46 %51
%52 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %51
%53 = OpLoad %int %52
OpStore %48 %53
OpReturn
OpFunctionEnd
%f = OpFunction %void None %52
%54 = OpLabel
%56 = OpLoad %uint %local_invocation_index_1
%55 = OpFunctionCall %void %f_inner %56
%f = OpFunction %void None %54
%56 = OpLabel
%58 = OpLoad %uint %local_invocation_index_1
%57 = OpFunctionCall %void %f_inner %58
OpReturn
OpFunctionEnd

View File

@ -1,24 +1,32 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
void f() {
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
s.data[ubo.dynamic_idx] = 1;
result.tint_symbol = s.data[3];
s.data[ubo.inner.dynamic_idx] = 1;
result.inner.tint_symbol = s.data[3];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,15 +1,19 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -17,12 +21,14 @@
OpName %S "S"
OpMemberName %S 0 "data"
OpName %s "s"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -30,35 +36,37 @@
OpDecorate %_arr_int_uint_64 ArrayStride 4
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%void = OpTypeVoid
%8 = OpTypeFunction %void
%10 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Function_S = OpTypePointer Function %S
%18 = OpConstantNull %S
%20 = OpConstantNull %S
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Function_int = OpTypePointer Function %int
%int_1 = OpConstant %int 1
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_3 = OpConstant %int 3
%f = OpFunction %void None %8
%11 = OpLabel
%s = OpVariable %_ptr_Function_S Function %18
%21 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%22 = OpLoad %int %21
%24 = OpAccessChain %_ptr_Function_int %s %uint_0 %22
OpStore %24 %int_1
%27 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%29 = OpAccessChain %_ptr_Function_int %s %uint_0 %int_3
%30 = OpLoad %int %29
OpStore %27 %30
%f = OpFunction %void None %10
%13 = OpLabel
%s = OpVariable %_ptr_Function_S Function %20
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_Function_int %s %uint_0 %24
OpStore %26 %int_1
%29 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%31 = OpAccessChain %_ptr_Function_int %s %uint_0 %int_3
%32 = OpLoad %int %31
OpStore %29 %32
OpReturn
OpFunctionEnd

View File

@ -1,28 +1,36 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
void x(inout S p) {
p.data[ubo.dynamic_idx] = 1;
p.data[ubo.inner.dynamic_idx] = 1;
}
void f() {
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
x(s);
result.tint_symbol = s.data[3];
result.inner.tint_symbol = s.data[3];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,15 +1,19 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 38
; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -19,12 +23,14 @@
OpName %p "p"
OpName %f "f"
OpName %s "s"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -32,42 +38,44 @@
OpDecorate %_arr_int_uint_64 ArrayStride 4
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%void = OpTypeVoid
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Function_S = OpTypePointer Function %S
%8 = OpTypeFunction %void %_ptr_Function_S
%10 = OpTypeFunction %void %_ptr_Function_S
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Function_int = OpTypePointer Function %int
%int_1 = OpConstant %int 1
%26 = OpTypeFunction %void
%30 = OpConstantNull %S
%28 = OpTypeFunction %void
%32 = OpConstantNull %S
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_3 = OpConstant %int 3
%x = OpFunction %void None %8
%x = OpFunction %void None %10
%p = OpFunctionParameter %_ptr_Function_S
%17 = OpLabel
%21 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%22 = OpLoad %int %21
%24 = OpAccessChain %_ptr_Function_int %p %uint_0 %22
OpStore %24 %int_1
%19 = OpLabel
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_Function_int %p %uint_0 %24
OpStore %26 %int_1
OpReturn
OpFunctionEnd
%f = OpFunction %void None %26
%28 = OpLabel
%s = OpVariable %_ptr_Function_S Function %30
%31 = OpFunctionCall %void %x %s
%34 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%36 = OpAccessChain %_ptr_Function_int %s %uint_0 %int_3
%37 = OpLoad %int %36
OpStore %34 %37
%f = OpFunction %void None %28
%30 = OpLabel
%s = OpVariable %_ptr_Function_S Function %32
%33 = OpFunctionCall %void %x %s
%36 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%38 = OpAccessChain %_ptr_Function_int %s %uint_0 %int_3
%39 = OpLoad %int %38
OpStore %36 %39
OpReturn
OpFunctionEnd

View File

@ -1,24 +1,32 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
void f() {
s.data[ubo.dynamic_idx] = 1;
result.tint_symbol = s.data[3];
s.data[ubo.inner.dynamic_idx] = 1;
result.inner.tint_symbol = s.data[3];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,15 +1,19 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -17,12 +21,14 @@
OpMemberName %S 0 "data"
OpName %s "s"
OpName %f "f"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -30,35 +36,37 @@
OpDecorate %_arr_int_uint_64 ArrayStride 4
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Private_S = OpTypePointer Private %S
%14 = OpConstantNull %S
%s = OpVariable %_ptr_Private_S Private %14
%16 = OpConstantNull %S
%s = OpVariable %_ptr_Private_S Private %16
%void = OpTypeVoid
%15 = OpTypeFunction %void
%17 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Private_int = OpTypePointer Private %int
%int_1 = OpConstant %int 1
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_3 = OpConstant %int 3
%f = OpFunction %void None %15
%18 = OpLabel
%21 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%22 = OpLoad %int %21
%24 = OpAccessChain %_ptr_Private_int %s %uint_0 %22
OpStore %24 %int_1
%27 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%29 = OpAccessChain %_ptr_Private_int %s %uint_0 %int_3
%30 = OpLoad %int %29
OpStore %27 %30
%f = OpFunction %void None %17
%20 = OpLabel
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_Private_int %s %uint_0 %24
OpStore %26 %int_1
%29 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%31 = OpAccessChain %_ptr_Private_int %s %uint_0 %int_3
%32 = OpLoad %int %31
OpStore %29 %32
OpReturn
OpFunctionEnd

View File

@ -1,28 +1,36 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
void x(inout S p) {
p.data[ubo.dynamic_idx] = 1;
p.data[ubo.inner.dynamic_idx] = 1;
}
void f() {
x(s);
result.tint_symbol = s.data[3];
result.inner.tint_symbol = s.data[3];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,15 +1,19 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 38
; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -19,12 +23,14 @@
OpName %x "x"
OpName %p "p"
OpName %f "f"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -32,42 +38,44 @@
OpDecorate %_arr_int_uint_64 ArrayStride 4
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Private_S = OpTypePointer Private %S
%14 = OpConstantNull %S
%s = OpVariable %_ptr_Private_S Private %14
%16 = OpConstantNull %S
%s = OpVariable %_ptr_Private_S Private %16
%void = OpTypeVoid
%15 = OpTypeFunction %void %_ptr_Private_S
%17 = OpTypeFunction %void %_ptr_Private_S
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Private_int = OpTypePointer Private %int
%int_1 = OpConstant %int 1
%28 = OpTypeFunction %void
%30 = OpTypeFunction %void
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_3 = OpConstant %int 3
%x = OpFunction %void None %15
%x = OpFunction %void None %17
%p = OpFunctionParameter %_ptr_Private_S
%19 = OpLabel
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_Private_int %p %uint_0 %24
OpStore %26 %int_1
%21 = OpLabel
%25 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%26 = OpLoad %int %25
%28 = OpAccessChain %_ptr_Private_int %p %uint_0 %26
OpStore %28 %int_1
OpReturn
OpFunctionEnd
%f = OpFunction %void None %28
%30 = OpLabel
%31 = OpFunctionCall %void %x %s
%34 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%36 = OpAccessChain %_ptr_Private_int %s %uint_0 %int_3
%37 = OpLoad %int %36
OpStore %34 %37
%f = OpFunction %void None %30
%32 = OpLabel
%33 = OpFunctionCall %void %x %s
%36 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%38 = OpAccessChain %_ptr_Private_int %s %uint_0 %int_3
%39 = OpLoad %int %38
OpStore %36 %39
OpReturn
OpFunctionEnd

View File

@ -1,23 +1,35 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
layout(binding = 2, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 2, std430) buffer result_block_ssbo {
Result inner;
} result;
layout(binding = 1, std430) buffer SSBO_ssbo {
struct SSBO {
int data[4];
};
layout(binding = 1, std430) buffer ssbo_block_ssbo {
SSBO inner;
} ssbo;
void f() {
ssbo.data[ubo.dynamic_idx] = 1;
result.tint_symbol = ssbo.data[3];
ssbo.inner.data[ubo.inner.dynamic_idx] = 1;
result.inner.tint_symbol = ssbo.inner.data[3];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,65 +1,77 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 29
; Bound: 32
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f"
OpExecutionMode %f LocalSize 1 1 1
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
OpName %ssbo_block "ssbo_block"
OpMemberName %ssbo_block 0 "inner"
OpName %SSBO "SSBO"
OpMemberName %SSBO 0 "data"
OpName %ssbo "ssbo"
OpName %f "f"
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 2
OpDecorate %SSBO Block
OpDecorate %ssbo_block Block
OpMemberDecorate %ssbo_block 0 Offset 0
OpMemberDecorate %SSBO 0 Offset 0
OpDecorate %_arr_int_uint_4 ArrayStride 4
OpDecorate %ssbo DescriptorSet 0
OpDecorate %ssbo Binding 1
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_int_uint_4 = OpTypeArray %int %uint_4
%SSBO = OpTypeStruct %_arr_int_uint_4
%_ptr_StorageBuffer_SSBO = OpTypePointer StorageBuffer %SSBO
%ssbo = OpVariable %_ptr_StorageBuffer_SSBO StorageBuffer
%ssbo_block = OpTypeStruct %SSBO
%_ptr_StorageBuffer_ssbo_block = OpTypePointer StorageBuffer %ssbo_block
%ssbo = OpVariable %_ptr_StorageBuffer_ssbo_block StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%17 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_1 = OpConstant %int 1
%int_3 = OpConstant %int 3
%f = OpFunction %void None %14
%17 = OpLabel
%20 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%21 = OpLoad %int %20
%23 = OpAccessChain %_ptr_StorageBuffer_int %ssbo %uint_0 %21
OpStore %23 %int_1
%25 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%27 = OpAccessChain %_ptr_StorageBuffer_int %ssbo %uint_0 %int_3
%28 = OpLoad %int %27
OpStore %25 %28
%f = OpFunction %void None %17
%20 = OpLabel
%23 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%24 = OpLoad %int %23
%26 = OpAccessChain %_ptr_StorageBuffer_int %ssbo %uint_0 %uint_0 %24
OpStore %26 %int_1
%28 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%30 = OpAccessChain %_ptr_StorageBuffer_int %ssbo %uint_0 %uint_0 %int_3
%31 = OpLoad %int %30
OpStore %28 %31
OpReturn
OpFunctionEnd

View File

@ -1,18 +1,26 @@
#version 310 es
layout(binding = 0, std140) uniform UBO_ubo {
struct UBO {
int dynamic_idx;
uint pad;
uint pad_1;
uint pad_2;
};
layout(binding = 0, std140) uniform ubo_block_ubo {
UBO inner;
} ubo;
struct S {
int data[64];
};
layout(binding = 1, std430) buffer Result_ssbo {
struct Result {
int tint_symbol;
};
layout(binding = 1, std430) buffer result_block_ssbo {
Result inner;
} result;
shared S s;
@ -24,8 +32,8 @@ void f(uint local_invocation_index) {
}
}
barrier();
s.data[ubo.dynamic_idx] = 1;
result.tint_symbol = s.data[3];
s.data[ubo.inner.dynamic_idx] = 1;
result.inner.tint_symbol = s.data[3];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,16 +1,20 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 60
; Bound: 62
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %f "f" %local_invocation_index_1
OpExecutionMode %f LocalSize 1 1 1
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %ubo_block "ubo_block"
OpMemberName %ubo_block 0 "inner"
OpName %UBO "UBO"
OpMemberName %UBO 0 "dynamic_idx"
OpName %ubo "ubo"
OpName %result_block "result_block"
OpMemberName %result_block 0 "inner"
OpName %Result "Result"
OpMemberName %Result 0 "out"
OpName %result "result"
@ -22,12 +26,14 @@
OpName %idx "idx"
OpName %f "f"
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpDecorate %UBO Block
OpDecorate %ubo_block Block
OpMemberDecorate %ubo_block 0 Offset 0
OpMemberDecorate %UBO 0 Offset 0
OpDecorate %ubo NonWritable
OpDecorate %ubo DescriptorSet 0
OpDecorate %ubo Binding 0
OpDecorate %Result Block
OpDecorate %result_block Block
OpMemberDecorate %result_block 0 Offset 0
OpMemberDecorate %Result 0 Offset 0
OpDecorate %result DescriptorSet 0
OpDecorate %result Binding 1
@ -38,24 +44,26 @@
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%int = OpTypeInt 32 1
%UBO = OpTypeStruct %int
%_ptr_Uniform_UBO = OpTypePointer Uniform %UBO
%ubo = OpVariable %_ptr_Uniform_UBO Uniform
%ubo_block = OpTypeStruct %UBO
%_ptr_Uniform_ubo_block = OpTypePointer Uniform %ubo_block
%ubo = OpVariable %_ptr_Uniform_ubo_block Uniform
%Result = OpTypeStruct %int
%_ptr_StorageBuffer_Result = OpTypePointer StorageBuffer %Result
%result = OpVariable %_ptr_StorageBuffer_Result StorageBuffer
%result_block = OpTypeStruct %Result
%_ptr_StorageBuffer_result_block = OpTypePointer StorageBuffer %result_block
%result = OpVariable %_ptr_StorageBuffer_result_block StorageBuffer
%uint_64 = OpConstant %uint 64
%_arr_int_uint_64 = OpTypeArray %int %uint_64
%S = OpTypeStruct %_arr_int_uint_64
%_ptr_Workgroup_S = OpTypePointer Workgroup %S
%s = OpVariable %_ptr_Workgroup_S Workgroup
%void = OpTypeVoid
%16 = OpTypeFunction %void %uint
%18 = OpTypeFunction %void %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%23 = OpConstantNull %uint
%25 = OpConstantNull %uint
%bool = OpTypeBool
%uint_0 = OpConstant %uint 0
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%38 = OpConstantNull %int
%40 = OpConstantNull %int
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
@ -63,49 +71,49 @@
%int_1 = OpConstant %int 1
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_3 = OpConstant %int 3
%55 = OpTypeFunction %void
%f_inner = OpFunction %void None %16
%57 = OpTypeFunction %void
%f_inner = OpFunction %void None %18
%local_invocation_index = OpFunctionParameter %uint
%20 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %23
%22 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %25
OpStore %idx %local_invocation_index
OpBranch %24
%24 = OpLabel
OpLoopMerge %25 %26 None
OpBranch %27
%27 = OpLabel
%29 = OpLoad %uint %idx
%30 = OpULessThan %bool %29 %uint_64
%28 = OpLogicalNot %bool %30
OpSelectionMerge %32 None
OpBranchConditional %28 %33 %32
%33 = OpLabel
OpBranch %25
%32 = OpLabel
%34 = OpLoad %uint %idx
%37 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %34
OpStore %37 %38
OpBranch %26
%26 = OpLabel
%39 = OpLoad %uint %idx
%41 = OpIAdd %uint %39 %uint_1
OpStore %idx %41
OpBranch %24
%25 = OpLabel
OpLoopMerge %27 %28 None
OpBranch %29
%29 = OpLabel
%31 = OpLoad %uint %idx
%32 = OpULessThan %bool %31 %uint_64
%30 = OpLogicalNot %bool %32
OpSelectionMerge %34 None
OpBranchConditional %30 %35 %34
%35 = OpLabel
OpBranch %27
%34 = OpLabel
%36 = OpLoad %uint %idx
%39 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %36
OpStore %39 %40
OpBranch %28
%28 = OpLabel
%41 = OpLoad %uint %idx
%43 = OpIAdd %uint %41 %uint_1
OpStore %idx %43
OpBranch %26
%27 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%46 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0
%47 = OpLoad %int %46
%48 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %47
OpStore %48 %int_1
%51 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0
%53 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %int_3
%54 = OpLoad %int %53
OpStore %51 %54
%48 = OpAccessChain %_ptr_Uniform_int %ubo %uint_0 %uint_0
%49 = OpLoad %int %48
%50 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %49
OpStore %50 %int_1
%53 = OpAccessChain %_ptr_StorageBuffer_int %result %uint_0 %uint_0
%55 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %int_3
%56 = OpLoad %int %55
OpStore %53 %56
OpReturn
OpFunctionEnd
%f = OpFunction %void None %55
%57 = OpLabel
%59 = OpLoad %uint %local_invocation_index_1
%58 = OpFunctionCall %void %f_inner %59
%f = OpFunction %void None %57
%59 = OpLabel
%61 = OpLoad %uint %local_invocation_index_1
%60 = OpFunctionCall %void %f_inner %61
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,12 @@
#version 310 es
struct Simulation {
uint i;
uint pad;
uint pad_1;
uint pad_2;
};
struct Particle {
vec3 position[8];
float lifetime;
@ -15,16 +22,13 @@ layout(binding = 3, std430) buffer Particles_ssbo {
Particle p[];
} particles;
layout(binding = 4, std140) uniform Simulation_ubo {
uint i;
uint pad;
uint pad_1;
uint pad_2;
layout(binding = 4, std140) uniform sim_block_ubo {
Simulation inner;
} sim;
void tint_symbol() {
Particle particle = particles.p[0];
particle.position[sim.i] = particle.position[sim.i];
particle.position[sim.inner.i] = particle.position[sim.inner.i];
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -15,6 +15,8 @@
OpMemberName %Particle 2 "color"
OpMemberName %Particle 3 "velocity"
OpName %particles "particles"
OpName %sim_block "sim_block"
OpMemberName %sim_block 0 "inner"
OpName %Simulation "Simulation"
OpMemberName %Simulation 0 "i"
OpName %sim "sim"
@ -31,7 +33,8 @@
OpDecorate %particles NonWritable
OpDecorate %particles DescriptorSet 1
OpDecorate %particles Binding 3
OpDecorate %Simulation Block
OpDecorate %sim_block Block
OpMemberDecorate %sim_block 0 Offset 0
OpMemberDecorate %Simulation 0 Offset 0
OpDecorate %sim NonWritable
OpDecorate %sim DescriptorSet 1
@ -48,31 +51,32 @@
%_ptr_StorageBuffer_Particles = OpTypePointer StorageBuffer %Particles
%particles = OpVariable %_ptr_StorageBuffer_Particles StorageBuffer
%Simulation = OpTypeStruct %uint
%_ptr_Uniform_Simulation = OpTypePointer Uniform %Simulation
%sim = OpVariable %_ptr_Uniform_Simulation Uniform
%sim_block = OpTypeStruct %Simulation
%_ptr_Uniform_sim_block = OpTypePointer Uniform %sim_block
%sim = OpVariable %_ptr_Uniform_sim_block Uniform
%void = OpTypeVoid
%15 = OpTypeFunction %void
%16 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%int = OpTypeInt 32 1
%21 = OpConstantNull %int
%22 = OpConstantNull %int
%_ptr_StorageBuffer_Particle = OpTypePointer StorageBuffer %Particle
%_ptr_Function_Particle = OpTypePointer Function %Particle
%27 = OpConstantNull %Particle
%28 = OpConstantNull %Particle
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Function_v3float = OpTypePointer Function %v3float
%main = OpFunction %void None %15
%18 = OpLabel
%particle = OpVariable %_ptr_Function_Particle Function %27
%23 = OpAccessChain %_ptr_StorageBuffer_Particle %particles %uint_0 %21
%24 = OpLoad %Particle %23
OpStore %particle %24
%29 = OpAccessChain %_ptr_Uniform_uint %sim %uint_0
%30 = OpLoad %uint %29
%32 = OpAccessChain %_ptr_Function_v3float %particle %uint_0 %30
%33 = OpAccessChain %_ptr_Uniform_uint %sim %uint_0
%34 = OpLoad %uint %33
%35 = OpAccessChain %_ptr_Function_v3float %particle %uint_0 %34
%36 = OpLoad %v3float %35
OpStore %32 %36
%main = OpFunction %void None %16
%19 = OpLabel
%particle = OpVariable %_ptr_Function_Particle Function %28
%24 = OpAccessChain %_ptr_StorageBuffer_Particle %particles %uint_0 %22
%25 = OpLoad %Particle %24
OpStore %particle %25
%30 = OpAccessChain %_ptr_Uniform_uint %sim %uint_0 %uint_0
%31 = OpLoad %uint %30
%33 = OpAccessChain %_ptr_Function_v3float %particle %uint_0 %31
%34 = OpAccessChain %_ptr_Uniform_uint %sim %uint_0 %uint_0
%35 = OpLoad %uint %34
%36 = OpAccessChain %_ptr_Function_v3float %particle %uint_0 %35
%37 = OpLoad %v3float %36
OpStore %33 %37
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
void tint_symbol() {
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
m1[uniforms.i][0] = 1.0f;
m1[uniforms.inner.i][0] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 24
; Bound: 25
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %m1 "m1"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,27 +24,28 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%6 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
%14 = OpConstantNull %mat2v4float
%15 = OpConstantNull %mat2v4float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%int = OpTypeInt 32 1
%20 = OpConstantNull %int
%21 = OpConstantNull %int
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %5
%8 = OpLabel
%m1 = OpVariable %_ptr_Function_mat2v4float Function %14
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%22 = OpAccessChain %_ptr_Function_float %m1 %18 %20
OpStore %22 %float_1
%main = OpFunction %void None %6
%9 = OpLabel
%m1 = OpVariable %_ptr_Function_mat2v4float Function %15
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%19 = OpLoad %uint %18
%23 = OpAccessChain %_ptr_Function_float %m1 %19 %21
OpStore %23 %float_1
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
void tint_symbol() {
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
m1[uniforms.i][uniforms.j] = 1.0f;
m1[uniforms.inner.i][uniforms.inner.j] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Bound: 26
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %m1 "m1"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,28 +24,29 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%6 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
%14 = OpConstantNull %mat2v4float
%15 = OpConstantNull %mat2v4float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %5
%8 = OpLabel
%m1 = OpVariable %_ptr_Function_mat2v4float Function %14
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%20 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%21 = OpLoad %uint %20
%23 = OpAccessChain %_ptr_Function_float %m1 %18 %21
OpStore %23 %float_1
%main = OpFunction %void None %6
%9 = OpLabel
%m1 = OpVariable %_ptr_Function_mat2v4float Function %15
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%19 = OpLoad %uint %18
%21 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%22 = OpLoad %uint %21
%24 = OpAccessChain %_ptr_Function_float %m1 %19 %22
OpStore %24 %float_1
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
void tint_symbol() {
m1[0][uniforms.j] = 1.0f;
m1[0][uniforms.inner.j] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 24
; Bound: 26
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %m1 "m1"
OpName %main "main"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,27 +24,29 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Private_mat2v4float = OpTypePointer Private %mat2v4float
%10 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %10
%11 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %11
%void = OpTypeVoid
%11 = OpTypeFunction %void
%12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%16 = OpConstantNull %int
%17 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Private_float = OpTypePointer Private %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %11
%14 = OpLabel
%19 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%20 = OpLoad %uint %19
%22 = OpAccessChain %_ptr_Private_float %m1 %16 %20
OpStore %22 %float_1
%main = OpFunction %void None %12
%15 = OpLabel
%21 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%22 = OpLoad %uint %21
%24 = OpAccessChain %_ptr_Private_float %m1 %17 %22
OpStore %24 %float_1
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
void tint_symbol() {
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
m1[uniforms.i] = vec4(1.0f);
m1[uniforms.inner.i] = vec4(1.0f);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Bound: 24
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %m1 "m1"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,26 +24,27 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%6 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
%14 = OpConstantNull %mat2v4float
%15 = OpConstantNull %mat2v4float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Function_v4float = OpTypePointer Function %v4float
%float_1 = OpConstant %float 1
%22 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%main = OpFunction %void None %5
%8 = OpLabel
%m1 = OpVariable %_ptr_Function_mat2v4float Function %14
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%20 = OpAccessChain %_ptr_Function_v4float %m1 %18
OpStore %20 %22
%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%main = OpFunction %void None %6
%9 = OpLabel
%m1 = OpVariable %_ptr_Function_mat2v4float Function %15
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%19 = OpLoad %uint %18
%21 = OpAccessChain %_ptr_Function_v4float %m1 %19
OpStore %21 %23
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
void tint_symbol() {
m1[uniforms.i][0] = 1.0f;
m1[uniforms.inner.i][0] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 24
; Bound: 25
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %m1 "m1"
OpName %main "main"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,27 +24,28 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Private_mat2v4float = OpTypePointer Private %mat2v4float
%10 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %10
%11 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %11
%void = OpTypeVoid
%11 = OpTypeFunction %void
%12 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%int = OpTypeInt 32 1
%20 = OpConstantNull %int
%21 = OpConstantNull %int
%_ptr_Private_float = OpTypePointer Private %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %11
%14 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%22 = OpAccessChain %_ptr_Private_float %m1 %18 %20
OpStore %22 %float_1
%main = OpFunction %void None %12
%15 = OpLabel
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%19 = OpLoad %uint %18
%23 = OpAccessChain %_ptr_Private_float %m1 %19 %21
OpStore %23 %float_1
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
void tint_symbol() {
m1[uniforms.i][uniforms.j] = 1.0f;
m1[uniforms.inner.i][uniforms.inner.j] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Bound: 26
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %m1 "m1"
OpName %main "main"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,28 +24,29 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Private_mat2v4float = OpTypePointer Private %mat2v4float
%10 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %10
%11 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %11
%void = OpTypeVoid
%11 = OpTypeFunction %void
%12 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%_ptr_Private_float = OpTypePointer Private %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %11
%14 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%20 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%21 = OpLoad %uint %20
%23 = OpAccessChain %_ptr_Private_float %m1 %18 %21
OpStore %23 %float_1
%main = OpFunction %void None %12
%15 = OpLabel
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%19 = OpLoad %uint %18
%21 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%22 = OpLoad %uint %21
%24 = OpAccessChain %_ptr_Private_float %m1 %19 %22
OpStore %24 %float_1
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
void tint_symbol() {
m1[0][uniforms.j] = 1.0f;
m1[0][uniforms.inner.j] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 24
; Bound: 26
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %m1 "m1"
OpName %main "main"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,27 +24,29 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Private_mat2v4float = OpTypePointer Private %mat2v4float
%10 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %10
%11 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %11
%void = OpTypeVoid
%11 = OpTypeFunction %void
%12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%16 = OpConstantNull %int
%17 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Private_float = OpTypePointer Private %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %11
%14 = OpLabel
%19 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%20 = OpLoad %uint %19
%22 = OpAccessChain %_ptr_Private_float %m1 %16 %20
OpStore %22 %float_1
%main = OpFunction %void None %12
%15 = OpLabel
%21 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%22 = OpLoad %uint %21
%24 = OpAccessChain %_ptr_Private_float %m1 %17 %22
OpStore %24 %float_1
OpReturn
OpFunctionEnd

View File

@ -1,15 +1,19 @@
#version 310 es
layout(binding = 4, std140) uniform Uniforms_ubo {
struct Uniforms {
uint i;
uint j;
uint pad;
uint pad_1;
};
layout(binding = 4, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
void tint_symbol() {
m1[uniforms.i] = vec4(1.0f);
m1[uniforms.inner.i] = vec4(1.0f);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Bound: 24
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %m1 "m1"
OpName %main "main"
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
@ -21,26 +24,27 @@
OpDecorate %uniforms Binding 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%_ptr_Private_mat2v4float = OpTypePointer Private %mat2v4float
%10 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %10
%11 = OpConstantNull %mat2v4float
%m1 = OpVariable %_ptr_Private_mat2v4float Private %11
%void = OpTypeVoid
%11 = OpTypeFunction %void
%12 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Private_v4float = OpTypePointer Private %v4float
%float_1 = OpConstant %float 1
%22 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%main = OpFunction %void None %11
%14 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%20 = OpAccessChain %_ptr_Private_v4float %m1 %18
OpStore %20 %22
%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%main = OpFunction %void None %12
%15 = OpLabel
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%19 = OpLoad %uint %18
%21 = OpAccessChain %_ptr_Private_v4float %m1 %19
OpStore %21 %23
OpReturn
OpFunctionEnd

View File

@ -10,7 +10,7 @@ struct PointLight {
vec4 position;
};
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
mat4 worldView;
mat4 proj;
uint numPointLights;
@ -18,6 +18,10 @@ layout(binding = 0, std140) uniform Uniforms_ubo {
uint pad;
uint pad_1;
vec4 color;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
layout(binding = 1, std430) buffer PointLights_ssbo {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 107
; Bound: 108
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -13,6 +13,8 @@
OpName %uv_1 "uv_1"
OpName %color_1 "color_1"
OpName %color_2 "color_2"
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "worldView"
OpMemberName %Uniforms 1 "proj"
@ -48,7 +50,8 @@
OpDecorate %uv_1 Location 2
OpDecorate %color_1 Location 3
OpDecorate %color_2 Location 0
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 0 ColMajor
OpMemberDecorate %Uniforms 0 MatrixStride 16
@ -94,25 +97,27 @@
%mat4v4float = OpTypeMatrix %v4float 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %mat4v4float %mat4v4float %uint %uint %v4float
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%PointLight = OpTypeStruct %v4float
%_runtimearr_PointLight = OpTypeRuntimeArray %PointLight
%PointLights = OpTypeStruct %_runtimearr_PointLight
%_ptr_StorageBuffer_PointLights = OpTypePointer StorageBuffer %PointLights
%pointLights = OpVariable %_ptr_StorageBuffer_PointLights StorageBuffer
%26 = OpTypeSampler
%_ptr_UniformConstant_26 = OpTypePointer UniformConstant %26
%mySampler = OpVariable %_ptr_UniformConstant_26 UniformConstant
%29 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_29 = OpTypePointer UniformConstant %29
%myTexture = OpVariable %_ptr_UniformConstant_29 UniformConstant
%27 = OpTypeSampler
%_ptr_UniformConstant_27 = OpTypePointer UniformConstant %27
%mySampler = OpVariable %_ptr_UniformConstant_27 UniformConstant
%30 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_30 = OpTypePointer UniformConstant %30
%myTexture = OpVariable %_ptr_UniformConstant_30 UniformConstant
%FragmentInput = OpTypeStruct %v4float %v4float %v4float %v2float %v4float
%30 = OpTypeFunction %v4float %FragmentInput
%31 = OpTypeFunction %v4float %FragmentInput
%_ptr_Function_v4float = OpTypePointer Function %v4float
%uint_0 = OpConstant %uint 0
%uint_3 = OpConstant %uint 3
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%41 = OpConstantNull %uint
%43 = OpConstantNull %uint
%bool = OpTypeBool
%uint_1 = OpConstant %uint 1
%_ptr_Function_float = OpTypePointer Function %float
@ -120,95 +125,94 @@
%uint_2 = OpConstant %uint 2
%uint_4 = OpConstant %uint 4
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%78 = OpTypeSampledImage %29
%80 = OpTypeSampledImage %30
%FragmentOutput = OpTypeStruct %v4float
%82 = OpTypeFunction %FragmentOutput %FragmentInput
%84 = OpTypeFunction %FragmentOutput %FragmentInput
%_ptr_Function_FragmentOutput = OpTypePointer Function %FragmentOutput
%89 = OpConstantNull %FragmentOutput
%uint_0 = OpConstant %uint 0
%92 = OpConstantNull %float
%93 = OpConstantComposite %v4float %float_1 %92 %92 %float_1
%91 = OpConstantNull %FragmentOutput
%93 = OpConstantNull %float
%94 = OpConstantComposite %v4float %float_1 %93 %93 %float_1
%void = OpTypeVoid
%95 = OpTypeFunction %void
%getColor = OpFunction %v4float None %30
%96 = OpTypeFunction %void
%getColor = OpFunction %v4float None %31
%fragment = OpFunctionParameter %FragmentInput
%34 = OpLabel
%35 = OpLabel
%color = OpVariable %_ptr_Function_v4float Function %13
%39 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
%40 = OpLoad %uint %39
%42 = OpIEqual %bool %40 %41
OpSelectionMerge %44 None
OpBranchConditional %42 %45 %46
%45 = OpLabel
%47 = OpCompositeExtract %v4float %fragment 4
OpStore %color %47
OpBranch %44
%46 = OpLabel
%48 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
%49 = OpLoad %uint %48
%51 = OpIEqual %bool %49 %uint_1
OpSelectionMerge %52 None
OpBranchConditional %51 %53 %54
%53 = OpLabel
%55 = OpCompositeExtract %v4float %fragment 2
OpStore %color %55
%57 = OpAccessChain %_ptr_Function_float %color %uint_3
OpStore %57 %float_1
OpBranch %52
%54 = OpLabel
%59 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
%60 = OpLoad %uint %59
%62 = OpIEqual %bool %60 %uint_2
OpSelectionMerge %63 None
OpBranchConditional %62 %64 %65
%64 = OpLabel
%68 = OpAccessChain %_ptr_Uniform_v4float %uniforms %uint_4
%69 = OpLoad %v4float %68
OpStore %color %69
OpBranch %63
%41 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_3
%42 = OpLoad %uint %41
%44 = OpIEqual %bool %42 %43
OpSelectionMerge %46 None
OpBranchConditional %44 %47 %48
%47 = OpLabel
%49 = OpCompositeExtract %v4float %fragment 4
OpStore %color %49
OpBranch %46
%48 = OpLabel
%50 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_3
%51 = OpLoad %uint %50
%53 = OpIEqual %bool %51 %uint_1
OpSelectionMerge %54 None
OpBranchConditional %53 %55 %56
%55 = OpLabel
%57 = OpCompositeExtract %v4float %fragment 2
OpStore %color %57
%59 = OpAccessChain %_ptr_Function_float %color %uint_3
OpStore %59 %float_1
OpBranch %54
%56 = OpLabel
%61 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_3
%62 = OpLoad %uint %61
%64 = OpIEqual %bool %62 %uint_2
OpSelectionMerge %65 None
OpBranchConditional %64 %66 %67
%66 = OpLabel
%70 = OpAccessChain %_ptr_Uniform_v4float %uniforms %uint_0 %uint_4
%71 = OpLoad %v4float %70
OpStore %color %71
OpBranch %65
%67 = OpLabel
%72 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_3
%73 = OpLoad %uint %72
%74 = OpIEqual %bool %73 %uint_3
OpSelectionMerge %75 None
OpBranchConditional %74 %76 %75
%76 = OpLabel
%78 = OpLoad %27 %mySampler
%79 = OpLoad %30 %myTexture
%81 = OpSampledImage %80 %79 %78
%82 = OpCompositeExtract %v2float %fragment 3
%77 = OpImageSampleImplicitLod %v4float %81 %82
OpStore %color %77
OpBranch %75
%75 = OpLabel
OpBranch %65
%65 = OpLabel
%70 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
%71 = OpLoad %uint %70
%72 = OpIEqual %bool %71 %uint_3
OpSelectionMerge %73 None
OpBranchConditional %72 %74 %73
%74 = OpLabel
%76 = OpLoad %26 %mySampler
%77 = OpLoad %29 %myTexture
%79 = OpSampledImage %78 %77 %76
%80 = OpCompositeExtract %v2float %fragment 3
%75 = OpImageSampleImplicitLod %v4float %79 %80
OpStore %color %75
OpBranch %73
%73 = OpLabel
OpBranch %63
%63 = OpLabel
OpBranch %52
%52 = OpLabel
OpBranch %44
%44 = OpLabel
%81 = OpLoad %v4float %color
OpReturnValue %81
OpBranch %54
%54 = OpLabel
OpBranch %46
%46 = OpLabel
%83 = OpLoad %v4float %color
OpReturnValue %83
OpFunctionEnd
%main_inner = OpFunction %FragmentOutput None %82
%main_inner = OpFunction %FragmentOutput None %84
%fragment_0 = OpFunctionParameter %FragmentInput
%86 = OpLabel
%output = OpVariable %_ptr_Function_FragmentOutput Function %89
%91 = OpAccessChain %_ptr_Function_v4float %output %uint_0
OpStore %91 %93
%94 = OpLoad %FragmentOutput %output
OpReturnValue %94
%88 = OpLabel
%output = OpVariable %_ptr_Function_FragmentOutput Function %91
%92 = OpAccessChain %_ptr_Function_v4float %output %uint_0
OpStore %92 %94
%95 = OpLoad %FragmentOutput %output
OpReturnValue %95
OpFunctionEnd
%main = OpFunction %void None %95
%98 = OpLabel
%100 = OpLoad %v4float %position_1
%101 = OpLoad %v4float %view_position_1
%102 = OpLoad %v4float %normal_1
%103 = OpLoad %v2float %uv_1
%104 = OpLoad %v4float %color_1
%105 = OpCompositeConstruct %FragmentInput %100 %101 %102 %103 %104
%99 = OpFunctionCall %FragmentOutput %main_inner %105
%106 = OpCompositeExtract %v4float %99 0
OpStore %color_2 %106
%main = OpFunction %void None %96
%99 = OpLabel
%101 = OpLoad %v4float %position_1
%102 = OpLoad %v4float %view_position_1
%103 = OpLoad %v4float %normal_1
%104 = OpLoad %v2float %uv_1
%105 = OpLoad %v4float %color_1
%106 = OpCompositeConstruct %FragmentInput %101 %102 %103 %104 %105
%100 = OpFunctionCall %FragmentOutput %main_inner %106
%107 = OpCompositeExtract %v4float %100 0
OpStore %color_2 %107
OpReturn
OpFunctionEnd

View File

@ -2,8 +2,12 @@
precision mediump float;
layout(location = 0) out vec4 x_GLF_color_1_1;
layout(binding = 0, std140) uniform buf0_ubo {
struct buf0 {
vec4 ref;
};
layout(binding = 0, std140) uniform x_7_block_ubo {
buf0 inner;
} x_7;
vec4 x_GLF_color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
@ -17,7 +21,7 @@ void main_1() {
float x_39 = f;
v = vec4(sin(x_33), cos(x_35), exp2(x_37), log(x_39));
vec4 x_42 = v;
vec4 x_44 = x_7.ref;
vec4 x_44 = x_7.inner.ref;
if ((distance(x_42, x_44) < 0.100000001f)) {
x_GLF_color = vec4(1.0f, 0.0f, 0.0f, 1.0f);
} else {

View File

@ -1,14 +1,16 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 63
; Bound: 64
; Schema: 0
OpCapability Shader
%21 = OpExtInstImport "GLSL.std.450"
%22 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %x_7_block "x_7_block"
OpMemberName %x_7_block 0 "inner"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "ref"
OpName %x_7 "x_7"
@ -21,7 +23,8 @@
OpName %main_inner "main_inner"
OpName %main "main"
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpDecorate %x_7_block Block
OpMemberDecorate %x_7_block 0 Offset 0
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_7 NonWritable
OpDecorate %x_7 DescriptorSet 0
@ -33,73 +36,74 @@
%5 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
%buf0 = OpTypeStruct %v4float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_7_block = OpTypeStruct %buf0
%_ptr_Uniform_x_7_block = OpTypePointer Uniform %x_7_block
%x_7 = OpVariable %_ptr_Uniform_x_7_block Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%11 = OpTypeFunction %void
%12 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%17 = OpConstantNull %float
%18 = OpConstantNull %float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
%float_1 = OpConstant %float 1
%25 = OpConstantComposite %v3float %float_1 %17 %17
%26 = OpConstantComposite %v3float %17 %float_1 %17
%27 = OpConstantComposite %v3float %17 %17 %float_1
%28 = OpConstantComposite %mat3v3float %25 %26 %27
%26 = OpConstantComposite %v3float %float_1 %18 %18
%27 = OpConstantComposite %v3float %18 %float_1 %18
%28 = OpConstantComposite %v3float %18 %18 %float_1
%29 = OpConstantComposite %mat3v3float %26 %27 %28
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_0_100000001 = OpConstant %float 0.100000001
%bool = OpTypeBool
%51 = OpConstantComposite %v4float %float_1 %17 %17 %float_1
%52 = OpConstantComposite %v4float %float_1 %18 %18 %float_1
%main_out = OpTypeStruct %v4float
%52 = OpTypeFunction %main_out
%main_1 = OpFunction %void None %11
%14 = OpLabel
%f = OpVariable %_ptr_Function_float Function %17
%53 = OpTypeFunction %main_out
%main_1 = OpFunction %void None %12
%15 = OpLabel
%f = OpVariable %_ptr_Function_float Function %18
%v = OpVariable %_ptr_Function_v4float Function %5
%20 = OpExtInst %float %21 Determinant %28
OpStore %f %20
%29 = OpLoad %float %f
%21 = OpExtInst %float %22 Determinant %29
OpStore %f %21
%30 = OpLoad %float %f
%31 = OpLoad %float %f
%32 = OpLoad %float %f
%33 = OpExtInst %float %21 Sin %29
%34 = OpExtInst %float %21 Cos %30
%35 = OpExtInst %float %21 Exp2 %31
%36 = OpExtInst %float %21 Log %32
%37 = OpCompositeConstruct %v4float %33 %34 %35 %36
OpStore %v %37
%38 = OpLoad %v4float %v
%42 = OpAccessChain %_ptr_Uniform_v4float %x_7 %uint_0
%43 = OpLoad %v4float %42
%44 = OpExtInst %float %21 Distance %38 %43
%46 = OpFOrdLessThan %bool %44 %float_0_100000001
OpSelectionMerge %48 None
OpBranchConditional %46 %49 %50
%49 = OpLabel
OpStore %x_GLF_color %51
OpBranch %48
%33 = OpLoad %float %f
%34 = OpExtInst %float %22 Sin %30
%35 = OpExtInst %float %22 Cos %31
%36 = OpExtInst %float %22 Exp2 %32
%37 = OpExtInst %float %22 Log %33
%38 = OpCompositeConstruct %v4float %34 %35 %36 %37
OpStore %v %38
%39 = OpLoad %v4float %v
%43 = OpAccessChain %_ptr_Uniform_v4float %x_7 %uint_0 %uint_0
%44 = OpLoad %v4float %43
%45 = OpExtInst %float %22 Distance %39 %44
%47 = OpFOrdLessThan %bool %45 %float_0_100000001
OpSelectionMerge %49 None
OpBranchConditional %47 %50 %51
%50 = OpLabel
OpStore %x_GLF_color %52
OpBranch %49
%51 = OpLabel
OpStore %x_GLF_color %5
OpBranch %48
%48 = OpLabel
OpBranch %49
%49 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %52
%55 = OpLabel
%56 = OpFunctionCall %void %main_1
%57 = OpLoad %v4float %x_GLF_color
%58 = OpCompositeConstruct %main_out %57
OpReturnValue %58
%main_inner = OpFunction %main_out None %53
%56 = OpLabel
%57 = OpFunctionCall %void %main_1
%58 = OpLoad %v4float %x_GLF_color
%59 = OpCompositeConstruct %main_out %58
OpReturnValue %59
OpFunctionEnd
%main = OpFunction %void None %11
%60 = OpLabel
%61 = OpFunctionCall %main_out %main_inner
%62 = OpCompositeExtract %v4float %61 0
OpStore %x_GLF_color_1_1 %62
%main = OpFunction %void None %12
%61 = OpLabel
%62 = OpFunctionCall %main_out %main_inner
%63 = OpCompositeExtract %v4float %62 0
OpStore %x_GLF_color_1_1 %63
OpReturn
OpFunctionEnd

View File

@ -11,8 +11,7 @@ struct strided_arr {
uint pad_2;
};
vec3 position = vec3(0.0f, 0.0f, 0.0f);
layout(binding = 2, std140) uniform LeftOver_ubo {
struct LeftOver {
mat4 worldViewProjection;
float time;
uint pad_3;
@ -20,6 +19,11 @@ layout(binding = 2, std140) uniform LeftOver_ubo {
uint pad_5;
mat4 test2[2];
strided_arr test[4];
};
vec3 position = vec3(0.0f, 0.0f, 0.0f);
layout(binding = 2, std140) uniform x_14_block_ubo {
LeftOver inner;
} x_14;
vec2 vUV = vec2(0.0f, 0.0f);
@ -34,14 +38,14 @@ void main_1() {
vec4 x_21 = q;
p = vec3(x_21.x, x_21.y, x_21.z);
float x_27 = p.x;
float x_41 = x_14.test[0].el;
float x_41 = x_14.inner.test[0].el;
float x_45 = position.y;
float x_49 = x_14.time;
float x_49 = x_14.inner.time;
p.x = (x_27 + sin(((x_41 * x_45) + x_49)));
float x_55 = p.y;
float x_57 = x_14.time;
float x_57 = x_14.inner.time;
p.y = (x_55 + sin((x_57 + 4.0f)));
mat4 x_69 = x_14.worldViewProjection;
mat4 x_69 = x_14.inner.worldViewProjection;
vec3 x_70 = p;
tint_symbol = (x_69 * vec4(x_70.x, x_70.y, x_70.z, 1.0f));
vec2 x_83 = uv;

View File

@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 122
; Bound: 123
; Schema: 0
OpCapability Shader
%75 = OpExtInstImport "GLSL.std.450"
%76 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %main "main" %position_param_1 %uv_param_1 %normal_param_1 %gl_Position_1 %vUV_1_1 %vertex_point_size
OpName %position_param_1 "position_param_1"
@ -14,6 +14,8 @@
OpName %vUV_1_1 "vUV_1_1"
OpName %vertex_point_size "vertex_point_size"
OpName %position "position"
OpName %x_14_block "x_14_block"
OpMemberName %x_14_block 0 "inner"
OpName %LeftOver "LeftOver"
OpMemberName %LeftOver 0 "worldViewProjection"
OpMemberName %LeftOver 1 "time"
@ -43,7 +45,8 @@
OpDecorate %gl_Position_1 BuiltIn Position
OpDecorate %vUV_1_1 Location 0
OpDecorate %vertex_point_size BuiltIn PointSize
OpDecorate %LeftOver Block
OpDecorate %x_14_block Block
OpMemberDecorate %x_14_block 0 Offset 0
OpMemberDecorate %LeftOver 0 Offset 0
OpMemberDecorate %LeftOver 0 ColMajor
OpMemberDecorate %LeftOver 0 MatrixStride 16
@ -89,8 +92,9 @@
%uint_4 = OpConstant %uint 4
%_arr_strided_arr_uint_4 = OpTypeArray %strided_arr %uint_4
%LeftOver = OpTypeStruct %mat4v4float %float %_arr_mat4v4float_uint_2 %_arr_strided_arr_uint_4
%_ptr_Uniform_LeftOver = OpTypePointer Uniform %LeftOver
%x_14 = OpVariable %_ptr_Uniform_LeftOver Uniform
%x_14_block = OpTypeStruct %LeftOver
%_ptr_Uniform_x_14_block = OpTypePointer Uniform %x_14_block
%x_14 = OpVariable %_ptr_Uniform_x_14_block Uniform
%_ptr_Private_v2float = OpTypePointer Private %v2float
%vUV = OpVariable %_ptr_Private_v2float Private %15
%uv = OpVariable %_ptr_Private_v2float Private %15
@ -98,7 +102,7 @@
%_ptr_Private_v4float = OpTypePointer Private %v4float
%gl_Position = OpVariable %_ptr_Private_v4float Private %12
%void = OpTypeVoid
%38 = OpTypeFunction %void
%39 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_v3float = OpTypePointer Function %v3float
%float_1 = OpConstant %float 1
@ -106,7 +110,7 @@
%_ptr_Function_float = OpTypePointer Function %float
%uint_3 = OpConstant %uint 3
%int = OpTypeInt 32 1
%63 = OpConstantNull %int
%64 = OpConstantNull %int
%_ptr_Uniform_float = OpTypePointer Uniform %float
%uint_1 = OpConstant %uint 1
%_ptr_Private_float = OpTypePointer Private %float
@ -114,88 +118,88 @@
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
%float_n1 = OpConstant %float -1
%main_out = OpTypeStruct %v4float %v2float
%103 = OpTypeFunction %main_out %v3float %v2float %v3float
%main_1 = OpFunction %void None %38
%41 = OpLabel
%104 = OpTypeFunction %main_out %v3float %v2float %v3float
%main_1 = OpFunction %void None %39
%42 = OpLabel
%q = OpVariable %_ptr_Function_v4float Function %12
%p = OpVariable %_ptr_Function_v3float Function %21
%46 = OpLoad %v3float %position
%47 = OpCompositeExtract %float %46 0
%48 = OpCompositeExtract %float %46 1
%49 = OpCompositeExtract %float %46 2
%51 = OpCompositeConstruct %v4float %47 %48 %49 %float_1
OpStore %q %51
%52 = OpLoad %v4float %q
%53 = OpCompositeExtract %float %52 0
%54 = OpCompositeExtract %float %52 1
%55 = OpCompositeExtract %float %52 2
%56 = OpCompositeConstruct %v3float %53 %54 %55
OpStore %p %56
%59 = OpAccessChain %_ptr_Function_float %p %uint_0
%60 = OpLoad %float %59
%65 = OpAccessChain %_ptr_Uniform_float %x_14 %uint_3 %63 %uint_0
%66 = OpLoad %float %65
%69 = OpAccessChain %_ptr_Private_float %position %uint_1
%70 = OpLoad %float %69
%71 = OpAccessChain %_ptr_Uniform_float %x_14 %uint_1
%72 = OpLoad %float %71
%73 = OpAccessChain %_ptr_Function_float %p %uint_0
%76 = OpFMul %float %66 %70
%77 = OpFAdd %float %76 %72
%74 = OpExtInst %float %75 Sin %77
%78 = OpFAdd %float %60 %74
OpStore %73 %78
%79 = OpAccessChain %_ptr_Function_float %p %uint_1
%80 = OpLoad %float %79
%81 = OpAccessChain %_ptr_Uniform_float %x_14 %uint_1
%82 = OpLoad %float %81
%83 = OpAccessChain %_ptr_Function_float %p %uint_1
%86 = OpFAdd %float %82 %float_4
%84 = OpExtInst %float %75 Sin %86
%87 = OpFAdd %float %80 %84
OpStore %83 %87
%89 = OpAccessChain %_ptr_Uniform_mat4v4float %x_14 %uint_0
%90 = OpLoad %mat4v4float %89
%91 = OpLoad %v3float %p
%92 = OpCompositeExtract %float %91 0
%93 = OpCompositeExtract %float %91 1
%94 = OpCompositeExtract %float %91 2
%95 = OpCompositeConstruct %v4float %92 %93 %94 %float_1
%96 = OpMatrixTimesVector %v4float %90 %95
OpStore %gl_Position %96
%97 = OpLoad %v2float %uv
OpStore %vUV %97
%98 = OpAccessChain %_ptr_Private_float %gl_Position %uint_1
%99 = OpLoad %float %98
%100 = OpAccessChain %_ptr_Private_float %gl_Position %uint_1
%102 = OpFMul %float %99 %float_n1
OpStore %100 %102
%47 = OpLoad %v3float %position
%48 = OpCompositeExtract %float %47 0
%49 = OpCompositeExtract %float %47 1
%50 = OpCompositeExtract %float %47 2
%52 = OpCompositeConstruct %v4float %48 %49 %50 %float_1
OpStore %q %52
%53 = OpLoad %v4float %q
%54 = OpCompositeExtract %float %53 0
%55 = OpCompositeExtract %float %53 1
%56 = OpCompositeExtract %float %53 2
%57 = OpCompositeConstruct %v3float %54 %55 %56
OpStore %p %57
%60 = OpAccessChain %_ptr_Function_float %p %uint_0
%61 = OpLoad %float %60
%66 = OpAccessChain %_ptr_Uniform_float %x_14 %uint_0 %uint_3 %64 %uint_0
%67 = OpLoad %float %66
%70 = OpAccessChain %_ptr_Private_float %position %uint_1
%71 = OpLoad %float %70
%72 = OpAccessChain %_ptr_Uniform_float %x_14 %uint_0 %uint_1
%73 = OpLoad %float %72
%74 = OpAccessChain %_ptr_Function_float %p %uint_0
%77 = OpFMul %float %67 %71
%78 = OpFAdd %float %77 %73
%75 = OpExtInst %float %76 Sin %78
%79 = OpFAdd %float %61 %75
OpStore %74 %79
%80 = OpAccessChain %_ptr_Function_float %p %uint_1
%81 = OpLoad %float %80
%82 = OpAccessChain %_ptr_Uniform_float %x_14 %uint_0 %uint_1
%83 = OpLoad %float %82
%84 = OpAccessChain %_ptr_Function_float %p %uint_1
%87 = OpFAdd %float %83 %float_4
%85 = OpExtInst %float %76 Sin %87
%88 = OpFAdd %float %81 %85
OpStore %84 %88
%90 = OpAccessChain %_ptr_Uniform_mat4v4float %x_14 %uint_0 %uint_0
%91 = OpLoad %mat4v4float %90
%92 = OpLoad %v3float %p
%93 = OpCompositeExtract %float %92 0
%94 = OpCompositeExtract %float %92 1
%95 = OpCompositeExtract %float %92 2
%96 = OpCompositeConstruct %v4float %93 %94 %95 %float_1
%97 = OpMatrixTimesVector %v4float %91 %96
OpStore %gl_Position %97
%98 = OpLoad %v2float %uv
OpStore %vUV %98
%99 = OpAccessChain %_ptr_Private_float %gl_Position %uint_1
%100 = OpLoad %float %99
%101 = OpAccessChain %_ptr_Private_float %gl_Position %uint_1
%103 = OpFMul %float %100 %float_n1
OpStore %101 %103
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %103
%main_inner = OpFunction %main_out None %104
%position_param = OpFunctionParameter %v3float
%uv_param = OpFunctionParameter %v2float
%normal_param = OpFunctionParameter %v3float
%109 = OpLabel
%110 = OpLabel
OpStore %position %position_param
OpStore %uv %uv_param
OpStore %normal %normal_param
%110 = OpFunctionCall %void %main_1
%111 = OpLoad %v4float %gl_Position
%112 = OpLoad %v2float %vUV
%113 = OpCompositeConstruct %main_out %111 %112
OpReturnValue %113
%111 = OpFunctionCall %void %main_1
%112 = OpLoad %v4float %gl_Position
%113 = OpLoad %v2float %vUV
%114 = OpCompositeConstruct %main_out %112 %113
OpReturnValue %114
OpFunctionEnd
%main = OpFunction %void None %38
%115 = OpLabel
%117 = OpLoad %v3float %position_param_1
%118 = OpLoad %v2float %uv_param_1
%119 = OpLoad %v3float %normal_param_1
%116 = OpFunctionCall %main_out %main_inner %117 %118 %119
%120 = OpCompositeExtract %v4float %116 0
OpStore %gl_Position_1 %120
%121 = OpCompositeExtract %v2float %116 1
OpStore %vUV_1_1 %121
%main = OpFunction %void None %39
%116 = OpLabel
%118 = OpLoad %v3float %position_param_1
%119 = OpLoad %v2float %uv_param_1
%120 = OpLoad %v3float %normal_param_1
%117 = OpFunctionCall %main_out %main_inner %118 %119 %120
%121 = OpCompositeExtract %v4float %117 0
OpStore %gl_Position_1 %121
%122 = OpCompositeExtract %v2float %117 1
OpStore %vUV_1_1 %122
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd

View File

@ -1,6 +1,6 @@
#version 310 es
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
uint numTriangles;
uint gridSize;
uint pad1;
@ -9,6 +9,25 @@ layout(binding = 0, std140) uniform Uniforms_ubo {
uint pad;
vec3 bbMax;
uint pad_1;
};
struct Dbg {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
layout(binding = 10, std430) buffer U32s_ssbo {
@ -27,30 +46,19 @@ layout(binding = 21, std430) buffer AI32s_ssbo {
int values[];
} LUT;
layout(binding = 50, std430) buffer Dbg_ssbo {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
layout(binding = 50, std430) buffer dbg_block_ssbo {
Dbg inner;
} dbg;
vec3 toVoxelPos(vec3 position) {
vec3 bbMin = vec3(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z);
vec3 bbMax = vec3(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z);
vec3 bbMin = vec3(uniforms.inner.bbMin.x, uniforms.inner.bbMin.y, uniforms.inner.bbMin.z);
vec3 bbMax = vec3(uniforms.inner.bbMax.x, uniforms.inner.bbMax.y, uniforms.inner.bbMax.z);
vec3 bbSize = (bbMax - bbMin);
float cubeSize = max(max(bbSize.x, bbSize.y), bbSize.z);
float gridSize = float(uniforms.gridSize);
float gx = ((gridSize * (position.x - uniforms.bbMin.x)) / cubeSize);
float gy = ((gridSize * (position.y - uniforms.bbMin.y)) / cubeSize);
float gz = ((gridSize * (position.z - uniforms.bbMin.z)) / cubeSize);
float gridSize = float(uniforms.inner.gridSize);
float gx = ((gridSize * (position.x - uniforms.inner.bbMin.x)) / cubeSize);
float gy = ((gridSize * (position.y - uniforms.inner.bbMin.y)) / cubeSize);
float gz = ((gridSize * (position.z - uniforms.inner.bbMin.z)) / cubeSize);
return vec3(gx, gy, gz);
}
@ -65,8 +73,8 @@ vec3 loadPosition(uint vertexIndex) {
}
void doIgnore() {
uint g42 = uniforms.numTriangles;
uint kj6 = dbg.value1;
uint g42 = uniforms.inner.numTriangles;
uint kj6 = dbg.inner.value1;
uint b53 = atomicOr(counters.values[0], 0u);
uint rwg = indices.values[0];
float rb5 = positions.values[0];
@ -75,7 +83,7 @@ void doIgnore() {
void main_count(uvec3 GlobalInvocationID) {
uint triangleIndex = GlobalInvocationID.x;
if ((triangleIndex >= uniforms.numTriangles)) {
if ((triangleIndex >= uniforms.inner.numTriangles)) {
return;
}
doIgnore();
@ -87,13 +95,13 @@ void main_count(uvec3 GlobalInvocationID) {
vec3 p2 = loadPosition(i2);
vec3 center = (((p0 + p1) + p2) / 3.0f);
vec3 voxelPos = toVoxelPos(center);
uint voxelIndex = toIndex1D(uniforms.gridSize, voxelPos);
uint voxelIndex = toIndex1D(uniforms.inner.gridSize, voxelPos);
uint acefg = atomicAdd(counters.values[voxelIndex], 1u);
if ((triangleIndex == 0u)) {
dbg.value0 = uniforms.gridSize;
dbg.value_f32_0 = center.x;
dbg.value_f32_1 = center.y;
dbg.value_f32_2 = center.z;
dbg.inner.value0 = uniforms.inner.gridSize;
dbg.inner.value_f32_0 = center.x;
dbg.inner.value_f32_1 = center.y;
dbg.inner.value_f32_2 = center.z;
}
}
@ -104,7 +112,7 @@ void main() {
}
#version 310 es
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
uint numTriangles;
uint gridSize;
uint pad1;
@ -113,6 +121,25 @@ layout(binding = 0, std140) uniform Uniforms_ubo {
uint pad;
vec3 bbMax;
uint pad_1;
};
struct Dbg {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
layout(binding = 10, std430) buffer U32s_ssbo {
@ -131,24 +158,13 @@ layout(binding = 21, std430) buffer AI32s_ssbo {
int values[];
} LUT;
layout(binding = 50, std430) buffer Dbg_ssbo {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
layout(binding = 50, std430) buffer dbg_block_ssbo {
Dbg inner;
} dbg;
void doIgnore() {
uint g42 = uniforms.numTriangles;
uint kj6 = dbg.value1;
uint g42 = uniforms.inner.numTriangles;
uint kj6 = dbg.inner.value1;
uint b53 = atomicOr(counters.values[0], 0u);
uint rwg = indices.values[0];
float rb5 = positions.values[0];
@ -158,14 +174,14 @@ void doIgnore() {
void main_create_lut(uvec3 GlobalInvocationID) {
uint voxelIndex = GlobalInvocationID.x;
doIgnore();
uint maxVoxels = ((uniforms.gridSize * uniforms.gridSize) * uniforms.gridSize);
uint maxVoxels = ((uniforms.inner.gridSize * uniforms.inner.gridSize) * uniforms.inner.gridSize);
if ((voxelIndex >= maxVoxels)) {
return;
}
uint numTriangles = atomicOr(counters.values[voxelIndex], 0u);
int offset = -1;
if ((numTriangles > 0u)) {
uint tint_symbol = atomicAdd(dbg.offsetCounter, numTriangles);
uint tint_symbol = atomicAdd(dbg.inner.offsetCounter, numTriangles);
offset = int(tint_symbol);
}
atomicExchange(LUT.values[voxelIndex], offset);
@ -178,7 +194,7 @@ void main() {
}
#version 310 es
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
uint numTriangles;
uint gridSize;
uint pad1;
@ -187,6 +203,25 @@ layout(binding = 0, std140) uniform Uniforms_ubo {
uint pad;
vec3 bbMax;
uint pad_1;
};
struct Dbg {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
layout(binding = 10, std430) buffer U32s_ssbo {
@ -205,30 +240,19 @@ layout(binding = 21, std430) buffer AI32s_ssbo {
int values[];
} LUT;
layout(binding = 50, std430) buffer Dbg_ssbo {
uint offsetCounter;
uint pad0;
uint pad1;
uint pad2;
uint value0;
uint value1;
uint value2;
uint value3;
float value_f32_0;
float value_f32_1;
float value_f32_2;
float value_f32_3;
layout(binding = 50, std430) buffer dbg_block_ssbo {
Dbg inner;
} dbg;
vec3 toVoxelPos(vec3 position) {
vec3 bbMin = vec3(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z);
vec3 bbMax = vec3(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z);
vec3 bbMin = vec3(uniforms.inner.bbMin.x, uniforms.inner.bbMin.y, uniforms.inner.bbMin.z);
vec3 bbMax = vec3(uniforms.inner.bbMax.x, uniforms.inner.bbMax.y, uniforms.inner.bbMax.z);
vec3 bbSize = (bbMax - bbMin);
float cubeSize = max(max(bbSize.x, bbSize.y), bbSize.z);
float gridSize = float(uniforms.gridSize);
float gx = ((gridSize * (position.x - uniforms.bbMin.x)) / cubeSize);
float gy = ((gridSize * (position.y - uniforms.bbMin.y)) / cubeSize);
float gz = ((gridSize * (position.z - uniforms.bbMin.z)) / cubeSize);
float gridSize = float(uniforms.inner.gridSize);
float gx = ((gridSize * (position.x - uniforms.inner.bbMin.x)) / cubeSize);
float gy = ((gridSize * (position.y - uniforms.inner.bbMin.y)) / cubeSize);
float gz = ((gridSize * (position.z - uniforms.inner.bbMin.z)) / cubeSize);
return vec3(gx, gy, gz);
}
@ -243,8 +267,8 @@ vec3 loadPosition(uint vertexIndex) {
}
void doIgnore() {
uint g42 = uniforms.numTriangles;
uint kj6 = dbg.value1;
uint g42 = uniforms.inner.numTriangles;
uint kj6 = dbg.inner.value1;
uint b53 = atomicOr(counters.values[0], 0u);
uint rwg = indices.values[0];
float rb5 = positions.values[0];
@ -254,7 +278,7 @@ void doIgnore() {
void main_sort_triangles(uvec3 GlobalInvocationID) {
uint triangleIndex = GlobalInvocationID.x;
doIgnore();
if ((triangleIndex >= uniforms.numTriangles)) {
if ((triangleIndex >= uniforms.inner.numTriangles)) {
return;
}
uint i0 = indices.values[((3u * triangleIndex) + 0u)];
@ -265,7 +289,7 @@ void main_sort_triangles(uvec3 GlobalInvocationID) {
vec3 p2 = loadPosition(i2);
vec3 center = (((p0 + p1) + p2) / 3.0f);
vec3 voxelPos = toVoxelPos(center);
uint voxelIndex = toIndex1D(uniforms.gridSize, voxelPos);
uint voxelIndex = toIndex1D(uniforms.inner.gridSize, voxelPos);
int triangleOffset = atomicAdd(LUT.values[voxelIndex], 1);
}

View File

@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 402
; Bound: 404
; Schema: 0
OpCapability Shader
%65 = OpExtInstImport "GLSL.std.450"
%67 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main_count "main_count" %GlobalInvocationID_1
OpEntryPoint GLCompute %main_create_lut "main_create_lut" %GlobalInvocationID_2
@ -15,6 +15,8 @@
OpName %GlobalInvocationID_1 "GlobalInvocationID_1"
OpName %GlobalInvocationID_2 "GlobalInvocationID_2"
OpName %GlobalInvocationID_3 "GlobalInvocationID_3"
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "numTriangles"
OpMemberName %Uniforms 1 "gridSize"
@ -35,6 +37,8 @@
OpName %AI32s "AI32s"
OpMemberName %AI32s 0 "values"
OpName %LUT "LUT"
OpName %dbg_block "dbg_block"
OpMemberName %dbg_block 0 "inner"
OpName %Dbg "Dbg"
OpMemberName %Dbg 0 "offsetCounter"
OpMemberName %Dbg 1 "pad0"
@ -117,7 +121,8 @@
OpDecorate %GlobalInvocationID_1 BuiltIn GlobalInvocationId
OpDecorate %GlobalInvocationID_2 BuiltIn GlobalInvocationId
OpDecorate %GlobalInvocationID_3 BuiltIn GlobalInvocationId
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpMemberDecorate %Uniforms 2 Offset 8
@ -147,7 +152,8 @@
OpDecorate %_runtimearr_int ArrayStride 4
OpDecorate %LUT Binding 21
OpDecorate %LUT DescriptorSet 0
OpDecorate %Dbg Block
OpDecorate %dbg_block Block
OpMemberDecorate %dbg_block 0 Offset 0
OpMemberDecorate %Dbg 0 Offset 0
OpMemberDecorate %Dbg 1 Offset 4
OpMemberDecorate %Dbg 2 Offset 8
@ -171,8 +177,9 @@
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%Uniforms = OpTypeStruct %uint %uint %uint %uint %v3float %v3float
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%_runtimearr_uint = OpTypeRuntimeArray %uint
%U32s = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_U32s = OpTypePointer StorageBuffer %U32s
@ -191,37 +198,38 @@
%_ptr_StorageBuffer_AI32s = OpTypePointer StorageBuffer %AI32s
%LUT = OpVariable %_ptr_StorageBuffer_AI32s StorageBuffer
%Dbg = OpTypeStruct %uint %uint %uint %uint %uint %uint %uint %uint %float %float %float %float
%_ptr_StorageBuffer_Dbg = OpTypePointer StorageBuffer %Dbg
%dbg = OpVariable %_ptr_StorageBuffer_Dbg StorageBuffer
%32 = OpTypeFunction %v3float %v3float
%uint_4 = OpConstant %uint 4
%dbg_block = OpTypeStruct %Dbg
%_ptr_StorageBuffer_dbg_block = OpTypePointer StorageBuffer %dbg_block
%dbg = OpVariable %_ptr_StorageBuffer_dbg_block StorageBuffer
%34 = OpTypeFunction %v3float %v3float
%uint_0 = OpConstant %uint 0
%uint_4 = OpConstant %uint 4
%_ptr_Uniform_float = OpTypePointer Uniform %float
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%50 = OpConstantNull %v3float
%52 = OpConstantNull %v3float
%uint_5 = OpConstant %uint 5
%_ptr_Function_float = OpTypePointer Function %float
%75 = OpConstantNull %float
%77 = OpConstantNull %float
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%112 = OpTypeFunction %uint %uint %v3float
%114 = OpTypeFunction %uint %uint %v3float
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
%120 = OpConstantNull %v3uint
%122 = OpConstantNull %v3uint
%_ptr_Function_uint = OpTypePointer Function %uint
%133 = OpTypeFunction %v3uint %uint %uint
%141 = OpConstantNull %uint
%154 = OpTypeFunction %v3float %uint
%135 = OpTypeFunction %v3uint %uint %uint
%143 = OpConstantNull %uint
%156 = OpTypeFunction %v3float %uint
%uint_3 = OpConstant %uint 3
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%void = OpTypeVoid
%175 = OpTypeFunction %void
%177 = OpTypeFunction %void
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%188 = OpConstantNull %int
%190 = OpConstantNull %int
%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%_ptr_Function_int = OpTypePointer Function %int
%204 = OpTypeFunction %void %v3uint
%206 = OpTypeFunction %void %v3uint
%bool = OpTypeBool
%float_3 = OpConstant %float 3
%uint_8 = OpConstant %uint 8
@ -229,416 +237,416 @@
%uint_10 = OpConstant %uint 10
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%toVoxelPos = OpFunction %v3float None %32
%toVoxelPos = OpFunction %v3float None %34
%position = OpFunctionParameter %v3float
%35 = OpLabel
%bbMin = OpVariable %_ptr_Function_v3float Function %50
%bbMax = OpVariable %_ptr_Function_v3float Function %50
%bbSize = OpVariable %_ptr_Function_v3float Function %50
%cubeSize = OpVariable %_ptr_Function_float Function %75
%gridSize = OpVariable %_ptr_Function_float Function %75
%gx = OpVariable %_ptr_Function_float Function %75
%gy = OpVariable %_ptr_Function_float Function %75
%gz = OpVariable %_ptr_Function_float Function %75
%39 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_0
%40 = OpLoad %float %39
%42 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_1
%43 = OpLoad %float %42
%45 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_2
%46 = OpLoad %float %45
%47 = OpCompositeConstruct %v3float %40 %43 %46
OpStore %bbMin %47
%52 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_5 %uint_0
%53 = OpLoad %float %52
%54 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_5 %uint_1
%37 = OpLabel
%bbMin = OpVariable %_ptr_Function_v3float Function %52
%bbMax = OpVariable %_ptr_Function_v3float Function %52
%bbSize = OpVariable %_ptr_Function_v3float Function %52
%cubeSize = OpVariable %_ptr_Function_float Function %77
%gridSize = OpVariable %_ptr_Function_float Function %77
%gx = OpVariable %_ptr_Function_float Function %77
%gy = OpVariable %_ptr_Function_float Function %77
%gz = OpVariable %_ptr_Function_float Function %77
%41 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_0
%42 = OpLoad %float %41
%44 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_1
%45 = OpLoad %float %44
%47 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_2
%48 = OpLoad %float %47
%49 = OpCompositeConstruct %v3float %42 %45 %48
OpStore %bbMin %49
%54 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_0
%55 = OpLoad %float %54
%56 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_5 %uint_2
%56 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_1
%57 = OpLoad %float %56
%58 = OpCompositeConstruct %v3float %53 %55 %57
OpStore %bbMax %58
%60 = OpLoad %v3float %bbMax
%61 = OpLoad %v3float %bbMin
%62 = OpFSub %v3float %60 %61
OpStore %bbSize %62
%68 = OpAccessChain %_ptr_Function_float %bbSize %uint_0
%69 = OpLoad %float %68
%70 = OpAccessChain %_ptr_Function_float %bbSize %uint_1
%58 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_2
%59 = OpLoad %float %58
%60 = OpCompositeConstruct %v3float %55 %57 %59
OpStore %bbMax %60
%62 = OpLoad %v3float %bbMax
%63 = OpLoad %v3float %bbMin
%64 = OpFSub %v3float %62 %63
OpStore %bbSize %64
%70 = OpAccessChain %_ptr_Function_float %bbSize %uint_0
%71 = OpLoad %float %70
%66 = OpExtInst %float %65 NMax %69 %71
%72 = OpAccessChain %_ptr_Function_float %bbSize %uint_2
%72 = OpAccessChain %_ptr_Function_float %bbSize %uint_1
%73 = OpLoad %float %72
%64 = OpExtInst %float %65 NMax %66 %73
OpStore %cubeSize %64
%78 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%79 = OpLoad %uint %78
%76 = OpConvertUToF %float %79
OpStore %gridSize %76
%81 = OpLoad %float %gridSize
%82 = OpCompositeExtract %float %position 0
%83 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_0
%84 = OpLoad %float %83
%85 = OpFSub %float %82 %84
%86 = OpFMul %float %81 %85
%87 = OpLoad %float %cubeSize
%88 = OpFDiv %float %86 %87
OpStore %gx %88
%90 = OpLoad %float %gridSize
%91 = OpCompositeExtract %float %position 1
%92 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_1
%93 = OpLoad %float %92
%94 = OpFSub %float %91 %93
%95 = OpFMul %float %90 %94
%96 = OpLoad %float %cubeSize
%97 = OpFDiv %float %95 %96
OpStore %gy %97
%99 = OpLoad %float %gridSize
%100 = OpCompositeExtract %float %position 2
%101 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_4 %uint_2
%102 = OpLoad %float %101
%103 = OpFSub %float %100 %102
%104 = OpFMul %float %99 %103
%105 = OpLoad %float %cubeSize
%106 = OpFDiv %float %104 %105
OpStore %gz %106
%108 = OpLoad %float %gx
%109 = OpLoad %float %gy
%110 = OpLoad %float %gz
%111 = OpCompositeConstruct %v3float %108 %109 %110
OpReturnValue %111
%68 = OpExtInst %float %67 NMax %71 %73
%74 = OpAccessChain %_ptr_Function_float %bbSize %uint_2
%75 = OpLoad %float %74
%66 = OpExtInst %float %67 NMax %68 %75
OpStore %cubeSize %66
%80 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%81 = OpLoad %uint %80
%78 = OpConvertUToF %float %81
OpStore %gridSize %78
%83 = OpLoad %float %gridSize
%84 = OpCompositeExtract %float %position 0
%85 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_0
%86 = OpLoad %float %85
%87 = OpFSub %float %84 %86
%88 = OpFMul %float %83 %87
%89 = OpLoad %float %cubeSize
%90 = OpFDiv %float %88 %89
OpStore %gx %90
%92 = OpLoad %float %gridSize
%93 = OpCompositeExtract %float %position 1
%94 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_1
%95 = OpLoad %float %94
%96 = OpFSub %float %93 %95
%97 = OpFMul %float %92 %96
%98 = OpLoad %float %cubeSize
%99 = OpFDiv %float %97 %98
OpStore %gy %99
%101 = OpLoad %float %gridSize
%102 = OpCompositeExtract %float %position 2
%103 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_2
%104 = OpLoad %float %103
%105 = OpFSub %float %102 %104
%106 = OpFMul %float %101 %105
%107 = OpLoad %float %cubeSize
%108 = OpFDiv %float %106 %107
OpStore %gz %108
%110 = OpLoad %float %gx
%111 = OpLoad %float %gy
%112 = OpLoad %float %gz
%113 = OpCompositeConstruct %v3float %110 %111 %112
OpReturnValue %113
OpFunctionEnd
%toIndex1D = OpFunction %uint None %112
%toIndex1D = OpFunction %uint None %114
%gridSize_0 = OpFunctionParameter %uint
%voxelPos = OpFunctionParameter %v3float
%116 = OpLabel
%icoord = OpVariable %_ptr_Function_v3uint Function %120
%117 = OpConvertFToU %v3uint %voxelPos
OpStore %icoord %117
%122 = OpAccessChain %_ptr_Function_uint %icoord %uint_0
%123 = OpLoad %uint %122
%124 = OpAccessChain %_ptr_Function_uint %icoord %uint_1
%118 = OpLabel
%icoord = OpVariable %_ptr_Function_v3uint Function %122
%119 = OpConvertFToU %v3uint %voxelPos
OpStore %icoord %119
%124 = OpAccessChain %_ptr_Function_uint %icoord %uint_0
%125 = OpLoad %uint %124
%126 = OpIMul %uint %gridSize_0 %125
%127 = OpIAdd %uint %123 %126
%128 = OpIMul %uint %gridSize_0 %gridSize_0
%129 = OpAccessChain %_ptr_Function_uint %icoord %uint_2
%130 = OpLoad %uint %129
%131 = OpIMul %uint %128 %130
%132 = OpIAdd %uint %127 %131
OpReturnValue %132
%126 = OpAccessChain %_ptr_Function_uint %icoord %uint_1
%127 = OpLoad %uint %126
%128 = OpIMul %uint %gridSize_0 %127
%129 = OpIAdd %uint %125 %128
%130 = OpIMul %uint %gridSize_0 %gridSize_0
%131 = OpAccessChain %_ptr_Function_uint %icoord %uint_2
%132 = OpLoad %uint %131
%133 = OpIMul %uint %130 %132
%134 = OpIAdd %uint %129 %133
OpReturnValue %134
OpFunctionEnd
%toIndex3D = OpFunction %v3uint None %133
%toIndex3D = OpFunction %v3uint None %135
%gridSize_1 = OpFunctionParameter %uint
%index = OpFunctionParameter %uint
%137 = OpLabel
%z = OpVariable %_ptr_Function_uint Function %141
%y = OpVariable %_ptr_Function_uint Function %141
%x = OpVariable %_ptr_Function_uint Function %141
%138 = OpIMul %uint %gridSize_1 %gridSize_1
%139 = OpUDiv %uint %index %138
OpStore %z %139
%142 = OpIMul %uint %gridSize_1 %gridSize_1
%143 = OpLoad %uint %z
%144 = OpIMul %uint %142 %143
%145 = OpISub %uint %index %144
%146 = OpUDiv %uint %145 %gridSize_1
OpStore %y %146
%148 = OpUMod %uint %index %gridSize_1
OpStore %x %148
%150 = OpLoad %uint %x
%151 = OpLoad %uint %y
%152 = OpLoad %uint %z
%153 = OpCompositeConstruct %v3uint %150 %151 %152
OpReturnValue %153
%139 = OpLabel
%z = OpVariable %_ptr_Function_uint Function %143
%y = OpVariable %_ptr_Function_uint Function %143
%x = OpVariable %_ptr_Function_uint Function %143
%140 = OpIMul %uint %gridSize_1 %gridSize_1
%141 = OpUDiv %uint %index %140
OpStore %z %141
%144 = OpIMul %uint %gridSize_1 %gridSize_1
%145 = OpLoad %uint %z
%146 = OpIMul %uint %144 %145
%147 = OpISub %uint %index %146
%148 = OpUDiv %uint %147 %gridSize_1
OpStore %y %148
%150 = OpUMod %uint %index %gridSize_1
OpStore %x %150
%152 = OpLoad %uint %x
%153 = OpLoad %uint %y
%154 = OpLoad %uint %z
%155 = OpCompositeConstruct %v3uint %152 %153 %154
OpReturnValue %155
OpFunctionEnd
%loadPosition = OpFunction %v3float None %154
%loadPosition = OpFunction %v3float None %156
%vertexIndex = OpFunctionParameter %uint
%157 = OpLabel
%position_0 = OpVariable %_ptr_Function_v3float Function %50
%159 = OpIMul %uint %uint_3 %vertexIndex
%160 = OpIAdd %uint %159 %141
%162 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %160
%163 = OpLoad %float %162
%164 = OpIMul %uint %uint_3 %vertexIndex
%165 = OpIAdd %uint %164 %uint_1
%166 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %165
%167 = OpLoad %float %166
%168 = OpIMul %uint %uint_3 %vertexIndex
%169 = OpIAdd %uint %168 %uint_2
%170 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %169
%171 = OpLoad %float %170
%172 = OpCompositeConstruct %v3float %163 %167 %171
OpStore %position_0 %172
%174 = OpLoad %v3float %position_0
OpReturnValue %174
%159 = OpLabel
%position_0 = OpVariable %_ptr_Function_v3float Function %52
%161 = OpIMul %uint %uint_3 %vertexIndex
%162 = OpIAdd %uint %161 %143
%164 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %162
%165 = OpLoad %float %164
%166 = OpIMul %uint %uint_3 %vertexIndex
%167 = OpIAdd %uint %166 %uint_1
%168 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %167
%169 = OpLoad %float %168
%170 = OpIMul %uint %uint_3 %vertexIndex
%171 = OpIAdd %uint %170 %uint_2
%172 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %171
%173 = OpLoad %float %172
%174 = OpCompositeConstruct %v3float %165 %169 %173
OpStore %position_0 %174
%176 = OpLoad %v3float %position_0
OpReturnValue %176
OpFunctionEnd
%doIgnore = OpFunction %void None %175
%178 = OpLabel
%g42 = OpVariable %_ptr_Function_uint Function %141
%kj6 = OpVariable %_ptr_Function_uint Function %141
%b53 = OpVariable %_ptr_Function_uint Function %141
%rwg = OpVariable %_ptr_Function_uint Function %141
%rb5 = OpVariable %_ptr_Function_float Function %75
%g55 = OpVariable %_ptr_Function_int Function %188
%179 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%180 = OpLoad %uint %179
OpStore %g42 %180
%183 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_5
%184 = OpLoad %uint %183
OpStore %kj6 %184
%190 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %188
%186 = OpAtomicLoad %uint %190 %uint_1 %uint_0
OpStore %b53 %186
%192 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %188
%193 = OpLoad %uint %192
OpStore %rwg %193
%195 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %188
%196 = OpLoad %float %195
OpStore %rb5 %196
%201 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %188
%198 = OpAtomicLoad %int %201 %uint_1 %uint_0
OpStore %g55 %198
%doIgnore = OpFunction %void None %177
%180 = OpLabel
%g42 = OpVariable %_ptr_Function_uint Function %143
%kj6 = OpVariable %_ptr_Function_uint Function %143
%b53 = OpVariable %_ptr_Function_uint Function %143
%rwg = OpVariable %_ptr_Function_uint Function %143
%rb5 = OpVariable %_ptr_Function_float Function %77
%g55 = OpVariable %_ptr_Function_int Function %190
%181 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%182 = OpLoad %uint %181
OpStore %g42 %182
%185 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_0 %uint_5
%186 = OpLoad %uint %185
OpStore %kj6 %186
%192 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %190
%188 = OpAtomicLoad %uint %192 %uint_1 %uint_0
OpStore %b53 %188
%194 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %190
%195 = OpLoad %uint %194
OpStore %rwg %195
%197 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %190
%198 = OpLoad %float %197
OpStore %rb5 %198
%203 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %190
%200 = OpAtomicLoad %int %203 %uint_1 %uint_0
OpStore %g55 %200
OpReturn
OpFunctionEnd
%main_count_inner = OpFunction %void None %204
%main_count_inner = OpFunction %void None %206
%GlobalInvocationID = OpFunctionParameter %v3uint
%207 = OpLabel
%triangleIndex = OpVariable %_ptr_Function_uint Function %141
%i0 = OpVariable %_ptr_Function_uint Function %141
%i1 = OpVariable %_ptr_Function_uint Function %141
%i2 = OpVariable %_ptr_Function_uint Function %141
%p0 = OpVariable %_ptr_Function_v3float Function %50
%p1 = OpVariable %_ptr_Function_v3float Function %50
%p2 = OpVariable %_ptr_Function_v3float Function %50
%252 = OpVariable %_ptr_Function_v3float Function %50
%center = OpVariable %_ptr_Function_v3float Function %50
%voxelPos_0 = OpVariable %_ptr_Function_v3float Function %50
%voxelIndex = OpVariable %_ptr_Function_uint Function %141
%acefg = OpVariable %_ptr_Function_uint Function %141
%208 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %triangleIndex %208
%210 = OpLoad %uint %triangleIndex
%211 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%212 = OpLoad %uint %211
%213 = OpUGreaterThanEqual %bool %210 %212
OpSelectionMerge %215 None
OpBranchConditional %213 %216 %215
%216 = OpLabel
%209 = OpLabel
%triangleIndex = OpVariable %_ptr_Function_uint Function %143
%i0 = OpVariable %_ptr_Function_uint Function %143
%i1 = OpVariable %_ptr_Function_uint Function %143
%i2 = OpVariable %_ptr_Function_uint Function %143
%p0 = OpVariable %_ptr_Function_v3float Function %52
%p1 = OpVariable %_ptr_Function_v3float Function %52
%p2 = OpVariable %_ptr_Function_v3float Function %52
%254 = OpVariable %_ptr_Function_v3float Function %52
%center = OpVariable %_ptr_Function_v3float Function %52
%voxelPos_0 = OpVariable %_ptr_Function_v3float Function %52
%voxelIndex = OpVariable %_ptr_Function_uint Function %143
%acefg = OpVariable %_ptr_Function_uint Function %143
%210 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %triangleIndex %210
%212 = OpLoad %uint %triangleIndex
%213 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%214 = OpLoad %uint %213
%215 = OpUGreaterThanEqual %bool %212 %214
OpSelectionMerge %217 None
OpBranchConditional %215 %218 %217
%218 = OpLabel
OpReturn
%215 = OpLabel
%217 = OpFunctionCall %void %doIgnore
%218 = OpLoad %uint %triangleIndex
%219 = OpIMul %uint %uint_3 %218
%220 = OpIAdd %uint %219 %141
%221 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %220
%222 = OpLoad %uint %221
OpStore %i0 %222
%224 = OpLoad %uint %triangleIndex
%225 = OpIMul %uint %uint_3 %224
%226 = OpIAdd %uint %225 %uint_1
%227 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %226
%228 = OpLoad %uint %227
OpStore %i1 %228
%230 = OpLoad %uint %triangleIndex
%231 = OpIMul %uint %uint_3 %230
%232 = OpIAdd %uint %231 %uint_2
%233 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %232
%234 = OpLoad %uint %233
OpStore %i2 %234
%237 = OpLoad %uint %i0
%236 = OpFunctionCall %v3float %loadPosition %237
OpStore %p0 %236
%240 = OpLoad %uint %i1
%239 = OpFunctionCall %v3float %loadPosition %240
OpStore %p1 %239
%243 = OpLoad %uint %i2
%242 = OpFunctionCall %v3float %loadPosition %243
OpStore %p2 %242
%245 = OpLoad %v3float %p0
%246 = OpLoad %v3float %p1
%247 = OpFAdd %v3float %245 %246
%248 = OpLoad %v3float %p2
%217 = OpLabel
%219 = OpFunctionCall %void %doIgnore
%220 = OpLoad %uint %triangleIndex
%221 = OpIMul %uint %uint_3 %220
%222 = OpIAdd %uint %221 %143
%223 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %222
%224 = OpLoad %uint %223
OpStore %i0 %224
%226 = OpLoad %uint %triangleIndex
%227 = OpIMul %uint %uint_3 %226
%228 = OpIAdd %uint %227 %uint_1
%229 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %228
%230 = OpLoad %uint %229
OpStore %i1 %230
%232 = OpLoad %uint %triangleIndex
%233 = OpIMul %uint %uint_3 %232
%234 = OpIAdd %uint %233 %uint_2
%235 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %234
%236 = OpLoad %uint %235
OpStore %i2 %236
%239 = OpLoad %uint %i0
%238 = OpFunctionCall %v3float %loadPosition %239
OpStore %p0 %238
%242 = OpLoad %uint %i1
%241 = OpFunctionCall %v3float %loadPosition %242
OpStore %p1 %241
%245 = OpLoad %uint %i2
%244 = OpFunctionCall %v3float %loadPosition %245
OpStore %p2 %244
%247 = OpLoad %v3float %p0
%248 = OpLoad %v3float %p1
%249 = OpFAdd %v3float %247 %248
%253 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
%251 = OpFDiv %v3float %249 %253
OpStore %center %251
%256 = OpLoad %v3float %center
%255 = OpFunctionCall %v3float %toVoxelPos %256
OpStore %voxelPos_0 %255
%259 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%260 = OpLoad %uint %259
%261 = OpLoad %v3float %voxelPos_0
%258 = OpFunctionCall %uint %toIndex1D %260 %261
OpStore %voxelIndex %258
%265 = OpLoad %uint %voxelIndex
%266 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %265
%263 = OpAtomicIAdd %uint %266 %uint_1 %uint_0 %uint_1
OpStore %acefg %263
%268 = OpLoad %uint %triangleIndex
%269 = OpIEqual %bool %268 %141
OpSelectionMerge %270 None
OpBranchConditional %269 %271 %270
%271 = OpLabel
%272 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_4
%273 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%274 = OpLoad %uint %273
OpStore %272 %274
%276 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_8
%277 = OpAccessChain %_ptr_Function_float %center %uint_0
%278 = OpLoad %float %277
OpStore %276 %278
%280 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_9
%281 = OpAccessChain %_ptr_Function_float %center %uint_1
%282 = OpLoad %float %281
OpStore %280 %282
%284 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_10
%285 = OpAccessChain %_ptr_Function_float %center %uint_2
%286 = OpLoad %float %285
OpStore %284 %286
OpBranch %270
%270 = OpLabel
%250 = OpLoad %v3float %p2
%251 = OpFAdd %v3float %249 %250
%255 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
%253 = OpFDiv %v3float %251 %255
OpStore %center %253
%258 = OpLoad %v3float %center
%257 = OpFunctionCall %v3float %toVoxelPos %258
OpStore %voxelPos_0 %257
%261 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%262 = OpLoad %uint %261
%263 = OpLoad %v3float %voxelPos_0
%260 = OpFunctionCall %uint %toIndex1D %262 %263
OpStore %voxelIndex %260
%267 = OpLoad %uint %voxelIndex
%268 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %267
%265 = OpAtomicIAdd %uint %268 %uint_1 %uint_0 %uint_1
OpStore %acefg %265
%270 = OpLoad %uint %triangleIndex
%271 = OpIEqual %bool %270 %143
OpSelectionMerge %272 None
OpBranchConditional %271 %273 %272
%273 = OpLabel
%274 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_0 %uint_4
%275 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%276 = OpLoad %uint %275
OpStore %274 %276
%278 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_0 %uint_8
%279 = OpAccessChain %_ptr_Function_float %center %uint_0
%280 = OpLoad %float %279
OpStore %278 %280
%282 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_0 %uint_9
%283 = OpAccessChain %_ptr_Function_float %center %uint_1
%284 = OpLoad %float %283
OpStore %282 %284
%286 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_0 %uint_10
%287 = OpAccessChain %_ptr_Function_float %center %uint_2
%288 = OpLoad %float %287
OpStore %286 %288
OpBranch %272
%272 = OpLabel
OpReturn
OpFunctionEnd
%main_count = OpFunction %void None %175
%288 = OpLabel
%290 = OpLoad %v3uint %GlobalInvocationID_1
%289 = OpFunctionCall %void %main_count_inner %290
%main_count = OpFunction %void None %177
%290 = OpLabel
%292 = OpLoad %v3uint %GlobalInvocationID_1
%291 = OpFunctionCall %void %main_count_inner %292
OpReturn
OpFunctionEnd
%main_create_lut_inner = OpFunction %void None %204
%main_create_lut_inner = OpFunction %void None %206
%GlobalInvocationID_0 = OpFunctionParameter %v3uint
%293 = OpLabel
%voxelIndex_0 = OpVariable %_ptr_Function_uint Function %141
%maxVoxels = OpVariable %_ptr_Function_uint Function %141
%numTriangles = OpVariable %_ptr_Function_uint Function %141
%offset = OpVariable %_ptr_Function_int Function %188
%294 = OpCompositeExtract %uint %GlobalInvocationID_0 0
OpStore %voxelIndex_0 %294
%296 = OpFunctionCall %void %doIgnore
%297 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%298 = OpLoad %uint %297
%299 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%295 = OpLabel
%voxelIndex_0 = OpVariable %_ptr_Function_uint Function %143
%maxVoxels = OpVariable %_ptr_Function_uint Function %143
%numTriangles = OpVariable %_ptr_Function_uint Function %143
%offset = OpVariable %_ptr_Function_int Function %190
%296 = OpCompositeExtract %uint %GlobalInvocationID_0 0
OpStore %voxelIndex_0 %296
%298 = OpFunctionCall %void %doIgnore
%299 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%300 = OpLoad %uint %299
%301 = OpIMul %uint %298 %300
%302 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%303 = OpLoad %uint %302
%304 = OpIMul %uint %301 %303
OpStore %maxVoxels %304
%306 = OpLoad %uint %voxelIndex_0
%307 = OpLoad %uint %maxVoxels
%308 = OpUGreaterThanEqual %bool %306 %307
OpSelectionMerge %309 None
OpBranchConditional %308 %310 %309
%310 = OpLabel
%301 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%302 = OpLoad %uint %301
%303 = OpIMul %uint %300 %302
%304 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%305 = OpLoad %uint %304
%306 = OpIMul %uint %303 %305
OpStore %maxVoxels %306
%308 = OpLoad %uint %voxelIndex_0
%309 = OpLoad %uint %maxVoxels
%310 = OpUGreaterThanEqual %bool %308 %309
OpSelectionMerge %311 None
OpBranchConditional %310 %312 %311
%312 = OpLabel
OpReturn
%309 = OpLabel
%313 = OpLoad %uint %voxelIndex_0
%314 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %313
%311 = OpAtomicLoad %uint %314 %uint_1 %uint_0
OpStore %numTriangles %311
%311 = OpLabel
%315 = OpLoad %uint %voxelIndex_0
%316 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %315
%313 = OpAtomicLoad %uint %316 %uint_1 %uint_0
OpStore %numTriangles %313
OpStore %offset %int_n1
%318 = OpLoad %uint %numTriangles
%319 = OpUGreaterThan %bool %318 %141
OpSelectionMerge %320 None
OpBranchConditional %319 %321 %320
%321 = OpLabel
%324 = OpAccessChain %_ptr_StorageBuffer_uint_0 %dbg %uint_0
%325 = OpLoad %uint %numTriangles
%322 = OpAtomicIAdd %uint %324 %uint_1 %uint_0 %325
%326 = OpBitcast %int %322
OpStore %offset %326
OpBranch %320
%320 = OpLabel
%329 = OpLoad %uint %voxelIndex_0
%330 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %329
%331 = OpLoad %int %offset
OpAtomicStore %330 %uint_1 %uint_0 %331
%320 = OpLoad %uint %numTriangles
%321 = OpUGreaterThan %bool %320 %143
OpSelectionMerge %322 None
OpBranchConditional %321 %323 %322
%323 = OpLabel
%326 = OpAccessChain %_ptr_StorageBuffer_uint_0 %dbg %uint_0 %uint_0
%327 = OpLoad %uint %numTriangles
%324 = OpAtomicIAdd %uint %326 %uint_1 %uint_0 %327
%328 = OpBitcast %int %324
OpStore %offset %328
OpBranch %322
%322 = OpLabel
%331 = OpLoad %uint %voxelIndex_0
%332 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %331
%333 = OpLoad %int %offset
OpAtomicStore %332 %uint_1 %uint_0 %333
OpReturn
OpFunctionEnd
%main_create_lut = OpFunction %void None %175
%333 = OpLabel
%335 = OpLoad %v3uint %GlobalInvocationID_2
%334 = OpFunctionCall %void %main_create_lut_inner %335
%main_create_lut = OpFunction %void None %177
%335 = OpLabel
%337 = OpLoad %v3uint %GlobalInvocationID_2
%336 = OpFunctionCall %void %main_create_lut_inner %337
OpReturn
OpFunctionEnd
%main_sort_triangles_inner = OpFunction %void None %204
%main_sort_triangles_inner = OpFunction %void None %206
%GlobalInvocationID_4 = OpFunctionParameter %v3uint
%338 = OpLabel
%triangleIndex_0 = OpVariable %_ptr_Function_uint Function %141
%i0_0 = OpVariable %_ptr_Function_uint Function %141
%i1_0 = OpVariable %_ptr_Function_uint Function %141
%i2_0 = OpVariable %_ptr_Function_uint Function %141
%p0_0 = OpVariable %_ptr_Function_v3float Function %50
%p1_0 = OpVariable %_ptr_Function_v3float Function %50
%p2_0 = OpVariable %_ptr_Function_v3float Function %50
%381 = OpVariable %_ptr_Function_v3float Function %50
%center_0 = OpVariable %_ptr_Function_v3float Function %50
%voxelPos_1 = OpVariable %_ptr_Function_v3float Function %50
%voxelIndex_1 = OpVariable %_ptr_Function_uint Function %141
%triangleOffset = OpVariable %_ptr_Function_int Function %188
%339 = OpCompositeExtract %uint %GlobalInvocationID_4 0
OpStore %triangleIndex_0 %339
%341 = OpFunctionCall %void %doIgnore
%342 = OpLoad %uint %triangleIndex_0
%343 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%344 = OpLoad %uint %343
%345 = OpUGreaterThanEqual %bool %342 %344
OpSelectionMerge %346 None
OpBranchConditional %345 %347 %346
%347 = OpLabel
%340 = OpLabel
%triangleIndex_0 = OpVariable %_ptr_Function_uint Function %143
%i0_0 = OpVariable %_ptr_Function_uint Function %143
%i1_0 = OpVariable %_ptr_Function_uint Function %143
%i2_0 = OpVariable %_ptr_Function_uint Function %143
%p0_0 = OpVariable %_ptr_Function_v3float Function %52
%p1_0 = OpVariable %_ptr_Function_v3float Function %52
%p2_0 = OpVariable %_ptr_Function_v3float Function %52
%383 = OpVariable %_ptr_Function_v3float Function %52
%center_0 = OpVariable %_ptr_Function_v3float Function %52
%voxelPos_1 = OpVariable %_ptr_Function_v3float Function %52
%voxelIndex_1 = OpVariable %_ptr_Function_uint Function %143
%triangleOffset = OpVariable %_ptr_Function_int Function %190
%341 = OpCompositeExtract %uint %GlobalInvocationID_4 0
OpStore %triangleIndex_0 %341
%343 = OpFunctionCall %void %doIgnore
%344 = OpLoad %uint %triangleIndex_0
%345 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0
%346 = OpLoad %uint %345
%347 = OpUGreaterThanEqual %bool %344 %346
OpSelectionMerge %348 None
OpBranchConditional %347 %349 %348
%349 = OpLabel
OpReturn
%346 = OpLabel
%348 = OpLoad %uint %triangleIndex_0
%349 = OpIMul %uint %uint_3 %348
%350 = OpIAdd %uint %349 %141
%351 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %350
%352 = OpLoad %uint %351
OpStore %i0_0 %352
%354 = OpLoad %uint %triangleIndex_0
%355 = OpIMul %uint %uint_3 %354
%356 = OpIAdd %uint %355 %uint_1
%357 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %356
%358 = OpLoad %uint %357
OpStore %i1_0 %358
%360 = OpLoad %uint %triangleIndex_0
%361 = OpIMul %uint %uint_3 %360
%362 = OpIAdd %uint %361 %uint_2
%363 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %362
%364 = OpLoad %uint %363
OpStore %i2_0 %364
%367 = OpLoad %uint %i0_0
%366 = OpFunctionCall %v3float %loadPosition %367
OpStore %p0_0 %366
%370 = OpLoad %uint %i1_0
%369 = OpFunctionCall %v3float %loadPosition %370
OpStore %p1_0 %369
%373 = OpLoad %uint %i2_0
%372 = OpFunctionCall %v3float %loadPosition %373
OpStore %p2_0 %372
%375 = OpLoad %v3float %p0_0
%376 = OpLoad %v3float %p1_0
%377 = OpFAdd %v3float %375 %376
%378 = OpLoad %v3float %p2_0
%348 = OpLabel
%350 = OpLoad %uint %triangleIndex_0
%351 = OpIMul %uint %uint_3 %350
%352 = OpIAdd %uint %351 %143
%353 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %352
%354 = OpLoad %uint %353
OpStore %i0_0 %354
%356 = OpLoad %uint %triangleIndex_0
%357 = OpIMul %uint %uint_3 %356
%358 = OpIAdd %uint %357 %uint_1
%359 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %358
%360 = OpLoad %uint %359
OpStore %i1_0 %360
%362 = OpLoad %uint %triangleIndex_0
%363 = OpIMul %uint %uint_3 %362
%364 = OpIAdd %uint %363 %uint_2
%365 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %364
%366 = OpLoad %uint %365
OpStore %i2_0 %366
%369 = OpLoad %uint %i0_0
%368 = OpFunctionCall %v3float %loadPosition %369
OpStore %p0_0 %368
%372 = OpLoad %uint %i1_0
%371 = OpFunctionCall %v3float %loadPosition %372
OpStore %p1_0 %371
%375 = OpLoad %uint %i2_0
%374 = OpFunctionCall %v3float %loadPosition %375
OpStore %p2_0 %374
%377 = OpLoad %v3float %p0_0
%378 = OpLoad %v3float %p1_0
%379 = OpFAdd %v3float %377 %378
%382 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
%380 = OpFDiv %v3float %379 %382
OpStore %center_0 %380
%385 = OpLoad %v3float %center_0
%384 = OpFunctionCall %v3float %toVoxelPos %385
OpStore %voxelPos_1 %384
%388 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%389 = OpLoad %uint %388
%390 = OpLoad %v3float %voxelPos_1
%387 = OpFunctionCall %uint %toIndex1D %389 %390
OpStore %voxelIndex_1 %387
%394 = OpLoad %uint %voxelIndex_1
%395 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %394
%392 = OpAtomicIAdd %int %395 %uint_1 %uint_0 %int_1
OpStore %triangleOffset %392
%380 = OpLoad %v3float %p2_0
%381 = OpFAdd %v3float %379 %380
%384 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
%382 = OpFDiv %v3float %381 %384
OpStore %center_0 %382
%387 = OpLoad %v3float %center_0
%386 = OpFunctionCall %v3float %toVoxelPos %387
OpStore %voxelPos_1 %386
%390 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1
%391 = OpLoad %uint %390
%392 = OpLoad %v3float %voxelPos_1
%389 = OpFunctionCall %uint %toIndex1D %391 %392
OpStore %voxelIndex_1 %389
%396 = OpLoad %uint %voxelIndex_1
%397 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %396
%394 = OpAtomicIAdd %int %397 %uint_1 %uint_0 %int_1
OpStore %triangleOffset %394
OpReturn
OpFunctionEnd
%main_sort_triangles = OpFunction %void None %175
%399 = OpLabel
%401 = OpLoad %v3uint %GlobalInvocationID_3
%400 = OpFunctionCall %void %main_sort_triangles_inner %401
%main_sort_triangles = OpFunction %void None %177
%401 = OpLabel
%403 = OpLoad %v3uint %GlobalInvocationID_3
%402 = OpFunctionCall %void %main_sort_triangles_inner %403
OpReturn
OpFunctionEnd

View File

@ -4,25 +4,37 @@ precision mediump float;
layout(location = 2) in float fClipDistance3_param_1;
layout(location = 3) in float fClipDistance4_param_1;
layout(location = 0) out vec4 glFragColor_1_1;
float fClipDistance3 = 0.0f;
float fClipDistance4 = 0.0f;
layout(binding = 0, std140) uniform Scene_ubo {
struct Scene {
vec4 vEyePosition;
} x_29;
};
layout(binding = 1, std140) uniform Material_ubo {
struct Material {
vec4 vDiffuseColor;
vec3 vAmbientColor;
float placeholder;
vec3 vEmissiveColor;
float placeholder2;
} x_49;
};
layout(binding = 2, std140) uniform Mesh_ubo {
struct Mesh {
float visibility;
uint pad;
uint pad_1;
uint pad_2;
};
float fClipDistance3 = 0.0f;
float fClipDistance4 = 0.0f;
layout(binding = 0, std140) uniform x_29_block_ubo {
Scene inner;
} x_29;
layout(binding = 1, std140) uniform x_49_block_ubo {
Material inner;
} x_49;
layout(binding = 2, std140) uniform x_137_block_ubo {
Mesh inner;
} x_137;
vec4 glFragColor = vec4(0.0f, 0.0f, 0.0f, 0.0f);
@ -54,13 +66,13 @@ void main_1() {
tint_discard = true;
return;
}
vec4 x_34 = x_29.vEyePosition;
vec4 x_34 = x_29.inner.vEyePosition;
vec3 x_38 = vec3(0.0f);
viewDirectionW = normalize((vec3(x_34.x, x_34.y, x_34.z) - x_38));
baseColor = vec4(1.0f);
vec4 x_52 = x_49.vDiffuseColor;
vec4 x_52 = x_49.inner.vDiffuseColor;
diffuseColor = vec3(x_52.x, x_52.y, x_52.z);
float x_60 = x_49.vDiffuseColor.w;
float x_60 = x_49.inner.vDiffuseColor.w;
alpha = x_60;
vec3 x_62 = vec3(0.0f);
vec3 x_64 = vec3(0.0f);
@ -76,12 +88,12 @@ void main_1() {
shadow = 1.0f;
refractionColor = vec4(0.0f, 0.0f, 0.0f, 1.0f);
reflectionColor = vec4(0.0f, 0.0f, 0.0f, 1.0f);
vec3 x_94 = x_49.vEmissiveColor;
vec3 x_94 = x_49.inner.vEmissiveColor;
emissiveColor = x_94;
vec3 x_96 = diffuseBase;
vec3 x_97 = diffuseColor;
vec3 x_99 = emissiveColor;
vec3 x_103 = x_49.vAmbientColor;
vec3 x_103 = x_49.inner.vAmbientColor;
vec4 x_108 = baseColor;
finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), vec3(0.0f), vec3(1.0f)) * vec3(x_108.x, x_108.y, x_108.z));
finalSpecular = vec3(0.0f);
@ -97,7 +109,7 @@ void main_1() {
vec3 x_132 = max(vec3(x_129.x, x_129.y, x_129.z), vec3(0.0f));
vec4 x_133 = color;
color = vec4(x_132.x, x_132.y, x_132.z, x_133.w);
float x_140 = x_137.visibility;
float x_140 = x_137.inner.visibility;
float x_142 = color.w;
color.w = (x_142 * x_140);
vec4 x_147 = color;

View File

@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 199
; Bound: 202
; Schema: 0
OpCapability Shader
%81 = OpExtInstImport "GLSL.std.450"
%84 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %fClipDistance3_param_1 %fClipDistance4_param_1 %glFragColor_1_1
OpExecutionMode %main OriginUpperLeft
@ -13,9 +13,13 @@
OpName %glFragColor_1_1 "glFragColor_1_1"
OpName %fClipDistance3 "fClipDistance3"
OpName %fClipDistance4 "fClipDistance4"
OpName %x_29_block "x_29_block"
OpMemberName %x_29_block 0 "inner"
OpName %Scene "Scene"
OpMemberName %Scene 0 "vEyePosition"
OpName %x_29 "x_29"
OpName %x_49_block "x_49_block"
OpMemberName %x_49_block 0 "inner"
OpName %Material "Material"
OpMemberName %Material 0 "vDiffuseColor"
OpMemberName %Material 1 "vAmbientColor"
@ -23,6 +27,8 @@
OpMemberName %Material 3 "vEmissiveColor"
OpMemberName %Material 4 "placeholder2"
OpName %x_49 "x_49"
OpName %x_137_block "x_137_block"
OpMemberName %x_137_block 0 "inner"
OpName %Mesh "Mesh"
OpMemberName %Mesh 0 "visibility"
OpName %x_137 "x_137"
@ -56,12 +62,14 @@
OpDecorate %fClipDistance3_param_1 Location 2
OpDecorate %fClipDistance4_param_1 Location 3
OpDecorate %glFragColor_1_1 Location 0
OpDecorate %Scene Block
OpDecorate %x_29_block Block
OpMemberDecorate %x_29_block 0 Offset 0
OpMemberDecorate %Scene 0 Offset 0
OpDecorate %x_29 NonWritable
OpDecorate %x_29 DescriptorSet 0
OpDecorate %x_29 Binding 0
OpDecorate %Material Block
OpDecorate %x_49_block Block
OpMemberDecorate %x_49_block 0 Offset 0
OpMemberDecorate %Material 0 Offset 0
OpMemberDecorate %Material 1 Offset 16
OpMemberDecorate %Material 2 Offset 28
@ -70,7 +78,8 @@
OpDecorate %x_49 NonWritable
OpDecorate %x_49 DescriptorSet 0
OpDecorate %x_49 Binding 1
OpDecorate %Mesh Block
OpDecorate %x_137_block Block
OpMemberDecorate %x_137_block 0 Offset 0
OpMemberDecorate %Mesh 0 Offset 0
OpDecorate %x_137 NonWritable
OpDecorate %x_137 DescriptorSet 0
@ -89,237 +98,240 @@
%fClipDistance3 = OpVariable %_ptr_Private_float Private %11
%fClipDistance4 = OpVariable %_ptr_Private_float Private %11
%Scene = OpTypeStruct %v4float
%_ptr_Uniform_Scene = OpTypePointer Uniform %Scene
%x_29 = OpVariable %_ptr_Uniform_Scene Uniform
%x_29_block = OpTypeStruct %Scene
%_ptr_Uniform_x_29_block = OpTypePointer Uniform %x_29_block
%x_29 = OpVariable %_ptr_Uniform_x_29_block Uniform
%v3float = OpTypeVector %float 3
%Material = OpTypeStruct %v4float %v3float %float %v3float %float
%_ptr_Uniform_Material = OpTypePointer Uniform %Material
%x_49 = OpVariable %_ptr_Uniform_Material Uniform
%x_49_block = OpTypeStruct %Material
%_ptr_Uniform_x_49_block = OpTypePointer Uniform %x_49_block
%x_49 = OpVariable %_ptr_Uniform_x_49_block Uniform
%Mesh = OpTypeStruct %float
%_ptr_Uniform_Mesh = OpTypePointer Uniform %Mesh
%x_137 = OpVariable %_ptr_Uniform_Mesh Uniform
%x_137_block = OpTypeStruct %Mesh
%_ptr_Uniform_x_137_block = OpTypePointer Uniform %x_137_block
%x_137 = OpVariable %_ptr_Uniform_x_137_block Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%glFragColor = OpVariable %_ptr_Private_v4float Private %8
%bool = OpTypeBool
%26 = OpConstantNull %bool
%29 = OpConstantNull %bool
%_ptr_Private_bool = OpTypePointer Private %bool
%tint_discard = OpVariable %_ptr_Private_bool Private %26
%tint_discard = OpVariable %_ptr_Private_bool Private %29
%void = OpTypeVoid
%29 = OpTypeFunction %void
%32 = OpTypeFunction %void
%_ptr_Function_bool = OpTypePointer Function %bool
%_ptr_Function_v3float = OpTypePointer Function %v3float
%37 = OpConstantNull %v3float
%40 = OpConstantNull %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%47 = OpConstantNull %v2float
%50 = OpConstantNull %v2float
%true = OpConstantTrue %bool
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_1 = OpConstant %float 1
%88 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%91 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%uint_3 = OpConstant %uint 3
%_ptr_Uniform_float = OpTypePointer Uniform %float
%115 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%116 = OpConstantComposite %v4float %11 %11 %11 %float_1
%118 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%119 = OpConstantComposite %v4float %11 %11 %11 %float_1
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
%uint_1 = OpConstant %uint 1
%main_out = OpTypeStruct %v4float
%179 = OpTypeFunction %main_out %float %float
%190 = OpConstantNull %main_out
%main_1 = OpFunction %void None %29
%32 = OpLabel
%tint_return_flag = OpVariable %_ptr_Function_bool Function %26
%viewDirectionW = OpVariable %_ptr_Function_v3float Function %37
%182 = OpTypeFunction %main_out %float %float
%193 = OpConstantNull %main_out
%main_1 = OpFunction %void None %32
%35 = OpLabel
%tint_return_flag = OpVariable %_ptr_Function_bool Function %29
%viewDirectionW = OpVariable %_ptr_Function_v3float Function %40
%baseColor = OpVariable %_ptr_Function_v4float Function %8
%diffuseColor = OpVariable %_ptr_Function_v3float Function %37
%diffuseColor = OpVariable %_ptr_Function_v3float Function %40
%alpha = OpVariable %_ptr_Function_float Function %11
%normalW = OpVariable %_ptr_Function_v3float Function %37
%uvOffset = OpVariable %_ptr_Function_v2float Function %47
%baseAmbientColor = OpVariable %_ptr_Function_v3float Function %37
%normalW = OpVariable %_ptr_Function_v3float Function %40
%uvOffset = OpVariable %_ptr_Function_v2float Function %50
%baseAmbientColor = OpVariable %_ptr_Function_v3float Function %40
%glossiness = OpVariable %_ptr_Function_float Function %11
%diffuseBase = OpVariable %_ptr_Function_v3float Function %37
%diffuseBase = OpVariable %_ptr_Function_v3float Function %40
%shadow = OpVariable %_ptr_Function_float Function %11
%refractionColor = OpVariable %_ptr_Function_v4float Function %8
%reflectionColor = OpVariable %_ptr_Function_v4float Function %8
%emissiveColor = OpVariable %_ptr_Function_v3float Function %37
%finalDiffuse = OpVariable %_ptr_Function_v3float Function %37
%finalSpecular = OpVariable %_ptr_Function_v3float Function %37
%emissiveColor = OpVariable %_ptr_Function_v3float Function %40
%finalDiffuse = OpVariable %_ptr_Function_v3float Function %40
%finalSpecular = OpVariable %_ptr_Function_v3float Function %40
%color = OpVariable %_ptr_Function_v4float Function %8
%58 = OpLoad %float %fClipDistance3
%59 = OpFOrdGreaterThan %bool %58 %11
OpSelectionMerge %60 None
OpBranchConditional %59 %61 %60
%61 = OpLabel
%61 = OpLoad %float %fClipDistance3
%62 = OpFOrdGreaterThan %bool %61 %11
OpSelectionMerge %63 None
OpBranchConditional %62 %64 %63
%64 = OpLabel
OpStore %tint_discard %true
OpStore %tint_return_flag %true
OpBranch %60
%60 = OpLabel
%64 = OpLoad %bool %tint_return_flag
%63 = OpLogicalNot %bool %64
OpSelectionMerge %65 None
OpBranchConditional %63 %66 %65
%66 = OpLabel
%67 = OpLoad %float %fClipDistance4
%68 = OpFOrdGreaterThan %bool %67 %11
OpSelectionMerge %69 None
OpBranchConditional %68 %70 %69
%70 = OpLabel
OpStore %tint_discard %true
OpStore %tint_return_flag %true
OpBranch %69
OpBranch %63
%63 = OpLabel
%67 = OpLoad %bool %tint_return_flag
%66 = OpLogicalNot %bool %67
OpSelectionMerge %68 None
OpBranchConditional %66 %69 %68
%69 = OpLabel
%72 = OpLoad %bool %tint_return_flag
%71 = OpLogicalNot %bool %72
OpSelectionMerge %73 None
OpBranchConditional %71 %74 %73
%74 = OpLabel
%78 = OpAccessChain %_ptr_Uniform_v4float %x_29 %uint_0
%79 = OpLoad %v4float %78
%82 = OpCompositeExtract %float %79 0
%83 = OpCompositeExtract %float %79 1
%84 = OpCompositeExtract %float %79 2
%85 = OpCompositeConstruct %v3float %82 %83 %84
%86 = OpFSub %v3float %85 %37
%80 = OpExtInst %v3float %81 Normalize %86
OpStore %viewDirectionW %80
OpStore %baseColor %88
%89 = OpAccessChain %_ptr_Uniform_v4float %x_49 %uint_0
%90 = OpLoad %v4float %89
%91 = OpCompositeExtract %float %90 0
%92 = OpCompositeExtract %float %90 1
%93 = OpCompositeExtract %float %90 2
%94 = OpCompositeConstruct %v3float %91 %92 %93
OpStore %diffuseColor %94
%97 = OpAccessChain %_ptr_Uniform_float %x_49 %uint_0 %uint_3
%98 = OpLoad %float %97
OpStore %alpha %98
OpStore %uvOffset %47
%99 = OpLoad %v4float %baseColor
%100 = OpCompositeExtract %float %99 0
%101 = OpCompositeExtract %float %99 1
%102 = OpCompositeExtract %float %99 2
%103 = OpCompositeConstruct %v3float %100 %101 %102
%104 = OpCompositeExtract %float %8 0
%105 = OpCompositeExtract %float %8 1
%106 = OpCompositeExtract %float %8 2
%107 = OpCompositeConstruct %v3float %104 %105 %106
%108 = OpFMul %v3float %103 %107
%109 = OpLoad %v4float %baseColor
%110 = OpCompositeExtract %float %108 0
%111 = OpCompositeExtract %float %108 1
%112 = OpCompositeExtract %float %108 2
%113 = OpCompositeExtract %float %109 3
%114 = OpCompositeConstruct %v4float %110 %111 %112 %113
OpStore %baseColor %114
OpStore %baseAmbientColor %115
OpStore %glossiness %11
OpStore %diffuseBase %37
OpStore %shadow %float_1
OpStore %refractionColor %116
OpStore %reflectionColor %116
%118 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_3
%119 = OpLoad %v3float %118
OpStore %emissiveColor %119
%120 = OpLoad %v3float %diffuseBase
%121 = OpLoad %v3float %diffuseColor
%122 = OpLoad %v3float %emissiveColor
%124 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_1
%125 = OpLoad %v3float %124
%126 = OpLoad %v4float %baseColor
%128 = OpFMul %v3float %120 %121
%129 = OpFAdd %v3float %128 %122
%130 = OpFAdd %v3float %129 %125
%127 = OpExtInst %v3float %81 NClamp %130 %37 %115
%131 = OpCompositeExtract %float %126 0
%132 = OpCompositeExtract %float %126 1
%133 = OpCompositeExtract %float %126 2
%134 = OpCompositeConstruct %v3float %131 %132 %133
%135 = OpFMul %v3float %127 %134
OpStore %finalDiffuse %135
OpStore %finalSpecular %37
%136 = OpLoad %v3float %finalDiffuse
%137 = OpLoad %v3float %baseAmbientColor
%138 = OpLoad %v3float %finalSpecular
%139 = OpLoad %v4float %reflectionColor
%140 = OpLoad %v4float %refractionColor
%141 = OpFMul %v3float %136 %137
%142 = OpFAdd %v3float %141 %138
%143 = OpCompositeExtract %float %139 0
%144 = OpCompositeExtract %float %139 1
%145 = OpCompositeExtract %float %139 2
%146 = OpCompositeConstruct %v3float %143 %144 %145
%147 = OpFAdd %v3float %142 %146
%148 = OpCompositeExtract %float %140 0
%149 = OpCompositeExtract %float %140 1
%150 = OpCompositeExtract %float %140 2
%151 = OpCompositeConstruct %v3float %148 %149 %150
%152 = OpFAdd %v3float %147 %151
%153 = OpLoad %float %alpha
%154 = OpCompositeExtract %float %152 0
%155 = OpCompositeExtract %float %152 1
%156 = OpCompositeExtract %float %152 2
%157 = OpCompositeConstruct %v4float %154 %155 %156 %153
OpStore %color %157
%158 = OpLoad %v4float %color
%160 = OpCompositeExtract %float %158 0
%161 = OpCompositeExtract %float %158 1
%162 = OpCompositeExtract %float %158 2
%163 = OpCompositeConstruct %v3float %160 %161 %162
%159 = OpExtInst %v3float %81 NMax %163 %37
%164 = OpLoad %v4float %color
%165 = OpCompositeExtract %float %159 0
%166 = OpCompositeExtract %float %159 1
%167 = OpCompositeExtract %float %159 2
%168 = OpCompositeExtract %float %164 3
%169 = OpCompositeConstruct %v4float %165 %166 %167 %168
OpStore %color %169
%170 = OpAccessChain %_ptr_Uniform_float %x_137 %uint_0
%171 = OpLoad %float %170
%172 = OpAccessChain %_ptr_Function_float %color %uint_3
%173 = OpLoad %float %172
%174 = OpAccessChain %_ptr_Function_float %color %uint_3
%175 = OpFMul %float %173 %171
OpStore %174 %175
%176 = OpLoad %v4float %color
OpStore %glFragColor %176
OpStore %tint_return_flag %true
OpBranch %73
%70 = OpLoad %float %fClipDistance4
%71 = OpFOrdGreaterThan %bool %70 %11
OpSelectionMerge %72 None
OpBranchConditional %71 %73 %72
%73 = OpLabel
OpBranch %65
%65 = OpLabel
OpStore %tint_discard %true
OpStore %tint_return_flag %true
OpBranch %72
%72 = OpLabel
%75 = OpLoad %bool %tint_return_flag
%74 = OpLogicalNot %bool %75
OpSelectionMerge %76 None
OpBranchConditional %74 %77 %76
%77 = OpLabel
%81 = OpAccessChain %_ptr_Uniform_v4float %x_29 %uint_0 %uint_0
%82 = OpLoad %v4float %81
%85 = OpCompositeExtract %float %82 0
%86 = OpCompositeExtract %float %82 1
%87 = OpCompositeExtract %float %82 2
%88 = OpCompositeConstruct %v3float %85 %86 %87
%89 = OpFSub %v3float %88 %40
%83 = OpExtInst %v3float %84 Normalize %89
OpStore %viewDirectionW %83
OpStore %baseColor %91
%92 = OpAccessChain %_ptr_Uniform_v4float %x_49 %uint_0 %uint_0
%93 = OpLoad %v4float %92
%94 = OpCompositeExtract %float %93 0
%95 = OpCompositeExtract %float %93 1
%96 = OpCompositeExtract %float %93 2
%97 = OpCompositeConstruct %v3float %94 %95 %96
OpStore %diffuseColor %97
%100 = OpAccessChain %_ptr_Uniform_float %x_49 %uint_0 %uint_0 %uint_3
%101 = OpLoad %float %100
OpStore %alpha %101
OpStore %uvOffset %50
%102 = OpLoad %v4float %baseColor
%103 = OpCompositeExtract %float %102 0
%104 = OpCompositeExtract %float %102 1
%105 = OpCompositeExtract %float %102 2
%106 = OpCompositeConstruct %v3float %103 %104 %105
%107 = OpCompositeExtract %float %8 0
%108 = OpCompositeExtract %float %8 1
%109 = OpCompositeExtract %float %8 2
%110 = OpCompositeConstruct %v3float %107 %108 %109
%111 = OpFMul %v3float %106 %110
%112 = OpLoad %v4float %baseColor
%113 = OpCompositeExtract %float %111 0
%114 = OpCompositeExtract %float %111 1
%115 = OpCompositeExtract %float %111 2
%116 = OpCompositeExtract %float %112 3
%117 = OpCompositeConstruct %v4float %113 %114 %115 %116
OpStore %baseColor %117
OpStore %baseAmbientColor %118
OpStore %glossiness %11
OpStore %diffuseBase %40
OpStore %shadow %float_1
OpStore %refractionColor %119
OpStore %reflectionColor %119
%121 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_0 %uint_3
%122 = OpLoad %v3float %121
OpStore %emissiveColor %122
%123 = OpLoad %v3float %diffuseBase
%124 = OpLoad %v3float %diffuseColor
%125 = OpLoad %v3float %emissiveColor
%127 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_0 %uint_1
%128 = OpLoad %v3float %127
%129 = OpLoad %v4float %baseColor
%131 = OpFMul %v3float %123 %124
%132 = OpFAdd %v3float %131 %125
%133 = OpFAdd %v3float %132 %128
%130 = OpExtInst %v3float %84 NClamp %133 %40 %118
%134 = OpCompositeExtract %float %129 0
%135 = OpCompositeExtract %float %129 1
%136 = OpCompositeExtract %float %129 2
%137 = OpCompositeConstruct %v3float %134 %135 %136
%138 = OpFMul %v3float %130 %137
OpStore %finalDiffuse %138
OpStore %finalSpecular %40
%139 = OpLoad %v3float %finalDiffuse
%140 = OpLoad %v3float %baseAmbientColor
%141 = OpLoad %v3float %finalSpecular
%142 = OpLoad %v4float %reflectionColor
%143 = OpLoad %v4float %refractionColor
%144 = OpFMul %v3float %139 %140
%145 = OpFAdd %v3float %144 %141
%146 = OpCompositeExtract %float %142 0
%147 = OpCompositeExtract %float %142 1
%148 = OpCompositeExtract %float %142 2
%149 = OpCompositeConstruct %v3float %146 %147 %148
%150 = OpFAdd %v3float %145 %149
%151 = OpCompositeExtract %float %143 0
%152 = OpCompositeExtract %float %143 1
%153 = OpCompositeExtract %float %143 2
%154 = OpCompositeConstruct %v3float %151 %152 %153
%155 = OpFAdd %v3float %150 %154
%156 = OpLoad %float %alpha
%157 = OpCompositeExtract %float %155 0
%158 = OpCompositeExtract %float %155 1
%159 = OpCompositeExtract %float %155 2
%160 = OpCompositeConstruct %v4float %157 %158 %159 %156
OpStore %color %160
%161 = OpLoad %v4float %color
%163 = OpCompositeExtract %float %161 0
%164 = OpCompositeExtract %float %161 1
%165 = OpCompositeExtract %float %161 2
%166 = OpCompositeConstruct %v3float %163 %164 %165
%162 = OpExtInst %v3float %84 NMax %166 %40
%167 = OpLoad %v4float %color
%168 = OpCompositeExtract %float %162 0
%169 = OpCompositeExtract %float %162 1
%170 = OpCompositeExtract %float %162 2
%171 = OpCompositeExtract %float %167 3
%172 = OpCompositeConstruct %v4float %168 %169 %170 %171
OpStore %color %172
%173 = OpAccessChain %_ptr_Uniform_float %x_137 %uint_0 %uint_0
%174 = OpLoad %float %173
%175 = OpAccessChain %_ptr_Function_float %color %uint_3
%176 = OpLoad %float %175
%177 = OpAccessChain %_ptr_Function_float %color %uint_3
%178 = OpFMul %float %176 %174
OpStore %177 %178
%179 = OpLoad %v4float %color
OpStore %glFragColor %179
OpStore %tint_return_flag %true
OpBranch %76
%76 = OpLabel
OpBranch %68
%68 = OpLabel
OpReturn
OpFunctionEnd
%tint_discard_func = OpFunction %void None %29
%178 = OpLabel
%tint_discard_func = OpFunction %void None %32
%181 = OpLabel
OpKill
OpFunctionEnd
%main_inner = OpFunction %main_out None %179
%main_inner = OpFunction %main_out None %182
%fClipDistance3_param = OpFunctionParameter %float
%fClipDistance4_param = OpFunctionParameter %float
%184 = OpLabel
%187 = OpLabel
OpStore %fClipDistance3 %fClipDistance3_param
OpStore %fClipDistance4 %fClipDistance4_param
%185 = OpFunctionCall %void %main_1
%186 = OpLoad %bool %tint_discard
OpSelectionMerge %187 None
OpBranchConditional %186 %188 %187
%188 = OpLabel
%189 = OpFunctionCall %void %tint_discard_func
OpReturnValue %190
%187 = OpLabel
%191 = OpLoad %v4float %glFragColor
%192 = OpCompositeConstruct %main_out %191
OpReturnValue %192
%188 = OpFunctionCall %void %main_1
%189 = OpLoad %bool %tint_discard
OpSelectionMerge %190 None
OpBranchConditional %189 %191 %190
%191 = OpLabel
%192 = OpFunctionCall %void %tint_discard_func
OpReturnValue %193
%190 = OpLabel
%194 = OpLoad %v4float %glFragColor
%195 = OpCompositeConstruct %main_out %194
OpReturnValue %195
OpFunctionEnd
%main = OpFunction %void None %29
%194 = OpLabel
%196 = OpLoad %float %fClipDistance3_param_1
%197 = OpLoad %float %fClipDistance4_param_1
%195 = OpFunctionCall %main_out %main_inner %196 %197
%198 = OpCompositeExtract %v4float %195 0
OpStore %glFragColor_1_1 %198
%main = OpFunction %void None %32
%197 = OpLabel
%199 = OpLoad %float %fClipDistance3_param_1
%200 = OpLoad %float %fClipDistance4_param_1
%198 = OpFunctionCall %main_out %main_inner %199 %200
%201 = OpCompositeExtract %v4float %198 0
OpStore %glFragColor_1_1 %201
OpReturn
OpFunctionEnd

View File

@ -15,11 +15,15 @@ struct TileLightIdData {
uint lightId[64];
};
layout(binding = 0, std430) buffer Tiles_ssbo {
struct Tiles {
TileLightIdData data[4];
};
layout(binding = 0, std430) buffer tileLightId_block_ssbo {
Tiles inner;
} tileLightId;
layout(binding = 0, std140) uniform Config_ubo {
struct Config {
uint numLights;
uint numTiles;
uint tileCountX;
@ -28,30 +32,38 @@ layout(binding = 0, std140) uniform Config_ubo {
uint tileSize;
uint pad;
uint pad_1;
};
layout(binding = 0, std140) uniform config_block_ubo {
Config inner;
} config;
layout(binding = 0, std140) uniform Uniforms_ubo {
struct Uniforms {
vec4 tint_symbol;
vec4 tint_symbol_1;
mat4 viewMatrix;
mat4 projectionMatrix;
vec4 fullScreenSize;
};
layout(binding = 0, std140) uniform uniforms_block_ubo {
Uniforms inner;
} uniforms;
void tint_symbol_2(uvec3 GlobalInvocationID) {
uint index = GlobalInvocationID.x;
if ((index >= config.numLights)) {
if ((index >= config.inner.numLights)) {
return;
}
lightsBuffer.lights[index].position.y = ((lightsBuffer.lights[index].position.y - 0.100000001f) + (0.001f * (float(index) - (64.0f * floor((float(index) / 64.0f))))));
if ((lightsBuffer.lights[index].position.y < uniforms.tint_symbol.y)) {
lightsBuffer.lights[index].position.y = uniforms.tint_symbol_1.y;
if ((lightsBuffer.lights[index].position.y < uniforms.inner.tint_symbol.y)) {
lightsBuffer.lights[index].position.y = uniforms.inner.tint_symbol_1.y;
}
mat4 M = uniforms.projectionMatrix;
mat4 M = uniforms.inner.projectionMatrix;
float viewNear = (-(M[3][2]) / (-1.0f + M[2][2]));
float viewFar = (-(M[3][2]) / (1.0f + M[2][2]));
vec4 lightPos = lightsBuffer.lights[index].position;
lightPos = (uniforms.viewMatrix * lightPos);
lightPos = (uniforms.inner.viewMatrix * lightPos);
lightPos = (lightPos / lightPos.w);
float lightRadius = lightsBuffer.lights[index].radius;
vec4 boxMin = (lightPos - vec4(vec3(lightRadius), 0.0f));
@ -67,8 +79,8 @@ void tint_symbol_2(uvec3 GlobalInvocationID) {
{
for(int x_1 = 0; (x_1 < TILE_COUNT_X); x_1 = (x_1 + 1)) {
ivec2 tilePixel0Idx = ivec2((x_1 * TILE_SIZE), (y_1 * TILE_SIZE));
vec2 floorCoord = (((2.0f * vec2(tilePixel0Idx)) / uniforms.fullScreenSize.xy) - vec2(1.0f));
vec2 ceilCoord = (((2.0f * vec2((tilePixel0Idx + ivec2(TILE_SIZE)))) / uniforms.fullScreenSize.xy) - vec2(1.0f));
vec2 floorCoord = (((2.0f * vec2(tilePixel0Idx)) / uniforms.inner.fullScreenSize.xy) - vec2(1.0f));
vec2 ceilCoord = (((2.0f * vec2((tilePixel0Idx + ivec2(TILE_SIZE)))) / uniforms.inner.fullScreenSize.xy) - vec2(1.0f));
vec2 viewFloorCoord = vec2((((-(viewNear) * floorCoord.x) - (M[2][0] * viewNear)) / M[0][0]), (((-(viewNear) * floorCoord.y) - (M[2][1] * viewNear)) / M[1][1]));
vec2 viewCeilCoord = vec2((((-(viewNear) * ceilCoord.x) - (M[2][0] * viewNear)) / M[0][0]), (((-(viewNear) * ceilCoord.y) - (M[2][1] * viewNear)) / M[1][1]));
frustumPlanes[0] = vec4(1.0f, 0.0f, (-(viewFloorCoord.x) / viewNear), 0.0f);
@ -102,16 +114,16 @@ void tint_symbol_2(uvec3 GlobalInvocationID) {
uint tileId = uint((x_1 + (y_1 * TILE_COUNT_X)));
bool tint_tmp = (tileId < 0u);
if (!tint_tmp) {
tint_tmp = (tileId >= config.numTiles);
tint_tmp = (tileId >= config.inner.numTiles);
}
if ((tint_tmp)) {
continue;
}
uint offset = atomicAdd(tileLightId.data[tileId].count, 1u);
if ((offset >= config.numTileLightSlot)) {
uint offset = atomicAdd(tileLightId.inner.data[tileId].count, 1u);
if ((offset >= config.inner.numTileLightSlot)) {
continue;
}
tileLightId.data[tileId].lightId[offset] = GlobalInvocationID.x;
tileLightId.inner.data[tileId].lightId[offset] = GlobalInvocationID.x;
}
}
}

View File

@ -1,10 +1,10 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 415
; Bound: 418
; Schema: 0
OpCapability Shader
%60 = OpExtInstImport "GLSL.std.450"
%63 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %GlobalInvocationID_1
OpExecutionMode %main LocalSize 64 1 1
@ -16,12 +16,16 @@
OpMemberName %LightData 1 "color"
OpMemberName %LightData 2 "radius"
OpName %lightsBuffer "lightsBuffer"
OpName %tileLightId_block "tileLightId_block"
OpMemberName %tileLightId_block 0 "inner"
OpName %Tiles "Tiles"
OpMemberName %Tiles 0 "data"
OpName %TileLightIdData "TileLightIdData"
OpMemberName %TileLightIdData 0 "count"
OpMemberName %TileLightIdData 1 "lightId"
OpName %tileLightId "tileLightId"
OpName %config_block "config_block"
OpMemberName %config_block 0 "inner"
OpName %Config "Config"
OpMemberName %Config 0 "numLights"
OpMemberName %Config 1 "numTiles"
@ -30,6 +34,8 @@
OpMemberName %Config 4 "numTileLightSlot"
OpMemberName %Config 5 "tileSize"
OpName %config "config"
OpName %uniforms_block "uniforms_block"
OpMemberName %uniforms_block 0 "inner"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "min"
OpMemberName %Uniforms 1 "max"
@ -70,7 +76,8 @@
OpDecorate %_runtimearr_LightData ArrayStride 32
OpDecorate %lightsBuffer DescriptorSet 0
OpDecorate %lightsBuffer Binding 0
OpDecorate %Tiles Block
OpDecorate %tileLightId_block Block
OpMemberDecorate %tileLightId_block 0 Offset 0
OpMemberDecorate %Tiles 0 Offset 0
OpMemberDecorate %TileLightIdData 0 Offset 0
OpMemberDecorate %TileLightIdData 1 Offset 4
@ -78,7 +85,8 @@
OpDecorate %_arr_TileLightIdData_uint_4 ArrayStride 260
OpDecorate %tileLightId DescriptorSet 1
OpDecorate %tileLightId Binding 0
OpDecorate %Config Block
OpDecorate %config_block Block
OpMemberDecorate %config_block 0 Offset 0
OpMemberDecorate %Config 0 Offset 0
OpMemberDecorate %Config 1 Offset 4
OpMemberDecorate %Config 2 Offset 8
@ -88,7 +96,8 @@
OpDecorate %config NonWritable
OpDecorate %config DescriptorSet 2
OpDecorate %config Binding 0
OpDecorate %Uniforms Block
OpDecorate %uniforms_block Block
OpMemberDecorate %uniforms_block 0 Offset 0
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 16
OpMemberDecorate %Uniforms 2 Offset 32
@ -120,19 +129,22 @@
%uint_4 = OpConstant %uint 4
%_arr_TileLightIdData_uint_4 = OpTypeArray %TileLightIdData %uint_4
%Tiles = OpTypeStruct %_arr_TileLightIdData_uint_4
%_ptr_StorageBuffer_Tiles = OpTypePointer StorageBuffer %Tiles
%tileLightId = OpVariable %_ptr_StorageBuffer_Tiles StorageBuffer
%tileLightId_block = OpTypeStruct %Tiles
%_ptr_StorageBuffer_tileLightId_block = OpTypePointer StorageBuffer %tileLightId_block
%tileLightId = OpVariable %_ptr_StorageBuffer_tileLightId_block StorageBuffer
%Config = OpTypeStruct %uint %uint %uint %uint %uint %uint
%_ptr_Uniform_Config = OpTypePointer Uniform %Config
%config = OpVariable %_ptr_Uniform_Config Uniform
%config_block = OpTypeStruct %Config
%_ptr_Uniform_config_block = OpTypePointer Uniform %config_block
%config = OpVariable %_ptr_Uniform_config_block Uniform
%mat4v4float = OpTypeMatrix %v4float 4
%Uniforms = OpTypeStruct %v4float %v4float %mat4v4float %mat4v4float %v4float
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform
%void = OpTypeVoid
%28 = OpTypeFunction %void %v3uint
%31 = OpTypeFunction %void %v3uint
%_ptr_Function_uint = OpTypePointer Function %uint
%36 = OpConstantNull %uint
%39 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%bool = OpTypeBool
@ -145,471 +157,471 @@
%uint_3 = OpConstant %uint 3
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
%87 = OpConstantNull %mat4v4float
%90 = OpConstantNull %mat4v4float
%int = OpTypeInt 32 1
%int_3 = OpConstant %int 3
%int_2 = OpConstant %int 2
%_ptr_Function_float = OpTypePointer Function %float
%float_n1 = OpConstant %float -1
%101 = OpConstantNull %float
%104 = OpConstantNull %float
%float_1 = OpConstant %float 1
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%117 = OpConstantNull %v4float
%120 = OpConstantNull %v4float
%uint_2 = OpConstant %uint 2
%uint_6 = OpConstant %uint 6
%_arr_v4float_uint_6 = OpTypeArray %v4float %uint_6
%_ptr_Function__arr_v4float_uint_6 = OpTypePointer Function %_arr_v4float_uint_6
%155 = OpConstantNull %_arr_v4float_uint_6
%158 = OpConstantNull %_arr_v4float_uint_6
%int_4 = OpConstant %int 4
%int_5 = OpConstant %int 5
%int_16 = OpConstant %int 16
%166 = OpConstantNull %int
%169 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
%196 = OpConstantNull %v2int
%199 = OpConstantNull %v2int
%float_2 = OpConstant %float 2
%v2float = OpTypeVector %float 2
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%207 = OpConstantComposite %v2float %float_1 %float_1
%210 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%211 = OpConstantNull %v2float
%214 = OpConstantNull %v2float
%int_1 = OpConstant %int 1
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
%410 = OpTypeFunction %void
%main_inner = OpFunction %void None %28
%413 = OpTypeFunction %void
%main_inner = OpFunction %void None %31
%GlobalInvocationID = OpFunctionParameter %v3uint
%32 = OpLabel
%index = OpVariable %_ptr_Function_uint Function %36
%M = OpVariable %_ptr_Function_mat4v4float Function %87
%viewNear = OpVariable %_ptr_Function_float Function %101
%viewFar = OpVariable %_ptr_Function_float Function %101
%lightPos = OpVariable %_ptr_Function_v4float Function %117
%127 = OpVariable %_ptr_Function_v4float Function %117
%lightRadius = OpVariable %_ptr_Function_float Function %101
%boxMin = OpVariable %_ptr_Function_v4float Function %117
%boxMax = OpVariable %_ptr_Function_v4float Function %117
%frustumPlanes = OpVariable %_ptr_Function__arr_v4float_uint_6 Function %155
%y = OpVariable %_ptr_Function_int Function %166
%x = OpVariable %_ptr_Function_int Function %166
%tilePixel0Idx = OpVariable %_ptr_Function_v2int Function %196
%floorCoord = OpVariable %_ptr_Function_v2float Function %211
%ceilCoord = OpVariable %_ptr_Function_v2float Function %211
%viewFloorCoord = OpVariable %_ptr_Function_v2float Function %211
%viewCeilCoord = OpVariable %_ptr_Function_v2float Function %211
%dp = OpVariable %_ptr_Function_float Function %101
%i = OpVariable %_ptr_Function_uint Function %36
%p = OpVariable %_ptr_Function_v4float Function %117
%tileId = OpVariable %_ptr_Function_uint Function %36
%offset = OpVariable %_ptr_Function_uint Function %36
%33 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %index %33
%37 = OpLoad %uint %index
%40 = OpAccessChain %_ptr_Uniform_uint %config %uint_0
%41 = OpLoad %uint %40
%42 = OpUGreaterThanEqual %bool %37 %41
OpSelectionMerge %44 None
OpBranchConditional %42 %45 %44
%45 = OpLabel
%35 = OpLabel
%index = OpVariable %_ptr_Function_uint Function %39
%M = OpVariable %_ptr_Function_mat4v4float Function %90
%viewNear = OpVariable %_ptr_Function_float Function %104
%viewFar = OpVariable %_ptr_Function_float Function %104
%lightPos = OpVariable %_ptr_Function_v4float Function %120
%130 = OpVariable %_ptr_Function_v4float Function %120
%lightRadius = OpVariable %_ptr_Function_float Function %104
%boxMin = OpVariable %_ptr_Function_v4float Function %120
%boxMax = OpVariable %_ptr_Function_v4float Function %120
%frustumPlanes = OpVariable %_ptr_Function__arr_v4float_uint_6 Function %158
%y = OpVariable %_ptr_Function_int Function %169
%x = OpVariable %_ptr_Function_int Function %169
%tilePixel0Idx = OpVariable %_ptr_Function_v2int Function %199
%floorCoord = OpVariable %_ptr_Function_v2float Function %214
%ceilCoord = OpVariable %_ptr_Function_v2float Function %214
%viewFloorCoord = OpVariable %_ptr_Function_v2float Function %214
%viewCeilCoord = OpVariable %_ptr_Function_v2float Function %214
%dp = OpVariable %_ptr_Function_float Function %104
%i = OpVariable %_ptr_Function_uint Function %39
%p = OpVariable %_ptr_Function_v4float Function %120
%tileId = OpVariable %_ptr_Function_uint Function %39
%offset = OpVariable %_ptr_Function_uint Function %39
%36 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %index %36
%40 = OpLoad %uint %index
%43 = OpAccessChain %_ptr_Uniform_uint %config %uint_0 %uint_0
%44 = OpLoad %uint %43
%45 = OpUGreaterThanEqual %bool %40 %44
OpSelectionMerge %47 None
OpBranchConditional %45 %48 %47
%48 = OpLabel
OpReturn
%44 = OpLabel
%46 = OpLoad %uint %index
%49 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %46 %uint_0 %uint_1
%50 = OpLoad %uint %index
%51 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %50 %uint_0 %uint_1
%52 = OpLoad %float %51
%54 = OpFSub %float %52 %float_0_100000001
%57 = OpLoad %uint %index
%56 = OpConvertUToF %float %57
%62 = OpLoad %uint %index
%61 = OpConvertUToF %float %62
%63 = OpFDiv %float %61 %float_64
%59 = OpExtInst %float %60 Floor %63
%64 = OpFMul %float %float_64 %59
%65 = OpFSub %float %56 %64
%66 = OpFMul %float %float_0_00100000005 %65
%67 = OpFAdd %float %54 %66
OpStore %49 %67
%68 = OpLoad %uint %index
%69 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %68 %uint_0 %uint_1
%70 = OpLoad %float %69
%72 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_1
%47 = OpLabel
%49 = OpLoad %uint %index
%52 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %49 %uint_0 %uint_1
%53 = OpLoad %uint %index
%54 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %53 %uint_0 %uint_1
%55 = OpLoad %float %54
%57 = OpFSub %float %55 %float_0_100000001
%60 = OpLoad %uint %index
%59 = OpConvertUToF %float %60
%65 = OpLoad %uint %index
%64 = OpConvertUToF %float %65
%66 = OpFDiv %float %64 %float_64
%62 = OpExtInst %float %63 Floor %66
%67 = OpFMul %float %float_64 %62
%68 = OpFSub %float %59 %67
%69 = OpFMul %float %float_0_00100000005 %68
%70 = OpFAdd %float %57 %69
OpStore %52 %70
%71 = OpLoad %uint %index
%72 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %71 %uint_0 %uint_1
%73 = OpLoad %float %72
%74 = OpFOrdLessThan %bool %70 %73
OpSelectionMerge %75 None
OpBranchConditional %74 %76 %75
%76 = OpLabel
%77 = OpLoad %uint %index
%78 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %77 %uint_0 %uint_1
%79 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_1 %uint_1
%80 = OpLoad %float %79
OpStore %78 %80
OpBranch %75
%75 = OpLabel
%83 = OpAccessChain %_ptr_Uniform_mat4v4float %uniforms %uint_3
%84 = OpLoad %mat4v4float %83
OpStore %M %84
%93 = OpAccessChain %_ptr_Function_float %M %int_3 %int_2
%94 = OpLoad %float %93
%88 = OpFNegate %float %94
%96 = OpAccessChain %_ptr_Function_float %M %int_2 %int_2
%75 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_0 %uint_1
%76 = OpLoad %float %75
%77 = OpFOrdLessThan %bool %73 %76
OpSelectionMerge %78 None
OpBranchConditional %77 %79 %78
%79 = OpLabel
%80 = OpLoad %uint %index
%81 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %80 %uint_0 %uint_1
%82 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_1 %uint_1
%83 = OpLoad %float %82
OpStore %81 %83
OpBranch %78
%78 = OpLabel
%86 = OpAccessChain %_ptr_Uniform_mat4v4float %uniforms %uint_0 %uint_3
%87 = OpLoad %mat4v4float %86
OpStore %M %87
%96 = OpAccessChain %_ptr_Function_float %M %int_3 %int_2
%97 = OpLoad %float %96
%98 = OpFAdd %float %float_n1 %97
%99 = OpFDiv %float %88 %98
OpStore %viewNear %99
%103 = OpAccessChain %_ptr_Function_float %M %int_3 %int_2
%104 = OpLoad %float %103
%102 = OpFNegate %float %104
%106 = OpAccessChain %_ptr_Function_float %M %int_2 %int_2
%91 = OpFNegate %float %97
%99 = OpAccessChain %_ptr_Function_float %M %int_2 %int_2
%100 = OpLoad %float %99
%101 = OpFAdd %float %float_n1 %100
%102 = OpFDiv %float %91 %101
OpStore %viewNear %102
%106 = OpAccessChain %_ptr_Function_float %M %int_3 %int_2
%107 = OpLoad %float %106
%108 = OpFAdd %float %float_1 %107
%109 = OpFDiv %float %102 %108
OpStore %viewFar %109
%111 = OpLoad %uint %index
%113 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %111 %uint_0
%114 = OpLoad %v4float %113
OpStore %lightPos %114
%119 = OpAccessChain %_ptr_Uniform_mat4v4float %uniforms %uint_2
%120 = OpLoad %mat4v4float %119
%121 = OpLoad %v4float %lightPos
%122 = OpMatrixTimesVector %v4float %120 %121
OpStore %lightPos %122
%123 = OpLoad %v4float %lightPos
%124 = OpAccessChain %_ptr_Function_float %lightPos %uint_3
%125 = OpLoad %float %124
%128 = OpCompositeConstruct %v4float %125 %125 %125 %125
%126 = OpFDiv %v4float %123 %128
OpStore %lightPos %126
%129 = OpLoad %uint %index
%130 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %129 %uint_2
%131 = OpLoad %float %130
OpStore %lightRadius %131
%133 = OpLoad %v4float %lightPos
%134 = OpLoad %float %lightRadius
%135 = OpCompositeConstruct %v3float %134 %134 %134
%136 = OpCompositeExtract %float %135 0
%137 = OpCompositeExtract %float %135 1
%138 = OpCompositeExtract %float %135 2
%139 = OpCompositeConstruct %v4float %136 %137 %138 %101
%140 = OpFSub %v4float %133 %139
OpStore %boxMin %140
%142 = OpLoad %v4float %lightPos
%143 = OpLoad %float %lightRadius
%144 = OpCompositeConstruct %v3float %143 %143 %143
%145 = OpCompositeExtract %float %144 0
%146 = OpCompositeExtract %float %144 1
%147 = OpCompositeExtract %float %144 2
%148 = OpCompositeConstruct %v4float %145 %146 %147 %101
%149 = OpFAdd %v4float %142 %148
OpStore %boxMax %149
%157 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_4
%158 = OpLoad %float %viewNear
%159 = OpCompositeConstruct %v4float %101 %101 %float_n1 %158
OpStore %157 %159
%161 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_5
%163 = OpLoad %float %viewFar
%162 = OpFNegate %float %163
%164 = OpCompositeConstruct %v4float %101 %101 %float_1 %162
OpStore %161 %164
OpStore %y %166
OpBranch %169
%169 = OpLabel
OpLoopMerge %170 %171 None
%105 = OpFNegate %float %107
%109 = OpAccessChain %_ptr_Function_float %M %int_2 %int_2
%110 = OpLoad %float %109
%111 = OpFAdd %float %float_1 %110
%112 = OpFDiv %float %105 %111
OpStore %viewFar %112
%114 = OpLoad %uint %index
%116 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %114 %uint_0
%117 = OpLoad %v4float %116
OpStore %lightPos %117
%122 = OpAccessChain %_ptr_Uniform_mat4v4float %uniforms %uint_0 %uint_2
%123 = OpLoad %mat4v4float %122
%124 = OpLoad %v4float %lightPos
%125 = OpMatrixTimesVector %v4float %123 %124
OpStore %lightPos %125
%126 = OpLoad %v4float %lightPos
%127 = OpAccessChain %_ptr_Function_float %lightPos %uint_3
%128 = OpLoad %float %127
%131 = OpCompositeConstruct %v4float %128 %128 %128 %128
%129 = OpFDiv %v4float %126 %131
OpStore %lightPos %129
%132 = OpLoad %uint %index
%133 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %132 %uint_2
%134 = OpLoad %float %133
OpStore %lightRadius %134
%136 = OpLoad %v4float %lightPos
%137 = OpLoad %float %lightRadius
%138 = OpCompositeConstruct %v3float %137 %137 %137
%139 = OpCompositeExtract %float %138 0
%140 = OpCompositeExtract %float %138 1
%141 = OpCompositeExtract %float %138 2
%142 = OpCompositeConstruct %v4float %139 %140 %141 %104
%143 = OpFSub %v4float %136 %142
OpStore %boxMin %143
%145 = OpLoad %v4float %lightPos
%146 = OpLoad %float %lightRadius
%147 = OpCompositeConstruct %v3float %146 %146 %146
%148 = OpCompositeExtract %float %147 0
%149 = OpCompositeExtract %float %147 1
%150 = OpCompositeExtract %float %147 2
%151 = OpCompositeConstruct %v4float %148 %149 %150 %104
%152 = OpFAdd %v4float %145 %151
OpStore %boxMax %152
%160 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_4
%161 = OpLoad %float %viewNear
%162 = OpCompositeConstruct %v4float %104 %104 %float_n1 %161
OpStore %160 %162
%164 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_5
%166 = OpLoad %float %viewFar
%165 = OpFNegate %float %166
%167 = OpCompositeConstruct %v4float %104 %104 %float_1 %165
OpStore %164 %167
OpStore %y %169
OpBranch %172
%172 = OpLabel
%174 = OpLoad %int %y
%175 = OpSLessThan %bool %174 %int_2
%173 = OpLogicalNot %bool %175
OpSelectionMerge %176 None
OpBranchConditional %173 %177 %176
%177 = OpLabel
OpBranch %170
%176 = OpLabel
OpStore %x %166
OpBranch %179
OpLoopMerge %173 %174 None
OpBranch %175
%175 = OpLabel
%177 = OpLoad %int %y
%178 = OpSLessThan %bool %177 %int_2
%176 = OpLogicalNot %bool %178
OpSelectionMerge %179 None
OpBranchConditional %176 %180 %179
%180 = OpLabel
OpBranch %173
%179 = OpLabel
OpLoopMerge %180 %181 None
OpStore %x %169
OpBranch %182
%182 = OpLabel
%184 = OpLoad %int %x
%185 = OpSLessThan %bool %184 %int_2
%183 = OpLogicalNot %bool %185
OpSelectionMerge %186 None
OpBranchConditional %183 %187 %186
%187 = OpLabel
OpBranch %180
%186 = OpLabel
%189 = OpLoad %int %x
%190 = OpIMul %int %189 %int_16
%191 = OpLoad %int %y
%192 = OpIMul %int %191 %int_16
%193 = OpCompositeConstruct %v2int %190 %192
OpStore %tilePixel0Idx %193
%200 = OpLoad %v2int %tilePixel0Idx
%198 = OpConvertSToF %v2float %200
%201 = OpVectorTimesScalar %v2float %198 %float_2
%203 = OpAccessChain %_ptr_Uniform_v4float %uniforms %uint_4
%204 = OpLoad %v4float %203
%205 = OpVectorShuffle %v2float %204 %204 0 1
%206 = OpFDiv %v2float %201 %205
%208 = OpFSub %v2float %206 %207
OpStore %floorCoord %208
%213 = OpLoad %v2int %tilePixel0Idx
%214 = OpCompositeConstruct %v2int %int_16 %int_16
%215 = OpIAdd %v2int %213 %214
%212 = OpConvertSToF %v2float %215
%216 = OpVectorTimesScalar %v2float %212 %float_2
%217 = OpAccessChain %_ptr_Uniform_v4float %uniforms %uint_4
%218 = OpLoad %v4float %217
%219 = OpVectorShuffle %v2float %218 %218 0 1
%220 = OpFDiv %v2float %216 %219
%221 = OpFSub %v2float %220 %207
OpStore %ceilCoord %221
%224 = OpLoad %float %viewNear
%223 = OpFNegate %float %224
%225 = OpAccessChain %_ptr_Function_float %floorCoord %uint_0
%226 = OpLoad %float %225
%227 = OpFMul %float %223 %226
%228 = OpAccessChain %_ptr_Function_float %M %int_2 %166
OpLoopMerge %183 %184 None
OpBranch %185
%185 = OpLabel
%187 = OpLoad %int %x
%188 = OpSLessThan %bool %187 %int_2
%186 = OpLogicalNot %bool %188
OpSelectionMerge %189 None
OpBranchConditional %186 %190 %189
%190 = OpLabel
OpBranch %183
%189 = OpLabel
%192 = OpLoad %int %x
%193 = OpIMul %int %192 %int_16
%194 = OpLoad %int %y
%195 = OpIMul %int %194 %int_16
%196 = OpCompositeConstruct %v2int %193 %195
OpStore %tilePixel0Idx %196
%203 = OpLoad %v2int %tilePixel0Idx
%201 = OpConvertSToF %v2float %203
%204 = OpVectorTimesScalar %v2float %201 %float_2
%206 = OpAccessChain %_ptr_Uniform_v4float %uniforms %uint_0 %uint_4
%207 = OpLoad %v4float %206
%208 = OpVectorShuffle %v2float %207 %207 0 1
%209 = OpFDiv %v2float %204 %208
%211 = OpFSub %v2float %209 %210
OpStore %floorCoord %211
%216 = OpLoad %v2int %tilePixel0Idx
%217 = OpCompositeConstruct %v2int %int_16 %int_16
%218 = OpIAdd %v2int %216 %217
%215 = OpConvertSToF %v2float %218
%219 = OpVectorTimesScalar %v2float %215 %float_2
%220 = OpAccessChain %_ptr_Uniform_v4float %uniforms %uint_0 %uint_4
%221 = OpLoad %v4float %220
%222 = OpVectorShuffle %v2float %221 %221 0 1
%223 = OpFDiv %v2float %219 %222
%224 = OpFSub %v2float %223 %210
OpStore %ceilCoord %224
%227 = OpLoad %float %viewNear
%226 = OpFNegate %float %227
%228 = OpAccessChain %_ptr_Function_float %floorCoord %uint_0
%229 = OpLoad %float %228
%230 = OpLoad %float %viewNear
%231 = OpFMul %float %229 %230
%232 = OpFSub %float %227 %231
%233 = OpAccessChain %_ptr_Function_float %M %166 %166
%234 = OpLoad %float %233
%235 = OpFDiv %float %232 %234
%237 = OpLoad %float %viewNear
%236 = OpFNegate %float %237
%238 = OpAccessChain %_ptr_Function_float %floorCoord %uint_1
%239 = OpLoad %float %238
%240 = OpFMul %float %236 %239
%242 = OpAccessChain %_ptr_Function_float %M %int_2 %int_1
%243 = OpLoad %float %242
%244 = OpLoad %float %viewNear
%245 = OpFMul %float %243 %244
%246 = OpFSub %float %240 %245
%247 = OpAccessChain %_ptr_Function_float %M %int_1 %int_1
%248 = OpLoad %float %247
%249 = OpFDiv %float %246 %248
%250 = OpCompositeConstruct %v2float %235 %249
OpStore %viewFloorCoord %250
%253 = OpLoad %float %viewNear
%252 = OpFNegate %float %253
%254 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_0
%255 = OpLoad %float %254
%256 = OpFMul %float %252 %255
%257 = OpAccessChain %_ptr_Function_float %M %int_2 %166
%230 = OpFMul %float %226 %229
%231 = OpAccessChain %_ptr_Function_float %M %int_2 %169
%232 = OpLoad %float %231
%233 = OpLoad %float %viewNear
%234 = OpFMul %float %232 %233
%235 = OpFSub %float %230 %234
%236 = OpAccessChain %_ptr_Function_float %M %169 %169
%237 = OpLoad %float %236
%238 = OpFDiv %float %235 %237
%240 = OpLoad %float %viewNear
%239 = OpFNegate %float %240
%241 = OpAccessChain %_ptr_Function_float %floorCoord %uint_1
%242 = OpLoad %float %241
%243 = OpFMul %float %239 %242
%245 = OpAccessChain %_ptr_Function_float %M %int_2 %int_1
%246 = OpLoad %float %245
%247 = OpLoad %float %viewNear
%248 = OpFMul %float %246 %247
%249 = OpFSub %float %243 %248
%250 = OpAccessChain %_ptr_Function_float %M %int_1 %int_1
%251 = OpLoad %float %250
%252 = OpFDiv %float %249 %251
%253 = OpCompositeConstruct %v2float %238 %252
OpStore %viewFloorCoord %253
%256 = OpLoad %float %viewNear
%255 = OpFNegate %float %256
%257 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_0
%258 = OpLoad %float %257
%259 = OpLoad %float %viewNear
%260 = OpFMul %float %258 %259
%261 = OpFSub %float %256 %260
%262 = OpAccessChain %_ptr_Function_float %M %166 %166
%263 = OpLoad %float %262
%264 = OpFDiv %float %261 %263
%266 = OpLoad %float %viewNear
%265 = OpFNegate %float %266
%267 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_1
%268 = OpLoad %float %267
%269 = OpFMul %float %265 %268
%270 = OpAccessChain %_ptr_Function_float %M %int_2 %int_1
%259 = OpFMul %float %255 %258
%260 = OpAccessChain %_ptr_Function_float %M %int_2 %169
%261 = OpLoad %float %260
%262 = OpLoad %float %viewNear
%263 = OpFMul %float %261 %262
%264 = OpFSub %float %259 %263
%265 = OpAccessChain %_ptr_Function_float %M %169 %169
%266 = OpLoad %float %265
%267 = OpFDiv %float %264 %266
%269 = OpLoad %float %viewNear
%268 = OpFNegate %float %269
%270 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_1
%271 = OpLoad %float %270
%272 = OpLoad %float %viewNear
%273 = OpFMul %float %271 %272
%274 = OpFSub %float %269 %273
%275 = OpAccessChain %_ptr_Function_float %M %int_1 %int_1
%276 = OpLoad %float %275
%277 = OpFDiv %float %274 %276
%278 = OpCompositeConstruct %v2float %264 %277
OpStore %viewCeilCoord %278
%280 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %166
%282 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_0
%283 = OpLoad %float %282
%281 = OpFNegate %float %283
%284 = OpLoad %float %viewNear
%285 = OpFDiv %float %281 %284
%286 = OpCompositeConstruct %v4float %float_1 %101 %285 %101
OpStore %280 %286
%287 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_1
%288 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_0
%289 = OpLoad %float %288
%290 = OpLoad %float %viewNear
%291 = OpFDiv %float %289 %290
%292 = OpCompositeConstruct %v4float %float_n1 %101 %291 %101
OpStore %287 %292
%293 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_2
%295 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_1
%296 = OpLoad %float %295
%294 = OpFNegate %float %296
%297 = OpLoad %float %viewNear
%298 = OpFDiv %float %294 %297
%299 = OpCompositeConstruct %v4float %101 %float_1 %298 %101
OpStore %293 %299
%300 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_3
%301 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_1
%302 = OpLoad %float %301
%303 = OpLoad %float %viewNear
%304 = OpFDiv %float %302 %303
%305 = OpCompositeConstruct %v4float %101 %float_n1 %304 %101
OpStore %300 %305
OpStore %dp %101
OpStore %i %36
OpBranch %308
%308 = OpLabel
OpLoopMerge %309 %310 None
%272 = OpFMul %float %268 %271
%273 = OpAccessChain %_ptr_Function_float %M %int_2 %int_1
%274 = OpLoad %float %273
%275 = OpLoad %float %viewNear
%276 = OpFMul %float %274 %275
%277 = OpFSub %float %272 %276
%278 = OpAccessChain %_ptr_Function_float %M %int_1 %int_1
%279 = OpLoad %float %278
%280 = OpFDiv %float %277 %279
%281 = OpCompositeConstruct %v2float %267 %280
OpStore %viewCeilCoord %281
%283 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %169
%285 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_0
%286 = OpLoad %float %285
%284 = OpFNegate %float %286
%287 = OpLoad %float %viewNear
%288 = OpFDiv %float %284 %287
%289 = OpCompositeConstruct %v4float %float_1 %104 %288 %104
OpStore %283 %289
%290 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_1
%291 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_0
%292 = OpLoad %float %291
%293 = OpLoad %float %viewNear
%294 = OpFDiv %float %292 %293
%295 = OpCompositeConstruct %v4float %float_n1 %104 %294 %104
OpStore %290 %295
%296 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_2
%298 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_1
%299 = OpLoad %float %298
%297 = OpFNegate %float %299
%300 = OpLoad %float %viewNear
%301 = OpFDiv %float %297 %300
%302 = OpCompositeConstruct %v4float %104 %float_1 %301 %104
OpStore %296 %302
%303 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %int_3
%304 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_1
%305 = OpLoad %float %304
%306 = OpLoad %float %viewNear
%307 = OpFDiv %float %305 %306
%308 = OpCompositeConstruct %v4float %104 %float_n1 %307 %104
OpStore %303 %308
OpStore %dp %104
OpStore %i %39
OpBranch %311
%311 = OpLabel
%313 = OpLoad %uint %i
%314 = OpULessThan %bool %313 %uint_6
%312 = OpLogicalNot %bool %314
OpSelectionMerge %315 None
OpBranchConditional %312 %316 %315
%316 = OpLabel
OpBranch %309
%315 = OpLabel
%318 = OpLoad %uint %i
%319 = OpAccessChain %_ptr_Function_float %frustumPlanes %318 %uint_0
%320 = OpLoad %float %319
%321 = OpFOrdGreaterThan %bool %320 %101
OpSelectionMerge %322 None
OpBranchConditional %321 %323 %324
%323 = OpLabel
%325 = OpAccessChain %_ptr_Function_float %p %uint_0
%326 = OpAccessChain %_ptr_Function_float %boxMax %uint_0
%327 = OpLoad %float %326
OpStore %325 %327
OpBranch %322
%324 = OpLabel
OpLoopMerge %312 %313 None
OpBranch %314
%314 = OpLabel
%316 = OpLoad %uint %i
%317 = OpULessThan %bool %316 %uint_6
%315 = OpLogicalNot %bool %317
OpSelectionMerge %318 None
OpBranchConditional %315 %319 %318
%319 = OpLabel
OpBranch %312
%318 = OpLabel
%321 = OpLoad %uint %i
%322 = OpAccessChain %_ptr_Function_float %frustumPlanes %321 %uint_0
%323 = OpLoad %float %322
%324 = OpFOrdGreaterThan %bool %323 %104
OpSelectionMerge %325 None
OpBranchConditional %324 %326 %327
%326 = OpLabel
%328 = OpAccessChain %_ptr_Function_float %p %uint_0
%329 = OpAccessChain %_ptr_Function_float %boxMin %uint_0
%329 = OpAccessChain %_ptr_Function_float %boxMax %uint_0
%330 = OpLoad %float %329
OpStore %328 %330
OpBranch %322
%322 = OpLabel
%331 = OpLoad %uint %i
%332 = OpAccessChain %_ptr_Function_float %frustumPlanes %331 %uint_1
OpBranch %325
%327 = OpLabel
%331 = OpAccessChain %_ptr_Function_float %p %uint_0
%332 = OpAccessChain %_ptr_Function_float %boxMin %uint_0
%333 = OpLoad %float %332
%334 = OpFOrdGreaterThan %bool %333 %101
OpSelectionMerge %335 None
OpBranchConditional %334 %336 %337
%336 = OpLabel
%338 = OpAccessChain %_ptr_Function_float %p %uint_1
%339 = OpAccessChain %_ptr_Function_float %boxMax %uint_1
%340 = OpLoad %float %339
OpStore %338 %340
OpBranch %335
%337 = OpLabel
OpStore %331 %333
OpBranch %325
%325 = OpLabel
%334 = OpLoad %uint %i
%335 = OpAccessChain %_ptr_Function_float %frustumPlanes %334 %uint_1
%336 = OpLoad %float %335
%337 = OpFOrdGreaterThan %bool %336 %104
OpSelectionMerge %338 None
OpBranchConditional %337 %339 %340
%339 = OpLabel
%341 = OpAccessChain %_ptr_Function_float %p %uint_1
%342 = OpAccessChain %_ptr_Function_float %boxMin %uint_1
%342 = OpAccessChain %_ptr_Function_float %boxMax %uint_1
%343 = OpLoad %float %342
OpStore %341 %343
OpBranch %335
%335 = OpLabel
%344 = OpLoad %uint %i
%345 = OpAccessChain %_ptr_Function_float %frustumPlanes %344 %uint_2
OpBranch %338
%340 = OpLabel
%344 = OpAccessChain %_ptr_Function_float %p %uint_1
%345 = OpAccessChain %_ptr_Function_float %boxMin %uint_1
%346 = OpLoad %float %345
%347 = OpFOrdGreaterThan %bool %346 %101
OpSelectionMerge %348 None
OpBranchConditional %347 %349 %350
%349 = OpLabel
%351 = OpAccessChain %_ptr_Function_float %p %uint_2
%352 = OpAccessChain %_ptr_Function_float %boxMax %uint_2
%353 = OpLoad %float %352
OpStore %351 %353
OpBranch %348
%350 = OpLabel
OpStore %344 %346
OpBranch %338
%338 = OpLabel
%347 = OpLoad %uint %i
%348 = OpAccessChain %_ptr_Function_float %frustumPlanes %347 %uint_2
%349 = OpLoad %float %348
%350 = OpFOrdGreaterThan %bool %349 %104
OpSelectionMerge %351 None
OpBranchConditional %350 %352 %353
%352 = OpLabel
%354 = OpAccessChain %_ptr_Function_float %p %uint_2
%355 = OpAccessChain %_ptr_Function_float %boxMin %uint_2
%355 = OpAccessChain %_ptr_Function_float %boxMax %uint_2
%356 = OpLoad %float %355
OpStore %354 %356
OpBranch %348
%348 = OpLabel
%357 = OpAccessChain %_ptr_Function_float %p %uint_3
OpStore %357 %float_1
%358 = OpLoad %float %dp
%361 = OpLoad %v4float %p
%362 = OpLoad %uint %i
%363 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %362
%364 = OpLoad %v4float %363
%360 = OpDot %float %361 %364
%359 = OpExtInst %float %60 NMin %101 %360
%365 = OpFAdd %float %358 %359
OpStore %dp %365
OpBranch %310
%310 = OpLabel
%366 = OpLoad %uint %i
%367 = OpIAdd %uint %366 %uint_1
OpStore %i %367
OpBranch %308
%309 = OpLabel
%368 = OpLoad %float %dp
%369 = OpFOrdGreaterThanEqual %bool %368 %101
OpSelectionMerge %370 None
OpBranchConditional %369 %371 %370
%371 = OpLabel
%373 = OpLoad %int %x
%374 = OpLoad %int %y
%375 = OpIMul %int %374 %int_2
%376 = OpIAdd %int %373 %375
%372 = OpBitcast %uint %376
OpStore %tileId %372
%378 = OpLoad %uint %tileId
%379 = OpULessThan %bool %378 %36
OpSelectionMerge %380 None
OpBranchConditional %379 %380 %381
%381 = OpLabel
%382 = OpLoad %uint %tileId
%383 = OpAccessChain %_ptr_Uniform_uint %config %uint_1
%384 = OpLoad %uint %383
%385 = OpUGreaterThanEqual %bool %382 %384
OpBranch %380
%380 = OpLabel
%386 = OpPhi %bool %379 %371 %385 %381
OpSelectionMerge %387 None
OpBranchConditional %386 %388 %387
%388 = OpLabel
OpBranch %181
%387 = OpLabel
%391 = OpLoad %uint %tileId
%393 = OpAccessChain %_ptr_StorageBuffer_uint %tileLightId %uint_0 %391 %uint_0
%389 = OpAtomicIAdd %uint %393 %uint_1 %uint_0 %uint_1
OpStore %offset %389
%395 = OpLoad %uint %offset
%396 = OpAccessChain %_ptr_Uniform_uint %config %uint_4
%397 = OpLoad %uint %396
%398 = OpUGreaterThanEqual %bool %395 %397
OpSelectionMerge %399 None
OpBranchConditional %398 %400 %399
%400 = OpLabel
OpBranch %181
%399 = OpLabel
%401 = OpLoad %uint %tileId
%402 = OpLoad %uint %offset
%404 = OpAccessChain %_ptr_StorageBuffer_uint_0 %tileLightId %uint_0 %401 %uint_1 %402
%405 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %404 %405
OpBranch %370
%370 = OpLabel
OpBranch %181
%181 = OpLabel
%406 = OpLoad %int %x
%407 = OpIAdd %int %406 %int_1
OpStore %x %407
OpBranch %179
%180 = OpLabel
OpBranch %171
%171 = OpLabel
%408 = OpLoad %int %y
%409 = OpIAdd %int %408 %int_1
OpStore %y %409
OpBranch %169
%170 = OpLabel
OpBranch %351
%353 = OpLabel
%357 = OpAccessChain %_ptr_Function_float %p %uint_2
%358 = OpAccessChain %_ptr_Function_float %boxMin %uint_2
%359 = OpLoad %float %358
OpStore %357 %359
OpBranch %351
%351 = OpLabel
%360 = OpAccessChain %_ptr_Function_float %p %uint_3
OpStore %360 %float_1
%361 = OpLoad %float %dp
%364 = OpLoad %v4float %p
%365 = OpLoad %uint %i
%366 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %365
%367 = OpLoad %v4float %366
%363 = OpDot %float %364 %367
%362 = OpExtInst %float %63 NMin %104 %363
%368 = OpFAdd %float %361 %362
OpStore %dp %368
OpBranch %313
%313 = OpLabel
%369 = OpLoad %uint %i
%370 = OpIAdd %uint %369 %uint_1
OpStore %i %370
OpBranch %311
%312 = OpLabel
%371 = OpLoad %float %dp
%372 = OpFOrdGreaterThanEqual %bool %371 %104
OpSelectionMerge %373 None
OpBranchConditional %372 %374 %373
%374 = OpLabel
%376 = OpLoad %int %x
%377 = OpLoad %int %y
%378 = OpIMul %int %377 %int_2
%379 = OpIAdd %int %376 %378
%375 = OpBitcast %uint %379
OpStore %tileId %375
%381 = OpLoad %uint %tileId
%382 = OpULessThan %bool %381 %39
OpSelectionMerge %383 None
OpBranchConditional %382 %383 %384
%384 = OpLabel
%385 = OpLoad %uint %tileId
%386 = OpAccessChain %_ptr_Uniform_uint %config %uint_0 %uint_1
%387 = OpLoad %uint %386
%388 = OpUGreaterThanEqual %bool %385 %387
OpBranch %383
%383 = OpLabel
%389 = OpPhi %bool %382 %374 %388 %384
OpSelectionMerge %390 None
OpBranchConditional %389 %391 %390
%391 = OpLabel
OpBranch %184
%390 = OpLabel
%394 = OpLoad %uint %tileId
%396 = OpAccessChain %_ptr_StorageBuffer_uint %tileLightId %uint_0 %uint_0 %394 %uint_0
%392 = OpAtomicIAdd %uint %396 %uint_1 %uint_0 %uint_1
OpStore %offset %392
%398 = OpLoad %uint %offset
%399 = OpAccessChain %_ptr_Uniform_uint %config %uint_0 %uint_4
%400 = OpLoad %uint %399
%401 = OpUGreaterThanEqual %bool %398 %400
OpSelectionMerge %402 None
OpBranchConditional %401 %403 %402
%403 = OpLabel
OpBranch %184
%402 = OpLabel
%404 = OpLoad %uint %tileId
%405 = OpLoad %uint %offset
%407 = OpAccessChain %_ptr_StorageBuffer_uint_0 %tileLightId %uint_0 %uint_0 %404 %uint_1 %405
%408 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %407 %408
OpBranch %373
%373 = OpLabel
OpBranch %184
%184 = OpLabel
%409 = OpLoad %int %x
%410 = OpIAdd %int %409 %int_1
OpStore %x %410
OpBranch %182
%183 = OpLabel
OpBranch %174
%174 = OpLabel
%411 = OpLoad %int %y
%412 = OpIAdd %int %411 %int_1
OpStore %y %412
OpBranch %172
%173 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %410
%412 = OpLabel
%414 = OpLoad %v3uint %GlobalInvocationID_1
%413 = OpFunctionCall %void %main_inner %414
%main = OpFunction %void None %413
%415 = OpLabel
%417 = OpLoad %v3uint %GlobalInvocationID_1
%416 = OpFunctionCall %void %main_inner %417
OpReturn
OpFunctionEnd

View File

@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
layout(binding = 0, std430) buffer Buffer_ssbo {
struct Buffer {
uint data;
};
layout(binding = 0, std430) buffer tint_symbol_block_ssbo {
Buffer inner;
} tint_symbol;
void tint_symbol_1() {
tint_symbol.data = (tint_symbol.data + 1u);
tint_symbol.inner.data = (tint_symbol.inner.data + 1u);
}

View File

@ -1,40 +1,44 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 18
; Bound: 19
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %buffer_block "buffer_block"
OpMemberName %buffer_block 0 "inner"
OpName %Buffer "Buffer"
OpMemberName %Buffer 0 "data"
OpName %buffer "buffer"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %Buffer Block
OpDecorate %buffer_block Block
OpMemberDecorate %buffer_block 0 Offset 0
OpMemberDecorate %Buffer 0 Offset 0
OpDecorate %buffer DescriptorSet 0
OpDecorate %buffer Binding 0
%uint = OpTypeInt 32 0
%Buffer = OpTypeStruct %uint
%_ptr_StorageBuffer_Buffer = OpTypePointer StorageBuffer %Buffer
%buffer = OpVariable %_ptr_StorageBuffer_Buffer StorageBuffer
%buffer_block = OpTypeStruct %Buffer
%_ptr_StorageBuffer_buffer_block = OpTypePointer StorageBuffer %buffer_block
%buffer = OpVariable %_ptr_StorageBuffer_buffer_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%6 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
%unused_entry_point = OpFunction %void None %6
%9 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%13 = OpAccessChain %_ptr_StorageBuffer_uint %buffer %uint_0
%14 = OpAccessChain %_ptr_StorageBuffer_uint %buffer %uint_0
%15 = OpLoad %uint %14
%17 = OpIAdd %uint %15 %uint_1
OpStore %13 %17
%main = OpFunction %void None %6
%11 = OpLabel
%14 = OpAccessChain %_ptr_StorageBuffer_uint %buffer %uint_0 %uint_0
%15 = OpAccessChain %_ptr_StorageBuffer_uint %buffer %uint_0 %uint_0
%16 = OpLoad %uint %15
%18 = OpIAdd %uint %16 %uint_1
OpStore %14 %18
OpReturn
OpFunctionEnd

View File

@ -3,7 +3,7 @@ precision mediump float;
layout(location = 0) in vec4 vcolor_S0_param_1;
layout(location = 0) out vec4 sk_FragColor_1_1;
layout(binding = 0, std140) uniform UniformBuffer_ubo {
struct UniformBuffer {
uint pad;
uint pad_1;
uint pad_2;
@ -15,6 +15,10 @@ layout(binding = 0, std140) uniform UniformBuffer_ubo {
vec4 ucolorRed_S1_c0;
vec4 ucolorGreen_S1_c0;
mat3 umatrix_S1;
};
layout(binding = 0, std140) uniform x_4_block_ubo {
UniformBuffer inner;
} x_4;
vec4 sk_FragColor = vec4(0.0f, 0.0f, 0.0f, 0.0f);
@ -30,7 +34,7 @@ bool test_int_S1_c0_b() {
bool x_55 = false;
bool x_65 = false;
bool x_66 = false;
float x_26 = x_4.unknownInput_S1_c0;
float x_26 = x_4.inner.unknownInput_S1_c0;
int x_27 = int(x_26);
unknown = x_27;
ok = true;
@ -90,7 +94,7 @@ void main_1() {
bool x_115 = false;
vec4 x_72 = vcolor_S0;
outputColor_S0 = x_72;
float x_77 = x_4.unknownInput_S1_c0;
float x_77 = x_4.inner.unknownInput_S1_c0;
x_8_unknown = x_77;
x_9_ok = true;
x_87 = false;
@ -135,10 +139,10 @@ void main_1() {
x_115 = x_114;
}
if (x_115) {
vec4 x_122 = x_4.ucolorGreen_S1_c0;
vec4 x_122 = x_4.inner.ucolorGreen_S1_c0;
x_116 = x_122;
} else {
vec4 x_124 = x_4.ucolorRed_S1_c0;
vec4 x_124 = x_4.inner.ucolorRed_S1_c0;
x_116 = x_124;
}
vec4 x_125 = x_116;

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 176
; Bound: 177
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -10,6 +10,8 @@
OpName %sk_Clockwise_param_1 "sk_Clockwise_param_1"
OpName %vcolor_S0_param_1 "vcolor_S0_param_1"
OpName %sk_FragColor_1_1 "sk_FragColor_1_1"
OpName %x_4_block "x_4_block"
OpMemberName %x_4_block 0 "inner"
OpName %UniformBuffer "UniformBuffer"
OpMemberName %UniformBuffer 0 "unknownInput_S1_c0"
OpMemberName %UniformBuffer 1 "ucolorRed_S1_c0"
@ -53,7 +55,8 @@
OpDecorate %sk_Clockwise_param_1 BuiltIn FrontFacing
OpDecorate %vcolor_S0_param_1 Location 0
OpDecorate %sk_FragColor_1_1 Location 0
OpDecorate %UniformBuffer Block
OpDecorate %x_4_block Block
OpMemberDecorate %x_4_block 0 Offset 0
OpMemberDecorate %UniformBuffer 0 Offset 16
OpMemberDecorate %UniformBuffer 1 Offset 32
OpMemberDecorate %UniformBuffer 2 Offset 48
@ -77,255 +80,256 @@
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
%UniformBuffer = OpTypeStruct %float %v4float %v4float %mat3v3float
%_ptr_Uniform_UniformBuffer = OpTypePointer Uniform %UniformBuffer
%x_4 = OpVariable %_ptr_Uniform_UniformBuffer Uniform
%x_4_block = OpTypeStruct %UniformBuffer
%_ptr_Uniform_x_4_block = OpTypePointer Uniform %x_4_block
%x_4 = OpVariable %_ptr_Uniform_x_4_block Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%sk_FragColor = OpVariable %_ptr_Private_v4float Private %10
%_ptr_Private_bool = OpTypePointer Private %bool
%20 = OpConstantNull %bool
%sk_Clockwise = OpVariable %_ptr_Private_bool Private %20
%21 = OpConstantNull %bool
%sk_Clockwise = OpVariable %_ptr_Private_bool Private %21
%vcolor_S0 = OpVariable %_ptr_Private_v4float Private %10
%22 = OpTypeFunction %bool
%23 = OpTypeFunction %bool
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%28 = OpConstantNull %int
%29 = OpConstantNull %int
%_ptr_Function_bool = OpTypePointer Function %bool
%v4int = OpTypeVector %int 4
%_ptr_Function_v4int = OpTypePointer Function %v4int
%34 = OpConstantNull %v4int
%35 = OpConstantNull %v4int
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%true = OpConstantTrue %bool
%v4bool = OpTypeVector %bool 4
%int_1 = OpConstant %int 1
%59 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%60 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
%int_2 = OpConstant %int 2
%72 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
%73 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
%void = OpTypeVoid
%85 = OpTypeFunction %void
%86 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
%94 = OpConstantNull %float
%95 = OpConstantNull %float
%float_1 = OpConstant %float 1
%119 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%120 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%float_2 = OpConstant %float 2
%132 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
%133 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
%uint_2 = OpConstant %uint 2
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%uint_1 = OpConstant %uint 1
%main_out = OpTypeStruct %v4float
%161 = OpTypeFunction %main_out %bool %v4float
%test_int_S1_c0_b = OpFunction %bool None %22
%24 = OpLabel
%unknown = OpVariable %_ptr_Function_int Function %28
%ok = OpVariable %_ptr_Function_bool Function %20
%val = OpVariable %_ptr_Function_v4int Function %34
%x_40 = OpVariable %_ptr_Function_bool Function %20
%x_41 = OpVariable %_ptr_Function_bool Function %20
%x_54 = OpVariable %_ptr_Function_bool Function %20
%x_55 = OpVariable %_ptr_Function_bool Function %20
%x_65 = OpVariable %_ptr_Function_bool Function %20
%x_66 = OpVariable %_ptr_Function_bool Function %20
%44 = OpAccessChain %_ptr_Uniform_float %x_4 %uint_0
%45 = OpLoad %float %44
%46 = OpConvertFToS %int %45
OpStore %unknown %46
%162 = OpTypeFunction %main_out %bool %v4float
%test_int_S1_c0_b = OpFunction %bool None %23
%25 = OpLabel
%unknown = OpVariable %_ptr_Function_int Function %29
%ok = OpVariable %_ptr_Function_bool Function %21
%val = OpVariable %_ptr_Function_v4int Function %35
%x_40 = OpVariable %_ptr_Function_bool Function %21
%x_41 = OpVariable %_ptr_Function_bool Function %21
%x_54 = OpVariable %_ptr_Function_bool Function %21
%x_55 = OpVariable %_ptr_Function_bool Function %21
%x_65 = OpVariable %_ptr_Function_bool Function %21
%x_66 = OpVariable %_ptr_Function_bool Function %21
%45 = OpAccessChain %_ptr_Uniform_float %x_4 %uint_0 %uint_0
%46 = OpLoad %float %45
%47 = OpConvertFToS %int %46
OpStore %unknown %47
OpStore %ok %true
OpStore %x_41 %20
OpSelectionMerge %48 None
OpBranchConditional %true %49 %48
OpStore %x_41 %21
OpSelectionMerge %49 None
OpBranchConditional %true %50 %49
%50 = OpLabel
%52 = OpCompositeConstruct %v4int %47 %47 %47 %47
%53 = OpSDiv %v4int %35 %52
%54 = OpIEqual %v4bool %53 %35
%51 = OpAll %bool %54
OpStore %x_40 %51
%56 = OpLoad %bool %x_40
OpStore %x_41 %56
OpBranch %49
%49 = OpLabel
%51 = OpCompositeConstruct %v4int %46 %46 %46 %46
%52 = OpSDiv %v4int %34 %51
%53 = OpIEqual %v4bool %52 %34
%50 = OpAll %bool %53
OpStore %x_40 %50
%55 = OpLoad %bool %x_40
OpStore %x_41 %55
OpBranch %48
%48 = OpLabel
%56 = OpLoad %bool %x_41
OpStore %ok %56
%57 = OpCompositeConstruct %v4int %46 %46 %46 %46
OpStore %val %57
%60 = OpIAdd %v4int %57 %59
OpStore %val %60
%61 = OpISub %v4int %60 %59
%57 = OpLoad %bool %x_41
OpStore %ok %57
%58 = OpCompositeConstruct %v4int %47 %47 %47 %47
OpStore %val %58
%61 = OpIAdd %v4int %58 %60
OpStore %val %61
%62 = OpIAdd %v4int %61 %59
%62 = OpISub %v4int %61 %60
OpStore %val %62
%63 = OpISub %v4int %62 %59
%63 = OpIAdd %v4int %62 %60
OpStore %val %63
OpStore %x_55 %20
%64 = OpLoad %bool %x_41
OpSelectionMerge %65 None
OpBranchConditional %64 %66 %65
%64 = OpISub %v4int %63 %60
OpStore %val %64
OpStore %x_55 %21
%65 = OpLoad %bool %x_41
OpSelectionMerge %66 None
OpBranchConditional %65 %67 %66
%67 = OpLabel
%69 = OpIEqual %v4bool %64 %58
%68 = OpAll %bool %69
OpStore %x_54 %68
%70 = OpLoad %bool %x_54
OpStore %x_55 %70
OpBranch %66
%66 = OpLabel
%68 = OpIEqual %v4bool %63 %57
%67 = OpAll %bool %68
OpStore %x_54 %67
%69 = OpLoad %bool %x_54
OpStore %x_55 %69
OpBranch %65
%65 = OpLabel
%70 = OpLoad %bool %x_55
OpStore %ok %70
%73 = OpIMul %v4int %63 %72
OpStore %val %73
%74 = OpSDiv %v4int %73 %72
%71 = OpLoad %bool %x_55
OpStore %ok %71
%74 = OpIMul %v4int %64 %73
OpStore %val %74
%75 = OpIMul %v4int %74 %72
%75 = OpSDiv %v4int %74 %73
OpStore %val %75
%76 = OpSDiv %v4int %75 %72
%76 = OpIMul %v4int %75 %73
OpStore %val %76
OpStore %x_66 %20
%77 = OpLoad %bool %x_55
OpSelectionMerge %78 None
OpBranchConditional %77 %79 %78
%77 = OpSDiv %v4int %76 %73
OpStore %val %77
OpStore %x_66 %21
%78 = OpLoad %bool %x_55
OpSelectionMerge %79 None
OpBranchConditional %78 %80 %79
%80 = OpLabel
%82 = OpIEqual %v4bool %77 %58
%81 = OpAll %bool %82
OpStore %x_65 %81
%83 = OpLoad %bool %x_65
OpStore %x_66 %83
OpBranch %79
%79 = OpLabel
%81 = OpIEqual %v4bool %76 %57
%80 = OpAll %bool %81
OpStore %x_65 %80
%82 = OpLoad %bool %x_65
OpStore %x_66 %82
OpBranch %78
%78 = OpLabel
%83 = OpLoad %bool %x_66
OpStore %ok %83
%84 = OpLoad %bool %x_66
OpReturnValue %84
OpStore %ok %84
%85 = OpLoad %bool %x_66
OpReturnValue %85
OpFunctionEnd
%main_1 = OpFunction %void None %85
%88 = OpLabel
%main_1 = OpFunction %void None %86
%89 = OpLabel
%outputColor_S0 = OpVariable %_ptr_Function_v4float Function %10
%output_S1 = OpVariable %_ptr_Function_v4float Function %10
%x_8_unknown = OpVariable %_ptr_Function_float Function %94
%x_9_ok = OpVariable %_ptr_Function_bool Function %20
%x_8_unknown = OpVariable %_ptr_Function_float Function %95
%x_9_ok = OpVariable %_ptr_Function_bool Function %21
%x_10_val = OpVariable %_ptr_Function_v4float Function %10
%x_116 = OpVariable %_ptr_Function_v4float Function %10
%x_86 = OpVariable %_ptr_Function_bool Function %20
%x_87 = OpVariable %_ptr_Function_bool Function %20
%x_99 = OpVariable %_ptr_Function_bool Function %20
%x_100 = OpVariable %_ptr_Function_bool Function %20
%x_110 = OpVariable %_ptr_Function_bool Function %20
%x_111 = OpVariable %_ptr_Function_bool Function %20
%x_114 = OpVariable %_ptr_Function_bool Function %20
%x_115 = OpVariable %_ptr_Function_bool Function %20
%106 = OpLoad %v4float %vcolor_S0
OpStore %outputColor_S0 %106
%107 = OpAccessChain %_ptr_Uniform_float %x_4 %uint_0
%108 = OpLoad %float %107
OpStore %x_8_unknown %108
%x_86 = OpVariable %_ptr_Function_bool Function %21
%x_87 = OpVariable %_ptr_Function_bool Function %21
%x_99 = OpVariable %_ptr_Function_bool Function %21
%x_100 = OpVariable %_ptr_Function_bool Function %21
%x_110 = OpVariable %_ptr_Function_bool Function %21
%x_111 = OpVariable %_ptr_Function_bool Function %21
%x_114 = OpVariable %_ptr_Function_bool Function %21
%x_115 = OpVariable %_ptr_Function_bool Function %21
%107 = OpLoad %v4float %vcolor_S0
OpStore %outputColor_S0 %107
%108 = OpAccessChain %_ptr_Uniform_float %x_4 %uint_0 %uint_0
%109 = OpLoad %float %108
OpStore %x_8_unknown %109
OpStore %x_9_ok %true
OpStore %x_87 %20
OpSelectionMerge %109 None
OpBranchConditional %true %110 %109
OpStore %x_87 %21
OpSelectionMerge %110 None
OpBranchConditional %true %111 %110
%111 = OpLabel
%113 = OpCompositeConstruct %v4float %109 %109 %109 %109
%114 = OpFDiv %v4float %10 %113
%115 = OpFOrdEqual %v4bool %114 %10
%112 = OpAll %bool %115
OpStore %x_86 %112
%116 = OpLoad %bool %x_86
OpStore %x_87 %116
OpBranch %110
%110 = OpLabel
%112 = OpCompositeConstruct %v4float %108 %108 %108 %108
%113 = OpFDiv %v4float %10 %112
%114 = OpFOrdEqual %v4bool %113 %10
%111 = OpAll %bool %114
OpStore %x_86 %111
%115 = OpLoad %bool %x_86
OpStore %x_87 %115
OpBranch %109
%109 = OpLabel
%116 = OpLoad %bool %x_87
OpStore %x_9_ok %116
%117 = OpCompositeConstruct %v4float %108 %108 %108 %108
OpStore %x_10_val %117
%120 = OpFAdd %v4float %117 %119
OpStore %x_10_val %120
%121 = OpFSub %v4float %120 %119
%117 = OpLoad %bool %x_87
OpStore %x_9_ok %117
%118 = OpCompositeConstruct %v4float %109 %109 %109 %109
OpStore %x_10_val %118
%121 = OpFAdd %v4float %118 %120
OpStore %x_10_val %121
%122 = OpFAdd %v4float %121 %119
%122 = OpFSub %v4float %121 %120
OpStore %x_10_val %122
%123 = OpFSub %v4float %122 %119
%123 = OpFAdd %v4float %122 %120
OpStore %x_10_val %123
OpStore %x_100 %20
%124 = OpLoad %bool %x_87
OpSelectionMerge %125 None
OpBranchConditional %124 %126 %125
%124 = OpFSub %v4float %123 %120
OpStore %x_10_val %124
OpStore %x_100 %21
%125 = OpLoad %bool %x_87
OpSelectionMerge %126 None
OpBranchConditional %125 %127 %126
%127 = OpLabel
%129 = OpFOrdEqual %v4bool %124 %118
%128 = OpAll %bool %129
OpStore %x_99 %128
%130 = OpLoad %bool %x_99
OpStore %x_100 %130
OpBranch %126
%126 = OpLabel
%128 = OpFOrdEqual %v4bool %123 %117
%127 = OpAll %bool %128
OpStore %x_99 %127
%129 = OpLoad %bool %x_99
OpStore %x_100 %129
OpBranch %125
%125 = OpLabel
%130 = OpLoad %bool %x_100
OpStore %x_9_ok %130
%133 = OpFMul %v4float %123 %132
OpStore %x_10_val %133
%134 = OpFDiv %v4float %133 %132
%131 = OpLoad %bool %x_100
OpStore %x_9_ok %131
%134 = OpFMul %v4float %124 %133
OpStore %x_10_val %134
%135 = OpFMul %v4float %134 %132
%135 = OpFDiv %v4float %134 %133
OpStore %x_10_val %135
%136 = OpFDiv %v4float %135 %132
%136 = OpFMul %v4float %135 %133
OpStore %x_10_val %136
OpStore %x_111 %20
%137 = OpLoad %bool %x_100
OpSelectionMerge %138 None
OpBranchConditional %137 %139 %138
%137 = OpFDiv %v4float %136 %133
OpStore %x_10_val %137
OpStore %x_111 %21
%138 = OpLoad %bool %x_100
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
%142 = OpFOrdEqual %v4bool %137 %118
%141 = OpAll %bool %142
OpStore %x_110 %141
%143 = OpLoad %bool %x_110
OpStore %x_111 %143
OpBranch %139
%139 = OpLabel
%141 = OpFOrdEqual %v4bool %136 %117
%140 = OpAll %bool %141
OpStore %x_110 %140
%142 = OpLoad %bool %x_110
OpStore %x_111 %142
OpBranch %138
%138 = OpLabel
%143 = OpLoad %bool %x_111
OpStore %x_9_ok %143
OpStore %x_115 %20
%144 = OpLoad %bool %x_111
OpSelectionMerge %145 None
OpBranchConditional %144 %146 %145
OpStore %x_9_ok %144
OpStore %x_115 %21
%145 = OpLoad %bool %x_111
OpSelectionMerge %146 None
OpBranchConditional %145 %147 %146
%147 = OpLabel
%148 = OpFunctionCall %bool %test_int_S1_c0_b
OpStore %x_114 %148
%149 = OpLoad %bool %x_114
OpStore %x_115 %149
OpBranch %146
%146 = OpLabel
%147 = OpFunctionCall %bool %test_int_S1_c0_b
OpStore %x_114 %147
%148 = OpLoad %bool %x_114
OpStore %x_115 %148
OpBranch %145
%145 = OpLabel
%149 = OpLoad %bool %x_115
OpSelectionMerge %150 None
OpBranchConditional %149 %151 %152
%151 = OpLabel
%155 = OpAccessChain %_ptr_Uniform_v4float %x_4 %uint_2
%156 = OpLoad %v4float %155
OpStore %x_116 %156
OpBranch %150
%150 = OpLoad %bool %x_115
OpSelectionMerge %151 None
OpBranchConditional %150 %152 %153
%152 = OpLabel
%158 = OpAccessChain %_ptr_Uniform_v4float %x_4 %uint_1
%159 = OpLoad %v4float %158
OpStore %x_116 %159
OpBranch %150
%150 = OpLabel
%160 = OpLoad %v4float %x_116
OpStore %output_S1 %160
OpStore %sk_FragColor %160
%156 = OpAccessChain %_ptr_Uniform_v4float %x_4 %uint_0 %uint_2
%157 = OpLoad %v4float %156
OpStore %x_116 %157
OpBranch %151
%153 = OpLabel
%159 = OpAccessChain %_ptr_Uniform_v4float %x_4 %uint_0 %uint_1
%160 = OpLoad %v4float %159
OpStore %x_116 %160
OpBranch %151
%151 = OpLabel
%161 = OpLoad %v4float %x_116
OpStore %output_S1 %161
OpStore %sk_FragColor %161
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %161
%main_inner = OpFunction %main_out None %162
%sk_Clockwise_param = OpFunctionParameter %bool
%vcolor_S0_param = OpFunctionParameter %v4float
%166 = OpLabel
%167 = OpLabel
OpStore %sk_Clockwise %sk_Clockwise_param
OpStore %vcolor_S0 %vcolor_S0_param
%167 = OpFunctionCall %void %main_1
%168 = OpLoad %v4float %sk_FragColor
%169 = OpCompositeConstruct %main_out %168
OpReturnValue %169
%168 = OpFunctionCall %void %main_1
%169 = OpLoad %v4float %sk_FragColor
%170 = OpCompositeConstruct %main_out %169
OpReturnValue %170
OpFunctionEnd
%main = OpFunction %void None %85
%171 = OpLabel
%173 = OpLoad %bool %sk_Clockwise_param_1
%174 = OpLoad %v4float %vcolor_S0_param_1
%172 = OpFunctionCall %main_out %main_inner %173 %174
%175 = OpCompositeExtract %v4float %172 0
OpStore %sk_FragColor_1_1 %175
%main = OpFunction %void None %86
%172 = OpLabel
%174 = OpLoad %bool %sk_Clockwise_param_1
%175 = OpLoad %v4float %vcolor_S0_param_1
%173 = OpFunctionCall %main_out %main_inner %174 %175
%176 = OpCompositeExtract %v4float %173 0
OpStore %sk_FragColor_1_1 %176
OpReturn
OpFunctionEnd

View File

@ -4,18 +4,26 @@ uint tint_int_dot(uvec3 a, uvec3 b) {
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
layout(binding = 0, std140) uniform g_ubo {
struct g {
uvec3 a;
uint pad;
};
struct h {
uint a;
};
layout(binding = 0, std140) uniform i_block_ubo {
g inner;
} i;
layout(binding = 1, std430) buffer h_ssbo {
uint a;
layout(binding = 1, std430) buffer j_block_ssbo {
h inner;
} j;
void tint_symbol() {
uint l = tint_int_dot(i.a, i.a);
j.a = i.a.x;
uint l = tint_int_dot(i.inner.a, i.inner.a);
j.inner.a = i.inner.a.x;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,62 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; Bound: 37
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %g "g"
OpMemberName %g 0 "a"
OpName %i "i"
OpName %j_block "j_block"
OpMemberName %j_block 0 "inner"
OpName %h "h"
OpMemberName %h 0 "a"
OpName %j "j"
OpName %main "main"
OpDecorate %g Block
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpMemberDecorate %g 0 Offset 0
OpDecorate %i NonWritable
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
OpDecorate %h Block
OpDecorate %j_block Block
OpMemberDecorate %j_block 0 Offset 0
OpMemberDecorate %h 0 Offset 0
OpDecorate %j DescriptorSet 0
OpDecorate %j Binding 1
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%g = OpTypeStruct %v3uint
%_ptr_Uniform_g = OpTypePointer Uniform %g
%i = OpVariable %_ptr_Uniform_g Uniform
%i_block = OpTypeStruct %g
%_ptr_Uniform_i_block = OpTypePointer Uniform %i_block
%i = OpVariable %_ptr_Uniform_i_block Uniform
%h = OpTypeStruct %uint
%_ptr_StorageBuffer_h = OpTypePointer StorageBuffer %h
%j = OpVariable %_ptr_StorageBuffer_h StorageBuffer
%j_block = OpTypeStruct %h
%_ptr_StorageBuffer_j_block = OpTypePointer StorageBuffer %j_block
%j = OpVariable %_ptr_StorageBuffer_j_block StorageBuffer
%void = OpTypeVoid
%9 = OpTypeFunction %void
%11 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%main = OpFunction %void None %9
%12 = OpLabel
%16 = OpAccessChain %_ptr_Uniform_v3uint %i %uint_0
%17 = OpLoad %v3uint %16
%18 = OpAccessChain %_ptr_Uniform_v3uint %i %uint_0
%main = OpFunction %void None %11
%14 = OpLabel
%18 = OpAccessChain %_ptr_Uniform_v3uint %i %uint_0 %uint_0
%19 = OpLoad %v3uint %18
%20 = OpCompositeExtract %uint %17 0
%21 = OpCompositeExtract %uint %19 0
%22 = OpIMul %uint %20 %21
%23 = OpCompositeExtract %uint %17 1
%24 = OpCompositeExtract %uint %19 1
%25 = OpIMul %uint %23 %24
%26 = OpIAdd %uint %22 %25
%27 = OpCompositeExtract %uint %17 2
%28 = OpCompositeExtract %uint %19 2
%29 = OpIMul %uint %27 %28
%13 = OpIAdd %uint %26 %29
%31 = OpAccessChain %_ptr_StorageBuffer_uint %j %uint_0
%33 = OpAccessChain %_ptr_Uniform_uint %i %uint_0 %uint_0
%34 = OpLoad %uint %33
OpStore %31 %34
%20 = OpAccessChain %_ptr_Uniform_v3uint %i %uint_0 %uint_0
%21 = OpLoad %v3uint %20
%22 = OpCompositeExtract %uint %19 0
%23 = OpCompositeExtract %uint %21 0
%24 = OpIMul %uint %22 %23
%25 = OpCompositeExtract %uint %19 1
%26 = OpCompositeExtract %uint %21 1
%27 = OpIMul %uint %25 %26
%28 = OpIAdd %uint %24 %27
%29 = OpCompositeExtract %uint %19 2
%30 = OpCompositeExtract %uint %21 2
%31 = OpIMul %uint %29 %30
%15 = OpIAdd %uint %28 %31
%33 = OpAccessChain %_ptr_StorageBuffer_uint %j %uint_0 %uint_0
%35 = OpAccessChain %_ptr_Uniform_uint %i %uint_0 %uint_0 %uint_0
%36 = OpLoad %uint %35
OpStore %33 %36
OpReturn
OpFunctionEnd

View File

@ -1,12 +1,16 @@
#version 310 es
layout(binding = 0, std140) uniform UniformBuffer_ubo {
struct UniformBuffer {
ivec3 d;
uint pad;
};
layout(binding = 0, std140) uniform u_input_block_ubo {
UniformBuffer inner;
} u_input;
void tint_symbol() {
ivec3 temp = (u_input.d << uvec3(0u));
ivec3 temp = (u_input.inner.d << uvec3(0u));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,17 +1,20 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 18
; Bound: 19
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %u_input_block "u_input_block"
OpMemberName %u_input_block 0 "inner"
OpName %UniformBuffer "UniformBuffer"
OpMemberName %UniformBuffer 0 "d"
OpName %u_input "u_input"
OpName %main "main"
OpDecorate %UniformBuffer Block
OpDecorate %u_input_block Block
OpMemberDecorate %u_input_block 0 Offset 0
OpMemberDecorate %UniformBuffer 0 Offset 0
OpDecorate %u_input NonWritable
OpDecorate %u_input DescriptorSet 0
@ -19,19 +22,20 @@
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%UniformBuffer = OpTypeStruct %v3int
%_ptr_Uniform_UniformBuffer = OpTypePointer Uniform %UniformBuffer
%u_input = OpVariable %_ptr_Uniform_UniformBuffer Uniform
%u_input_block = OpTypeStruct %UniformBuffer
%_ptr_Uniform_u_input_block = OpTypePointer Uniform %u_input_block
%u_input = OpVariable %_ptr_Uniform_u_input_block Uniform
%void = OpTypeVoid
%6 = OpTypeFunction %void
%7 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v3int = OpTypePointer Uniform %v3int
%v3uint = OpTypeVector %uint 3
%16 = OpConstantNull %v3uint
%main = OpFunction %void None %6
%9 = OpLabel
%13 = OpAccessChain %_ptr_Uniform_v3int %u_input %uint_0
%14 = OpLoad %v3int %13
%17 = OpShiftLeftLogical %v3int %14 %16
%17 = OpConstantNull %v3uint
%main = OpFunction %void None %7
%10 = OpLabel
%14 = OpAccessChain %_ptr_Uniform_v3int %u_input %uint_0 %uint_0
%15 = OpLoad %v3int %14
%18 = OpShiftLeftLogical %v3int %15 %17
OpReturn
OpFunctionEnd

View File

@ -1,12 +1,16 @@
#version 310 es
layout(binding = 0, std430) buffer Input_ssbo {
struct Input {
ivec3 position;
uint pad;
};
layout(binding = 0, std430) buffer tint_symbol_block_ssbo {
Input inner;
} tint_symbol;
void tint_symbol_1(uvec3 id) {
ivec3 pos = (tint_symbol.position - ivec3(0));
ivec3 pos = (tint_symbol.inner.position - ivec3(0));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,13 +1,15 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 26
; Bound: 27
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %id_1
OpExecutionMode %main LocalSize 1 1 1
OpName %id_1 "id_1"
OpName %input_block "input_block"
OpMemberName %input_block 0 "inner"
OpName %Input "Input"
OpMemberName %Input 0 "position"
OpName %input "input"
@ -15,7 +17,8 @@
OpName %id "id"
OpName %main "main"
OpDecorate %id_1 BuiltIn GlobalInvocationId
OpDecorate %Input Block
OpDecorate %input_block Block
OpMemberDecorate %input_block 0 Offset 0
OpMemberDecorate %Input 0 Offset 0
OpDecorate %input NonWritable
OpDecorate %input DescriptorSet 0
@ -27,25 +30,26 @@
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%Input = OpTypeStruct %v3int
%_ptr_StorageBuffer_Input = OpTypePointer StorageBuffer %Input
%input = OpVariable %_ptr_StorageBuffer_Input StorageBuffer
%input_block = OpTypeStruct %Input
%_ptr_StorageBuffer_input_block = OpTypePointer StorageBuffer %input_block
%input = OpVariable %_ptr_StorageBuffer_input_block StorageBuffer
%void = OpTypeVoid
%10 = OpTypeFunction %void %v3uint
%11 = OpTypeFunction %void %v3uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
%19 = OpConstantNull %v3int
%21 = OpTypeFunction %void
%main_inner = OpFunction %void None %10
%20 = OpConstantNull %v3int
%22 = OpTypeFunction %void
%main_inner = OpFunction %void None %11
%id = OpFunctionParameter %v3uint
%14 = OpLabel
%17 = OpAccessChain %_ptr_StorageBuffer_v3int %input %uint_0
%18 = OpLoad %v3int %17
%20 = OpISub %v3int %18 %19
%15 = OpLabel
%18 = OpAccessChain %_ptr_StorageBuffer_v3int %input %uint_0 %uint_0
%19 = OpLoad %v3int %18
%21 = OpISub %v3int %19 %20
OpReturn
OpFunctionEnd
%main = OpFunction %void None %21
%23 = OpLabel
%25 = OpLoad %v3uint %id_1
%24 = OpFunctionCall %void %main_inner %25
%main = OpFunction %void None %22
%24 = OpLabel
%26 = OpLoad %v3uint %id_1
%25 = OpFunctionCall %void %main_inner %26
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,14 @@
struct S {
f : f32,
};
@group(0) @binding(0)
var<storage, read> in : S;
@group(0) @binding(1)
var<storage, read_write> out : S;
@compute @workgroup_size(1)
fn main() {
out = in;
}

View File

@ -0,0 +1,21 @@
struct S {
float f;
};
ByteAddressBuffer tint_symbol : register(t0, space0);
RWByteAddressBuffer tint_symbol_1 : register(u1, space0);
void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) {
buffer.Store((offset + 0u), asuint(value.f));
}
S tint_symbol_4(ByteAddressBuffer buffer, uint offset) {
const S tint_symbol_6 = {asfloat(buffer.Load((offset + 0u)))};
return tint_symbol_6;
}
[numthreads(1, 1, 1)]
void main() {
tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u));
return;
}

View File

@ -0,0 +1,21 @@
struct S {
float f;
};
ByteAddressBuffer tint_symbol : register(t0, space0);
RWByteAddressBuffer tint_symbol_1 : register(u1, space0);
void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) {
buffer.Store((offset + 0u), asuint(value.f));
}
S tint_symbol_4(ByteAddressBuffer buffer, uint offset) {
const S tint_symbol_6 = {asfloat(buffer.Load((offset + 0u)))};
return tint_symbol_6;
}
[numthreads(1, 1, 1)]
void main() {
tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u));
return;
}

View File

@ -0,0 +1,23 @@
#version 310 es
struct S {
float f;
};
layout(binding = 0, std430) buffer tint_symbol_block_ssbo {
S inner;
} tint_symbol;
layout(binding = 1, std430) buffer tint_symbol_block_ssbo_1 {
S inner;
} tint_symbol_1;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol_2();
return;
}

View File

@ -0,0 +1,12 @@
#include <metal_stdlib>
using namespace metal;
struct S {
/* 0x0000 */ float f;
};
kernel void tint_symbol(device S* tint_symbol_1 [[buffer(0)]], const device S* tint_symbol_2 [[buffer(1)]]) {
*(tint_symbol_1) = *(tint_symbol_2);
return;
}

View File

@ -0,0 +1,43 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 17
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %in_block "in_block"
OpMemberName %in_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "f"
OpName %in "in"
OpName %out "out"
OpName %main "main"
OpDecorate %in_block Block
OpMemberDecorate %in_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpDecorate %in NonWritable
OpDecorate %in DescriptorSet 0
OpDecorate %in Binding 0
OpDecorate %out DescriptorSet 0
OpDecorate %out Binding 1
%float = OpTypeFloat 32
%S = OpTypeStruct %float
%in_block = OpTypeStruct %S
%_ptr_StorageBuffer_in_block = OpTypePointer StorageBuffer %in_block
%in = OpVariable %_ptr_StorageBuffer_in_block StorageBuffer
%out = OpVariable %_ptr_StorageBuffer_in_block StorageBuffer
%void = OpTypeVoid
%7 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
%main = OpFunction %void None %7
%10 = OpLabel
%14 = OpAccessChain %_ptr_StorageBuffer_S %out %uint_0
%15 = OpAccessChain %_ptr_StorageBuffer_S %in %uint_0
%16 = OpLoad %S %15
OpStore %14 %16
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,12 @@
struct S {
f : f32,
}
@group(0) @binding(0) var<storage, read> in : S;
@group(0) @binding(1) var<storage, read_write> out : S;
@compute @workgroup_size(1)
fn main() {
out = in;
}

View File

@ -1,27 +1,31 @@
#version 310 es
layout(binding = 0, std430) buffer Buf_ssbo {
struct Buf {
uint count;
uint data[50];
};
layout(binding = 0, std430) buffer b_block_ssbo {
Buf inner;
} b;
void tint_symbol() {
uint i = 0u;
while (true) {
if ((i >= b.count)) {
if ((i >= b.inner.count)) {
break;
}
uint p_save = i;
if (((i % 2u) == 0u)) {
{
b.data[p_save] = (b.data[p_save] * 2u);
b.inner.data[p_save] = (b.inner.data[p_save] * 2u);
i = (i + 1u);
}
continue;
}
b.data[p_save] = 0u;
b.inner.data[p_save] = 0u;
{
b.data[p_save] = (b.data[p_save] * 2u);
b.inner.data[p_save] = (b.inner.data[p_save] * 2u);
i = (i + 1u);
}
}

View File

@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 42
; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %b_block "b_block"
OpMemberName %b_block 0 "inner"
OpName %Buf "Buf"
OpMemberName %Buf 0 "count"
OpMemberName %Buf 1 "data"
OpName %b "b"
OpName %main "main"
OpName %i "i"
OpDecorate %Buf Block
OpDecorate %b_block Block
OpMemberDecorate %b_block 0 Offset 0
OpMemberDecorate %Buf 0 Offset 0
OpMemberDecorate %Buf 1 Offset 4
OpDecorate %_arr_uint_uint_50 ArrayStride 4
@ -23,57 +26,58 @@
%uint_50 = OpConstant %uint 50
%_arr_uint_uint_50 = OpTypeArray %uint %uint_50
%Buf = OpTypeStruct %uint %_arr_uint_uint_50
%_ptr_StorageBuffer_Buf = OpTypePointer StorageBuffer %Buf
%b = OpVariable %_ptr_StorageBuffer_Buf StorageBuffer
%b_block = OpTypeStruct %Buf
%_ptr_StorageBuffer_b_block = OpTypePointer StorageBuffer %b_block
%b = OpVariable %_ptr_StorageBuffer_b_block StorageBuffer
%void = OpTypeVoid
%7 = OpTypeFunction %void
%11 = OpConstantNull %uint
%8 = OpTypeFunction %void
%12 = OpConstantNull %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%bool = OpTypeBool
%uint_2 = OpConstant %uint 2
%uint_1 = OpConstant %uint 1
%main = OpFunction %void None %7
%10 = OpLabel
%i = OpVariable %_ptr_Function_uint Function %11
OpStore %i %11
OpBranch %14
%14 = OpLabel
OpLoopMerge %15 %16 None
%main = OpFunction %void None %8
%11 = OpLabel
%i = OpVariable %_ptr_Function_uint Function %12
OpStore %i %12
OpBranch %15
%15 = OpLabel
OpLoopMerge %16 %17 None
OpBranch %18
%18 = OpLabel
%19 = OpLoad %uint %i
%22 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_0 %uint_0
%23 = OpLoad %uint %22
%24 = OpUGreaterThanEqual %bool %19 %23
OpSelectionMerge %26 None
OpBranchConditional %24 %27 %26
%27 = OpLabel
OpBranch %16
%26 = OpLabel
%28 = OpLoad %uint %i
%29 = OpLoad %uint %i
%31 = OpUMod %uint %29 %uint_2
%32 = OpIEqual %bool %31 %12
OpSelectionMerge %33 None
OpBranchConditional %32 %34 %33
%34 = OpLabel
OpBranch %17
%33 = OpLabel
%36 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_0 %uint_1 %28
OpStore %36 %12
OpBranch %17
%17 = OpLabel
%18 = OpLoad %uint %i
%21 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_0
%22 = OpLoad %uint %21
%23 = OpUGreaterThanEqual %bool %18 %22
OpSelectionMerge %25 None
OpBranchConditional %23 %26 %25
%26 = OpLabel
%37 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_0 %uint_1 %28
%38 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_0 %uint_1 %28
%39 = OpLoad %uint %38
%40 = OpIMul %uint %39 %uint_2
OpStore %37 %40
%41 = OpLoad %uint %i
%42 = OpIAdd %uint %41 %uint_1
OpStore %i %42
OpBranch %15
%25 = OpLabel
%27 = OpLoad %uint %i
%28 = OpLoad %uint %i
%30 = OpUMod %uint %28 %uint_2
%31 = OpIEqual %bool %30 %11
OpSelectionMerge %32 None
OpBranchConditional %31 %33 %32
%33 = OpLabel
OpBranch %16
%32 = OpLabel
%35 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_1 %27
OpStore %35 %11
OpBranch %16
%16 = OpLabel
%36 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_1 %27
%37 = OpAccessChain %_ptr_StorageBuffer_uint %b %uint_1 %27
%38 = OpLoad %uint %37
%39 = OpIMul %uint %38 %uint_2
OpStore %36 %39
%40 = OpLoad %uint %i
%41 = OpIAdd %uint %40 %uint_1
OpStore %i %41
OpBranch %14
%15 = OpLabel
OpReturn
OpFunctionEnd

View File

@ -4,12 +4,20 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
layout(binding = 0, std430) buffer S_ssbo {
struct S {
mat2 m;
} SSBO;
};
layout(binding = 0, std140) uniform S_std140_ubo {
struct S_std140 {
vec2 m_0;
vec2 m_1;
};
layout(binding = 0, std430) buffer SSBO_block_ssbo {
S inner;
} SSBO;
layout(binding = 0, std140) uniform SSBO_block_std140_ubo {
S_std140 inner;
} UBO;

Some files were not shown because too many files have changed in this diff Show More