GLSL: move entry point handling to CanonicalizeEntryPointIO transform.

Move builtin_to_string() and builtin_type() to
the CanonicalizeEntryPointIO transform. Use the former to
rename entry point IO variables to the gl_ names, and the latter
to cast values to the correct type.

Change-Id: Iddfad574ddd660ff1bfd89a399a001b967b6b67e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78380
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2022-01-28 22:36:58 +00:00 committed by Tint LUCI CQ
parent f34038b1a0
commit 0b39270e01
1735 changed files with 9397 additions and 30642 deletions

View File

@ -130,11 +130,14 @@ struct CanonicalizeEntryPointIO::State {
/// Clones the shader IO decorations from `src`. /// Clones the shader IO decorations from `src`.
/// @param src the decorations to clone /// @param src the decorations to clone
/// @param do_interpolate whether to clone InterpolateDecoration
/// @return the cloned decorations /// @return the cloned decorations
ast::DecorationList CloneShaderIOAttributes(const ast::DecorationList& src) { ast::DecorationList CloneShaderIOAttributes(const ast::DecorationList& src,
bool do_interpolate) {
ast::DecorationList new_decorations; ast::DecorationList new_decorations;
for (auto* deco : src) { for (auto* deco : src) {
if (IsShaderIODecoration(deco)) { if (IsShaderIODecoration(deco) &&
(do_interpolate || !deco->Is<ast::InterpolateDecoration>())) {
new_decorations.push_back(ctx.Clone(deco)); new_decorations.push_back(ctx.Clone(deco));
} }
} }
@ -159,7 +162,8 @@ struct CanonicalizeEntryPointIO::State {
const sem::Type* type, const sem::Type* type,
ast::DecorationList attributes) { ast::DecorationList attributes) {
auto* ast_type = CreateASTTypeFor(ctx, type); auto* ast_type = CreateASTTypeFor(ctx, type);
if (cfg.shader_style == ShaderStyle::kSpirv) { if (cfg.shader_style == ShaderStyle::kSpirv ||
cfg.shader_style == ShaderStyle::kGlsl) {
// Vulkan requires that integer user-defined fragment inputs are // Vulkan requires that integer user-defined fragment inputs are
// always decorated with `Flat`. // always decorated with `Flat`.
// TODO(crbug.com/tint/1224): Remove this once a flat interpolation // TODO(crbug.com/tint/1224): Remove this once a flat interpolation
@ -176,8 +180,15 @@ struct CanonicalizeEntryPointIO::State {
attributes.push_back( attributes.push_back(
ctx.dst->Disable(ast::DisabledValidation::kIgnoreStorageClass)); ctx.dst->Disable(ast::DisabledValidation::kIgnoreStorageClass));
// Create the global variable and use its value for the shader input. // In GLSL, if it's a builtin, override the name with the
// corresponding gl_ builtin name
auto* builtin = ast::GetDecoration<ast::BuiltinDecoration>(attributes);
if (cfg.shader_style == ShaderStyle::kGlsl && builtin) {
name = GLSLBuiltinToString(builtin->builtin, func_ast->PipelineStage());
}
auto symbol = ctx.dst->Symbols().New(name); auto symbol = ctx.dst->Symbols().New(name);
// Create the global variable and use its value for the shader input.
const ast::Expression* value = ctx.dst->Expr(symbol); const ast::Expression* value = ctx.dst->Expr(symbol);
if (HasSampleMask(attributes)) { if (HasSampleMask(attributes)) {
// Vulkan requires the type of a SampleMask builtin to be an array. // Vulkan requires the type of a SampleMask builtin to be an array.
@ -185,6 +196,13 @@ struct CanonicalizeEntryPointIO::State {
ast_type = ctx.dst->ty.array(ast_type, 1); ast_type = ctx.dst->ty.array(ast_type, 1);
value = ctx.dst->IndexAccessor(value, 0); value = ctx.dst->IndexAccessor(value, 0);
} }
// In GLSL, if the type doesn't match the type of the builtin,
// insert a bitcast
if (cfg.shader_style == ShaderStyle::kGlsl && builtin &&
GLSLBuiltinNeedsBitcast(builtin->builtin)) {
value = ctx.dst->Bitcast(CreateASTTypeFor(ctx, type), value);
}
ctx.dst->Global(symbol, ast_type, ast::StorageClass::kInput, ctx.dst->Global(symbol, ast_type, ast::StorageClass::kInput,
std::move(attributes)); std::move(attributes));
return value; return value;
@ -231,6 +249,13 @@ struct CanonicalizeEntryPointIO::State {
ast::InterpolationType::kFlat, ast::InterpolationSampling::kNone)); ast::InterpolationType::kFlat, ast::InterpolationSampling::kNone));
} }
// In GLSL, if it's a builtin, override the name with the
// corresponding gl_ builtin name
auto* builtin = ast::GetDecoration<ast::BuiltinDecoration>(attributes);
if (cfg.shader_style == ShaderStyle::kGlsl && builtin) {
name = GLSLBuiltinToString(builtin->builtin, func_ast->PipelineStage());
}
OutputValue output; OutputValue output;
output.name = name; output.name = name;
output.type = CreateASTTypeFor(ctx, type); output.type = CreateASTTypeFor(ctx, type);
@ -279,7 +304,15 @@ struct CanonicalizeEntryPointIO::State {
auto* member_ast = member->Declaration(); auto* member_ast = member->Declaration();
auto name = ctx.src->Symbols().NameFor(member_ast->symbol); auto name = ctx.src->Symbols().NameFor(member_ast->symbol);
auto attributes = CloneShaderIOAttributes(member_ast->decorations);
// In GLSL, do not add interpolation decorations on vertex input
bool do_interpolate = true;
if (cfg.shader_style == ShaderStyle::kGlsl &&
func_ast->PipelineStage() == ast::PipelineStage::kVertex) {
do_interpolate = false;
}
auto attributes =
CloneShaderIOAttributes(member_ast->decorations, do_interpolate);
auto* input_expr = AddInput(name, member->Type(), std::move(attributes)); auto* input_expr = AddInput(name, member->Type(), std::move(attributes));
inner_struct_values.push_back(input_expr); inner_struct_values.push_back(input_expr);
} }
@ -296,6 +329,12 @@ struct CanonicalizeEntryPointIO::State {
/// @param original_result the result object produced by the original function /// @param original_result the result object produced by the original function
void ProcessReturnType(const sem::Type* inner_ret_type, void ProcessReturnType(const sem::Type* inner_ret_type,
Symbol original_result) { Symbol original_result) {
bool do_interpolate = true;
// In GLSL, do not add interpolation decorations on fragment output
if (cfg.shader_style == ShaderStyle::kGlsl &&
func_ast->PipelineStage() == ast::PipelineStage::kFragment) {
do_interpolate = false;
}
if (auto* str = inner_ret_type->As<sem::Struct>()) { if (auto* str = inner_ret_type->As<sem::Struct>()) {
for (auto* member : str->Members()) { for (auto* member : str->Members()) {
if (member->Type()->Is<sem::Struct>()) { if (member->Type()->Is<sem::Struct>()) {
@ -305,15 +344,16 @@ struct CanonicalizeEntryPointIO::State {
auto* member_ast = member->Declaration(); auto* member_ast = member->Declaration();
auto name = ctx.src->Symbols().NameFor(member_ast->symbol); auto name = ctx.src->Symbols().NameFor(member_ast->symbol);
auto attributes = CloneShaderIOAttributes(member_ast->decorations); auto attributes =
CloneShaderIOAttributes(member_ast->decorations, do_interpolate);
// Extract the original structure member. // Extract the original structure member.
AddOutput(name, member->Type(), std::move(attributes), AddOutput(name, member->Type(), std::move(attributes),
ctx.dst->MemberAccessor(original_result, name)); ctx.dst->MemberAccessor(original_result, name));
} }
} else if (!inner_ret_type->Is<sem::Void>()) { } else if (!inner_ret_type->Is<sem::Void>()) {
auto attributes = auto attributes = CloneShaderIOAttributes(
CloneShaderIOAttributes(func_ast->return_type_decorations); func_ast->return_type_decorations, do_interpolate);
// Propagate the non-struct return value as is. // Propagate the non-struct return value as is.
AddOutput("value", func_sem->ReturnType(), std::move(attributes), AddOutput("value", func_sem->ReturnType(), std::move(attributes),
@ -348,6 +388,15 @@ struct CanonicalizeEntryPointIO::State {
{ctx.dst->Builtin(ast::Builtin::kPointSize)}, ctx.dst->Expr(1.f)); {ctx.dst->Builtin(ast::Builtin::kPointSize)}, ctx.dst->Expr(1.f));
} }
/// Create an expression for gl_Position.[component]
/// @param component the component of gl_Position to access
/// @returns the new expression
const ast::Expression* GLPosition(const char* component) {
Symbol pos = ctx.dst->Symbols().Register("gl_Position");
Symbol c = ctx.dst->Symbols().Register(component);
return ctx.dst->MemberAccessor(ctx.dst->Expr(pos), ctx.dst->Expr(c));
}
/// Create the wrapper function's struct parameter and type objects. /// Create the wrapper function's struct parameter and type objects.
void CreateInputStruct() { void CreateInputStruct() {
// Sort the struct members to satisfy HLSL interfacing matching rules. // Sort the struct members to satisfy HLSL interfacing matching rules.
@ -412,7 +461,7 @@ struct CanonicalizeEntryPointIO::State {
} }
/// Create and assign the wrapper function's output variables. /// Create and assign the wrapper function's output variables.
void CreateSpirvOutputVariables() { void CreateGlobalOutputVariables() {
for (auto& outval : wrapper_output_values) { for (auto& outval : wrapper_output_values) {
// Disable validation for use of the `output` storage class. // Disable validation for use of the `output` storage class.
ast::DecorationList attributes = std::move(outval.attributes); ast::DecorationList attributes = std::move(outval.attributes);
@ -438,10 +487,17 @@ struct CanonicalizeEntryPointIO::State {
// Recreate the original function without entry point attributes and call it. // Recreate the original function without entry point attributes and call it.
/// @returns the inner function call expression /// @returns the inner function call expression
const ast::CallExpression* CallInnerFunction() { const ast::CallExpression* CallInnerFunction() {
// Add a suffix to the function name, as the wrapper function will take the Symbol inner_name;
// original entry point name. if (cfg.shader_style == ShaderStyle::kGlsl) {
// In GLSL, clone the original entry point name, as the wrapper will be
// called "main".
inner_name = ctx.Clone(func_ast->symbol);
} else {
// Add a suffix to the function name, as the wrapper function will take
// the original entry point name.
auto ep_name = ctx.src->Symbols().NameFor(func_ast->symbol); auto ep_name = ctx.src->Symbols().NameFor(func_ast->symbol);
auto inner_name = ctx.dst->Symbols().New(ep_name + "_inner"); inner_name = ctx.dst->Symbols().New(ep_name + "_inner");
}
// Clone everything, dropping the function and return type attributes. // Clone everything, dropping the function and return type attributes.
// The parameter attributes will have already been stripped during // The parameter attributes will have already been stripped during
@ -472,7 +528,7 @@ struct CanonicalizeEntryPointIO::State {
// Exit early if there is no shader IO to handle. // Exit early if there is no shader IO to handle.
if (func_sem->Parameters().size() == 0 && if (func_sem->Parameters().size() == 0 &&
func_sem->ReturnType()->Is<sem::Void>() && !needs_fixed_sample_mask && func_sem->ReturnType()->Is<sem::Void>() && !needs_fixed_sample_mask &&
!needs_vertex_point_size) { !needs_vertex_point_size && cfg.shader_style != ShaderStyle::kGlsl) {
return; return;
} }
@ -526,8 +582,9 @@ struct CanonicalizeEntryPointIO::State {
// Produce the entry point outputs, if necessary. // Produce the entry point outputs, if necessary.
if (!wrapper_output_values.empty()) { if (!wrapper_output_values.empty()) {
if (cfg.shader_style == ShaderStyle::kSpirv) { if (cfg.shader_style == ShaderStyle::kSpirv ||
CreateSpirvOutputVariables(); cfg.shader_style == ShaderStyle::kGlsl) {
CreateGlobalOutputVariables();
} else { } else {
auto* output_struct = CreateOutputStruct(); auto* output_struct = CreateOutputStruct();
wrapper_ret_type = [&, output_struct] { wrapper_ret_type = [&, output_struct] {
@ -536,9 +593,28 @@ struct CanonicalizeEntryPointIO::State {
} }
} }
if (cfg.shader_style == ShaderStyle::kGlsl &&
func_ast->PipelineStage() == ast::PipelineStage::kVertex) {
auto* pos_y = GLPosition("y");
auto* negate_pos_y = ctx.dst->create<ast::UnaryOpExpression>(
ast::UnaryOp::kNegation, GLPosition("y"));
wrapper_body.push_back(ctx.dst->Assign(pos_y, negate_pos_y));
auto* two_z = ctx.dst->Mul(ctx.dst->Expr(2.0f), GLPosition("z"));
auto* fixed_z = ctx.dst->Sub(two_z, GLPosition("w"));
wrapper_body.push_back(ctx.dst->Assign(GLPosition("z"), fixed_z));
}
// Create the wrapper entry point function. // Create the wrapper entry point function.
// Take the name of the original entry point function. // For GLSL, use "main", otherwise take the name of the original
auto name = ctx.Clone(func_ast->symbol); // entry point function.
Symbol name;
if (cfg.shader_style == ShaderStyle::kGlsl) {
name = ctx.dst->Symbols().New("main");
} else {
name = ctx.Clone(func_ast->symbol);
}
auto* wrapper_func = ctx.dst->create<ast::Function>( auto* wrapper_func = ctx.dst->create<ast::Function>(
name, wrapper_ep_parameters, wrapper_ret_type(), name, wrapper_ep_parameters, wrapper_ret_type(),
ctx.dst->Block(wrapper_body), ctx.Clone(func_ast->decorations), ctx.dst->Block(wrapper_body), ctx.Clone(func_ast->decorations),
@ -546,6 +622,65 @@ struct CanonicalizeEntryPointIO::State {
ctx.InsertAfter(ctx.src->AST().GlobalDeclarations(), func_ast, ctx.InsertAfter(ctx.src->AST().GlobalDeclarations(), func_ast,
wrapper_func); wrapper_func);
} }
/// Retrieve the gl_ string corresponding to a builtin.
/// @param builtin the builtin
/// @param stage the current pipeline stage
/// @returns the gl_ string corresponding to that builtin
const char* GLSLBuiltinToString(ast::Builtin builtin,
ast::PipelineStage stage) {
switch (builtin) {
case ast::Builtin::kPosition:
switch (stage) {
case ast::PipelineStage::kVertex:
return "gl_Position";
case ast::PipelineStage::kFragment:
return "gl_FragCoord";
default:
return "";
}
case ast::Builtin::kVertexIndex:
return "gl_VertexID";
case ast::Builtin::kInstanceIndex:
return "gl_InstanceID";
case ast::Builtin::kFrontFacing:
return "gl_FrontFacing";
case ast::Builtin::kFragDepth:
return "gl_FragDepth";
case ast::Builtin::kLocalInvocationId:
return "gl_LocalInvocationID";
case ast::Builtin::kLocalInvocationIndex:
return "gl_LocalInvocationIndex";
case ast::Builtin::kGlobalInvocationId:
return "gl_GlobalInvocationID";
case ast::Builtin::kNumWorkgroups:
return "gl_NumWorkGroups";
case ast::Builtin::kWorkgroupId:
return "gl_WorkGroupID";
case ast::Builtin::kSampleIndex:
return "gl_SampleID";
case ast::Builtin::kSampleMask:
return "gl_SampleMask";
default:
return "";
}
}
/// Check if the GLSL version if a builtin doesn't match the WGSL type
/// @param builtin the WGSL builtin to check
/// @returns true if the GLSL builtin needs to be cast to the WGSL type
bool GLSLBuiltinNeedsBitcast(ast::Builtin builtin) {
switch (builtin) {
case ast::Builtin::kVertexIndex:
case ast::Builtin::kInstanceIndex:
case ast::Builtin::kSampleIndex:
case ast::Builtin::kSampleMask:
// In GLSL, these are i32, not u32.
return true;
default:
return false;
}
}
}; };
void CanonicalizeEntryPointIO::Run(CloneContext& ctx, void CanonicalizeEntryPointIO::Run(CloneContext& ctx,

View File

@ -90,6 +90,8 @@ class CanonicalizeEntryPointIO
enum class ShaderStyle { enum class ShaderStyle {
/// Target SPIR-V (using global variables). /// Target SPIR-V (using global variables).
kSpirv, kSpirv,
/// Target GLSL (using global variables).
kGlsl,
/// Target MSL (using non-struct function parameters for builtins). /// Target MSL (using non-struct function parameters for builtins).
kMsl, kMsl,
/// Target HLSL (using structures for all IO). /// Target HLSL (using structures for all IO).

View File

@ -63,17 +63,13 @@ Output Glsl::Run(const Program* in, const DataMap& inputs) const {
// ZeroInitWorkgroupMemory may inject new builtin parameters. // ZeroInitWorkgroupMemory may inject new builtin parameters.
manager.Add<ZeroInitWorkgroupMemory>(); manager.Add<ZeroInitWorkgroupMemory>();
} }
manager.Add<CanonicalizeEntryPointIO>();
manager.Add<SimplifyPointers>();
// Running SingleEntryPoint before RemovePhonies prevents variables
// referenced only by phonies from being optimized out. Strictly
// speaking, that optimization isn't incorrect, but it prevents some
// tests (e.g., types/texture/*) from producing useful results.
if (cfg && !cfg->entry_point.empty()) { if (cfg && !cfg->entry_point.empty()) {
manager.Add<SingleEntryPoint>(); manager.Add<SingleEntryPoint>();
data.Add<SingleEntryPoint::Config>(cfg->entry_point); data.Add<SingleEntryPoint::Config>(cfg->entry_point);
} }
manager.Add<CanonicalizeEntryPointIO>();
manager.Add<SimplifyPointers>();
manager.Add<RemovePhonies>(); manager.Add<RemovePhonies>();
manager.Add<CombineSamplers>(); manager.Add<CombineSamplers>();
if (auto* binding_info = inputs.Get<CombineSamplers::BindingInfo>()) { if (auto* binding_info = inputs.Get<CombineSamplers::BindingInfo>()) {
@ -100,11 +96,8 @@ Output Glsl::Run(const Program* in, const DataMap& inputs) const {
manager.Add<AddEmptyEntryPoint>(); manager.Add<AddEmptyEntryPoint>();
manager.Add<AddSpirvBlockDecoration>(); manager.Add<AddSpirvBlockDecoration>();
// For now, canonicalize to structs for all IO, as in HLSL.
// TODO(senorblanco): we could skip this by accessing global entry point
// variables directly.
data.Add<CanonicalizeEntryPointIO::Config>( data.Add<CanonicalizeEntryPointIO::Config>(
CanonicalizeEntryPointIO::ShaderStyle::kHlsl); CanonicalizeEntryPointIO::ShaderStyle::kGlsl);
auto out = manager.Run(in, data); auto out = manager.Run(in, data);
if (!out.program.IsValid()) { if (!out.program.IsValid()) {
return out; return out;

View File

@ -1640,6 +1640,9 @@ bool GeneratorImpl::EmitGlobalVariable(const ast::Variable* global) {
return EmitPrivateVariable(sem); return EmitPrivateVariable(sem);
case ast::StorageClass::kWorkgroup: case ast::StorageClass::kWorkgroup:
return EmitWorkgroupVariable(sem); return EmitWorkgroupVariable(sem);
case ast::StorageClass::kInput:
case ast::StorageClass::kOutput:
return EmitIOVariable(sem);
default: default:
break; break;
} }
@ -1757,78 +1760,33 @@ bool GeneratorImpl::EmitWorkgroupVariable(const sem::Variable* var) {
return true; return true;
} }
sem::Type* GeneratorImpl::builtin_type(ast::Builtin builtin) { bool GeneratorImpl::EmitIOVariable(const sem::Variable* var) {
switch (builtin) { auto* decl = var->Declaration();
case ast::Builtin::kPosition: {
auto* f32 = builder_.create<sem::F32>(); // Do not emit builtin (gl_) variables.
return builder_.create<sem::Vector>(f32, 4); if (ast::HasDecoration<ast::BuiltinDecoration>(decl->decorations)) {
return true;
} }
case ast::Builtin::kVertexIndex:
case ast::Builtin::kInstanceIndex: { auto out = line();
return builder_.create<sem::I32>(); EmitDecorations(out, decl->decorations);
EmitInterpolationQualifiers(out, decl->decorations);
auto name = builder_.Symbols().NameFor(decl->symbol);
auto* type = var->Type()->UnwrapRef();
if (!EmitTypeAndName(out, type, var->StorageClass(), var->Access(), name)) {
return false;
} }
case ast::Builtin::kFrontFacing: {
return builder_.create<sem::Bool>(); if (auto* constructor = decl->constructor) {
} out << " = ";
case ast::Builtin::kFragDepth: { if (!EmitExpression(out, constructor)) {
return builder_.create<sem::F32>(); return false;
}
case ast::Builtin::kLocalInvocationId:
case ast::Builtin::kGlobalInvocationId:
case ast::Builtin::kNumWorkgroups:
case ast::Builtin::kWorkgroupId: {
auto* u32 = builder_.create<sem::U32>();
return builder_.create<sem::Vector>(u32, 3);
}
case ast::Builtin::kSampleIndex: {
return builder_.create<sem::I32>();
}
case ast::Builtin::kSampleMask:
default:
return nullptr;
} }
} }
const char* GeneratorImpl::builtin_to_string(ast::Builtin builtin, out << ";";
ast::PipelineStage stage) { return true;
switch (builtin) {
case ast::Builtin::kPosition:
switch (stage) {
case ast::PipelineStage::kVertex:
return "gl_Position";
case ast::PipelineStage::kFragment:
return "gl_FragCoord";
default:
TINT_ICE(Writer, builder_.Diagnostics())
<< "position builtin unexpected in this pipeline stage";
return "";
}
case ast::Builtin::kVertexIndex:
return "gl_VertexID";
case ast::Builtin::kInstanceIndex:
return "gl_InstanceID";
case ast::Builtin::kFrontFacing:
return "gl_FrontFacing";
case ast::Builtin::kFragDepth:
return "gl_FragDepth";
case ast::Builtin::kLocalInvocationId:
return "gl_LocalInvocationID";
case ast::Builtin::kLocalInvocationIndex:
return "gl_LocalInvocationIndex";
case ast::Builtin::kGlobalInvocationId:
return "gl_GlobalInvocationID";
case ast::Builtin::kNumWorkgroups:
return "gl_NumWorkGroups";
case ast::Builtin::kWorkgroupId:
return "gl_WorkGroupID";
case ast::Builtin::kSampleIndex:
return "gl_SampleID";
case ast::Builtin::kSampleMask:
// FIXME: is this always available?
return "gl_SampleMask";
default:
return "";
}
} }
void GeneratorImpl::EmitInterpolationQualifiers( void GeneratorImpl::EmitInterpolationQualifiers(
@ -1956,144 +1914,6 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
line() << "}"; 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;
}
if (!EmitDecorations(out, decorations)) {
return false;
}
// GLSL does not support interpolation qualifiers on vertex inputs
if (func->PipelineStage() != ast::PipelineStage::kVertex) {
EmitInterpolationQualifiers(out, decorations);
}
if (!EmitTypeAndName(
out, member->Type(), ast::StorageClass::kInput,
ast::Access::kReadWrite,
builder_.Symbols().NameFor(member->Declaration()->symbol))) {
return false;
}
out << ";";
}
}
// Declare entry point output variables
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;
}
if (!EmitDecorations(out, decorations)) {
return false;
}
// GLSL does not support interpolation qualifiers on fragment outputs
if (func->PipelineStage() != ast::PipelineStage::kFragment) {
EmitInterpolationQualifiers(out, decorations);
}
if (!EmitTypeAndName(
out, member->Type(), ast::StorageClass::kOutput,
ast::Access::kReadWrite,
builder_.Symbols().NameFor(member->Declaration()->symbol))) {
return false;
}
out << ";";
}
}
line();
// Create a main() function which calls the entry point.
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;
}
out << ";";
}
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;";
}
}
line() << "}";
line();
return true; return true;
} }

View File

@ -292,6 +292,11 @@ class GeneratorImpl : public TextGenerator {
/// @returns true on success /// @returns true on success
bool EmitWorkgroupVariable(const sem::Variable* var); bool EmitWorkgroupVariable(const sem::Variable* var);
/// Handles emitting a global variable with the input or output storage class
/// @param var the global variable
/// @returns true on success
bool EmitIOVariable(const sem::Variable* var);
/// Handles emitting interpolation qualifiers /// Handles emitting interpolation qualifiers
/// @param out the output of the expression stream /// @param out the output of the expression stream
/// @param decos the decorations /// @param decos the decorations

View File

@ -103,11 +103,6 @@ precision mediump float;
void func() { void func() {
return; return;
} }
void main() {
func();
}
)"); )");
} }
@ -142,35 +137,17 @@ TEST_F(GlslGeneratorImplTest_Function,
EXPECT_EQ(gen.result(), R"(#version 310 es EXPECT_EQ(gen.result(), R"(#version 310 es
precision mediump float; precision mediump float;
struct tint_symbol_1 { layout(location = 0) in float foo_1;
float foo; layout(location = 1) out float value;
}; float frag_main(float foo) {
struct tint_symbol_2 {
float value;
};
float frag_main_inner(float foo) {
return foo; return foo;
} }
tint_symbol_2 frag_main(tint_symbol_1 tint_symbol) {
float inner_result = frag_main_inner(tint_symbol.foo);
tint_symbol_2 wrapper_result = tint_symbol_2(0.0f);
wrapper_result.value = inner_result;
return wrapper_result;
}
layout(location = 0) in float foo;
layout(location = 1) out float value;
void main() { void main() {
tint_symbol_1 inputs; float inner_result = frag_main(foo_1);
inputs.foo = foo; value = inner_result;
tint_symbol_2 outputs; return;
outputs = frag_main(inputs);
value = outputs.value;
} }
)"); )");
} }
@ -192,35 +169,15 @@ TEST_F(GlslGeneratorImplTest_Function,
EXPECT_EQ(gen.result(), R"(#version 310 es EXPECT_EQ(gen.result(), R"(#version 310 es
precision mediump float; precision mediump float;
struct tint_symbol_1 { float frag_main(vec4 coord) {
vec4 coord;
};
struct tint_symbol_2 {
float value;
};
float frag_main_inner(vec4 coord) {
return coord.x; return coord.x;
} }
tint_symbol_2 frag_main(tint_symbol_1 tint_symbol) {
float inner_result = frag_main_inner(tint_symbol.coord);
tint_symbol_2 wrapper_result = tint_symbol_2(0.0f);
wrapper_result.value = inner_result;
return wrapper_result;
}
void main() { void main() {
tint_symbol_1 inputs; float inner_result = frag_main(gl_FragCoord);
inputs.coord = gl_FragCoord; gl_FragDepth = inner_result;
tint_symbol_2 outputs; return;
outputs = frag_main(inputs);
gl_FragDepth = outputs.value;
} }
)"); )");
} }
@ -266,74 +223,41 @@ TEST_F(GlslGeneratorImplTest_Function,
EXPECT_EQ(gen.result(), R"(#version 310 es EXPECT_EQ(gen.result(), R"(#version 310 es
precision mediump float; precision mediump float;
layout(location = 1) out float col1_1;
layout(location = 2) out float col2_1;
layout(location = 1) in float col1_2;
layout(location = 2) in float col2_2;
struct Interface { struct Interface {
vec4 pos; vec4 pos;
float col1; float col1;
float col2; float col2;
}; };
struct tint_symbol { Interface vert_main() {
float col1; Interface tint_symbol = Interface(vec4(0.0f, 0.0f, 0.0f, 0.0f), 0.5f, 0.25f);
float col2; return tint_symbol;
vec4 pos;
};
Interface vert_main_inner() {
Interface tint_symbol_3 = Interface(vec4(0.0f, 0.0f, 0.0f, 0.0f), 0.5f, 0.25f);
return tint_symbol_3;
} }
tint_symbol vert_main() {
Interface inner_result = vert_main_inner();
tint_symbol wrapper_result = tint_symbol(0.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.pos = inner_result.pos;
wrapper_result.col1 = inner_result.col1;
wrapper_result.col2 = inner_result.col2;
return wrapper_result;
}
layout(location = 1) out float col1;
layout(location = 2) out float col2;
void main() { void main() {
tint_symbol outputs; Interface inner_result = vert_main();
outputs = vert_main(); gl_Position = inner_result.pos;
col1 = outputs.col1; col1_1 = inner_result.col1;
col2 = outputs.col2; col2_1 = inner_result.col2;
gl_Position = outputs.pos; gl_Position.y = -(gl_Position.y);
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w; gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
gl_Position.y = -gl_Position.y; return;
} }
void frag_main(Interface inputs) {
struct tint_symbol_2 {
float col1;
float col2;
vec4 pos;
};
void frag_main_inner(Interface inputs) {
float r = inputs.col1; float r = inputs.col1;
float g = inputs.col2; float g = inputs.col2;
vec4 p = inputs.pos; vec4 p = inputs.pos;
} }
void frag_main(tint_symbol_2 tint_symbol_1) { void main_1() {
Interface tint_symbol_4 = Interface(tint_symbol_1.pos, tint_symbol_1.col1, tint_symbol_1.col2); Interface tint_symbol_1 = Interface(gl_FragCoord, col1_2, col2_2);
frag_main_inner(tint_symbol_4); frag_main(tint_symbol_1);
return; return;
} }
layout(location = 1) in float col1;
layout(location = 2) in float col2;
void main() {
tint_symbol_2 inputs;
inputs.col1 = col1;
inputs.col2 = col2;
inputs.pos = gl_FragCoord;
frag_main(inputs);
}
)"); )");
} }
@ -459,11 +383,6 @@ void frag_main() {
float v = sub_func(1.0f); float v = sub_func(1.0f);
return; return;
} }
void main() {
frag_main();
}
)"); )");
} }
@ -508,11 +427,6 @@ void frag_main() {
float v = uniforms.coord.x; float v = uniforms.coord.x;
return; return;
} }
void main() {
frag_main();
}
)"); )");
} }
@ -566,8 +480,8 @@ void frag_main() {
void main() { void main() {
frag_main(); frag_main();
return;
} }
)"); )");
} }
@ -621,8 +535,8 @@ void frag_main() {
void main() { void main() {
frag_main(); frag_main();
return;
} }
)"); )");
} }
@ -672,8 +586,8 @@ void frag_main() {
void main() { void main() {
frag_main(); frag_main();
return;
} }
)"); )");
} }
@ -724,8 +638,8 @@ void frag_main() {
void main() { void main() {
frag_main(); frag_main();
return;
} }
)"); )");
} }
@ -778,11 +692,6 @@ void frag_main() {
float v = sub_func(1.0f); float v = sub_func(1.0f);
return; return;
} }
void main() {
frag_main();
}
)"); )");
} }
@ -839,8 +748,8 @@ void frag_main() {
void main() { void main() {
frag_main(); frag_main();
return;
} }
)"); )");
} }
@ -858,13 +767,12 @@ TEST_F(GlslGeneratorImplTest_Function,
precision mediump float; precision mediump float;
void tint_symbol() { void tint_symbol() {
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"); )");
} }
@ -885,11 +793,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
return; return;
} }
void main() {
main();
}
)"); )");
} }
@ -911,11 +814,6 @@ layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in;
void main() { void main() {
return; return;
} }
void main() {
main();
}
)"); )");
} }
@ -943,11 +841,6 @@ layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in;
void main() { void main() {
return; return;
} }
void main() {
main();
}
)"); )");
} }
@ -984,11 +877,6 @@ layout(local_size_x = WGSL_SPEC_CONSTANT_7, local_size_y = WGSL_SPEC_CONSTANT_8,
void main() { void main() {
return; return;
} }
void main() {
main();
}
)"); )");
} }
@ -1096,26 +984,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;
void a() { void a() {
float v = data.d; float v = data.d;
return; return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
a(); a();
return;
} }
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() { layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main_1() {
b(); b();
return;
} }
)"); )");
} }

