GLSL: clean up GLSL output whitespace generation.

More line() and less std::endl.
More automated indents and less manual spacing.
Put a single newline after every struct and function declaration.

Note that this does touch every test result, but only affects whitespace.

Change-Id: I7506b9029b79b91fb335911dba44369b36f09bbe
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78300
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2022-01-26 16:48:55 +00:00 committed by Tint LUCI CQ
parent b1d2b84f7d
commit e2f35ba8e0
1730 changed files with 5934 additions and 5763 deletions

View File

@ -124,9 +124,6 @@ GeneratorImpl::GeneratorImpl(const Program* program) : TextGenerator(program) {}
GeneratorImpl::~GeneratorImpl() = default; GeneratorImpl::~GeneratorImpl() = default;
bool GeneratorImpl::Generate() { bool GeneratorImpl::Generate() {
const TypeInfo* last_kind = nullptr;
size_t last_padding_line = 0;
line() << "#version 310 es"; line() << "#version 310 es";
line() << "precision mediump float;"; line() << "precision mediump float;";
@ -139,17 +136,6 @@ bool GeneratorImpl::Generate() {
continue; // Ignore aliases. continue; // Ignore aliases.
} }
// Emit a new line between declarations if the type of declaration has
// changed, or we're about to emit a function
auto* kind = &decl->TypeInfo();
if (current_buffer_->lines.size() != last_padding_line) {
if (last_kind && (last_kind != kind || decl->Is<ast::Function>())) {
line();
last_padding_line = current_buffer_->lines.size();
}
}
last_kind = kind;
if (auto* global = decl->As<ast::Variable>()) { if (auto* global = decl->As<ast::Variable>()) {
if (!EmitGlobalVariable(global)) { if (!EmitGlobalVariable(global)) {
return false; return false;
@ -1632,6 +1618,7 @@ bool GeneratorImpl::EmitFunction(const ast::Function* func) {
} }
line() << "}"; line() << "}";
line();
return true; return true;
} }
@ -1677,6 +1664,7 @@ bool GeneratorImpl::EmitUniformVariable(const sem::Variable* var) {
EmitStructMembers(current_buffer_, str); EmitStructMembers(current_buffer_, str);
auto name = builder_.Symbols().NameFor(decl->symbol); auto name = builder_.Symbols().NameFor(decl->symbol);
line() << "} " << name << ";"; line() << "} " << name << ";";
line();
return true; return true;
} }
@ -1891,36 +1879,37 @@ bool GeneratorImpl::EmitDecorations(std::ostream& out,
bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) { bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
auto* func_sem = builder_.Sem().Get(func); auto* func_sem = builder_.Sem().Get(func);
if (func->PipelineStage() == ast::PipelineStage::kCompute) {
auto out = line();
// Emit the layout(local_size) attributes.
auto wgsize = func_sem->WorkgroupSize();
out << "layout(";
for (int i = 0; i < 3; i++) {
if (i > 0) {
out << ", ";
}
out << "local_size_" << (i == 0 ? "x" : i == 1 ? "y" : "z") << " = ";
if (wgsize[i].overridable_const) {
auto* global = builder_.Sem().Get<sem::GlobalVariable>(
wgsize[i].overridable_const);
if (!global->IsOverridable()) {
TINT_ICE(Writer, builder_.Diagnostics())
<< "expected a pipeline-overridable constant";
}
out << kSpecConstantPrefix << global->ConstantId();
} else {
out << std::to_string(wgsize[i].value);
}
}
out << ") in;";
}
// Emit original entry point signature
{ {
auto out = line(); auto out = line();
if (func->PipelineStage() == ast::PipelineStage::kCompute) { out << func->return_type->FriendlyName(builder_.Symbols()) << " "
// Emit the layout(local_size) attributes. << builder_.Symbols().NameFor(func->symbol) << "(";
auto wgsize = func_sem->WorkgroupSize();
out << "layout(";
for (int i = 0; i < 3; i++) {
if (i > 0) {
out << ", ";
}
out << "local_size_" << (i == 0 ? "x" : i == 1 ? "y" : "z") << " = ";
if (wgsize[i].overridable_const) {
auto* global = builder_.Sem().Get<sem::GlobalVariable>(
wgsize[i].overridable_const);
if (!global->IsOverridable()) {
TINT_ICE(Writer, builder_.Diagnostics())
<< "expected a pipeline-overridable constant";
}
out << kSpecConstantPrefix << global->ConstantId();
} else {
out << std::to_string(wgsize[i].value);
}
}
out << ") in;" << std::endl;
}
out << func->return_type->FriendlyName(builder_.Symbols());
out << " " << builder_.Symbols().NameFor(func->symbol) << "(";
bool first = true; bool first = true;
@ -1949,6 +1938,7 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
out << ") {"; out << ") {";
} }
// Emit original entry point function body
{ {
ScopedIndent si(this); ScopedIndent si(this);
@ -1966,13 +1956,13 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
line() << "}"; line() << "}";
auto out = line();
// Declare entry point input variables // Declare entry point input variables
for (auto* var : func->params) { for (auto* var : func->params) {
auto* sem = builder_.Sem().Get(var); auto* sem = builder_.Sem().Get(var);
auto* str = sem->Type()->As<sem::Struct>(); auto* str = sem->Type()->As<sem::Struct>();
for (auto* member : str->Members()) { for (auto* member : str->Members()) {
auto out = line();
auto decorations = member->Declaration()->decorations; auto decorations = member->Declaration()->decorations;
if (ast::HasDecoration<ast::BuiltinDecoration>(decorations)) { if (ast::HasDecoration<ast::BuiltinDecoration>(decorations)) {
continue; continue;
@ -1990,7 +1980,7 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
builder_.Symbols().NameFor(member->Declaration()->symbol))) { builder_.Symbols().NameFor(member->Declaration()->symbol))) {
return false; return false;
} }
out << ";" << std::endl; out << ";";
} }
} }
@ -1998,6 +1988,7 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
auto* return_type = func_sem->ReturnType()->As<sem::Struct>(); auto* return_type = func_sem->ReturnType()->As<sem::Struct>();
if (return_type) { if (return_type) {
for (auto* member : return_type->Members()) { for (auto* member : return_type->Members()) {
auto out = line();
auto decorations = member->Declaration()->decorations; auto decorations = member->Declaration()->decorations;
if (ast::HasDecoration<ast::BuiltinDecoration>(decorations)) { if (ast::HasDecoration<ast::BuiltinDecoration>(decorations)) {
continue; continue;
@ -2015,82 +2006,93 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
builder_.Symbols().NameFor(member->Declaration()->symbol))) { builder_.Symbols().NameFor(member->Declaration()->symbol))) {
return false; return false;
} }
out << ";" << std::endl; out << ";";
} }
} }
line();
// Create a main() function which calls the entry point. // Create a main() function which calls the entry point.
out << "void main() {" << std::endl; line() << "void main() {";
std::string printed_name;
for (auto* var : func->params) { // Emit main function body
out << " "; {
auto* sem = builder_.Sem().Get(var); ScopedIndent si(this);
if (!EmitTypeAndName(out, sem->Type(), sem->StorageClass(), sem->Access(), for (auto* var : func->params) {
"inputs")) { auto* sem = builder_.Sem().Get(var);
return false; auto* type = sem->Type();
} {
out << ";" << std::endl; auto out = line();
auto* type = sem->Type(); if (!EmitTypeAndName(out, type, sem->StorageClass(), sem->Access(),
auto* str = type->As<sem::Struct>(); "inputs")) {
for (auto* member : str->Members()) { return false;
std::string name =
builder_.Symbols().NameFor(member->Declaration()->symbol);
out << " inputs." << name << " = ";
if (auto* builtin = ast::GetDecoration<ast::BuiltinDecoration>(
member->Declaration()->decorations)) {
if (builtin_type(builtin->builtin) != member->Type()) {
if (!EmitType(out, member->Type(), ast::StorageClass::kNone,
ast::Access::kReadWrite, "")) {
return false;
}
out << "(";
out << builtin_to_string(builtin->builtin, func->PipelineStage());
out << ")";
} else {
out << builtin_to_string(builtin->builtin, func->PipelineStage());
} }
} else { out << ";";
out << name;
} }
out << ";" << std::endl; auto* str = type->As<sem::Struct>();
for (auto* member : str->Members()) {
auto out = line();
std::string name =
builder_.Symbols().NameFor(member->Declaration()->symbol);
out << "inputs." << name << " = ";
if (auto* builtin = ast::GetDecoration<ast::BuiltinDecoration>(
member->Declaration()->decorations)) {
if (builtin_type(builtin->builtin) != member->Type()) {
if (!EmitType(out, member->Type(), ast::StorageClass::kNone,
ast::Access::kReadWrite, "")) {
return false;
}
out << "(";
out << builtin_to_string(builtin->builtin, func->PipelineStage());
out << ")";
} else {
out << builtin_to_string(builtin->builtin, func->PipelineStage());
}
} else {
out << name;
}
out << ";";
}
}
if (return_type) {
line() << return_type->FriendlyName(builder_.Symbols()) << " outputs;";
}
{
auto out = line();
if (return_type) {
out << "outputs = ";
}
out << builder_.Symbols().NameFor(func->symbol);
if (func->params.empty()) {
out << "()";
} else {
out << "(inputs)";
}
out << ";";
}
auto* str = func_sem->ReturnType()->As<sem::Struct>();
if (str) {
for (auto* member : str->Members()) {
auto out = line();
std::string name =
builder_.Symbols().NameFor(member->Declaration()->symbol);
if (auto* builtin = ast::GetDecoration<ast::BuiltinDecoration>(
member->Declaration()->decorations)) {
out << builtin_to_string(builtin->builtin, func->PipelineStage());
} else {
out << name;
}
out << " = outputs." << name << ";";
}
}
if (func->PipelineStage() == ast::PipelineStage::kVertex) {
line() << "gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;";
line() << "gl_Position.y = -gl_Position.y;";
} }
} }
out << " "; line() << "}";
if (return_type) { line();
out << return_type->FriendlyName(builder_.Symbols()) << " "
<< "outputs;" << std::endl;
out << " outputs = ";
}
out << builder_.Symbols().NameFor(func->symbol);
if (func->params.empty()) {
out << "()";
} else {
out << "(inputs)";
}
out << ";" << std::endl;
auto* str = func_sem->ReturnType()->As<sem::Struct>();
if (str) {
for (auto* member : str->Members()) {
std::string name =
builder_.Symbols().NameFor(member->Declaration()->symbol);
out << " ";
if (auto* builtin = ast::GetDecoration<ast::BuiltinDecoration>(
member->Declaration()->decorations)) {
out << builtin_to_string(builtin->builtin, func->PipelineStage());
} else {
out << name;
}
out << " = outputs." << name << ";" << std::endl;
}
}
if (func->PipelineStage() == ast::PipelineStage::kVertex) {
out << " gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;"
<< std::endl;
out << " gl_Position.y = -gl_Position.y;" << std::endl;
}
out << "}" << std::endl << std::endl;
return true; return true;
} }
@ -2611,6 +2613,7 @@ bool GeneratorImpl::EmitStructType(TextBuffer* b, const sem::Struct* str) {
line(b) << "struct " << StructName(str) << " {"; line(b) << "struct " << StructName(str) << " {";
EmitStructMembers(b, str); EmitStructMembers(b, str);
line(b) << "};"; line(b) << "};";
line(b);
return true; return true;
} }

