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;
bool GeneratorImpl::Generate() {
const TypeInfo* last_kind = nullptr;
size_t last_padding_line = 0;
line() << "#version 310 es";
line() << "precision mediump float;";
@ -139,17 +136,6 @@ bool GeneratorImpl::Generate() {
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 (!EmitGlobalVariable(global)) {
return false;
@ -1632,6 +1618,7 @@ bool GeneratorImpl::EmitFunction(const ast::Function* func) {
}
line() << "}";
line();
return true;
}
@ -1677,6 +1664,7 @@ bool GeneratorImpl::EmitUniformVariable(const sem::Variable* var) {
EmitStructMembers(current_buffer_, str);
auto name = builder_.Symbols().NameFor(decl->symbol);
line() << "} " << name << ";";
line();
return true;
}
@ -1891,36 +1879,37 @@ bool GeneratorImpl::EmitDecorations(std::ostream& out,
bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* 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();
if (func->PipelineStage() == ast::PipelineStage::kCompute) {
// 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;" << std::endl;
}
out << func->return_type->FriendlyName(builder_.Symbols());
out << " " << builder_.Symbols().NameFor(func->symbol) << "(";
out << func->return_type->FriendlyName(builder_.Symbols()) << " "
<< builder_.Symbols().NameFor(func->symbol) << "(";
bool first = true;
@ -1949,6 +1938,7 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
out << ") {";
}
// Emit original entry point function body
{
ScopedIndent si(this);
@ -1966,13 +1956,13 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
line() << "}";
auto out = line();
// Declare entry point input variables
for (auto* var : func->params) {
auto* sem = builder_.Sem().Get(var);
auto* str = sem->Type()->As<sem::Struct>();
for (auto* member : str->Members()) {
auto out = line();
auto decorations = member->Declaration()->decorations;
if (ast::HasDecoration<ast::BuiltinDecoration>(decorations)) {
continue;
@ -1990,7 +1980,7 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
builder_.Symbols().NameFor(member->Declaration()->symbol))) {
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>();
if (return_type) {
for (auto* member : return_type->Members()) {
auto out = line();
auto decorations = member->Declaration()->decorations;
if (ast::HasDecoration<ast::BuiltinDecoration>(decorations)) {
continue;
@ -2015,82 +2006,93 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
builder_.Symbols().NameFor(member->Declaration()->symbol))) {
return false;
}
out << ";" << std::endl;
out << ";";
}
}
line();
// Create a main() function which calls the entry point.
out << "void main() {" << std::endl;
std::string printed_name;
for (auto* var : func->params) {
out << " ";
auto* sem = builder_.Sem().Get(var);
if (!EmitTypeAndName(out, sem->Type(), sem->StorageClass(), sem->Access(),
"inputs")) {
return false;
}
out << ";" << std::endl;
auto* type = sem->Type();
auto* str = type->As<sem::Struct>();
for (auto* member : str->Members()) {
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());
line() << "void main() {";
// Emit main function body
{
ScopedIndent si(this);
for (auto* var : func->params) {
auto* sem = builder_.Sem().Get(var);
auto* type = sem->Type();
{
auto out = line();
if (!EmitTypeAndName(out, type, sem->StorageClass(), sem->Access(),
"inputs")) {
return false;
}
} else {
out << name;
out << ";";
}
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 << " ";
if (return_type) {
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;
line() << "}";
line();
return true;
}
@ -2611,6 +2613,7 @@ bool GeneratorImpl::EmitStructType(TextBuffer* b, const sem::Struct* str) {
line(b) << "struct " << StructName(str) << " {";
EmitStructMembers(b, str);
line(b) << "};";
line(b);
return true;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,8 +9,8 @@ void tint_symbol() {
vec3 swizzle3 = v.xzy;
return;
}
void main() {
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() {
return;
}
void main() {
unused_entry_point();
}
struct S {
ivec4 arr[4];
};
@ -20,10 +19,10 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 {
ivec4 arr[4];
} src_uniform;
layout(binding = 1) buffer S_2 {
ivec4 arr[4];
} src_storage;
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));
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)));
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() {
return;
}
void main() {
unused_entry_point();
}
struct S {
ivec4 arr[4];
};
@ -20,12 +19,12 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 {
ivec4 arr[4];
} src_uniform;
layout(binding = 1) buffer S_2 {
ivec4 arr[4];
} 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));
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 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;
@ -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)));
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() {
return;
}
void main() {
unused_entry_point();
}
struct S {
ivec4 arr[4];
};
struct S_nested {
int arr[4][3][2];
};
@ -23,6 +23,7 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 {
ivec4 arr[4];
} src_uniform;
layout(binding = 1) buffer S_2 {
ivec4 arr[4];
} src_storage;
@ -32,7 +33,6 @@ layout(binding = 2) buffer S_3 {
layout(binding = 3) buffer S_nested_1 {
int arr[4][3][2];
} dst_nested;
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));
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)));
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() {
return;
}
void main() {
unused_entry_point();
}
struct S {
int arr[4];
};
@ -26,3 +25,4 @@ void foo() {
dst_struct.arr = 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() {
return;
}
void main() {
unused_entry_point();
}
struct S {
ivec4 arr[4];
};
@ -20,12 +19,12 @@ shared ivec4 src_workgroup[4];
layout(binding = 0) uniform S_1 {
ivec4 arr[4];
} src_uniform;
layout(binding = 1) buffer S_2 {
ivec4 arr[4];
} src_storage;
shared ivec4 dst[4];
shared int dst_nested[4][3][2];
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));
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)));
dst_nested = src_nested;
}