View File

@ -399,17 +399,16 @@ float tint_degrees(float param_0) {
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
float val = 0.0f; float val = 0.0f;
float tint_symbol = tint_degrees(val); float tint_symbol = tint_degrees(val);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }
@ -429,17 +428,16 @@ vec3 tint_degrees(vec3 param_0) {
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
vec3 val = vec3(0.0f, 0.0f, 0.0f); vec3 val = vec3(0.0f, 0.0f, 0.0f);
vec3 tint_symbol = tint_degrees(val); vec3 tint_symbol = tint_degrees(val);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }
@ -459,17 +457,16 @@ float tint_radians(float param_0) {
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
float val = 0.0f; float val = 0.0f;
float tint_symbol = tint_radians(val); float tint_symbol = tint_radians(val);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }
@ -489,17 +486,16 @@ vec3 tint_radians(vec3 param_0) {
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void test_function() { void test_function() {
vec3 val = vec3(0.0f, 0.0f, 0.0f); vec3 val = vec3(0.0f, 0.0f, 0.0f);
vec3 tint_symbol = tint_radians(val); vec3 tint_symbol = tint_radians(val);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }
@ -736,16 +732,15 @@ 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;
void test_function() { void test_function() {
tint_int_dot(v, v); tint_int_dot(v, v);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }
@ -764,16 +759,15 @@ 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;
void test_function() { void test_function() {
tint_int_dot(v, v); tint_int_dot(v, v);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }

View File

@ -140,16 +140,15 @@ 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;
void test_function() { void test_function() {
float expr = str.mem; float expr = str.mem;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
test_function(); test_function();
return;
} }
)"); )");
} }
@ -306,13 +305,12 @@ layout(binding = 0) buffer Data_1 {
} 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;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -355,13 +353,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
float x = data.a[2][1]; float x = data.a[2][1];
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -402,13 +399,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
int x = data.a[2]; int x = data.a[2];
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -450,13 +446,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
int x = data.a[((2 + 4) - 3)]; int x = data.a[((2 + 4) - 3)];
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -495,13 +490,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
data.a[2] = 2; data.a[2] = 2;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -554,13 +548,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
vec3 x = data.c[2].b; vec3 x = data.c[2].b;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -616,13 +609,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
vec2 x = data.c[2].b.xy; vec2 x = data.c[2].b.xy;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -678,13 +670,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
float x = data.c[2].b.g; float x = data.c[2].b.g;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -740,13 +731,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
float x = data.c[2].b[1]; float x = data.c[2].b[1];
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -798,13 +788,12 @@ layout(binding = 0) buffer Data_1 {
} 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;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }
@ -860,13 +849,12 @@ layout(binding = 0) buffer Data_1 {
} data; } data;
void tint_symbol() { void tint_symbol() {
data.c[2].b.y = 1.0f; data.c[2].b.y = 1.0f;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(gen.result(), expected); EXPECT_EQ(gen.result(), expected);
} }