View File

@ -45,6 +45,7 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Function) {
void my_func() { void my_func() {
return; return;
} }
)"); )");
} }
@ -82,6 +83,7 @@ TEST_F(GlslGeneratorImplTest_Function, Emit_Function_WithParams) {
void my_func(float a, int b) { void my_func(float a, int b) {
return; return;
} }
)"); )");
} }
@ -101,11 +103,11 @@ precision mediump float;
void func() { void func() {
return; return;
} }
void main() { void main() {
func(); func();
} }
)"); )");
} }
@ -143,6 +145,7 @@ precision mediump float;
struct tint_symbol_1 { struct tint_symbol_1 {
float foo; float foo;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
float value; float value;
}; };
@ -159,6 +162,7 @@ tint_symbol_2 frag_main(tint_symbol_1 tint_symbol) {
} }
layout(location = 0) in float foo; layout(location = 0) in float foo;
layout(location = 1) out float value; layout(location = 1) out float value;
void main() { void main() {
tint_symbol_1 inputs; tint_symbol_1 inputs;
inputs.foo = foo; inputs.foo = foo;
@ -167,7 +171,6 @@ void main() {
value = outputs.value; value = outputs.value;
} }
)"); )");
} }
@ -192,6 +195,7 @@ precision mediump float;
struct tint_symbol_1 { struct tint_symbol_1 {
vec4 coord; vec4 coord;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
float value; float value;
}; };
@ -206,6 +210,9 @@ tint_symbol_2 frag_main(tint_symbol_1 tint_symbol) {
wrapper_result.value = inner_result; wrapper_result.value = inner_result;
return wrapper_result; return wrapper_result;
} }
void main() { void main() {
tint_symbol_1 inputs; tint_symbol_1 inputs;
inputs.coord = gl_FragCoord; inputs.coord = gl_FragCoord;
@ -214,7 +221,6 @@ void main() {
gl_FragDepth = outputs.value; gl_FragDepth = outputs.value;
} }
)"); )");
} }
@ -265,6 +271,7 @@ struct Interface {
float col1; float col1;
float col2; float col2;
}; };
struct tint_symbol { struct tint_symbol {
float col1; float col1;
float col2; float col2;
@ -286,6 +293,8 @@ tint_symbol vert_main() {
} }
layout(location = 1) out float col1; layout(location = 1) out float col1;
layout(location = 2) out float col2; layout(location = 2) out float col2;
void main() { void main() {
tint_symbol outputs; tint_symbol outputs;
outputs = vert_main(); outputs = vert_main();
@ -296,8 +305,6 @@ void main() {
gl_Position.y = -gl_Position.y; gl_Position.y = -gl_Position.y;
} }
struct tint_symbol_2 { struct tint_symbol_2 {
float col1; float col1;
float col2; float col2;
@ -317,6 +324,8 @@ void frag_main(tint_symbol_2 tint_symbol_1) {
} }
layout(location = 1) in float col1; layout(location = 1) in float col1;
layout(location = 2) in float col2; layout(location = 2) in float col2;
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.col1 = col1; inputs.col1 = col1;
@ -325,7 +334,6 @@ void main() {
frag_main(inputs); frag_main(inputs);
} }
)"); )");
} }
@ -451,11 +459,11 @@ void frag_main() {
float v = sub_func(1.0f); float v = sub_func(1.0f);
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -500,11 +508,11 @@ void frag_main() {
float v = uniforms.coord.x; float v = uniforms.coord.x;
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -551,16 +559,15 @@ layout(binding = 0) buffer Data_1 {
int a; int a;
float b; float b;
} coord; } coord;
void frag_main() { void frag_main() {
float v = coord.b; float v = coord.b;
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -607,16 +614,15 @@ layout(binding = 0) buffer Data_1 {
int a; int a;
float b; float b;
} coord; } coord;
void frag_main() { void frag_main() {
float v = coord.b; float v = coord.b;
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -659,16 +665,15 @@ layout(binding = 0) buffer Data_1 {
int a; int a;
float b; float b;
} coord; } coord;
void frag_main() { void frag_main() {
coord.b = 2.0f; coord.b = 2.0f;
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -712,16 +717,15 @@ layout(binding = 0) buffer Data_1 {
int a; int a;
float b; float b;
} coord; } coord;
void frag_main() { void frag_main() {
coord.b = 2.0f; coord.b = 2.0f;
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -774,11 +778,11 @@ void frag_main() {
float v = sub_func(1.0f); float v = sub_func(1.0f);
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -824,7 +828,6 @@ struct S {
layout(binding = 0) buffer S_1 { layout(binding = 0) buffer S_1 {
float x; float x;
} coord; } coord;
float sub_func(float param) { float sub_func(float param) {
return coord.x; return coord.x;
} }
@ -833,11 +836,11 @@ void frag_main() {
float v = sub_func(1.0f); float v = sub_func(1.0f);
return; return;
} }
void main() { void main() {
frag_main(); frag_main();
} }
)"); )");
} }
@ -857,11 +860,11 @@ precision mediump float;
void tint_symbol() { void tint_symbol() {
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"); )");
} }
@ -882,11 +885,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
return; return;
} }
void main() { void main() {
main(); main();
} }
)"); )");
} }
@ -908,11 +911,11 @@ layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in;
void main() { void main() {
return; return;
} }
void main() { void main() {
main(); main();
} }
)"); )");
} }
@ -936,16 +939,15 @@ precision mediump float;
const int width = int(2); const int width = int(2);
const int height = int(3); const int height = int(3);
const int depth = int(4); const int depth = int(4);
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in;
void main() { void main() {
return; return;
} }
void main() { void main() {
main(); main();
} }
)"); )");
} }
@ -978,16 +980,15 @@ const int height = WGSL_SPEC_CONSTANT_8;
#define WGSL_SPEC_CONSTANT_9 int(4) #define WGSL_SPEC_CONSTANT_9 int(4)
#endif #endif
const int depth = WGSL_SPEC_CONSTANT_9; const int depth = WGSL_SPEC_CONSTANT_9;
layout(local_size_x = WGSL_SPEC_CONSTANT_7, local_size_y = WGSL_SPEC_CONSTANT_8, local_size_z = WGSL_SPEC_CONSTANT_9) in; layout(local_size_x = WGSL_SPEC_CONSTANT_7, local_size_y = WGSL_SPEC_CONSTANT_8, local_size_z = WGSL_SPEC_CONSTANT_9) in;
void main() { void main() {
return; return;
} }
void main() { void main() {
main(); main();
} }
)"); )");
} }
@ -1006,6 +1007,7 @@ precision mediump float;
void my_func(float a[5]) { void my_func(float a[5]) {
return; return;
} }
)"); )");
} }
@ -1024,6 +1026,7 @@ precision mediump float;
float[5] my_func() { float[5] my_func() {
return float[5](0.0f, 0.0f, 0.0f, 0.0f, 0.0f); return float[5](0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
} }
)"); )");
} }
@ -1093,28 +1096,26 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
float d; float d;
} data; } data;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void a() { void a() {
float v = data.d; float v = data.d;
return; return;
} }
void main() { void main() {
a(); a();
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void b() { void b() {
float v = data.d; float v = data.d;
return; return;
} }
void main() { void main() {
b(); b();
} }
)"); )");
} }

View File

@ -405,11 +405,11 @@ void test_function() {
float tint_symbol = tint_degrees(val); float tint_symbol = tint_degrees(val);
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }
@ -435,11 +435,11 @@ void test_function() {
vec3 tint_symbol = tint_degrees(val); vec3 tint_symbol = tint_degrees(val);
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }
@ -465,11 +465,11 @@ void test_function() {
float tint_symbol = tint_radians(val); float tint_symbol = tint_radians(val);
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }
@ -495,11 +495,11 @@ void test_function() {
vec3 tint_symbol = tint_radians(val); vec3 tint_symbol = tint_radians(val);
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }
@ -736,17 +736,16 @@ int tint_int_dot(ivec3 a, ivec3 b) {
} }
ivec3 v = ivec3(0, 0, 0); ivec3 v = ivec3(0, 0, 0);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
tint_int_dot(v, v); tint_int_dot(v, v);
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }
@ -765,17 +764,16 @@ uint tint_int_dot(uvec3 a, uvec3 b) {
} }
uvec3 v = uvec3(0u, 0u, 0u); uvec3 v = uvec3(0u, 0u, 0u);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
tint_int_dot(v, v); tint_int_dot(v, v);
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }

View File