View File

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

View File

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

View File

@ -3,7 +3,6 @@ precision mediump float;
const int slen = 4;
const uint ulen = 4u;
void tint_symbol() {
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);
@ -13,8 +12,8 @@ void tint_symbol() {
signed_constant = unsigned_literal;
return;
}
void main() {
tint_symbol();
}

View File

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

View File

@ -6,6 +6,7 @@ precision mediump float;
struct Time {
float value;
};
struct Uniforms {
float scale;
float offsetX;
@ -17,6 +18,7 @@ struct Uniforms {
layout(binding = 0) uniform Time_1 {
float value;
} time;
layout(binding = 1) uniform Uniforms_1 {
float scale;
float offsetX;
@ -29,10 +31,12 @@ struct VertexOutput {
vec4 Position;
vec4 v_color;
};
struct tint_symbol_2 {
vec4 position;
vec4 color;
};
struct tint_symbol_3 {
vec4 v_color;
vec4 Position;
@ -61,6 +65,7 @@ VertexOutput vert_main_inner(vec4 position, vec4 color) {
struct tint_symbol_5 {
vec4 v_color;
};
struct tint_symbol_6 {
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 = 1) in vec4 color;
layout(location = 0) out vec4 v_color;
void main() {
tint_symbol_2 inputs;
inputs.position = position;
@ -87,10 +94,9 @@ void main() {
gl_Position.y = -gl_Position.y;
}
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:40: '' : compilation terminated
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:44: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@ -101,6 +107,7 @@ precision mediump float;
struct Time {
float value;
};
struct Uniforms {
float scale;
float offsetX;
@ -108,21 +115,26 @@ struct Uniforms {
float scalar;
float scalarOffset;
};
struct VertexOutput {
vec4 Position;
vec4 v_color;
};
struct tint_symbol_2 {
vec4 position;
vec4 color;
};
struct tint_symbol_3 {
vec4 v_color;
vec4 Position;
};
struct tint_symbol_5 {
vec4 v_color;
};
struct tint_symbol_6 {
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) out vec4 value;
void main() {
tint_symbol_5 inputs;
inputs.v_color = v_color;
@ -147,4 +160,3 @@ void main() {
value = outputs.value;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 {
float inner[4];
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
float inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
int inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
mat2 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
mat2x3 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
mat3x2 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
mat4 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
S inner[];
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner[0] = tint_symbol.inner[0];
return;
}
void main() {
tint_symbol_2();
}

View File

@ -6,6 +6,7 @@ precision mediump float;
struct Inner {
float f;
};
struct S {
Inner inner;
};
@ -16,17 +17,16 @@ layout(binding = 0) buffer S_1 {
layout(binding = 1) buffer S_2 {
Inner inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1 = tint_symbol;
return;
}
void main() {
tint_symbol_2();
}
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: '' : compilation terminated

View File

@ -11,14 +11,13 @@ layout(binding = 0) buffer tint_symbol_block_1 {
layout(binding = 1) buffer tint_symbol_block_2 {
uint inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
ivec2 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
uvec3 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
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 {
vec4 inner;
} tint_symbol_1;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner;
return;
}
void main() {
tint_symbol_2();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ precision mediump float;
struct Inner {
float f;
};
struct S {
Inner inner;
};
@ -19,14 +20,14 @@ void tint_symbol() {
S x = u;
return;
}
void main() {
tint_symbol();
}
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:17: '' : compilation terminated
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:18: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

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

View File

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

View File

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

View File

@ -14,8 +14,8 @@ void tint_symbol() {
vec4 x = u.inner;
return;
}
void main() {
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() {
return;
}
void main() {
unused_entry_point();
}
const int H = 1;

View File

@ -7,6 +7,7 @@ struct modf_result {
float fract;
float whole;
};
modf_result tint_modf(float param_0) {
float 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() {
return;
}
void main() {
unused_entry_point();
}
void i() {
float s = tint_modf(1.0f).whole;
}
Error parsing GLSL shader:
ERROR: 0:11: '{ } style initializers' : not supported with this profile: es
ERROR: 0:11: '' : compilation terminated
ERROR: 0:12: '{ } style initializers' : not supported with this profile: es
ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,6 +4,7 @@ precision mediump float;
struct tint_symbol_2 {
vec2 vUV;
};
struct tint_symbol_3 {
vec4 value;
};
@ -11,7 +12,6 @@ struct tint_symbol_3 {
uniform highp sampler2D randomTexture_Sampler;
uniform highp sampler2D depthTexture_Sampler;
vec4 tint_symbol_inner(vec2 vUV) {
vec3 random = texture(randomTexture_Sampler, vUV).rgb;
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) out vec4 value;
void main() {
tint_symbol_2 inputs;
inputs.vUV = vUV;
@ -59,4 +60,3 @@ void main() {
value = outputs.value;
}

View File

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

View File

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

View File

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

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} 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;
void tint_symbol() {
m1[0][uniforms.j] = 1.0f;
return;
}
void main() {
tint_symbol();
}

View File

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

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} 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;
void tint_symbol() {
m1[uniforms.i][0] = 1.0f;
return;
}
void main() {
tint_symbol();
}

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} 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;
void tint_symbol() {
m1[uniforms.i][uniforms.j] = 1.0f;
return;
}
void main() {
tint_symbol();
}

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} 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;
void tint_symbol() {
m1[0][uniforms.j] = 1.0f;
return;
}
void main() {
tint_symbol();
}

View File

@ -10,15 +10,15 @@ layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} 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;
void tint_symbol() {
m1[uniforms.i] = vec4(1.0f);
return;
}
void main() {
tint_symbol();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,6 +11,7 @@ int f(int x) {
struct tint_symbol_2 {
ivec3 x;
};
struct tint_symbol_3 {
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 = 2) out int value;
void main() {
tint_symbol_2 inputs;
inputs.x = x;
@ -42,4 +44,3 @@ void main() {
value = outputs.value;
}

View File

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

View File

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

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