View File

@ -59,13 +59,12 @@ void a_func() {
b.GetDimensions(tint_symbol_1); b.GetDimensions(tint_symbol_1);
uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
uint len = tint_symbol_2; uint len = tint_symbol_2;
return;
} }
void main() { void main() {
a_func(); a_func();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -109,13 +108,12 @@ void a_func() {
b.GetDimensions(tint_symbol_1); b.GetDimensions(tint_symbol_1);
uint tint_symbol_2 = ((tint_symbol_1 - 4u) / 4u); uint tint_symbol_2 = ((tint_symbol_1 - 4u) / 4u);
uint len = tint_symbol_2; uint len = tint_symbol_2;
return;
} }
void main() { void main() {
a_func(); a_func();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
@ -160,13 +158,12 @@ void a_func() {
b.GetDimensions(tint_symbol_1); b.GetDimensions(tint_symbol_1);
uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
uint len = tint_symbol_2; uint len = tint_symbol_2;
return;
} }
void main() { void main() {
a_func(); a_func();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
@ -196,13 +193,12 @@ precision mediump float;
void tint_symbol() { void tint_symbol() {
int tint_symbol_1[4] = int[4](1, 2, 3, 4); int tint_symbol_1[4] = int[4](1, 2, 3, 4);
int pos = tint_symbol_1[3]; int pos = tint_symbol_1[3];
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -243,13 +239,12 @@ struct S {
void tint_symbol() { void tint_symbol() {
S tint_symbol_1 = S(1, vec3(2.0f, 3.0f, 4.0f), 4); S tint_symbol_1 = S(1, vec3(2.0f, 3.0f, 4.0f), 4);
vec3 pos = tint_symbol_1.b; vec3 pos = tint_symbol_1.b;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -284,13 +279,12 @@ precision mediump float;
void tint_symbol() { void tint_symbol() {
int v = 0; int v = 0;
int x = v; int x = v;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }
@ -337,13 +331,12 @@ precision mediump float;
void tint_symbol() { void tint_symbol() {
mat4 a[4] = mat4[4](mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)); mat4 a[4] = mat4[4](mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f), mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
vec4 v = a[3][2]; vec4 v = a[3][2];
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
)"; )";
EXPECT_EQ(expect, got); EXPECT_EQ(expect, got);
} }

View File

@ -37,41 +37,6 @@ void my_func() {
)"); )");
} }
struct GlslBuiltinData {
ast::Builtin builtin;
const char* attribute_name;
};
inline std::ostream& operator<<(std::ostream& out, GlslBuiltinData data) {
out << data.builtin;
return out;
}
using GlslBuiltinConversionTest = TestParamHelper<GlslBuiltinData>;
TEST_P(GlslBuiltinConversionTest, Emit) {
auto params = GetParam();
GeneratorImpl& gen = Build();
EXPECT_EQ(gen.builtin_to_string(params.builtin, ast::PipelineStage::kVertex),
std::string(params.attribute_name));
}
INSTANTIATE_TEST_SUITE_P(
GlslGeneratorImplTest,
GlslBuiltinConversionTest,
testing::Values(
GlslBuiltinData{ast::Builtin::kPosition, "gl_Position"},
GlslBuiltinData{ast::Builtin::kVertexIndex, "gl_VertexID"},
GlslBuiltinData{ast::Builtin::kInstanceIndex, "gl_InstanceID"},
GlslBuiltinData{ast::Builtin::kFrontFacing, "gl_FrontFacing"},
GlslBuiltinData{ast::Builtin::kFragDepth, "gl_FragDepth"},
GlslBuiltinData{ast::Builtin::kLocalInvocationId,
"gl_LocalInvocationID"},
GlslBuiltinData{ast::Builtin::kLocalInvocationIndex,
"gl_LocalInvocationIndex"},
GlslBuiltinData{ast::Builtin::kGlobalInvocationId,
"gl_GlobalInvocationID"},
GlslBuiltinData{ast::Builtin::kWorkgroupId, "gl_WorkGroupID"},
GlslBuiltinData{ast::Builtin::kSampleIndex, "gl_SampleID"},
GlslBuiltinData{ast::Builtin::kSampleMask, "gl_SampleMask"}));
} // namespace } // namespace
} // namespace glsl } // namespace glsl
} // namespace writer } // namespace writer

View File

@ -6,13 +6,12 @@ void main_1() {
return; return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
main_1(); main_1();
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,15 +1,14 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
mat3 m = mat3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f)); mat3 m = mat3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f));
vec3 v = m[1]; vec3 v = m[1];
float f = v[1]; float f = v[1];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -8,13 +8,12 @@ void main_1() {
return; return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
main_1(); main_1();
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,16 +1,15 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec3 v = vec3(1.0f, 2.0f, 3.0f); vec3 v = vec3(1.0f, 2.0f, 3.0f);
float scalar = v.y; float scalar = v.y;
vec2 swizzle2 = v.xz; vec2 swizzle2 = v.xz;
vec3 swizzle3 = v.xzy; vec3 swizzle3 = v.xzy;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -8,13 +8,12 @@ void main_1() {
return; return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
main_1(); main_1();
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,15 +1,14 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
mat3 m = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); mat3 m = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
vec3 v = m[1]; vec3 v = m[1];
float f = v[1]; float f = v[1];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -11,13 +11,12 @@ void main_1() {
return; return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
main_1(); main_1();
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,16 +1,15 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec3 v = vec3(0.0f, 0.0f, 0.0f); vec3 v = vec3(0.0f, 0.0f, 0.0f);
float scalar = v.y; float scalar = v.y;
vec2 swizzle2 = v.xz; vec2 swizzle2 = v.xz;
vec3 swizzle3 = v.xzy; vec3 swizzle3 = v.xzy;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -5,11 +5,6 @@ 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() {
unused_entry_point();
}
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };

View File

@ -5,11 +5,6 @@ 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() {
unused_entry_point();
}
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };

View File

@ -5,11 +5,6 @@ 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() {
unused_entry_point();
}
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };

View File

@ -5,11 +5,6 @@ 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() {
unused_entry_point();
}
struct S { struct S {
int arr[4]; int arr[4];
}; };

View File

@ -5,11 +5,6 @@ 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() {
unused_entry_point();
}
struct S { struct S {
ivec4 arr[4]; ivec4 arr[4];
}; };

View File

@ -13,7 +13,6 @@ float f3(float a[2][3][4]) {
return a[1][2][3]; return a[1][2][3];
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
float a1[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f); float a1[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
float a2[3][4] = float[3][4](float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f)); float a2[3][4] = float[3][4](float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f));
@ -21,10 +20,10 @@ void tint_symbol() {
float v1 = f1(a1); float v1 = f1(a1);
float v2 = f2(a2); float v2 = f2(a2);
float v3 = f3(a3); float v3 = f3(a3);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -16,15 +16,14 @@ float[2][3][4] f3() {
return tint_symbol_3; return tint_symbol_3;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
float a1[4] = f1(); float a1[4] = f1();
float a2[3][4] = f2(); float a2[3][4] = f2();
float a3[2][3][4] = f3(); float a3[2][3][4] = f3();
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -10,10 +10,9 @@ void tint_symbol() {
float unsigned_constant[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f); float unsigned_constant[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
signed_literal = unsigned_constant; signed_literal = unsigned_constant;
signed_constant = unsigned_literal; signed_constant = unsigned_literal;
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,7 +1,6 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
int x = 42; int x = 42;
int empty[4] = int[4](0, 0, 0, 0); int empty[4] = int[4](0, 0, 0, 0);
@ -36,10 +35,10 @@ void tint_symbol() {
int tint_symbol_19[4] = int[4](1, x, (x + 1), nonempty[3]); int tint_symbol_19[4] = int[4](1, x, (x + 1), nonempty[3]);
int tint_symbol_20[2][4] = int[2][4](tint_symbol_19, nested_nonempty[1][2]); int tint_symbol_20[2][4] = int[2][4](tint_symbol_19, nested_nonempty[1][2]);
int subexpr_nested_nonempty_with_expr[4] = tint_symbol_20[1]; int subexpr_nested_nonempty_with_expr[4] = tint_symbol_20[1];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -3,6 +3,9 @@ SKIP: FAILED
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec4 position_1;
layout(location = 1) in vec4 color_1;
layout(location = 0) out vec4 v_color_1;
struct Time { struct Time {
float value; float value;
}; };
@ -32,17 +35,7 @@ struct VertexOutput {
vec4 v_color; vec4 v_color;
}; };
struct tint_symbol_2 { VertexOutput vert_main(vec4 position, vec4 color) {
vec4 position;
vec4 color;
};
struct tint_symbol_3 {
vec4 v_color;
vec4 Position;
};
VertexOutput vert_main_inner(vec4 position, vec4 color) {
float fade = ((uniforms.scalarOffset + ((time.value * uniforms.scalar) / 10.0f)) % 1.0f); float fade = ((uniforms.scalarOffset + ((time.value * uniforms.scalar) / 10.0f)) % 1.0f);
if ((fade < 0.5f)) { if ((fade < 0.5f)) {
fade = (fade * 2.0f); fade = (fade * 2.0f);
@ -62,41 +55,17 @@ VertexOutput vert_main_inner(vec4 position, vec4 color) {
return tint_symbol; return tint_symbol;
} }
struct tint_symbol_5 {
vec4 v_color;
};
struct tint_symbol_6 {
vec4 value;
};
tint_symbol_3 vert_main(tint_symbol_2 tint_symbol_1) {
VertexOutput inner_result = vert_main_inner(tint_symbol_1.position, tint_symbol_1.color);
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.Position = inner_result.Position;
wrapper_result.v_color = inner_result.v_color;
return wrapper_result;
}
layout(location = 0) in vec4 position;
layout(location = 1) in vec4 color;
layout(location = 0) out vec4 v_color;
void main() { void main() {
tint_symbol_2 inputs; VertexOutput inner_result = vert_main(position_1, color_1);
inputs.position = position; gl_Position = inner_result.Position;
inputs.color = color; v_color_1 = inner_result.v_color;
tint_symbol_3 outputs; gl_Position.y = -(gl_Position.y);
outputs = vert_main(inputs); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
v_color = outputs.v_color; return;
gl_Position = outputs.Position;
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
gl_Position.y = -gl_Position.y;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
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:37: '%' : 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: 0:37: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.
@ -104,6 +73,8 @@ ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec4 v_color_1;
layout(location = 0) out vec4 value_1;
struct Time { struct Time {
float value; float value;
}; };
@ -121,42 +92,12 @@ struct VertexOutput {
vec4 v_color; vec4 v_color;
}; };
struct tint_symbol_2 { vec4 frag_main(vec4 v_color) {
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;
};
vec4 frag_main_inner(vec4 v_color) {
return v_color; return v_color;
} }
tint_symbol_6 frag_main(tint_symbol_5 tint_symbol_4) {
vec4 inner_result_1 = frag_main_inner(tint_symbol_4.v_color);
tint_symbol_6 wrapper_result_1 = tint_symbol_6(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result_1.value = inner_result_1;
return wrapper_result_1;
}
layout(location = 0) in vec4 v_color;
layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_5 inputs; vec4 inner_result = frag_main(v_color_1);
inputs.v_color = v_color; value_1 = inner_result;
tint_symbol_6 outputs; return;
outputs = frag_main(inputs);
value = outputs.value;
} }

View File

@ -3,6 +3,11 @@ SKIP: FAILED
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec3 position_1;
layout(location = 1) in vec4 color_1;
layout(location = 2) in vec2 quad_pos_1;
layout(location = 0) out vec4 color_2;
layout(location = 1) out vec2 quad_pos_2;
struct RenderParams { struct RenderParams {
mat4 modelViewProjectionMatrix; mat4 modelViewProjectionMatrix;
vec3 right; vec3 right;
@ -27,38 +32,6 @@ struct VertexOutput {
vec2 quad_pos; 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;
};
VertexOutput vs_main_inner(VertexInput tint_symbol) {
vec3 quad_pos = (mat2x3(render_params.right, render_params.up) * tint_symbol.quad_pos);
vec3 position = (tint_symbol.position + (quad_pos * 0.01f));
VertexOutput tint_symbol_1 = VertexOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec2(0.0f, 0.0f));
tint_symbol_1.position = (render_params.modelViewProjectionMatrix * vec4(position, 1.0f));
tint_symbol_1.color = tint_symbol.color;
tint_symbol_1.quad_pos = tint_symbol.quad_pos;
return tint_symbol_1;
}
struct tint_symbol_7 {
vec4 color;
vec2 quad_pos;
vec4 position;
};
struct tint_symbol_8 {
vec4 value;
};
struct SimulationParams { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
@ -71,61 +44,36 @@ struct Particle {
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 {
uvec3 GlobalInvocationID;
};
struct UBO { struct UBO {
uint width; uint width;
}; };
struct tint_symbol_12 { VertexOutput vs_main(VertexInput tint_symbol) {
uvec3 coord; vec3 quad_pos = (mat2x3(render_params.right, render_params.up) * tint_symbol.quad_pos);
}; vec3 position = (tint_symbol.position + (quad_pos * 0.01f));
VertexOutput tint_symbol_1 = VertexOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec2(0.0f, 0.0f));
struct tint_symbol_14 { tint_symbol_1.position = (render_params.modelViewProjectionMatrix * vec4(position, 1.0f));
uvec3 coord; tint_symbol_1.color = tint_symbol.color;
}; tint_symbol_1.quad_pos = tint_symbol.quad_pos;
return tint_symbol_1;
tint_symbol_5 vs_main(tint_symbol_4 tint_symbol_3) {
VertexInput tint_symbol_15 = VertexInput(tint_symbol_3.position, tint_symbol_3.color, tint_symbol_3.quad_pos);
VertexOutput inner_result = vs_main_inner(tint_symbol_15);
tint_symbol_5 wrapper_result = tint_symbol_5(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.position = inner_result.position;
wrapper_result.color = inner_result.color;
wrapper_result.quad_pos = inner_result.quad_pos;
return wrapper_result;
} }
layout(location = 0) in vec3 position;
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() { void main() {
tint_symbol_4 inputs; VertexInput tint_symbol_3 = VertexInput(position_1, color_1, quad_pos_1);
inputs.position = position; VertexOutput inner_result = vs_main(tint_symbol_3);
inputs.color = color; gl_Position = inner_result.position;
inputs.quad_pos = quad_pos; color_2 = inner_result.color;
tint_symbol_5 outputs; quad_pos_2 = inner_result.quad_pos;
outputs = vs_main(inputs); gl_Position.y = -(gl_Position.y);
color = outputs.color; gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
quad_pos = outputs.quad_pos; return;
gl_Position = outputs.position;
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
gl_Position.y = -gl_Position.y;
} }
Error parsing GLSL shader:
ERROR: 0:100: 'color' : redefinition
ERROR: 1 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec4 color_1;
layout(location = 1) in vec2 quad_pos_1;
layout(location = 0) out vec4 value_1;
struct RenderParams { struct RenderParams {
mat4 modelViewProjectionMatrix; mat4 modelViewProjectionMatrix;
vec3 right; vec3 right;
@ -144,34 +92,6 @@ struct VertexOutput {
vec2 quad_pos; 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;
};
vec4 fs_main_inner(VertexOutput tint_symbol) {
vec4 color = tint_symbol.color;
color.a = (color.a * max((1.0f - length(tint_symbol.quad_pos)), 0.0f));
return color;
}
struct SimulationParams { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
@ -184,44 +104,22 @@ struct Particle {
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 {
uvec3 GlobalInvocationID;
};
struct UBO { struct UBO {
uint width; uint width;
}; };
struct tint_symbol_12 { vec4 fs_main(VertexOutput tint_symbol) {
uvec3 coord; vec4 color = tint_symbol.color;
}; color.a = (color.a * max((1.0f - length(tint_symbol.quad_pos)), 0.0f));
return color;
struct tint_symbol_14 {
uvec3 coord;
};
tint_symbol_8 fs_main(tint_symbol_7 tint_symbol_6) {
VertexOutput tint_symbol_15 = VertexOutput(tint_symbol_6.position, tint_symbol_6.color, tint_symbol_6.quad_pos);
vec4 inner_result_1 = fs_main_inner(tint_symbol_15);
tint_symbol_8 wrapper_result_1 = tint_symbol_8(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result_1.value = inner_result_1;
return wrapper_result_1;
} }
layout(location = 0) in vec4 color;
layout(location = 1) in vec2 quad_pos;
layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_7 inputs; VertexOutput tint_symbol_3 = VertexOutput(gl_FragCoord, color_1, quad_pos_1);
inputs.color = color; vec4 inner_result = fs_main(tint_symbol_3);
inputs.quad_pos = quad_pos; value_1 = inner_result;
inputs.position = gl_FragCoord; return;
tint_symbol_8 outputs;
outputs = fs_main(inputs);
value = outputs.value;
} }
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -250,28 +148,6 @@ struct VertexOutput {
vec2 quad_pos; 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 { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
@ -292,12 +168,12 @@ layout(binding = 0) uniform SimulationParams_1 {
layout(binding = 1) buffer Particles_1 { layout(binding = 1) buffer Particles_1 {
Particle particles[]; Particle particles[];
} data; } data;
struct tint_symbol_10 { struct UBO {
uvec3 GlobalInvocationID; uint width;
}; };
uniform highp sampler2D tint_symbol_2_1; uniform highp sampler2D tint_symbol_2_1;
void simulate_inner(uvec3 GlobalInvocationID) { void simulate(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;
Particle particle = data.particles[idx]; Particle particle = data.particles[idx];
@ -328,31 +204,11 @@ void simulate_inner(uvec3 GlobalInvocationID) {
data.particles[idx] = particle; data.particles[idx] = particle;
} }
struct UBO {
uint width;
};
struct tint_symbol_12 {
uvec3 coord;
};
struct tint_symbol_14 {
uvec3 coord;
};
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void simulate(tint_symbol_10 tint_symbol_9) { void main() {
simulate_inner(tint_symbol_9.GlobalInvocationID); simulate(gl_GlobalInvocationID);
return; return;
} }
void main() {
tint_symbol_10 inputs;
inputs.GlobalInvocationID = gl_GlobalInvocationID;
simulate(inputs);
}
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:6: 'frac' : no matching overloaded function found ERROR: 0:6: 'frac' : no matching overloaded function found
ERROR: 0:6: '' : compilation terminated ERROR: 0:6: '' : compilation terminated
@ -381,28 +237,6 @@ struct VertexOutput {
vec2 quad_pos; 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 { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
@ -415,10 +249,6 @@ struct Particle {
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 {
uvec3 GlobalInvocationID;
};
struct UBO { struct UBO {
uint width; uint width;
}; };
@ -433,33 +263,17 @@ layout(binding = 4) buffer Buffer_1 {
layout(binding = 5) buffer Buffer_2 { layout(binding = 5) buffer Buffer_2 {
float weights[]; float weights[];
} buf_out; } buf_out;
struct tint_symbol_12 {
uvec3 coord;
};
uniform highp sampler2D tex_in_1; uniform highp sampler2D tex_in_1;
void import_level_inner(uvec3 coord) { void import_level(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;
} }
struct tint_symbol_14 {
uvec3 coord;
};
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void import_level(tint_symbol_12 tint_symbol_11) { void main() {
import_level_inner(tint_symbol_11.coord); import_level(gl_GlobalInvocationID);
return; return;
} }
void main() {
tint_symbol_12 inputs;
inputs.coord = gl_GlobalInvocationID;
import_level(inputs);
}
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -481,28 +295,6 @@ struct VertexOutput {
vec2 quad_pos; 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 { struct SimulationParams {
float deltaTime; float deltaTime;
vec4 seed; vec4 seed;
@ -515,10 +307,6 @@ struct Particle {
vec3 velocity; vec3 velocity;
}; };
struct tint_symbol_10 {
uvec3 GlobalInvocationID;
};
struct UBO { struct UBO {
uint width; uint width;
}; };
@ -533,16 +321,8 @@ layout(binding = 4) buffer Buffer_1 {
layout(binding = 5) buffer Buffer_2 { layout(binding = 5) buffer Buffer_2 {
float weights[]; float weights[];
} buf_out; } buf_out;
struct tint_symbol_12 {
uvec3 coord;
};
struct tint_symbol_14 {
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(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));
uint src_offset = ((coord.x * 2u) + ((coord.y * 2u) * ubo.width)); uint src_offset = ((coord.x * 2u) + ((coord.y * 2u) * ubo.width));
@ -558,15 +338,7 @@ void export_level_inner(uvec3 coord) {
} }
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void export_level(tint_symbol_14 tint_symbol_13) { void main() {
export_level_inner(tint_symbol_13.coord); export_level(gl_GlobalInvocationID);
return; return;
} }
void main() {
tint_symbol_14 inputs;
inputs.coord = gl_GlobalInvocationID;
export_level(inputs);
}

View File

@ -3,6 +3,10 @@ SKIP: FAILED
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec3 shadowPos_1;
layout(location = 1) in vec3 fragPos_1;
layout(location = 2) in vec3 fragNorm_1;
layout(location = 0) out vec4 value;
const float shadowDepthTextureSize = 1024.0f; const float shadowDepthTextureSize = 1024.0f;
struct Scene { struct Scene {
mat4 lightViewProjMatrix; mat4 lightViewProjMatrix;
@ -24,19 +28,9 @@ 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 {
vec3 shadowPos;
vec3 fragPos;
vec3 fragNorm;
};
struct tint_symbol_4 {
vec4 value;
};
uniform highp sampler2D shadowMap_shadowSampler; uniform highp sampler2D shadowMap_shadowSampler;
vec4 tint_symbol_inner(FragmentInput tint_symbol_1) { vec4 tint_symbol(FragmentInput tint_symbol_1) {
float visibility = 0.0f; float visibility = 0.0f;
float oneOverShadowDepthTextureSize = (1.0f / shadowDepthTextureSize); float oneOverShadowDepthTextureSize = (1.0f / shadowDepthTextureSize);
{ {
@ -55,31 +49,15 @@ vec4 tint_symbol_inner(FragmentInput tint_symbol_1) {
return vec4((lightingFactor * albedo), 1.0f); return vec4((lightingFactor * albedo), 1.0f);
} }
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
FragmentInput tint_symbol_5 = FragmentInput(tint_symbol_2.shadowPos, tint_symbol_2.fragPos, tint_symbol_2.fragNorm);
vec4 inner_result = tint_symbol_inner(tint_symbol_5);
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.value = inner_result;
return wrapper_result;
}
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() { void main() {
tint_symbol_3 inputs; FragmentInput tint_symbol_2 = FragmentInput(shadowPos_1, fragPos_1, fragNorm_1);
inputs.shadowPos = shadowPos; vec4 inner_result = tint_symbol(tint_symbol_2);
inputs.fragPos = fragPos; value = inner_result;
inputs.fragNorm = fragNorm; return;
tint_symbol_4 outputs;
outputs = tint_symbol(inputs);
value = outputs.value;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:45: 'assign' : cannot convert from ' temp highp 4-component vector of float' to ' temp mediump float' ERROR: 0:39: 'assign' : cannot convert from ' temp highp 4-component vector of float' to ' temp mediump float'
ERROR: 0:45: '' : compilation terminated ERROR: 0:39: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -1,50 +0,0 @@
SKIP: FAILED
#version 310 es
precision mediump float;
struct Input {
vec4 color;
};
struct Output {
vec4 color;
};
struct tint_symbol_3 {
vec4 color;
};
struct tint_symbol_4 {
vec4 color;
};
Output tint_symbol_inner(Input tint_symbol_1) {
Output tint_symbol_5 = Output(tint_symbol_1.color);
return tint_symbol_5;
}
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
Input tint_symbol_6 = Input(tint_symbol_2.color);
Output inner_result = tint_symbol_inner(tint_symbol_6);
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.color = inner_result.color;
return wrapper_result;
}
layout(location = 0) in vec4 color;
layout(location = 0) out vec4 color;
void main() {
tint_symbol_3 inputs;
inputs.color = color;
tint_symbol_4 outputs;
outputs = tint_symbol(inputs);
color = outputs.color;
}
Error parsing GLSL shader:
ERROR: 0:33: 'color' : redefinition
ERROR: 1 compilation errors. No code generated.

View File

@ -7,6 +7,17 @@ benchmark/skinned-shadowed-pbr-fragment.wgsl:51:13 warning: use of deprecated la
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec3 worldPos_1;
layout(location = 1) in vec3 view_1;
layout(location = 2) in vec2 texcoord_1;
layout(location = 3) in vec2 texcoord2_1;
layout(location = 4) in vec4 color_1;
layout(location = 5) in vec4 instanceColor_1;
layout(location = 6) in vec3 normal_1;
layout(location = 7) in vec3 tangent_1;
layout(location = 8) in vec3 bitangent_1;
layout(location = 0) out vec4 color_2;
layout(location = 1) out vec4 emissive_1;
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);
@ -312,27 +323,9 @@ struct FragmentOutput {
vec4 emissive; vec4 emissive;
}; };
struct tint_symbol_4 {
vec3 worldPos;
vec3 view;
vec2 texcoord;
vec2 texcoord2;
vec4 color;
vec4 instanceColor;
vec3 normal;
vec3 tangent;
vec3 bitangent;
vec4 position;
};
struct tint_symbol_5 {
vec4 color;
vec4 emissive;
};
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(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);
if ((globalLights.dirIntensity > 0.0f)) { if ((globalLights.dirIntensity > 0.0f)) {
@ -370,48 +363,16 @@ FragmentOutput fragmentMain_inner(VertexOutput tint_symbol) {
return tint_symbol_2; return tint_symbol_2;
} }
tint_symbol_5 fragmentMain(tint_symbol_4 tint_symbol_3) {
VertexOutput tint_symbol_6 = VertexOutput(tint_symbol_3.position, tint_symbol_3.worldPos, tint_symbol_3.view, tint_symbol_3.texcoord, tint_symbol_3.texcoord2, tint_symbol_3.color, tint_symbol_3.instanceColor, tint_symbol_3.normal, tint_symbol_3.tangent, tint_symbol_3.bitangent);
FragmentOutput inner_result = fragmentMain_inner(tint_symbol_6);
tint_symbol_5 wrapper_result = tint_symbol_5(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.color = inner_result.color;
wrapper_result.emissive = inner_result.emissive;
return wrapper_result;
}
layout(location = 0) in vec3 worldPos;
layout(location = 1) in vec3 view;
layout(location = 2) in vec2 texcoord;
layout(location = 3) in vec2 texcoord2;
layout(location = 4) in vec4 color;
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() { void main() {
tint_symbol_4 inputs; VertexOutput tint_symbol_3 = VertexOutput(gl_FragCoord, worldPos_1, view_1, texcoord_1, texcoord2_1, color_1, instanceColor_1, normal_1, tangent_1, bitangent_1);
inputs.worldPos = worldPos; FragmentOutput inner_result = fragmentMain(tint_symbol_3);
inputs.view = view; color_2 = inner_result.color;
inputs.texcoord = texcoord; emissive_1 = inner_result.emissive;
inputs.texcoord2 = texcoord2; return;
inputs.color = color;
inputs.instanceColor = instanceColor;
inputs.normal = normal;
inputs.tangent = tangent;
inputs.bitangent = bitangent;
inputs.position = gl_FragCoord;
tint_symbol_5 outputs;
outputs = fragmentMain(inputs);
color = outputs.color;
emissive = outputs.emissive;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:65: 'mad' : no matching overloaded function found ERROR: 0:76: 'mad' : no matching overloaded function found
ERROR: 0:65: '' : compilation terminated ERROR: 0:76: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -1,185 +0,0 @@
SKIP: FAILED
#version 310 es
precision mediump float;
struct VertexInput {
vec4 position;
vec3 normal;
vec4 tangent;
vec2 texcoord;
uvec4 joints;
vec4 weights;
vec4 instance0;
vec4 instance1;
vec4 instance2;
vec4 instance3;
vec4 instanceColor;
};
struct VertexOutput {
vec4 position;
vec3 worldPos;
vec3 view;
vec2 texcoord;
vec2 texcoord2;
vec4 color;
vec4 instanceColor;
vec3 normal;
vec3 tangent;
vec3 bitangent;
};
struct Camera {
mat4 projection;
mat4 inverseProjection;
mat4 view;
vec3 position;
float time;
vec2 outputSize;
float zNear;
float zFar;
};
layout(binding = 0) uniform Camera_1 {
mat4 projection;
mat4 inverseProjection;
mat4 view;
vec3 position;
float time;
vec2 outputSize;
float zNear;
float zFar;
} camera;
layout(binding = 1) buffer Joints_1 {
mat4 matrices[];
} joint;
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]);
mat4 joint2 = (joint.matrices[tint_symbol.joints.z] * inverseBind.matrices[tint_symbol.joints.z]);
mat4 joint3 = (joint.matrices[tint_symbol.joints.w] * inverseBind.matrices[tint_symbol.joints.w]);
mat4 skinMatrix = ((((joint0 * tint_symbol.weights.x) + (joint1 * tint_symbol.weights.y)) + (joint2 * tint_symbol.weights.z)) + (joint3 * tint_symbol.weights.w));
return skinMatrix;
}
struct tint_symbol_3 {
vec4 position;
vec3 normal;
vec4 tangent;
vec2 texcoord;
uvec4 joints;
vec4 weights;
vec4 instance0;
vec4 instance1;
vec4 instance2;
vec4 instance3;
vec4 instanceColor;
};
struct tint_symbol_4 {
vec3 worldPos;
vec3 view;
vec2 texcoord;
vec2 texcoord2;
vec4 color;
vec4 instanceColor;
vec3 normal;
vec3 tangent;
vec3 bitangent;
vec4 position;
};
VertexOutput vertexMain_inner(VertexInput tint_symbol) {
VertexOutput tint_symbol_1 = VertexOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
mat4 modelMatrix = getSkinMatrix(tint_symbol);
tint_symbol_1.normal = normalize((modelMatrix * vec4(tint_symbol.normal, 0.0f)).xyz);
tint_symbol_1.tangent = normalize((modelMatrix * vec4(tint_symbol.tangent.xyz, 0.0f)).xyz);
tint_symbol_1.bitangent = (cross(tint_symbol_1.normal, tint_symbol_1.tangent) * tint_symbol.tangent.w);
tint_symbol_1.color = vec4(1.0f);
tint_symbol_1.texcoord = tint_symbol.texcoord;
tint_symbol_1.instanceColor = tint_symbol.instanceColor;
vec4 modelPos = (modelMatrix * tint_symbol.position);
tint_symbol_1.worldPos = modelPos.xyz;
tint_symbol_1.view = (camera.position - modelPos.xyz);
tint_symbol_1.position = ((camera.projection * camera.view) * modelPos);
return tint_symbol_1;
}
tint_symbol_4 vertexMain(tint_symbol_3 tint_symbol_2) {
VertexInput tint_symbol_5 = VertexInput(tint_symbol_2.position, tint_symbol_2.normal, tint_symbol_2.tangent, tint_symbol_2.texcoord, tint_symbol_2.joints, tint_symbol_2.weights, tint_symbol_2.instance0, tint_symbol_2.instance1, tint_symbol_2.instance2, tint_symbol_2.instance3, tint_symbol_2.instanceColor);
VertexOutput inner_result = vertexMain_inner(tint_symbol_5);
tint_symbol_4 wrapper_result = tint_symbol_4(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.position = inner_result.position;
wrapper_result.worldPos = inner_result.worldPos;
wrapper_result.view = inner_result.view;
wrapper_result.texcoord = inner_result.texcoord;
wrapper_result.texcoord2 = inner_result.texcoord2;
wrapper_result.color = inner_result.color;
wrapper_result.instanceColor = inner_result.instanceColor;
wrapper_result.normal = inner_result.normal;
wrapper_result.tangent = inner_result.tangent;
wrapper_result.bitangent = inner_result.bitangent;
return wrapper_result;
}
layout(location = 0) in vec4 position;
layout(location = 1) in vec3 normal;
layout(location = 2) in vec4 tangent;
layout(location = 3) in vec2 texcoord;
layout(location = 6) in uvec4 joints;
layout(location = 7) in vec4 weights;
layout(location = 8) in vec4 instance0;
layout(location = 9) in vec4 instance1;
layout(location = 10) in vec4 instance2;
layout(location = 11) in vec4 instance3;
layout(location = 12) in vec4 instanceColor;
layout(location = 0) out vec3 worldPos;
layout(location = 1) out vec3 view;
layout(location = 2) out vec2 texcoord;
layout(location = 3) out vec2 texcoord2;
layout(location = 4) out vec4 color;
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;
inputs.normal = normal;
inputs.tangent = tangent;
inputs.texcoord = texcoord;
inputs.joints = joints;
inputs.weights = weights;
inputs.instance0 = instance0;
inputs.instance1 = instance1;
inputs.instance2 = instance2;
inputs.instance3 = instance3;
inputs.instanceColor = instanceColor;
tint_symbol_4 outputs;
outputs = vertexMain(inputs);
worldPos = outputs.worldPos;
view = outputs.view;
texcoord = outputs.texcoord;
texcoord2 = outputs.texcoord2;
color = outputs.color;
instanceColor = outputs.instanceColor;
normal = outputs.normal;
tangent = outputs.tangent;
bitangent = outputs.bitangent;
gl_Position = outputs.position;
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
gl_Position.y = -gl_Position.y;
}
Error parsing GLSL shader:
ERROR: 0:140: 'texcoord' : redefinition
ERROR: 1 compilation errors. No code generated.

View File

@ -16,11 +16,7 @@ struct Inner {
layout(binding = 0) buffer S_1 { layout(binding = 0) buffer S_1 {
Inner arr[]; Inner arr[];
} s; } s;
struct tint_symbol_2 { void tint_symbol(uint idx) {
uint idx;
};
void tint_symbol_inner(uint idx) {
ivec3 a = s.arr[idx].a; ivec3 a = s.arr[idx].a;
int b = s.arr[idx].b; int b = s.arr[idx].b;
uvec3 c = s.arr[idx].c; uvec3 c = s.arr[idx].c;
@ -33,15 +29,7 @@ void tint_symbol_inner(uint idx) {
} }
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(tint_symbol_2 tint_symbol_1) { void main() {
tint_symbol_inner(tint_symbol_1.idx); tint_symbol(gl_LocalInvocationIndex);
return; return;
} }
void main() {
tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs);
}

View File

@ -16,11 +16,7 @@ struct Inner {
layout(binding = 0) buffer S_1 { layout(binding = 0) buffer S_1 {
Inner arr[]; Inner arr[];
} s; } s;
struct tint_symbol_2 { void tint_symbol(uint idx) {
uint idx;
};
void tint_symbol_inner(uint idx) {
s.arr[idx].a = ivec3(0, 0, 0); s.arr[idx].a = ivec3(0, 0, 0);
s.arr[idx].b = 0; s.arr[idx].b = 0;
s.arr[idx].c = uvec3(0u, 0u, 0u); s.arr[idx].c = uvec3(0u, 0u, 0u);
@ -29,20 +25,12 @@ void tint_symbol_inner(uint idx) {
s.arr[idx].f = 0.0f; s.arr[idx].f = 0.0f;
s.arr[idx].g = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); s.arr[idx].g = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
s.arr[idx].h = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); s.arr[idx].h = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
ivec4 tint_symbol_3[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_1[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
s.arr[idx].i = tint_symbol_3; s.arr[idx].i = 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(tint_symbol_2 tint_symbol_1) { void main() {
tint_symbol_inner(tint_symbol_1.idx); tint_symbol(gl_LocalInvocationIndex);
return; return;
} }
void main() {
tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs);
}

View File

@ -30,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;
void tint_symbol() { void tint_symbol() {
ivec3 a = s.a; ivec3 a = s.a;
int b = s.b; int b = s.b;
@ -42,10 +41,10 @@ void tint_symbol() {
mat3x2 h = s.h; mat3x2 h = s.h;
Inner i = s.i; Inner i = s.i;
Inner j[4] = s.j; Inner j[4] = s.j;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -30,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;
void tint_symbol() { void tint_symbol() {
s.a = ivec3(0, 0, 0); s.a = ivec3(0, 0, 0);
s.b = 0; s.b = 0;
@ -44,10 +43,10 @@ void tint_symbol() {
s.i = tint_symbol_1; s.i = tint_symbol_1;
Inner tint_symbol_2[4] = Inner[4](Inner(0), Inner(0), Inner(0), Inner(0)); Inner tint_symbol_2[4] = Inner[4](Inner(0), Inner(0), Inner(0), Inner(0));
s.j = tint_symbol_2; s.j = tint_symbol_2;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
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;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -17,19 +17,18 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1 = tint_symbol; tint_symbol_1 = tint_symbol;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }
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:19: '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:19: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -11,13 +11,12 @@ 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;
void tint_symbol_2() { void tint_symbol_2() {
tint_symbol_1.inner = tint_symbol.inner; tint_symbol_1.inner = tint_symbol.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol_2(); tint_symbol_2();
return;
} }

View File

@ -23,11 +23,7 @@ layout(binding = 0) uniform S_1 {
Inner arr[8]; Inner arr[8];
} s; } s;
struct tint_symbol_2 { void tint_symbol(uint idx) {
uint idx;
};
void tint_symbol_inner(uint idx) {
ivec3 a = s.arr[idx].a; ivec3 a = s.arr[idx].a;
int b = s.arr[idx].b; int b = s.arr[idx].b;
uvec3 c = s.arr[idx].c; uvec3 c = s.arr[idx].c;
@ -42,15 +38,7 @@ void tint_symbol_inner(uint idx) {
} }
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(tint_symbol_2 tint_symbol_1) { void main() {
tint_symbol_inner(tint_symbol_1.idx); tint_symbol(gl_LocalInvocationIndex);
return; return;
} }
void main() {
tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs);
}

View File

@ -35,7 +35,6 @@ layout(binding = 0) uniform S_1 {
Inner l[4]; Inner l[4];
} s; } s;
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;
int b = s.b; int b = s.b;
@ -49,10 +48,10 @@ void tint_symbol() {
mat3x2 j = s.j; mat3x2 j = s.j;
Inner k = s.k; Inner k = s.k;
Inner l[4] = s.l; Inner l[4] = s.l;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
vec4 inner[4]; vec4 inner[4];
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec4 x[4] = u.inner; vec4 x[4] = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
float inner; float inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
float x = u.inner; float x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
int inner; int inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
int x = u.inner; int x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat2 inner; mat2 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
mat2 x = u.inner; mat2 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat2x3 inner; mat2x3 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
mat2x3 x = u.inner; mat2x3 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat3x2 inner; mat3x2 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
mat3x2 x = u.inner; mat3x2 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat4 inner; mat4 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
mat4 x = u.inner; mat4 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -15,19 +15,18 @@ layout(binding = 0) uniform S_1 {
Inner inner; Inner inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
S x = u; S x = u;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
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: '=' : 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: 0:17: '' : compilation terminated
ERROR: 2 compilation errors. No code generated. ERROR: 2 compilation errors. No code generated.

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
uint inner; uint inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
uint x = u.inner; uint x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
ivec2 inner; ivec2 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
ivec2 x = u.inner; ivec2 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
uvec3 inner; uvec3 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
uvec3 x = u.inner; uvec3 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
vec4 inner; vec4 inner;
} u; } u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec4 x = u.inner; vec4 x = u.inner;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -5,9 +5,4 @@ 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() {
unused_entry_point();
}
const int H = 1; const int H = 1;

View File

@ -20,11 +20,6 @@ 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() {
unused_entry_point();
}
void i() { void i() {
float s = tint_modf(1.0f).whole; float s = tint_modf(1.0f).whole;
} }

View File

@ -1,6 +1,10 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in int loc0_1;
layout(location = 1) in uint loc1_1;
layout(location = 2) in uint loc1_2;
layout(location = 3) in vec4 loc3_1;
struct VertexInputs0 { struct VertexInputs0 {
uint vertex_index; uint vertex_index;
int loc0; int loc0;
@ -11,52 +15,17 @@ struct VertexInputs1 {
vec4 loc3; vec4 loc3;
}; };
struct tint_symbol_2 { vec4 tint_symbol(VertexInputs0 inputs0, uint loc1, uint instance_index, VertexInputs1 inputs1) {
int loc0;
uint loc1;
uint loc1_1;
vec4 loc3;
uint vertex_index;
uint instance_index;
};
struct tint_symbol_3 {
vec4 value;
};
vec4 tint_symbol_inner(VertexInputs0 inputs0, uint loc1, uint instance_index, VertexInputs1 inputs1) {
uint foo = (inputs0.vertex_index + instance_index); uint foo = (inputs0.vertex_index + instance_index);
return vec4(0.0f, 0.0f, 0.0f, 0.0f); return vec4(0.0f, 0.0f, 0.0f, 0.0f);
} }
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
VertexInputs0 tint_symbol_4 = VertexInputs0(tint_symbol_1.vertex_index, tint_symbol_1.loc0);
VertexInputs1 tint_symbol_5 = VertexInputs1(tint_symbol_1.loc1_1, tint_symbol_1.loc3);
vec4 inner_result = tint_symbol_inner(tint_symbol_4, tint_symbol_1.loc1, tint_symbol_1.instance_index, tint_symbol_5);
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.value = inner_result;
return wrapper_result;
}
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() { void main() {
tint_symbol_2 inputs; VertexInputs0 tint_symbol_1 = VertexInputs0(uint(gl_VertexID), loc0_1);
inputs.loc0 = loc0; VertexInputs1 tint_symbol_2 = VertexInputs1(loc1_2, loc3_1);
inputs.loc1 = loc1; vec4 inner_result = tint_symbol(tint_symbol_1, loc1_1, uint(gl_InstanceID), tint_symbol_2);
inputs.loc1_1 = loc1_1; gl_Position = inner_result;
inputs.loc3 = loc3; gl_Position.y = -(gl_Position.y);
inputs.vertex_index = uint(gl_VertexID); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
inputs.instance_index = uint(gl_InstanceID); return;
tint_symbol_3 outputs;
outputs = tint_symbol(inputs);
gl_Position = outputs.value;
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
gl_Position.y = -gl_Position.y;
} }

View File

@ -111,11 +111,7 @@ void doIgnore() {
int g55 = atomicOr(LUT.values[0], 0); int g55 = atomicOr(LUT.values[0], 0);
} }
struct tint_symbol_1 { void main_count(uvec3 GlobalInvocationID) {
uvec3 GlobalInvocationID;
};
void main_count_inner(uvec3 GlobalInvocationID) {
uint triangleIndex = GlobalInvocationID.x; uint triangleIndex = GlobalInvocationID.x;
if ((triangleIndex >= uniforms.numTriangles)) { if ((triangleIndex >= uniforms.numTriangles)) {
return; return;
@ -134,15 +130,7 @@ void main_count_inner(uvec3 GlobalInvocationID) {
} }
layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
void main_count(tint_symbol_1 tint_symbol) { void main() {
main_count_inner(tint_symbol.GlobalInvocationID); main_count(gl_GlobalInvocationID);
return; return;
} }
void main() {
tint_symbol_1 inputs;
inputs.GlobalInvocationID = gl_GlobalInvocationID;
main_count(inputs);
}

View File

@ -5,11 +5,6 @@ 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() {
unused_entry_point();
}
struct A { struct A {
int a; int a;
}; };

View File

@ -1,6 +1,7 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) out vec2 texcoords_1;
struct Uniforms { struct Uniforms {
vec2 u_scale; vec2 u_scale;
vec2 u_offset; vec2 u_offset;
@ -16,16 +17,7 @@ struct VertexOutputs {
vec4 position; vec4 position;
}; };
struct tint_symbol_2 { VertexOutputs vs_main(uint VertexIndex) {
uint VertexIndex;
};
struct tint_symbol_3 {
vec2 texcoords;
vec4 position;
};
VertexOutputs vs_main_inner(uint VertexIndex) {
vec2 texcoord[3] = vec2[3](vec2(-0.5f, 0.0f), vec2(1.5f, 0.0f), vec2(0.5f, 2.0f)); vec2 texcoord[3] = vec2[3](vec2(-0.5f, 0.0f), vec2(1.5f, 0.0f), vec2(0.5f, 2.0f));
VertexOutputs tint_symbol = VertexOutputs(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f)); VertexOutputs tint_symbol = VertexOutputs(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
tint_symbol.position = vec4(((texcoord[VertexIndex] * 2.0f) - vec2(1.0f, 1.0f)), 0.0f, 1.0f); tint_symbol.position = vec4(((texcoord[VertexIndex] * 2.0f) - vec2(1.0f, 1.0f)), 0.0f, 1.0f);
@ -38,39 +30,19 @@ VertexOutputs vs_main_inner(uint VertexIndex) {
return tint_symbol; return tint_symbol;
} }
struct tint_symbol_5 {
vec2 texcoord;
};
struct tint_symbol_6 {
vec4 value;
};
tint_symbol_3 vs_main(tint_symbol_2 tint_symbol_1) {
VertexOutputs inner_result = vs_main_inner(tint_symbol_1.VertexIndex);
tint_symbol_3 wrapper_result = tint_symbol_3(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.texcoords = inner_result.texcoords;
wrapper_result.position = inner_result.position;
return wrapper_result;
}
layout(location = 0) out vec2 texcoords;
void main() { void main() {
tint_symbol_2 inputs; VertexOutputs inner_result = vs_main(uint(gl_VertexID));
inputs.VertexIndex = uint(gl_VertexID); texcoords_1 = inner_result.texcoords;
tint_symbol_3 outputs; gl_Position = inner_result.position;
outputs = vs_main(inputs); gl_Position.y = -(gl_Position.y);
texcoords = outputs.texcoords; gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
gl_Position = outputs.position; return;
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
gl_Position.y = -gl_Position.y;
} }
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec2 texcoord_1;
layout(location = 0) out vec4 value;
struct Uniforms { struct Uniforms {
vec2 u_scale; vec2 u_scale;
vec2 u_offset; vec2 u_offset;
@ -81,26 +53,9 @@ struct VertexOutputs {
vec4 position; 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; uniform highp sampler2D myTexture_mySampler;
vec4 fs_main_inner(vec2 texcoord) { vec4 fs_main(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)))) {
discard; discard;
@ -109,20 +64,8 @@ vec4 fs_main_inner(vec2 texcoord) {
return srcColor; return srcColor;
} }
tint_symbol_6 fs_main(tint_symbol_5 tint_symbol_4) {
vec4 inner_result_1 = fs_main_inner(tint_symbol_4.texcoord);
tint_symbol_6 wrapper_result_1 = tint_symbol_6(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result_1.value = inner_result_1;
return wrapper_result_1;
}
layout(location = 0) in vec2 texcoord;
layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_5 inputs; vec4 inner_result = fs_main(texcoord_1);
inputs.texcoord = texcoord; value = inner_result;
tint_symbol_6 outputs; return;
outputs = fs_main(inputs);
value = outputs.value;
} }

View File

@ -20,14 +20,13 @@ 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;
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;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -21,13 +21,12 @@ 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;
void f() { void f() {
result.tint_symbol = s.data[ubo.dynamic_idx]; result.tint_symbol = s.data[ubo.dynamic_idx];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -23,13 +23,12 @@ 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;
void f() { void f() {
result.tint_symbol = ssbo.data[ubo.dynamic_idx]; result.tint_symbol = ssbo.data[ubo.dynamic_idx];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -18,13 +18,12 @@ 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;
void f() { void f() {
result.tint_symbol = ubo.data[ubo.dynamic_idx].x; result.tint_symbol = ubo.data[ubo.dynamic_idx].x;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -21,11 +21,7 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
shared S s; shared S s;
struct tint_symbol_2 { void f(uint local_invocation_index) {
uint local_invocation_index;
};
void f_inner(uint local_invocation_index) {
{ {
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) { for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
uint i = idx; uint i = idx;
@ -37,15 +33,7 @@ void f_inner(uint local_invocation_index) {
} }
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(tint_symbol_2 tint_symbol_1) { void main() {
f_inner(tint_symbol_1.local_invocation_index); f(gl_LocalInvocationIndex);
return; return;
} }
void main() {
tint_symbol_2 inputs;
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
f(inputs);
}

View File

@ -20,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;
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));
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;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -24,15 +24,14 @@ void x(inout S p) {
p.data[ubo.dynamic_idx] = 1; p.data[ubo.dynamic_idx] = 1;
} }
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));
x(s); x(s);
result.tint_symbol = s.data[3]; result.tint_symbol = s.data[3];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -21,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;
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;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -25,14 +25,13 @@ void x(inout S p) {
p.data[ubo.dynamic_idx] = 1; p.data[ubo.dynamic_idx] = 1;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void f() { void f() {
x(s); x(s);
result.tint_symbol = s.data[3]; result.tint_symbol = s.data[3];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -23,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;
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;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
f(); f();
return;
} }

View File

@ -21,11 +21,7 @@ layout(binding = 1) buffer Result_1 {
int tint_symbol; int tint_symbol;
} result; } result;
shared S s; shared S s;
struct tint_symbol_2 { void f(uint local_invocation_index) {
uint local_invocation_index;
};
void f_inner(uint local_invocation_index) {
{ {
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) { for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
uint i = idx; uint i = idx;
@ -38,15 +34,7 @@ void f_inner(uint local_invocation_index) {
} }
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(tint_symbol_2 tint_symbol_1) { void main() {
f_inner(tint_symbol_1.local_invocation_index); f(gl_LocalInvocationIndex);
return; return;
} }
void main() {
tint_symbol_2 inputs;
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
f(inputs);
}

View File

@ -1,18 +1,12 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
struct tint_symbol_2 { layout(location = 0) in vec2 vUV_1;
vec2 vUV; layout(location = 0) out vec4 value;
};
struct tint_symbol_3 {
vec4 value;
};
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(vec2 vUV) {
vec3 random = texture(randomTexture_Sampler, vUV).rgb; vec3 random = texture(randomTexture_Sampler, vUV).rgb;
int i = 0; int i = 0;
while (true) { while (true) {
@ -43,20 +37,8 @@ vec4 tint_symbol_inner(vec2 vUV) {
return vec4(1.0f); return vec4(1.0f);
} }
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
vec4 inner_result = tint_symbol_inner(tint_symbol_1.vUV);
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.value = inner_result;
return wrapper_result;
}
layout(location = 0) in vec2 vUV;
layout(location = 0) out vec4 value;
void main() { void main() {
tint_symbol_2 inputs; vec4 inner_result = tint_symbol(vUV_1);
inputs.vUV = vUV; value = inner_result;
tint_symbol_3 outputs; return;
outputs = tint_symbol(inputs);
value = outputs.value;
} }

View File

@ -19,14 +19,13 @@ layout(binding = 4) uniform Simulation_1 {
uint i; uint i;
} sim; } sim;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
Particle particle = particles.p[0]; Particle particle = particles.p[0];
particle.position[sim.i] = particle.position[sim.i]; particle.position[sim.i] = particle.position[sim.i];
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -11,14 +11,13 @@ layout(binding = 4) uniform Uniforms_1 {
uint j; uint j;
} uniforms; } uniforms;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
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);
m1[uniforms.i][0] = 1.0f; m1[uniforms.i][0] = 1.0f;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -11,14 +11,13 @@ layout(binding = 4) uniform Uniforms_1 {
uint j; uint j;
} uniforms; } uniforms;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
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);
m1[uniforms.i][uniforms.j] = 1.0f; m1[uniforms.i][uniforms.j] = 1.0f;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
} 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;
void tint_symbol() { void tint_symbol() {
m1[0][uniforms.j] = 1.0f; m1[0][uniforms.j] = 1.0f;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -11,14 +11,13 @@ layout(binding = 4) uniform Uniforms_1 {
uint j; uint j;
} uniforms; } uniforms;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
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);
m1[uniforms.i] = vec4(1.0f); m1[uniforms.i] = vec4(1.0f);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
} 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;
void tint_symbol() { void tint_symbol() {
m1[uniforms.i][0] = 1.0f; m1[uniforms.i][0] = 1.0f;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
} 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;
void tint_symbol() { void tint_symbol() {
m1[uniforms.i][uniforms.j] = 1.0f; m1[uniforms.i][uniforms.j] = 1.0f;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
} 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;
void tint_symbol() { void tint_symbol() {
m1[0][uniforms.j] = 1.0f; m1[0][uniforms.j] = 1.0f;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
} 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;
void tint_symbol() { void tint_symbol() {
m1[uniforms.i] = vec4(1.0f); m1[uniforms.i] = vec4(1.0f);
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -16,17 +16,16 @@ void foo() {
} }
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
{ {
for(int i = 0; (i < 2); i = (i + 1)) { for(int i = 0; (i < 2); i = (i + 1)) {
foo(); foo();
} }
} }
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -13,17 +13,16 @@ void foo() {
v2b[i] = true; v2b[i] = true;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
{ {
for(int i = 0; (i < 2); i = (i + 1)) { for(int i = 0; (i < 2); i = (i + 1)) {
foo(); foo();
} }
} }
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,7 +1,6 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f); vec2 v2f = vec2(0.0f, 0.0f);
vec3 v3f = vec3(0.0f, 0.0f, 0.0f); vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
@ -31,10 +30,10 @@ void tint_symbol() {
v4b[i] = true; v4b[i] = true;
} }
} }
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,7 +1,6 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f); vec2 v2f = vec2(0.0f, 0.0f);
vec2 v2f_2 = vec2(0.0f, 0.0f); vec2 v2f_2 = vec2(0.0f, 0.0f);
@ -23,10 +22,10 @@ void tint_symbol() {
v2b_2[i] = true; v2b_2[i] = true;
} }
} }
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,7 +1,6 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f); vec2 v2f = vec2(0.0f, 0.0f);
vec3 v3f = vec3(0.0f, 0.0f, 0.0f); vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
@ -32,10 +31,10 @@ void tint_symbol() {
v4u[i] = 1u; v4u[i] = 1u;
v3b[i] = true; v3b[i] = true;
v4b[i] = true; v4b[i] = true;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,7 +1,6 @@
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() { void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f); vec2 v2f = vec2(0.0f, 0.0f);
vec3 v3f = vec3(0.0f, 0.0f, 0.0f); vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
@ -28,10 +27,10 @@ void tint_symbol() {
v2b[i] = true; v2b[i] = true;
v3b[i] = true; v3b[i] = true;
v4b[i] = true; v4b[i] = true;
return;
} }
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -1,8 +1,11 @@
SKIP: FAILED
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in vec4 view_position_1;
layout(location = 1) in vec4 normal_1;
layout(location = 2) in vec2 uv_1;
layout(location = 3) in vec4 color_1;
layout(location = 0) out vec4 color_2;
struct PointLight { struct PointLight {
vec4 position; vec4 position;
}; };
@ -38,53 +41,15 @@ struct FragmentOutput {
vec4 color; vec4 color;
}; };
struct tint_symbol_3 { FragmentOutput tint_symbol(FragmentInput fragment) {
vec4 view_position;
vec4 normal;
vec2 uv;
vec4 color;
vec4 position;
};
struct tint_symbol_4 {
vec4 color;
};
FragmentOutput tint_symbol_inner(FragmentInput fragment) {
FragmentOutput tint_symbol_1 = FragmentOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f)); FragmentOutput tint_symbol_1 = FragmentOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f));
tint_symbol_1.color = vec4(1.0f, 0.0f, 0.0f, 1.0f); tint_symbol_1.color = vec4(1.0f, 0.0f, 0.0f, 1.0f);
return tint_symbol_1; return tint_symbol_1;
} }
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
FragmentInput tint_symbol_5 = FragmentInput(tint_symbol_2.position, tint_symbol_2.view_position, tint_symbol_2.normal, tint_symbol_2.uv, tint_symbol_2.color);
FragmentOutput inner_result = tint_symbol_inner(tint_symbol_5);
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.color = inner_result.color;
return wrapper_result;
}
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() { void main() {
tint_symbol_3 inputs; FragmentInput tint_symbol_2 = FragmentInput(gl_FragCoord, view_position_1, normal_1, uv_1, color_1);
inputs.view_position = view_position; FragmentOutput inner_result = tint_symbol(tint_symbol_2);
inputs.normal = normal; color_2 = inner_result.color;
inputs.uv = uv; return;
inputs.color = color;
inputs.position = gl_FragCoord;
tint_symbol_4 outputs;
outputs = tint_symbol(inputs);
color = outputs.color;
} }
Error parsing GLSL shader:
ERROR: 0:69: 'color' : redefinition
ERROR: 1 compilation errors. No code generated.

View File

@ -14,10 +14,9 @@ void tint_symbol() {
} }
} }
} }
return;
} }
void main() { void main() {
tint_symbol(); tint_symbol();
return;
} }

View File

@ -3,58 +3,33 @@ SKIP: FAILED
#version 310 es #version 310 es
precision mediump float; precision mediump float;
layout(location = 0) in float a_1;
layout(location = 1) in float b_1;
layout(location = 0) out float a_2;
struct FragIn { struct FragIn {
float a; float a;
uint mask; uint mask;
}; };
struct tint_symbol_3 { FragIn tint_symbol(FragIn tint_symbol_1, float b) {
float a;
float b;
uint mask;
};
struct tint_symbol_4 {
float a;
uint mask;
};
FragIn tint_symbol_inner(FragIn tint_symbol_1, float b) {
if ((tint_symbol_1.mask == 0u)) { if ((tint_symbol_1.mask == 0u)) {
return tint_symbol_1; return tint_symbol_1;
} }
FragIn tint_symbol_5 = FragIn(b, 1u); FragIn tint_symbol_2 = FragIn(b, 1u);
return tint_symbol_5; return tint_symbol_2;
} }
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
FragIn tint_symbol_6 = FragIn(tint_symbol_2.a, tint_symbol_2.mask);
FragIn inner_result = tint_symbol_inner(tint_symbol_6, tint_symbol_2.b);
tint_symbol_4 wrapper_result = tint_symbol_4(0.0f, 0u);
wrapper_result.a = inner_result.a;
wrapper_result.mask = inner_result.mask;
return wrapper_result;
}
layout(location = 0) in float a;
layout(location = 1) in float b;
layout(location = 0) out float a;
void main() { void main() {
tint_symbol_3 inputs; FragIn tint_symbol_3 = FragIn(a_1, uint(gl_SampleMask[0]));
inputs.a = a; FragIn inner_result = tint_symbol(tint_symbol_3, b_1);
inputs.b = b; a_2 = inner_result.a;
inputs.mask = uint(gl_SampleMask); gl_SampleMask_1[0] = inner_result.mask;
tint_symbol_4 outputs; return;
outputs = tint_symbol(inputs);
a = outputs.a;
gl_SampleMask = outputs.mask;
} }
Error parsing GLSL shader: Error parsing GLSL shader:
ERROR: 0:39: 'a' : redefinition ERROR: 0:21: 'gl_SampleMask' : required extension not requested: GL_OES_sample_variables
ERROR: 1 compilation errors. No code generated. ERROR: 0:21: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

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