@ -140,17 +140,16 @@ struct Data {
}; };
Data str = Data(0.0f); Data str = Data(0.0f);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
float expr = str.mem; float expr = str.mem;
return; return;
} }
void main() { void main() {
test_function(); test_function();
} }
)"); )");
} }
@ -305,16 +304,15 @@ layout(binding = 0) buffer Data_1 {
int a; int a;
mat2x3 b; mat2x3 b;
} data; } data;
void tint_symbol() { void tint_symbol() {
data.b = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); data.b = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -355,16 +353,15 @@ layout(binding = 0) buffer Data_1 {
float z; float z;
mat4x3 a; mat4x3 a;
} data; } data;
void tint_symbol() { void tint_symbol() {
float x = data.a[2][1]; float x = data.a[2][1];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -403,16 +400,15 @@ layout(binding = 0) buffer Data_1 {
float z; float z;
int a[5]; int a[5];
} data; } data;
void tint_symbol() { void tint_symbol() {
int x = data.a[2]; int x = data.a[2];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -452,16 +448,15 @@ layout(binding = 0) buffer Data_1 {
float z; float z;
int a[5]; int a[5];
} data; } data;
void tint_symbol() { void tint_symbol() {
int x = data.a[((2 + 4) - 3)]; int x = data.a[((2 + 4) - 3)];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -498,16 +493,15 @@ layout(binding = 0) buffer Data_1 {
float z; float z;
int a[5]; int a[5];
} data; } data;
void tint_symbol() { void tint_symbol() {
data.a[2] = 2; data.a[2] = 2;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -550,6 +544,7 @@ struct Inner {
vec3 a; vec3 a;
vec3 b; vec3 b;
}; };
struct Data { struct Data {
Inner c[4]; Inner c[4];
}; };
@ -557,16 +552,15 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
Inner c[4]; Inner c[4];
} data; } data;
void tint_symbol() { void tint_symbol() {
vec3 x = data.c[2].b; vec3 x = data.c[2].b;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -612,6 +606,7 @@ struct Inner {
vec3 a; vec3 a;
vec3 b; vec3 b;
}; };
struct Data { struct Data {
Inner c[4]; Inner c[4];
}; };
@ -619,16 +614,15 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
Inner c[4]; Inner c[4];
} data; } data;
void tint_symbol() { void tint_symbol() {
vec2 x = data.c[2].b.xy; vec2 x = data.c[2].b.xy;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -674,6 +668,7 @@ struct Inner {
vec3 a; vec3 a;
vec3 b; vec3 b;
}; };
struct Data { struct Data {
Inner c[4]; Inner c[4];
}; };
@ -681,16 +676,15 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
Inner c[4]; Inner c[4];
} data; } data;
void tint_symbol() { void tint_symbol() {
float x = data.c[2].b.g; float x = data.c[2].b.g;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -736,6 +730,7 @@ struct Inner {
vec3 a; vec3 a;
vec3 b; vec3 b;
}; };
struct Data { struct Data {
Inner c[4]; Inner c[4];
}; };
@ -743,16 +738,15 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
Inner c[4]; Inner c[4];
} data; } data;
void tint_symbol() { void tint_symbol() {
float x = data.c[2].b[1]; float x = data.c[2].b[1];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -794,6 +788,7 @@ struct Inner {
vec3 a; vec3 a;
vec3 b; vec3 b;
}; };
struct Data { struct Data {
Inner c[4]; Inner c[4];
}; };
@ -801,16 +796,15 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
Inner c[4]; Inner c[4];
} data; } data;
void tint_symbol() { void tint_symbol() {
data.c[2].b = vec3(1.0f, 2.0f, 3.0f); data.c[2].b = vec3(1.0f, 2.0f, 3.0f);
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -856,6 +850,7 @@ struct Inner {
ivec3 a; ivec3 a;
vec3 b; vec3 b;
}; };
struct Data { struct Data {
Inner c[4]; Inner c[4];
}; };
@ -863,16 +858,15 @@ struct Data {
layout(binding = 0) buffer Data_1 { layout(binding = 0) buffer Data_1 {
Inner c[4]; Inner c[4];
} data; } data;
void tint_symbol() { void tint_symbol() {
data.c[2].b.y = 1.0f; data.c[2].b.y = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }

View File

@ -51,11 +51,9 @@ TEST_F(GlslSanitizerTest, Call_ArrayLength) {
auto* expect = R"(#version 310 es auto* expect = R"(#version 310 es
precision mediump float; precision mediump float;
layout(binding = 1) buffer my_struct_1 { layout(binding = 1) buffer my_struct_1 {
float a[]; float a[];
} b; } b;
void a_func() { void a_func() {
uint tint_symbol_1 = 0u; uint tint_symbol_1 = 0u;
b.GetDimensions(tint_symbol_1); b.GetDimensions(tint_symbol_1);
@ -63,11 +61,11 @@ void a_func() {
uint len = tint_symbol_2; uint len = tint_symbol_2;
return; return;
} }
void main() { void main() {
a_func(); a_func();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -102,12 +100,10 @@ TEST_F(GlslSanitizerTest, Call_ArrayLength_OtherMembersInStruct) {
auto* expect = R"(#version 310 es auto* expect = R"(#version 310 es
precision mediump float; precision mediump float;
layout(binding = 1) buffer my_struct_1 { layout(binding = 1) buffer my_struct_1 {
float z; float z;
float a[]; float a[];
} b; } b;
void a_func() { void a_func() {
uint tint_symbol_1 = 0u; uint tint_symbol_1 = 0u;
b.GetDimensions(tint_symbol_1); b.GetDimensions(tint_symbol_1);
@ -115,11 +111,11 @@ void a_func() {
uint len = tint_symbol_2; uint len = tint_symbol_2;
return; return;
} }
void main() { void main() {
a_func(); a_func();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
@ -156,11 +152,9 @@ TEST_F(GlslSanitizerTest, Call_ArrayLength_ViaLets) {
auto* expect = R"(#version 310 es auto* expect = R"(#version 310 es
precision mediump float; precision mediump float;
layout(binding = 1) buffer my_struct_1 { layout(binding = 1) buffer my_struct_1 {
float a[]; float a[];
} b; } b;
void a_func() { void a_func() {
uint tint_symbol_1 = 0u; uint tint_symbol_1 = 0u;
b.GetDimensions(tint_symbol_1); b.GetDimensions(tint_symbol_1);
@ -168,11 +162,11 @@ void a_func() {
uint len = tint_symbol_2; uint len = tint_symbol_2;
return; return;
} }
void main() { void main() {
a_func(); a_func();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
@ -204,11 +198,11 @@ void tint_symbol() {
int pos = tint_symbol_1[3]; int pos = tint_symbol_1[3];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -251,11 +245,11 @@ void tint_symbol() {
vec3 pos = tint_symbol_1.b; vec3 pos = tint_symbol_1.b;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -292,11 +286,11 @@ void tint_symbol() {
int x = v; int x = v;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -345,11 +339,11 @@ void tint_symbol() {
vec4 v = a[3][2]; vec4 v = a[3][2];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }

View File

@ -33,6 +33,7 @@ precision mediump float;
void my_func() { void my_func() {
} }
)"); )");
} }

View File

@ -180,6 +180,7 @@ TEST_F(GlslGeneratorImplTest_Type, EmitType_StructDecl) {
int a; int a;
float b; float b;
}; };
)"); )");
} }
@ -235,6 +236,7 @@ TEST_F(GlslGeneratorImplTest_Type, EmitType_Struct_WithOffsetAttributes) {
int a; int a;
float b; float b;
}; };
)"); )");
} }

View File

@ -11,8 +11,8 @@ void tint_symbol() {
main_1(); main_1();
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -8,8 +8,8 @@ void tint_symbol() {
float f = v[1]; float f = v[1];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -13,8 +13,8 @@ void tint_symbol() {
main_1(); main_1();
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -9,8 +9,8 @@ void tint_symbol() {
vec3 swizzle3 = v.xzy; vec3 swizzle3 = v.xzy;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -13,8 +13,8 @@ void tint_symbol() {
main_1(); main_1();
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -8,8 +8,8 @@ void tint_symbol() {
float f = v[1]; float f = v[1];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -16,8 +16,8 @@ void tint_symbol() {
main_1(); main_1();
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -9,8 +9,8 @@ void tint_symbol() {
vec3 swizzle3 = v.xzy; vec3 swizzle3 = v.xzy;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };
@ -20,10 +19,10 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 { layout(binding = 0) uniform S_1 {
ivec4 arr[4]; ivec4 arr[4];
} src_uniform; } src_uniform;
layout(binding = 1) buffer S_2 { layout(binding = 1) buffer S_2 {
ivec4 arr[4]; ivec4 arr[4];
} src_storage; } src_storage;
ivec4[4] ret_arr() { ivec4[4] ret_arr() {
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
return tint_symbol; return tint_symbol;
@ -53,3 +52,4 @@ void foo(ivec4 src_param[4]) {
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))); 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 = src_nested; dst_nested = src_nested;
} }

View File

@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };
@ -20,12 +19,12 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 { layout(binding = 0) uniform S_1 {
ivec4 arr[4]; ivec4 arr[4];
} src_uniform; } src_uniform;
layout(binding = 1) buffer S_2 { layout(binding = 1) buffer S_2 {
ivec4 arr[4]; ivec4 arr[4];
} src_storage; } src_storage;
ivec4 dst[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); ivec4 dst[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
int dst_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))); int dst_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)));
ivec4[4] ret_arr() { ivec4[4] ret_arr() {
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
return tint_symbol; return tint_symbol;
@ -53,3 +52,4 @@ void foo(ivec4 src_param[4]) {
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))); 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 = src_nested; dst_nested = src_nested;
} }

View File

@ -5,15 +5,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };
struct S_nested { struct S_nested {
int arr[4][3][2]; int arr[4][3][2];
}; };
@ -23,6 +23,7 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 { layout(binding = 0) uniform S_1 {
ivec4 arr[4]; ivec4 arr[4];
} src_uniform; } src_uniform;
layout(binding = 1) buffer S_2 { layout(binding = 1) buffer S_2 {
ivec4 arr[4]; ivec4 arr[4];
} src_storage; } src_storage;
@ -32,7 +33,6 @@ layout(binding = 2) buffer S_3 {
layout(binding = 3) buffer S_nested_1 { layout(binding = 3) buffer S_nested_1 {
int arr[4][3][2]; int arr[4][3][2];
} dst_nested; } dst_nested;
ivec4[4] ret_arr() { ivec4[4] ret_arr() {
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
return tint_symbol; return tint_symbol;
@ -60,3 +60,4 @@ void foo(ivec4 src_param[4]) {
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))); 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.arr = src_nested;
} }

View File

@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
struct S { struct S {
int arr[4]; int arr[4];
}; };
@ -26,3 +25,4 @@ void foo() {
dst_struct.arr = src; dst_struct.arr = src;
dst_array[0] = src; dst_array[0] = src;
} }

View File

@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };
@ -20,12 +19,12 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 { layout(binding = 0) uniform S_1 {
ivec4 arr[4]; ivec4 arr[4];
} src_uniform; } src_uniform;
layout(binding = 1) buffer S_2 { layout(binding = 1) buffer S_2 {
ivec4 arr[4]; ivec4 arr[4];
} src_storage; } src_storage;
shared ivec4 dst[4]; shared ivec4 dst[4];
shared int dst_nested[4][3][2]; shared int dst_nested[4][3][2];
ivec4[4] ret_arr() { ivec4[4] ret_arr() {
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)); ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
return tint_symbol; return tint_symbol;
@ -53,3 +52,4 @@ void foo(ivec4 src_param[4]) {
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))); 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 = src_nested; dst_nested = src_nested;
} }

View File

@ -23,8 +23,8 @@ void tint_symbol() {
float v3 = f3(a3); float v3 = f3(a3);
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -23,8 +23,8 @@ void tint_symbol() {
float a3[2][3][4] = f3(); float a3[2][3][4] = f3();
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -3,7 +3,6 @@ precision mediump float;
const int slen = 4; const int slen = 4;
const uint ulen = 4u; const uint ulen = 4u;
void tint_symbol() { void tint_symbol() {
float signed_literal[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f); float signed_literal[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
float unsigned_literal[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f); float unsigned_literal[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
@ -13,8 +12,8 @@ void tint_symbol() {
signed_constant = unsigned_literal; signed_constant = unsigned_literal;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -38,8 +38,8 @@ void tint_symbol() {
int subexpr_nested_nonempty_with_expr[4] = tint_symbol_20[1]; int subexpr_nested_nonempty_with_expr[4] = tint_symbol_20[1];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -6,6 +6,7 @@ precision mediump float;
struct Time { struct Time {
float value; float value;
}; };
struct Uniforms { struct Uniforms {
float scale; float scale;
float offsetX; float offsetX;
@ -17,6 +18,7 @@ struct Uniforms {
layout(binding = 0) uniform Time_1 { layout(binding = 0) uniform Time_1 {
float value; float value;
} time; } time;
layout(binding = 1) uniform Uniforms_1 { layout(binding = 1) uniform Uniforms_1 {
float scale; float scale;
float offsetX; float offsetX;
@ -29,10 +31,12 @@ struct VertexOutput {
vec4 Position; vec4 Position;
vec4 v_color; vec4 v_color;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
vec4 position; vec4 position;
vec4 color; vec4 color;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec4 v_color; vec4 v_color;
vec4 Position; vec4 Position;
@ -61,6 +65,7 @@ VertexOutput vert_main_inner(vec4 position, vec4 color) {
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 v_color; vec4 v_color;
}; };
struct tint_symbol_6 { struct tint_symbol_6 {
vec4 value; vec4 value;
}; };
@ -75,6 +80,8 @@ tint_symbol_3 vert_main(tint_symbol_2 tint_symbol_1) {
layout(location = 0) in vec4 position; layout(location = 0) in vec4 position;
layout(location = 1) in vec4 color; layout(location = 1) in vec4 color;
layout(location = 0) out vec4 v_color; layout(location = 0) out vec4 v_color;
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.position = position; inputs.position = position;
@ -87,10 +94,9 @@ void main() {
gl_Position.y = -gl_Position.y; gl_Position.y = -gl_Position.y;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:40: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type ' temp mediump float' and a right operand of type ' const float' (or there is no acceptable conversion) ERROR: 0:44: '%' : wrong operand types: no operation '%' exists that takes a left-hand operand of type ' temp mediump float' and a right operand of type ' const float' (or there is no acceptable conversion)
ERROR: 0:40: '' : compilation terminated ERROR: 0:44: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.
@ -101,6 +107,7 @@ precision mediump float;
struct Time { struct Time {
float value; float value;
}; };
struct Uniforms { struct Uniforms {
float scale; float scale;
float offsetX; float offsetX;
@ -108,21 +115,26 @@ struct Uniforms {
float scalar; float scalar;
float scalarOffset; float scalarOffset;
}; };
struct VertexOutput { struct VertexOutput {
vec4 Position; vec4 Position;
vec4 v_color; vec4 v_color;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
vec4 position; vec4 position;
vec4 color; vec4 color;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec4 v_color; vec4 v_color;
vec4 Position; vec4 Position;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 v_color; vec4 v_color;
}; };
struct tint_symbol_6 { struct tint_symbol_6 {
vec4 value; vec4 value;
}; };
@ -139,6 +151,7 @@ tint_symbol_6 frag_main(tint_symbol_5 tint_symbol_4) {
} }
layout(location = 0) in vec4 v_color; layout(location = 0) in vec4 v_color;
layout(location = 0) out vec4 value; layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_5 inputs; tint_symbol_5 inputs;
inputs.v_color = v_color; inputs.v_color = v_color;
@ -147,4 +160,3 @@ void main() {
value = outputs.value; value = outputs.value;
} }

View File

@ -20,16 +20,19 @@ struct VertexInput {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct VertexOutput { struct VertexOutput {
vec4 position; vec4 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
@ -51,28 +54,35 @@ struct tint_symbol_7 {
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_8 { struct tint_symbol_8 {
vec4 value; vec4 value;
}; };
struct SimulationParams { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
}; };
struct Particle { struct Particle {
vec3 position; vec3 position;
float lifetime; float lifetime;
vec4 color; vec4 color;
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 { struct tint_symbol_10 {
uvec3 GlobalInvocationID; uvec3 GlobalInvocationID;
}; };
struct UBO { struct UBO {
uint width; uint width;
}; };
struct tint_symbol_12 { struct tint_symbol_12 {
uvec3 coord; uvec3 coord;
}; };
struct tint_symbol_14 { struct tint_symbol_14 {
uvec3 coord; uvec3 coord;
}; };
@ -91,6 +101,8 @@ layout(location = 1) in vec4 color;
layout(location = 2) in vec2 quad_pos; layout(location = 2) in vec2 quad_pos;
layout(location = 0) out vec4 color; layout(location = 0) out vec4 color;
layout(location = 1) out vec2 quad_pos; layout(location = 1) out vec2 quad_pos;
void main() { void main() {
tint_symbol_4 inputs; tint_symbol_4 inputs;
inputs.position = position; inputs.position = position;
@ -105,9 +117,8 @@ void main() {
gl_Position.y = -gl_Position.y; gl_Position.y = -gl_Position.y;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:90: 'color' : redefinition ERROR: 0:100: 'color' : redefinition
ERROR: 1 compilation errors. No code generated. ERROR: 1 compilation errors. No code generated.
@ -120,31 +131,37 @@ struct RenderParams {
vec3 right; vec3 right;
vec3 up; vec3 up;
}; };
struct VertexInput { struct VertexInput {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct VertexOutput { struct VertexOutput {
vec4 position; vec4 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_7 { struct tint_symbol_7 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_8 { struct tint_symbol_8 {
vec4 value; vec4 value;
}; };
@ -159,21 +176,26 @@ struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
}; };
struct Particle { struct Particle {
vec3 position; vec3 position;
float lifetime; float lifetime;
vec4 color; vec4 color;
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 { struct tint_symbol_10 {
uvec3 GlobalInvocationID; uvec3 GlobalInvocationID;
}; };
struct UBO { struct UBO {
uint width; uint width;
}; };
struct tint_symbol_12 { struct tint_symbol_12 {
uvec3 coord; uvec3 coord;
}; };
struct tint_symbol_14 { struct tint_symbol_14 {
uvec3 coord; uvec3 coord;
}; };
@ -187,7 +209,9 @@ tint_symbol_8 fs_main(tint_symbol_7 tint_symbol_6) {
} }
layout(location = 0) in vec4 color; layout(location = 0) in vec4 color;
layout(location = 1) in vec2 quad_pos; layout(location = 1) in vec2 quad_pos;
layout(location = 0) out vec4 value; layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_7 inputs; tint_symbol_7 inputs;
inputs.color = color; inputs.color = color;
@ -198,12 +222,10 @@ void main() {
value = outputs.value; value = outputs.value;
} }
#version 310 es #version 310 es
precision mediump float; precision mediump float;
vec2 rand_seed = vec2(0.0f, 0.0f); vec2 rand_seed = vec2(0.0f, 0.0f);
float rand() { float rand() {
rand_seed.x = frac((cos(dot(rand_seed, vec2(23.140779495f, 232.616897583f))) * 136.816802979f)); rand_seed.x = frac((cos(dot(rand_seed, vec2(23.140779495f, 232.616897583f))) * 136.816802979f));
rand_seed.y = frac((cos(dot(rand_seed, vec2(54.478565216f, 345.841522217f))) * 534.764526367f)); rand_seed.y = frac((cos(dot(rand_seed, vec2(54.478565216f, 345.841522217f))) * 534.764526367f));
@ -215,38 +237,46 @@ struct RenderParams {
vec3 right; vec3 right;
vec3 up; vec3 up;
}; };
struct VertexInput { struct VertexInput {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct VertexOutput { struct VertexOutput {
vec4 position; vec4 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_7 { struct tint_symbol_7 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_8 { struct tint_symbol_8 {
vec4 value; vec4 value;
}; };
struct SimulationParams { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
}; };
struct Particle { struct Particle {
vec3 position; vec3 position;
float lifetime; float lifetime;
@ -258,16 +288,15 @@ layout(binding = 0) uniform SimulationParams_1 {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
} sim_params; } sim_params;
layout(binding = 1) buffer Particles_1 { layout(binding = 1) buffer Particles_1 {
Particle particles[]; Particle particles[];
} data; } data;
struct tint_symbol_10 { struct tint_symbol_10 {
uvec3 GlobalInvocationID; uvec3 GlobalInvocationID;
}; };
uniform highp sampler2D tint_symbol_2_1; uniform highp sampler2D tint_symbol_2_1;
void simulate_inner(uvec3 GlobalInvocationID) { void simulate_inner(uvec3 GlobalInvocationID) {
rand_seed = ((sim_params.seed.xy + vec2(GlobalInvocationID.xy)) * sim_params.seed.zw); rand_seed = ((sim_params.seed.xy + vec2(GlobalInvocationID.xy)) * sim_params.seed.zw);
uint idx = GlobalInvocationID.x; uint idx = GlobalInvocationID.x;
@ -302,9 +331,11 @@ void simulate_inner(uvec3 GlobalInvocationID) {
struct UBO { struct UBO {
uint width; uint width;
}; };
struct tint_symbol_12 { struct tint_symbol_12 {
uvec3 coord; uvec3 coord;
}; };
struct tint_symbol_14 { struct tint_symbol_14 {
uvec3 coord; uvec3 coord;
}; };
@ -314,16 +345,17 @@ void simulate(tint_symbol_10 tint_symbol_9) {
simulate_inner(tint_symbol_9.GlobalInvocationID); simulate_inner(tint_symbol_9.GlobalInvocationID);
return; return;
} }
void main() { void main() {
tint_symbol_10 inputs; tint_symbol_10 inputs;
inputs.GlobalInvocationID = gl_GlobalInvocationID; inputs.GlobalInvocationID = gl_GlobalInvocationID;
simulate(inputs); simulate(inputs);
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:7: 'frac' : no matching overloaded function found ERROR: 0:6: 'frac' : no matching overloaded function found
ERROR: 0:7: '' : compilation terminated ERROR: 0:6: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.
@ -336,47 +368,57 @@ struct RenderParams {
vec3 right; vec3 right;
vec3 up; vec3 up;
}; };
struct VertexInput { struct VertexInput {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct VertexOutput { struct VertexOutput {
vec4 position; vec4 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_7 { struct tint_symbol_7 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_8 { struct tint_symbol_8 {
vec4 value; vec4 value;
}; };
struct SimulationParams { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
}; };
struct Particle { struct Particle {
vec3 position; vec3 position;
float lifetime; float lifetime;
vec4 color; vec4 color;
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 { struct tint_symbol_10 {
uvec3 GlobalInvocationID; uvec3 GlobalInvocationID;
}; };
struct UBO { struct UBO {
uint width; uint width;
}; };
@ -384,19 +426,18 @@ struct UBO {
layout(binding = 3) uniform UBO_1 { layout(binding = 3) uniform UBO_1 {
uint width; uint width;
} ubo; } ubo;
layout(binding = 4) buffer Buffer_1 { layout(binding = 4) buffer Buffer_1 {
float weights[]; float weights[];
} buf_in; } buf_in;
layout(binding = 5) buffer Buffer_2 { layout(binding = 5) buffer Buffer_2 {
float weights[]; float weights[];
} buf_out; } buf_out;
struct tint_symbol_12 { struct tint_symbol_12 {
uvec3 coord; uvec3 coord;
}; };
uniform highp sampler2D tex_in_1; uniform highp sampler2D tex_in_1;
void import_level_inner(uvec3 coord) { void import_level_inner(uvec3 coord) {
uint offset = (coord.x + (coord.y * ubo.width)); uint offset = (coord.x + (coord.y * ubo.width));
buf_out.weights[offset] = texelFetch(tex_in_1, ivec2(coord.xy), 0).w; buf_out.weights[offset] = texelFetch(tex_in_1, ivec2(coord.xy), 0).w;
@ -411,13 +452,14 @@ void import_level(tint_symbol_12 tint_symbol_11) {
import_level_inner(tint_symbol_11.coord); import_level_inner(tint_symbol_11.coord);
return; return;
} }
void main() { void main() {
tint_symbol_12 inputs; tint_symbol_12 inputs;
inputs.coord = gl_GlobalInvocationID; inputs.coord = gl_GlobalInvocationID;
import_level(inputs); import_level(inputs);
} }
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -426,47 +468,57 @@ struct RenderParams {
vec3 right; vec3 right;
vec3 up; vec3 up;
}; };
struct VertexInput { struct VertexInput {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct VertexOutput { struct VertexOutput {
vec4 position; vec4 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 position; vec3 position;
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_7 { struct tint_symbol_7 {
vec4 color; vec4 color;
vec2 quad_pos; vec2 quad_pos;
vec4 position; vec4 position;
}; };
struct tint_symbol_8 { struct tint_symbol_8 {
vec4 value; vec4 value;
}; };
struct SimulationParams { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
}; };
struct Particle { struct Particle {
vec3 position; vec3 position;
float lifetime; float lifetime;
vec4 color; vec4 color;
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 { struct tint_symbol_10 {
uvec3 GlobalInvocationID; uvec3 GlobalInvocationID;
}; };
struct UBO { struct UBO {
uint width; uint width;
}; };
@ -474,22 +526,22 @@ struct UBO {
layout(binding = 3) uniform UBO_1 { layout(binding = 3) uniform UBO_1 {
uint width; uint width;
} ubo; } ubo;
layout(binding = 4) buffer Buffer_1 { layout(binding = 4) buffer Buffer_1 {
float weights[]; float weights[];
} buf_in; } buf_in;
layout(binding = 5) buffer Buffer_2 { layout(binding = 5) buffer Buffer_2 {
float weights[]; float weights[];
} buf_out; } buf_out;
struct tint_symbol_12 { struct tint_symbol_12 {
uvec3 coord; uvec3 coord;
}; };
struct tint_symbol_14 { struct tint_symbol_14 {
uvec3 coord; uvec3 coord;
}; };
layout(rgba8) uniform highp writeonly image2D tex_out_1; layout(rgba8) uniform highp writeonly image2D tex_out_1;
void export_level_inner(uvec3 coord) { void export_level_inner(uvec3 coord) {
if (all(lessThan(coord.xy, uvec2(imageSize(tex_out_1))))) { if (all(lessThan(coord.xy, uvec2(imageSize(tex_out_1))))) {
uint dst_offset = (coord.x + (coord.y * ubo.width)); uint dst_offset = (coord.x + (coord.y * ubo.width));
@ -510,10 +562,11 @@ void export_level(tint_symbol_14 tint_symbol_13) {
export_level_inner(tint_symbol_13.coord); export_level_inner(tint_symbol_13.coord);
return; return;
} }
void main() { void main() {
tint_symbol_14 inputs; tint_symbol_14 inputs;
inputs.coord = gl_GlobalInvocationID; inputs.coord = gl_GlobalInvocationID;
export_level(inputs); export_level(inputs);
} }

View File

@ -4,7 +4,6 @@ SKIP: FAILED
precision mediump float; precision mediump float;
const float shadowDepthTextureSize = 1024.0f; const float shadowDepthTextureSize = 1024.0f;
struct Scene { struct Scene {
mat4 lightViewProjMatrix; mat4 lightViewProjMatrix;
mat4 cameraViewProjMatrix; mat4 cameraViewProjMatrix;
@ -25,19 +24,18 @@ struct FragmentInput {
const vec3 albedo = vec3(0.899999976f, 0.899999976f, 0.899999976f); const vec3 albedo = vec3(0.899999976f, 0.899999976f, 0.899999976f);
const float ambientFactor = 0.200000003f; const float ambientFactor = 0.200000003f;
struct tint_symbol_3 { struct tint_symbol_3 {
vec3 shadowPos; vec3 shadowPos;
vec3 fragPos; vec3 fragPos;
vec3 fragNorm; vec3 fragNorm;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec4 value; vec4 value;
}; };
uniform highp sampler2D shadowMap_shadowSampler; uniform highp sampler2D shadowMap_shadowSampler;
vec4 tint_symbol_inner(FragmentInput tint_symbol_1) { vec4 tint_symbol_inner(FragmentInput tint_symbol_1) {
float visibility = 0.0f; float visibility = 0.0f;
float oneOverShadowDepthTextureSize = (1.0f / shadowDepthTextureSize); float oneOverShadowDepthTextureSize = (1.0f / shadowDepthTextureSize);
@ -68,6 +66,7 @@ layout(location = 0) in vec3 shadowPos;
layout(location = 1) in vec3 fragPos; layout(location = 1) in vec3 fragPos;
layout(location = 2) in vec3 fragNorm; layout(location = 2) in vec3 fragNorm;
layout(location = 0) out vec4 value; layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_3 inputs; tint_symbol_3 inputs;
inputs.shadowPos = shadowPos; inputs.shadowPos = shadowPos;
@ -78,10 +77,9 @@ void main() {
value = outputs.value; value = outputs.value;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:47: 'assign' : cannot convert from ' temp highp 4-component vector of float' to ' temp mediump float' ERROR: 0:45: 'assign' : cannot convert from ' temp highp 4-component vector of float' to ' temp mediump float'
ERROR: 0:47: '' : compilation terminated ERROR: 0:45: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -6,12 +6,15 @@ precision mediump float;
struct Input { struct Input {
vec4 color; vec4 color;
}; };
struct Output { struct Output {
vec4 color; vec4 color;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec4 color; vec4 color;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec4 color; vec4 color;
}; };
@ -30,6 +33,7 @@ tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
} }
layout(location = 0) in vec4 color; layout(location = 0) in vec4 color;
layout(location = 0) out vec4 color; layout(location = 0) out vec4 color;
void main() { void main() {
tint_symbol_3 inputs; tint_symbol_3 inputs;
inputs.color = color; inputs.color = color;
@ -38,9 +42,8 @@ void main() {
color = outputs.color; color = outputs.color;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:30: 'color' : redefinition ERROR: 0:33: 'color' : redefinition
ERROR: 1 compilation errors. No code generated. ERROR: 1 compilation errors. No code generated.

View File

@ -8,7 +8,6 @@ benchmark/skinned-shadowed-pbr-fragment.wgsl:51:13 warning: use of deprecated la
precision mediump float; precision mediump float;
const float GAMMA = 2.200000048f; const float GAMMA = 2.200000048f;
vec3 linearTosRGB(vec3 linear) { vec3 linearTosRGB(vec3 linear) {
float INV_GAMMA = (1.0f / GAMMA); float INV_GAMMA = (1.0f / GAMMA);
return pow(linear, vec3(INV_GAMMA)); return pow(linear, vec3(INV_GAMMA));
@ -40,6 +39,7 @@ struct ClusterLights {
uint offset; uint offset;
uint count; uint count;
}; };
struct ClusterLightGroup { struct ClusterLightGroup {
uint offset; uint offset;
ClusterLights lights[27648]; ClusterLights lights[27648];
@ -51,7 +51,6 @@ layout(binding = 1) buffer ClusterLightGroup_1 {
ClusterLights lights[27648]; ClusterLights lights[27648];
uint indices[1769472]; uint indices[1769472];
} clusterLights; } clusterLights;
struct Light { struct Light {
vec3 position; vec3 position;
float range; float range;
@ -68,7 +67,6 @@ layout(binding = 2) buffer GlobalLights_1 {
Light lights[]; Light lights[];
} globalLights; } globalLights;
const uvec3 tileCount = uvec3(32u, 18u, 48u); const uvec3 tileCount = uvec3(32u, 18u, 48u);
float linearDepth(float depthSample) { float linearDepth(float depthSample) {
return ((camera.zFar * camera.zNear) / mad(depthSample, (camera.zNear - camera.zFar), camera.zFar)); return ((camera.zFar * camera.zNear) / mad(depthSample, (camera.zNear - camera.zFar), camera.zFar));
} }
@ -90,7 +88,6 @@ layout(binding = 6) buffer LightShadowTable_1 {
} lightShadowTable; } lightShadowTable;
vec2 shadowSampleOffsets[16] = vec2[16](vec2(-1.5f, -1.5f), vec2(-1.5f, -0.5f), vec2(-1.5f, 0.5f), vec2(-1.5f, 1.5f), vec2(-0.5f, -1.5f), vec2(-0.5f, -0.5f), vec2(-0.5f, 0.5f), vec2(-0.5f, 1.5f), vec2(0.5f, -1.5f), vec2(0.5f, -0.5f), vec2(0.5f, 0.5f), vec2(0.5f, 1.5f), vec2(1.5f, -1.5f), vec2(1.5f, -0.5f), vec2(1.5f, 0.5f), vec2(1.5f, 1.5f)); vec2 shadowSampleOffsets[16] = vec2[16](vec2(-1.5f, -1.5f), vec2(-1.5f, -0.5f), vec2(-1.5f, 0.5f), vec2(-1.5f, 1.5f), vec2(-0.5f, -1.5f), vec2(-0.5f, -0.5f), vec2(-0.5f, 0.5f), vec2(-0.5f, 1.5f), vec2(0.5f, -1.5f), vec2(0.5f, -0.5f), vec2(0.5f, 0.5f), vec2(0.5f, 1.5f), vec2(1.5f, -1.5f), vec2(1.5f, -0.5f), vec2(1.5f, 0.5f), vec2(1.5f, 1.5f));
const uint shadowSampleCount = 16u; const uint shadowSampleCount = 16u;
struct ShadowProperties { struct ShadowProperties {
vec4 viewport; vec4 viewport;
mat4 viewProj; mat4 viewProj;
@ -102,7 +99,6 @@ layout(binding = 7) buffer LightShadows_1 {
uniform highp sampler2D shadowTexture_1; uniform highp sampler2D shadowTexture_1;
uniform highp sampler2D shadowTexture_shadowSampler; uniform highp sampler2D shadowTexture_shadowSampler;
float dirLightVisibility(vec3 worldPos) { float dirLightVisibility(vec3 worldPos) {
int shadowIndex = lightShadowTable.light[0u]; int shadowIndex = lightShadowTable.light[0u];
if ((shadowIndex == -1)) { if ((shadowIndex == -1)) {
@ -180,6 +176,7 @@ struct VertexOutput {
vec3 tangent; vec3 tangent;
vec3 bitangent; vec3 bitangent;
}; };
struct Material { struct Material {
vec4 baseColorFactor; vec4 baseColorFactor;
vec3 emissiveFactor; vec3 emissiveFactor;
@ -214,7 +211,6 @@ uniform highp sampler2D metallicRoughnessTexture_metallicRoughnessSampler;
uniform highp sampler2D occlusionTexture_occlusionSampler; uniform highp sampler2D occlusionTexture_occlusionSampler;
uniform highp sampler2D emissiveTexture_emissiveSampler; uniform highp sampler2D emissiveTexture_emissiveSampler;
SurfaceInfo GetSurfaceInfo(VertexOutput tint_symbol) { SurfaceInfo GetSurfaceInfo(VertexOutput tint_symbol) {
SurfaceInfo surface = SurfaceInfo(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.0f, vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), 0.0f, vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f)); SurfaceInfo surface = SurfaceInfo(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.0f, vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), 0.0f, vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
surface.v = normalize(tint_symbol.view); surface.v = normalize(tint_symbol.view);
@ -247,7 +243,6 @@ SurfaceInfo GetSurfaceInfo(VertexOutput tint_symbol) {
const float PI = 3.141592741f; const float PI = 3.141592741f;
const uint LightType_Point = 0u; const uint LightType_Point = 0u;
const uint LightType_Directional = 2u; const uint LightType_Directional = 2u;
struct PuctualLight { struct PuctualLight {
uint lightType; uint lightType;
vec3 pointToLight; vec3 pointToLight;
@ -316,6 +311,7 @@ struct FragmentOutput {
vec4 color; vec4 color;
vec4 emissive; vec4 emissive;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 worldPos; vec3 worldPos;
vec3 view; vec3 view;
@ -328,6 +324,7 @@ struct tint_symbol_4 {
vec3 bitangent; vec3 bitangent;
vec4 position; vec4 position;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec4 color; vec4 color;
vec4 emissive; vec4 emissive;
@ -335,7 +332,6 @@ struct tint_symbol_5 {
uniform highp sampler2D ssaoTexture_1; uniform highp sampler2D ssaoTexture_1;
uniform highp sampler2D ssaoTexture_defaultSampler; uniform highp sampler2D ssaoTexture_defaultSampler;
FragmentOutput fragmentMain_inner(VertexOutput tint_symbol) { FragmentOutput fragmentMain_inner(VertexOutput tint_symbol) {
SurfaceInfo surface = GetSurfaceInfo(tint_symbol); SurfaceInfo surface = GetSurfaceInfo(tint_symbol);
vec3 Lo = vec3(0.0f, 0.0f, 0.0f); vec3 Lo = vec3(0.0f, 0.0f, 0.0f);
@ -391,8 +387,10 @@ layout(location = 5) in vec4 instanceColor;
layout(location = 6) in vec3 normal; layout(location = 6) in vec3 normal;
layout(location = 7) in vec3 tangent; layout(location = 7) in vec3 tangent;
layout(location = 8) in vec3 bitangent; layout(location = 8) in vec3 bitangent;
layout(location = 0) out vec4 color; layout(location = 0) out vec4 color;
layout(location = 1) out vec4 emissive; layout(location = 1) out vec4 emissive;
void main() { void main() {
tint_symbol_4 inputs; tint_symbol_4 inputs;
inputs.worldPos = worldPos; inputs.worldPos = worldPos;
@ -411,10 +409,9 @@ void main() {
emissive = outputs.emissive; emissive = outputs.emissive;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:67: 'mad' : no matching overloaded function found ERROR: 0:65: 'mad' : no matching overloaded function found
ERROR: 0:67: '' : compilation terminated ERROR: 0:65: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -16,6 +16,7 @@ struct VertexInput {
vec4 instance3; vec4 instance3;
vec4 instanceColor; vec4 instanceColor;
}; };
struct VertexOutput { struct VertexOutput {
vec4 position; vec4 position;
vec3 worldPos; vec3 worldPos;
@ -28,6 +29,7 @@ struct VertexOutput {
vec3 tangent; vec3 tangent;
vec3 bitangent; vec3 bitangent;
}; };
struct Camera { struct Camera {
mat4 projection; mat4 projection;
mat4 inverseProjection; mat4 inverseProjection;
@ -56,7 +58,6 @@ layout(binding = 1) buffer Joints_1 {
layout(binding = 2) buffer Joints_2 { layout(binding = 2) buffer Joints_2 {
mat4 matrices[]; mat4 matrices[];
} inverseBind; } inverseBind;
mat4 getSkinMatrix(VertexInput tint_symbol) { mat4 getSkinMatrix(VertexInput tint_symbol) {
mat4 joint0 = (joint.matrices[tint_symbol.joints.x] * inverseBind.matrices[tint_symbol.joints.x]); mat4 joint0 = (joint.matrices[tint_symbol.joints.x] * inverseBind.matrices[tint_symbol.joints.x]);
mat4 joint1 = (joint.matrices[tint_symbol.joints.y] * inverseBind.matrices[tint_symbol.joints.y]); mat4 joint1 = (joint.matrices[tint_symbol.joints.y] * inverseBind.matrices[tint_symbol.joints.y]);
@ -79,6 +80,7 @@ struct tint_symbol_3 {
vec4 instance3; vec4 instance3;
vec4 instanceColor; vec4 instanceColor;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec3 worldPos; vec3 worldPos;
vec3 view; vec3 view;
@ -144,6 +146,8 @@ layout(location = 5) out vec4 instanceColor;
layout(location = 6) out vec3 normal; layout(location = 6) out vec3 normal;
layout(location = 7) out vec3 tangent; layout(location = 7) out vec3 tangent;
layout(location = 8) out vec3 bitangent; layout(location = 8) out vec3 bitangent;
void main() { void main() {
tint_symbol_3 inputs; tint_symbol_3 inputs;
inputs.position = position; inputs.position = position;
@ -173,9 +177,8 @@ void main() {
gl_Position.y = -gl_Position.y; gl_Position.y = -gl_Position.y;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:138: 'texcoord' : redefinition ERROR: 0:140: 'texcoord' : redefinition
ERROR: 1 compilation errors. No code generated. ERROR: 1 compilation errors. No code generated.

View File

@ -16,7 +16,6 @@ struct Inner {
layout(binding = 0) buffer S_1 { layout(binding = 0) buffer S_1 {
Inner arr[]; Inner arr[];
} s; } s;
struct tint_symbol_2 { struct tint_symbol_2 {
uint idx; uint idx;
}; };
@ -38,10 +37,11 @@ void tint_symbol(tint_symbol_2 tint_symbol_1) {
tint_symbol_inner(tint_symbol_1.idx); tint_symbol_inner(tint_symbol_1.idx);
return; return;
} }
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex); inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs); tint_symbol(inputs);
} }

View File

@ -16,7 +16,6 @@ struct Inner {
layout(binding = 0) buffer S_1 { layout(binding = 0) buffer S_1 {
Inner arr[]; Inner arr[];
} s; } s;
struct tint_symbol_2 { struct tint_symbol_2 {
uint idx; uint idx;
}; };
@ -39,10 +38,11 @@ void tint_symbol(tint_symbol_2 tint_symbol_1) {
tint_symbol_inner(tint_symbol_1.idx); tint_symbol_inner(tint_symbol_1.idx);
return; return;
} }
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex); inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs); tint_symbol(inputs);
} }

View File

@ -4,6 +4,7 @@ precision mediump float;
struct Inner { struct Inner {
int x; int x;
}; };
struct S { struct S {
ivec3 a; ivec3 a;
int b; int b;
@ -29,7 +30,6 @@ layout(binding = 0) buffer S_1 {
Inner i; Inner i;
Inner j[4]; Inner j[4];
} s; } s;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
ivec3 a = s.a; ivec3 a = s.a;
@ -44,8 +44,8 @@ void tint_symbol() {
Inner j[4] = s.j; Inner j[4] = s.j;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -4,6 +4,7 @@ precision mediump float;
struct Inner { struct Inner {
int x; int x;
}; };
struct S { struct S {
ivec3 a; ivec3 a;
int b; int b;
@ -29,7 +30,6 @@ layout(binding = 0) buffer S_1 {
Inner i; Inner i;
Inner j[4]; Inner j[4];
} s; } s;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
s.a = ivec3(0, 0, 0); s.a = ivec3(0, 0, 0);
@ -46,8 +46,8 @@ void tint_symbol() {
s.j = tint_symbol_2; s.j = tint_symbol_2;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
float inner[4]; float inner[4];
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
float inner; float inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
int inner; int inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
mat2 inner; mat2 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
mat2x3 inner; mat2x3 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
mat3x2 inner; mat3x2 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
mat4 inner; mat4 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
S inner[]; S inner[];
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner[0] = tint_symbol.inner[0]; tint_symbol_1.inner[0] = tint_symbol.inner[0];
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -6,6 +6,7 @@ precision mediump float;
struct Inner { struct Inner {
float f; float f;
}; };
struct S { struct S {
Inner inner; Inner inner;
}; };
@ -16,17 +17,16 @@ layout(binding = 0) buffer S_1 {
layout(binding = 1) buffer S_2 { layout(binding = 1) buffer S_2 {
Inner inner; Inner inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1 = tint_symbol; tint_symbol_1 = tint_symbol;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:20: 'assign' : cannot convert from 'layout( binding=0 column_major shared) buffer block{layout( column_major shared) buffer structure{ global mediump float f} inner}' to 'layout( binding=1 column_major shared) buffer block{layout( column_major shared) buffer structure{ global mediump float f} inner}' ERROR: 0:20: 'assign' : cannot convert from 'layout( binding=0 column_major shared) buffer block{layout( column_major shared) buffer structure{ global mediump float f} inner}' to 'layout( binding=1 column_major shared) buffer block{layout( column_major shared) buffer structure{ global mediump float f} inner}'
ERROR: 0:20: '' : compilation terminated ERROR: 0:20: '' : compilation terminated

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
uint inner; uint inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
ivec2 inner; ivec2 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
uvec3 inner; uvec3 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 { layout(binding = 1) buffer tint_symbol_block_2 {
vec4 inner; vec4 inner;
} tint_symbol_1; } tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return; return;
} }
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
} }

View File

@ -14,6 +14,7 @@ struct Inner {
mat3x2 j; mat3x2 j;
ivec4 k[4]; ivec4 k[4];
}; };
struct S { struct S {
Inner arr[8]; Inner arr[8];
}; };
@ -45,10 +46,11 @@ void tint_symbol(tint_symbol_2 tint_symbol_1) {
tint_symbol_inner(tint_symbol_1.idx); tint_symbol_inner(tint_symbol_1.idx);
return; return;
} }
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex); inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs); tint_symbol(inputs);
} }

View File

@ -4,6 +4,7 @@ precision mediump float;
struct Inner { struct Inner {
int x; int x;
}; };
struct S { struct S {
ivec3 a; ivec3 a;
int b; int b;
@ -50,8 +51,8 @@ void tint_symbol() {
Inner l[4] = s.l; Inner l[4] = s.l;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
vec4 x[4] = u.inner; vec4 x[4] = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
float x = u.inner; float x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
int x = u.inner; int x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
mat2 x = u.inner; mat2 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
mat2x3 x = u.inner; mat2x3 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
mat3x2 x = u.inner; mat3x2 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
mat4 x = u.inner; mat4 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -6,6 +6,7 @@ precision mediump float;
struct Inner { struct Inner {
float f; float f;
}; };
struct S { struct S {
Inner inner; Inner inner;
}; };
@ -19,14 +20,14 @@ void tint_symbol() {
S x = u; S x = u;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:17: '=' : cannot convert from 'layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform structure{ global mediump float f} inner}' to ' temp structure{ global structure{ global mediump float f} inner}' ERROR: 0:18: '=' : cannot convert from 'layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform structure{ global mediump float f} inner}' to ' temp structure{ global structure{ global mediump float f} inner}'
ERROR: 0:17: '' : compilation terminated ERROR: 0:18: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -14,8 +14,8 @@ void tint_symbol() {
uint x = u.inner; uint x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
ivec2 x = u.inner; ivec2 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
uvec3 x = u.inner; uvec3 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -14,8 +14,8 @@ void tint_symbol() {
vec4 x = u.inner; vec4 x = u.inner;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -5,10 +5,9 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
const int H = 1; const int H = 1;

View File

@ -7,6 +7,7 @@ struct modf_result {
float fract; float fract;
float whole; float whole;
}; };
modf_result tint_modf(float param_0) { modf_result tint_modf(float param_0) {
float whole; float whole;
float fract = modf(param_0, whole); float fract = modf(param_0, whole);
@ -19,18 +20,18 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
void i() { void i() {
float s = tint_modf(1.0f).whole; float s = tint_modf(1.0f).whole;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:11: '{ } style initializers' : not supported with this profile: es ERROR: 0:12: '{ } style initializers' : not supported with this profile: es
ERROR: 0:11: '' : compilation terminated ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -5,10 +5,12 @@ struct VertexInputs0 {
uint vertex_index; uint vertex_index;
int loc0; int loc0;
}; };
struct VertexInputs1 { struct VertexInputs1 {
uint loc1; uint loc1;
vec4 loc3; vec4 loc3;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
int loc0; int loc0;
uint loc1; uint loc1;
@ -17,6 +19,7 @@ struct tint_symbol_2 {
uint vertex_index; uint vertex_index;
uint instance_index; uint instance_index;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec4 value; vec4 value;
}; };
@ -38,6 +41,10 @@ layout(location = 0) in int loc0;
layout(location = 1) in uint loc1; layout(location = 1) in uint loc1;
layout(location = 2) in uint loc1_1; layout(location = 2) in uint loc1_1;
layout(location = 3) in vec4 loc3; layout(location = 3) in vec4 loc3;
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.loc0 = loc0; inputs.loc0 = loc0;
@ -53,4 +60,3 @@ void main() {
gl_Position.y = -gl_Position.y; gl_Position.y = -gl_Position.y;
} }

View File

@ -29,6 +29,7 @@ struct Uniforms {
vec3 bbMin; vec3 bbMin;
vec3 bbMax; vec3 bbMax;
}; };
struct Dbg { struct Dbg {
uint offsetCounter; uint offsetCounter;
uint pad0; uint pad0;
@ -52,6 +53,7 @@ layout(binding = 0) uniform Uniforms_1 {
vec3 bbMin; vec3 bbMin;
vec3 bbMax; vec3 bbMax;
} uniforms; } uniforms;
layout(binding = 10) buffer U32s_1 { layout(binding = 10) buffer U32s_1 {
uint values[]; uint values[];
} indices; } indices;
@ -78,7 +80,6 @@ layout(binding = 50) buffer Dbg_1 {
float value_f32_2; float value_f32_2;
float value_f32_3; float value_f32_3;
} dbg; } dbg;
vec3 toVoxelPos(vec3 position) { vec3 toVoxelPos(vec3 position) {
vec3 bbMin = vec3(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z); 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 bbMax = vec3(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z);
@ -137,10 +138,11 @@ void main_count(tint_symbol_1 tint_symbol) {
main_count_inner(tint_symbol.GlobalInvocationID); main_count_inner(tint_symbol.GlobalInvocationID);
return; return;
} }
void main() { void main() {
tint_symbol_1 inputs; tint_symbol_1 inputs;
inputs.GlobalInvocationID = gl_GlobalInvocationID; inputs.GlobalInvocationID = gl_GlobalInvocationID;
main_count(inputs); main_count(inputs);
} }

View File

@ -5,15 +5,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() { void unused_entry_point() {
return; return;
} }
void main() { void main() {
unused_entry_point(); unused_entry_point();
} }
struct A { struct A {
int a; int a;
}; };
struct B { struct B {
int b; int b;
}; };
@ -22,3 +22,4 @@ B f(A a) {
B tint_symbol = B(0); B tint_symbol = B(0);
return tint_symbol; return tint_symbol;
} }

View File

@ -15,9 +15,11 @@ struct VertexOutputs {
vec2 texcoords; vec2 texcoords;
vec4 position; vec4 position;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
uint VertexIndex; uint VertexIndex;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec2 texcoords; vec2 texcoords;
vec4 position; vec4 position;
@ -39,6 +41,7 @@ VertexOutputs vs_main_inner(uint VertexIndex) {
struct tint_symbol_5 { struct tint_symbol_5 {
vec2 texcoord; vec2 texcoord;
}; };
struct tint_symbol_6 { struct tint_symbol_6 {
vec4 value; vec4 value;
}; };
@ -50,7 +53,10 @@ tint_symbol_3 vs_main(tint_symbol_2 tint_symbol_1) {
wrapper_result.position = inner_result.position; wrapper_result.position = inner_result.position;
return wrapper_result; return wrapper_result;
} }
layout(location = 0) out vec2 texcoords; layout(location = 0) out vec2 texcoords;
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.VertexIndex = uint(gl_VertexID); inputs.VertexIndex = uint(gl_VertexID);
@ -62,7 +68,6 @@ void main() {
gl_Position.y = -gl_Position.y; gl_Position.y = -gl_Position.y;
} }
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -70,27 +75,31 @@ struct Uniforms {
vec2 u_scale; vec2 u_scale;
vec2 u_offset; vec2 u_offset;
}; };
struct VertexOutputs { struct VertexOutputs {
vec2 texcoords; vec2 texcoords;
vec4 position; vec4 position;
}; };
struct tint_symbol_2 { struct tint_symbol_2 {
uint VertexIndex; uint VertexIndex;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec2 texcoords; vec2 texcoords;
vec4 position; vec4 position;
}; };
struct tint_symbol_5 { struct tint_symbol_5 {
vec2 texcoord; vec2 texcoord;
}; };
struct tint_symbol_6 { struct tint_symbol_6 {
vec4 value; vec4 value;
}; };
uniform highp sampler2D myTexture_mySampler; uniform highp sampler2D myTexture_mySampler;
vec4 fs_main_inner(vec2 texcoord) { vec4 fs_main_inner(vec2 texcoord) {
vec2 clampedTexcoord = clamp(texcoord, vec2(0.0f, 0.0f), vec2(1.0f, 1.0f)); vec2 clampedTexcoord = clamp(texcoord, vec2(0.0f, 0.0f), vec2(1.0f, 1.0f));
if (!(all(equal(clampedTexcoord, texcoord)))) { if (!(all(equal(clampedTexcoord, texcoord)))) {
@ -108,6 +117,7 @@ tint_symbol_6 fs_main(tint_symbol_5 tint_symbol_4) {
} }
layout(location = 0) in vec2 texcoord; layout(location = 0) in vec2 texcoord;
layout(location = 0) out vec4 value; layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_5 inputs; tint_symbol_5 inputs;
inputs.texcoord = texcoord; inputs.texcoord = texcoord;
@ -116,4 +126,3 @@ void main() {
value = outputs.value; value = outputs.value;
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -19,15 +20,14 @@ struct Result {
layout(binding = 1) buffer Result_1 { layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { 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 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.tint_symbol = s.data[ubo.dynamic_idx];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -20,14 +21,13 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } 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)); 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));
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { void f() {
result.tint_symbol = s.data[ubo.dynamic_idx]; result.tint_symbol = s.data[ubo.dynamic_idx];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -16,7 +16,6 @@ struct Result {
layout(binding = 2) buffer Result_1 { layout(binding = 2) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
struct SSBO { struct SSBO {
int data[4]; int data[4];
}; };
@ -24,14 +23,13 @@ struct SSBO {
layout(binding = 1) buffer SSBO_1 { layout(binding = 1) buffer SSBO_1 {
int data[4]; int data[4];
} ssbo; } ssbo;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { void f() {
result.tint_symbol = ssbo.data[ubo.dynamic_idx]; result.tint_symbol = ssbo.data[ubo.dynamic_idx];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -18,14 +18,13 @@ struct Result {
layout(binding = 2) buffer Result_1 { layout(binding = 2) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { void f() {
result.tint_symbol = ubo.data[ubo.dynamic_idx].x; result.tint_symbol = ubo.data[ubo.dynamic_idx].x;
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -20,7 +21,6 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
shared S s; shared S s;
struct tint_symbol_2 { struct tint_symbol_2 {
uint local_invocation_index; uint local_invocation_index;
}; };
@ -41,10 +41,11 @@ void f(tint_symbol_2 tint_symbol_1) {
f_inner(tint_symbol_1.local_invocation_index); f_inner(tint_symbol_1.local_invocation_index);
return; return;
} }
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.local_invocation_index = uint(gl_LocalInvocationIndex); inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
f(inputs); f(inputs);
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -19,7 +20,6 @@ struct Result {
layout(binding = 1) buffer Result_1 { layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { 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 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));
@ -27,8 +27,8 @@ void f() {
result.tint_symbol = s.data[3]; result.tint_symbol = s.data[3];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -19,7 +20,6 @@ struct Result {
layout(binding = 1) buffer Result_1 { layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
void x(inout S p) { void x(inout S p) {
p.data[ubo.dynamic_idx] = 1; p.data[ubo.dynamic_idx] = 1;
} }
@ -31,8 +31,8 @@ void f() {
result.tint_symbol = s.data[3]; result.tint_symbol = s.data[3];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -20,15 +21,14 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } 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)); 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));
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { void f() {
s.data[ubo.dynamic_idx] = 1; s.data[ubo.dynamic_idx] = 1;
result.tint_symbol = s.data[3]; result.tint_symbol = s.data[3];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -20,7 +21,6 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } 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)); 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) { void x(inout S p) {
p.data[ubo.dynamic_idx] = 1; p.data[ubo.dynamic_idx] = 1;
} }
@ -31,8 +31,8 @@ void f() {
result.tint_symbol = s.data[3]; result.tint_symbol = s.data[3];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -16,7 +16,6 @@ struct Result {
layout(binding = 2) buffer Result_1 { layout(binding = 2) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
struct SSBO { struct SSBO {
int data[4]; int data[4];
}; };
@ -24,15 +23,14 @@ struct SSBO {
layout(binding = 1) buffer SSBO_1 { layout(binding = 1) buffer SSBO_1 {
int data[4]; int data[4];
} ssbo; } ssbo;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { void f() {
ssbo.data[ubo.dynamic_idx] = 1; ssbo.data[ubo.dynamic_idx] = 1;
result.tint_symbol = ssbo.data[3]; result.tint_symbol = ssbo.data[3];
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -12,6 +12,7 @@ layout(binding = 0) uniform UBO_1 {
struct S { struct S {
int data[64]; int data[64];
}; };
struct Result { struct Result {
int tint_symbol; int tint_symbol;
}; };
@ -20,7 +21,6 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
shared S s; shared S s;
struct tint_symbol_2 { struct tint_symbol_2 {
uint local_invocation_index; uint local_invocation_index;
}; };
@ -42,10 +42,11 @@ void f(tint_symbol_2 tint_symbol_1) {
f_inner(tint_symbol_1.local_invocation_index); f_inner(tint_symbol_1.local_invocation_index);
return; return;
} }
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.local_invocation_index = uint(gl_LocalInvocationIndex); inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
f(inputs); f(inputs);
} }

View File

@ -4,6 +4,7 @@ precision mediump float;
struct tint_symbol_2 { struct tint_symbol_2 {
vec2 vUV; vec2 vUV;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec4 value; vec4 value;
}; };
@ -11,7 +12,6 @@ struct tint_symbol_3 {
uniform highp sampler2D randomTexture_Sampler; uniform highp sampler2D randomTexture_Sampler;
uniform highp sampler2D depthTexture_Sampler; uniform highp sampler2D depthTexture_Sampler;
vec4 tint_symbol_inner(vec2 vUV) { vec4 tint_symbol_inner(vec2 vUV) {
vec3 random = texture(randomTexture_Sampler, vUV).rgb; vec3 random = texture(randomTexture_Sampler, vUV).rgb;
int i = 0; int i = 0;
@ -51,6 +51,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
} }
layout(location = 0) in vec2 vUV; layout(location = 0) in vec2 vUV;
layout(location = 0) out vec4 value; layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.vUV = vUV; inputs.vUV = vUV;
@ -59,4 +60,3 @@ void main() {
value = outputs.value; value = outputs.value;
} }

View File

@ -4,6 +4,7 @@ precision mediump float;
struct Simulation { struct Simulation {
uint i; uint i;
}; };
struct Particle { struct Particle {
vec3 position[8]; vec3 position[8];
float lifetime; float lifetime;
@ -24,8 +25,8 @@ void tint_symbol() {
particle.position[sim.i] = particle.position[sim.i]; particle.position[sim.i] = particle.position[sim.i];
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -17,8 +17,8 @@ void tint_symbol() {
m1[uniforms.i][0] = 1.0f; m1[uniforms.i][0] = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -17,8 +17,8 @@ void tint_symbol() {
m1[uniforms.i][uniforms.j] = 1.0f; m1[uniforms.i][uniforms.j] = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i; uint i;
uint j; uint j;
} uniforms; } uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
m1[0][uniforms.j] = 1.0f; m1[0][uniforms.j] = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -17,8 +17,8 @@ void tint_symbol() {
m1[uniforms.i] = vec4(1.0f); m1[uniforms.i] = vec4(1.0f);
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i; uint i;
uint j; uint j;
} uniforms; } uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
m1[uniforms.i][0] = 1.0f; m1[uniforms.i][0] = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i; uint i;
uint j; uint j;
} uniforms; } uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
m1[uniforms.i][uniforms.j] = 1.0f; m1[uniforms.i][uniforms.j] = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i; uint i;
uint j; uint j;
} uniforms; } uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
m1[0][uniforms.j] = 1.0f; m1[0][uniforms.j] = 1.0f;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i; uint i;
uint j; uint j;
} uniforms; } uniforms;
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
m1[uniforms.i] = vec4(1.0f); m1[uniforms.i] = vec4(1.0f);
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -5,7 +5,6 @@ vec2 v2f = vec2(0.0f, 0.0f);
ivec3 v3i = ivec3(0, 0, 0); ivec3 v3i = ivec3(0, 0, 0);
uvec4 v4u = uvec4(0u, 0u, 0u, 0u); uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
bvec2 v2b = bvec2(false, false); bvec2 v2b = bvec2(false, false);
void foo() { void foo() {
{ {
for(int i = 0; (i < 2); i = (i + 1)) { for(int i = 0; (i < 2); i = (i + 1)) {
@ -26,8 +25,8 @@ void tint_symbol() {
} }
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -5,7 +5,6 @@ vec2 v2f = vec2(0.0f, 0.0f);
ivec3 v3i = ivec3(0, 0, 0); ivec3 v3i = ivec3(0, 0, 0);
uvec4 v4u = uvec4(0u, 0u, 0u, 0u); uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
bvec2 v2b = bvec2(false, false); bvec2 v2b = bvec2(false, false);
void foo() { void foo() {
int i = 0; int i = 0;
v2f[i] = 1.0f; v2f[i] = 1.0f;
@ -23,8 +22,8 @@ void tint_symbol() {
} }
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -33,8 +33,8 @@ void tint_symbol() {
} }
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -25,8 +25,8 @@ void tint_symbol() {
} }
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -34,8 +34,8 @@ void tint_symbol() {
v4b[i] = true; v4b[i] = true;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -30,8 +30,8 @@ void tint_symbol() {
v4b[i] = true; v4b[i] = true;
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -6,6 +6,7 @@ precision mediump float;
struct PointLight { struct PointLight {
vec4 position; vec4 position;
}; };
struct Uniforms { struct Uniforms {
mat4 worldView; mat4 worldView;
mat4 proj; mat4 proj;
@ -21,10 +22,10 @@ layout(binding = 0) uniform Uniforms_1 {
uint color_source; uint color_source;
vec4 color; vec4 color;
} uniforms; } uniforms;
layout(binding = 1) buffer PointLights_1 { layout(binding = 1) buffer PointLights_1 {
PointLight values[]; PointLight values[];
} pointLights; } pointLights;
struct FragmentInput { struct FragmentInput {
vec4 position; vec4 position;
vec4 view_position; vec4 view_position;
@ -32,9 +33,11 @@ struct FragmentInput {
vec2 uv; vec2 uv;
vec4 color; vec4 color;
}; };
struct FragmentOutput { struct FragmentOutput {
vec4 color; vec4 color;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
vec4 view_position; vec4 view_position;
vec4 normal; vec4 normal;
@ -42,6 +45,7 @@ struct tint_symbol_3 {
vec4 color; vec4 color;
vec4 position; vec4 position;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
vec4 color; vec4 color;
}; };
@ -63,7 +67,9 @@ layout(location = 0) in vec4 view_position;
layout(location = 1) in vec4 normal; layout(location = 1) in vec4 normal;
layout(location = 2) in vec2 uv; layout(location = 2) in vec2 uv;
layout(location = 3) in vec4 color; layout(location = 3) in vec4 color;
layout(location = 0) out vec4 color; layout(location = 0) out vec4 color;
void main() { void main() {
tint_symbol_3 inputs; tint_symbol_3 inputs;
inputs.view_position = view_position; inputs.view_position = view_position;
@ -76,9 +82,8 @@ void main() {
color = outputs.color; color = outputs.color;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:64: 'color' : redefinition ERROR: 0:69: 'color' : redefinition
ERROR: 1 compilation errors. No code generated. ERROR: 1 compilation errors. No code generated.

View File

@ -16,8 +16,8 @@ void tint_symbol() {
} }
return; return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
} }

View File

@ -7,11 +7,13 @@ struct FragIn {
float a; float a;
uint mask; uint mask;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
float a; float a;
float b; float b;
uint mask; uint mask;
}; };
struct tint_symbol_4 { struct tint_symbol_4 {
float a; float a;
uint mask; uint mask;
@ -35,7 +37,10 @@ tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
} }
layout(location = 0) in float a; layout(location = 0) in float a;
layout(location = 1) in float b; layout(location = 1) in float b;
layout(location = 0) out float a; layout(location = 0) out float a;
void main() { void main() {
tint_symbol_3 inputs; tint_symbol_3 inputs;
inputs.a = a; inputs.a = a;
@ -47,9 +52,8 @@ void main() {
gl_SampleMask = outputs.mask; gl_SampleMask = outputs.mask;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:36: 'a' : redefinition ERROR: 0:39: 'a' : redefinition
ERROR: 1 compilation errors. No code generated. ERROR: 1 compilation errors. No code generated.

View File

@ -11,6 +11,7 @@ int f(int x) {
struct tint_symbol_2 { struct tint_symbol_2 {
ivec3 x; ivec3 x;
}; };
struct tint_symbol_3 { struct tint_symbol_3 {
int value; int value;
}; };
@ -34,6 +35,7 @@ tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
} }
layout(location = 1) flat in ivec3 x; layout(location = 1) flat in ivec3 x;
layout(location = 2) out int value; layout(location = 2) out int value;
void main() { void main() {
tint_symbol_2 inputs; tint_symbol_2 inputs;
inputs.x = x; inputs.x = x;
@ -42,4 +44,3 @@ void main() {
value = outputs.value; value = outputs.value;
} }

View File

@ -6,8 +6,8 @@ void f() {
int c = (1 / 0); int c = (1 / 0);
return; return;
} }
void main() { void main() {
f(); f();
} }

View File

@ -2,7 +2,6 @@
precision mediump float; precision mediump float;
float v = 0.0f; float v = 0.0f;
void x(inout float p) { void x(inout float p) {
p = 0.0f; p = 0.0f;
} }
@ -15,8 +14,8 @@ void f() {
g(); g();
return; return;
} }
void main() { void main() {
f(); f();
} }

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