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:
parent
f34038b1a0
commit
0b39270e01
|
@ -130,11 +130,14 @@ struct CanonicalizeEntryPointIO::State {
|
|||
|
||||
/// Clones the shader IO decorations from `src`.
|
||||
/// @param src the decorations to clone
|
||||
/// @param do_interpolate whether to clone InterpolateDecoration
|
||||
/// @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;
|
||||
for (auto* deco : src) {
|
||||
if (IsShaderIODecoration(deco)) {
|
||||
if (IsShaderIODecoration(deco) &&
|
||||
(do_interpolate || !deco->Is<ast::InterpolateDecoration>())) {
|
||||
new_decorations.push_back(ctx.Clone(deco));
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +162,8 @@ struct CanonicalizeEntryPointIO::State {
|
|||
const sem::Type* type,
|
||||
ast::DecorationList attributes) {
|
||||
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
|
||||
// always decorated with `Flat`.
|
||||
// TODO(crbug.com/tint/1224): Remove this once a flat interpolation
|
||||
|
@ -176,8 +180,15 @@ struct CanonicalizeEntryPointIO::State {
|
|||
attributes.push_back(
|
||||
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);
|
||||
|
||||
// Create the global variable and use its value for the shader input.
|
||||
const ast::Expression* value = ctx.dst->Expr(symbol);
|
||||
if (HasSampleMask(attributes)) {
|
||||
// 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);
|
||||
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,
|
||||
std::move(attributes));
|
||||
return value;
|
||||
|
@ -231,6 +249,13 @@ struct CanonicalizeEntryPointIO::State {
|
|||
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;
|
||||
output.name = name;
|
||||
output.type = CreateASTTypeFor(ctx, type);
|
||||
|
@ -279,7 +304,15 @@ struct CanonicalizeEntryPointIO::State {
|
|||
|
||||
auto* member_ast = member->Declaration();
|
||||
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));
|
||||
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
|
||||
void ProcessReturnType(const sem::Type* inner_ret_type,
|
||||
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>()) {
|
||||
for (auto* member : str->Members()) {
|
||||
if (member->Type()->Is<sem::Struct>()) {
|
||||
|
@ -305,15 +344,16 @@ struct CanonicalizeEntryPointIO::State {
|
|||
|
||||
auto* member_ast = member->Declaration();
|
||||
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.
|
||||
AddOutput(name, member->Type(), std::move(attributes),
|
||||
ctx.dst->MemberAccessor(original_result, name));
|
||||
}
|
||||
} else if (!inner_ret_type->Is<sem::Void>()) {
|
||||
auto attributes =
|
||||
CloneShaderIOAttributes(func_ast->return_type_decorations);
|
||||
auto attributes = CloneShaderIOAttributes(
|
||||
func_ast->return_type_decorations, do_interpolate);
|
||||
|
||||
// Propagate the non-struct return value as is.
|
||||
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));
|
||||
}
|
||||
|
||||
/// 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.
|
||||
void CreateInputStruct() {
|
||||
// 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.
|
||||
void CreateSpirvOutputVariables() {
|
||||
void CreateGlobalOutputVariables() {
|
||||
for (auto& outval : wrapper_output_values) {
|
||||
// Disable validation for use of the `output` storage class.
|
||||
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.
|
||||
/// @returns the inner function call expression
|
||||
const ast::CallExpression* CallInnerFunction() {
|
||||
// Add a suffix to the function name, as the wrapper function will take the
|
||||
// original entry point name.
|
||||
Symbol inner_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 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.
|
||||
// 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.
|
||||
if (func_sem->Parameters().size() == 0 &&
|
||||
func_sem->ReturnType()->Is<sem::Void>() && !needs_fixed_sample_mask &&
|
||||
!needs_vertex_point_size) {
|
||||
!needs_vertex_point_size && cfg.shader_style != ShaderStyle::kGlsl) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -526,8 +582,9 @@ struct CanonicalizeEntryPointIO::State {
|
|||
|
||||
// Produce the entry point outputs, if necessary.
|
||||
if (!wrapper_output_values.empty()) {
|
||||
if (cfg.shader_style == ShaderStyle::kSpirv) {
|
||||
CreateSpirvOutputVariables();
|
||||
if (cfg.shader_style == ShaderStyle::kSpirv ||
|
||||
cfg.shader_style == ShaderStyle::kGlsl) {
|
||||
CreateGlobalOutputVariables();
|
||||
} else {
|
||||
auto* output_struct = CreateOutputStruct();
|
||||
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.
|
||||
// Take the name of the original entry point function.
|
||||
auto name = ctx.Clone(func_ast->symbol);
|
||||
// For GLSL, use "main", otherwise take the name of the original
|
||||
// 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>(
|
||||
name, wrapper_ep_parameters, wrapper_ret_type(),
|
||||
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,
|
||||
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,
|
||||
|
|
|
@ -90,6 +90,8 @@ class CanonicalizeEntryPointIO
|
|||
enum class ShaderStyle {
|
||||
/// Target SPIR-V (using global variables).
|
||||
kSpirv,
|
||||
/// Target GLSL (using global variables).
|
||||
kGlsl,
|
||||
/// Target MSL (using non-struct function parameters for builtins).
|
||||
kMsl,
|
||||
/// Target HLSL (using structures for all IO).
|
||||
|
|
|
@ -63,17 +63,13 @@ Output Glsl::Run(const Program* in, const DataMap& inputs) const {
|
|||
// ZeroInitWorkgroupMemory may inject new builtin parameters.
|
||||
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()) {
|
||||
manager.Add<SingleEntryPoint>();
|
||||
data.Add<SingleEntryPoint::Config>(cfg->entry_point);
|
||||
}
|
||||
manager.Add<CanonicalizeEntryPointIO>();
|
||||
manager.Add<SimplifyPointers>();
|
||||
|
||||
manager.Add<RemovePhonies>();
|
||||
manager.Add<CombineSamplers>();
|
||||
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<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>(
|
||||
CanonicalizeEntryPointIO::ShaderStyle::kHlsl);
|
||||
CanonicalizeEntryPointIO::ShaderStyle::kGlsl);
|
||||
auto out = manager.Run(in, data);
|
||||
if (!out.program.IsValid()) {
|
||||
return out;
|
||||
|
|
|
@ -1640,6 +1640,9 @@ bool GeneratorImpl::EmitGlobalVariable(const ast::Variable* global) {
|
|||
return EmitPrivateVariable(sem);
|
||||
case ast::StorageClass::kWorkgroup:
|
||||
return EmitWorkgroupVariable(sem);
|
||||
case ast::StorageClass::kInput:
|
||||
case ast::StorageClass::kOutput:
|
||||
return EmitIOVariable(sem);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1757,78 +1760,33 @@ bool GeneratorImpl::EmitWorkgroupVariable(const sem::Variable* var) {
|
|||
return true;
|
||||
}
|
||||
|
||||
sem::Type* GeneratorImpl::builtin_type(ast::Builtin builtin) {
|
||||
switch (builtin) {
|
||||
case ast::Builtin::kPosition: {
|
||||
auto* f32 = builder_.create<sem::F32>();
|
||||
return builder_.create<sem::Vector>(f32, 4);
|
||||
bool GeneratorImpl::EmitIOVariable(const sem::Variable* var) {
|
||||
auto* decl = var->Declaration();
|
||||
|
||||
// Do not emit builtin (gl_) variables.
|
||||
if (ast::HasDecoration<ast::BuiltinDecoration>(decl->decorations)) {
|
||||
return true;
|
||||
}
|
||||
case ast::Builtin::kVertexIndex:
|
||||
case ast::Builtin::kInstanceIndex: {
|
||||
return builder_.create<sem::I32>();
|
||||
|
||||
auto out = line();
|
||||
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>();
|
||||
}
|
||||
case ast::Builtin::kFragDepth: {
|
||||
return builder_.create<sem::F32>();
|
||||
}
|
||||
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;
|
||||
|
||||
if (auto* constructor = decl->constructor) {
|
||||
out << " = ";
|
||||
if (!EmitExpression(out, constructor)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* GeneratorImpl::builtin_to_string(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:
|
||||
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 "";
|
||||
}
|
||||
out << ";";
|
||||
return true;
|
||||
}
|
||||
|
||||
void GeneratorImpl::EmitInterpolationQualifiers(
|
||||
|
@ -1956,144 +1914,6 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -292,6 +292,11 @@ class GeneratorImpl : public TextGenerator {
|
|||
/// @returns true on success
|
||||
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
|
||||
/// @param out the output of the expression stream
|
||||
/// @param decos the decorations
|
||||
|
|
|
@ -103,11 +103,6 @@ precision mediump float;
|
|||
void func() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
func();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -142,35 +137,17 @@ TEST_F(GlslGeneratorImplTest_Function,
|
|||
EXPECT_EQ(gen.result(), R"(#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
float foo;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
float value;
|
||||
};
|
||||
|
||||
float frag_main_inner(float foo) {
|
||||
layout(location = 0) in float foo_1;
|
||||
layout(location = 1) out float value;
|
||||
float frag_main(float 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() {
|
||||
tint_symbol_1 inputs;
|
||||
inputs.foo = foo;
|
||||
tint_symbol_2 outputs;
|
||||
outputs = frag_main(inputs);
|
||||
value = outputs.value;
|
||||
float inner_result = frag_main(foo_1);
|
||||
value = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -192,35 +169,15 @@ TEST_F(GlslGeneratorImplTest_Function,
|
|||
EXPECT_EQ(gen.result(), R"(#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
vec4 coord;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
float value;
|
||||
};
|
||||
|
||||
float frag_main_inner(vec4 coord) {
|
||||
float frag_main(vec4 coord) {
|
||||
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() {
|
||||
tint_symbol_1 inputs;
|
||||
inputs.coord = gl_FragCoord;
|
||||
tint_symbol_2 outputs;
|
||||
outputs = frag_main(inputs);
|
||||
gl_FragDepth = outputs.value;
|
||||
float inner_result = frag_main(gl_FragCoord);
|
||||
gl_FragDepth = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -266,74 +223,41 @@ TEST_F(GlslGeneratorImplTest_Function,
|
|||
EXPECT_EQ(gen.result(), R"(#version 310 es
|
||||
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 {
|
||||
vec4 pos;
|
||||
float col1;
|
||||
float col2;
|
||||
};
|
||||
|
||||
struct tint_symbol {
|
||||
float col1;
|
||||
float col2;
|
||||
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;
|
||||
Interface vert_main() {
|
||||
Interface tint_symbol = Interface(vec4(0.0f, 0.0f, 0.0f, 0.0f), 0.5f, 0.25f);
|
||||
return tint_symbol;
|
||||
}
|
||||
|
||||
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() {
|
||||
tint_symbol outputs;
|
||||
outputs = vert_main();
|
||||
col1 = outputs.col1;
|
||||
col2 = outputs.col2;
|
||||
gl_Position = outputs.pos;
|
||||
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
Interface inner_result = vert_main();
|
||||
gl_Position = inner_result.pos;
|
||||
col1_1 = inner_result.col1;
|
||||
col2_1 = inner_result.col2;
|
||||
gl_Position.y = -(gl_Position.y);
|
||||
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
struct tint_symbol_2 {
|
||||
float col1;
|
||||
float col2;
|
||||
vec4 pos;
|
||||
};
|
||||
|
||||
void frag_main_inner(Interface inputs) {
|
||||
void frag_main(Interface inputs) {
|
||||
float r = inputs.col1;
|
||||
float g = inputs.col2;
|
||||
vec4 p = inputs.pos;
|
||||
}
|
||||
|
||||
void frag_main(tint_symbol_2 tint_symbol_1) {
|
||||
Interface tint_symbol_4 = Interface(tint_symbol_1.pos, tint_symbol_1.col1, tint_symbol_1.col2);
|
||||
frag_main_inner(tint_symbol_4);
|
||||
void main_1() {
|
||||
Interface tint_symbol_1 = Interface(gl_FragCoord, col1_2, col2_2);
|
||||
frag_main(tint_symbol_1);
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
frag_main();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -508,11 +427,6 @@ void frag_main() {
|
|||
float v = uniforms.coord.x;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
frag_main();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -566,8 +480,8 @@ void frag_main() {
|
|||
|
||||
void main() {
|
||||
frag_main();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -621,8 +535,8 @@ void frag_main() {
|
|||
|
||||
void main() {
|
||||
frag_main();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -672,8 +586,8 @@ void frag_main() {
|
|||
|
||||
void main() {
|
||||
frag_main();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -724,8 +638,8 @@ void frag_main() {
|
|||
|
||||
void main() {
|
||||
frag_main();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -778,11 +692,6 @@ void frag_main() {
|
|||
float v = sub_func(1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
frag_main();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -839,8 +748,8 @@ void frag_main() {
|
|||
|
||||
void main() {
|
||||
frag_main();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -858,13 +767,12 @@ TEST_F(GlslGeneratorImplTest_Function,
|
|||
precision mediump float;
|
||||
|
||||
void tint_symbol() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -885,11 +793,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void main() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
main();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -911,11 +814,6 @@ layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in;
|
|||
void main() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
main();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -943,11 +841,6 @@ layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in;
|
|||
void main() {
|
||||
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() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
main();
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -1096,26 +984,26 @@ struct Data {
|
|||
layout(binding = 0) buffer Data_1 {
|
||||
float d;
|
||||
} data;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void a() {
|
||||
float v = data.d;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
a();
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void b() {
|
||||
float v = data.d;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main_1() {
|
||||
b();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
float val = 0.0f;
|
||||
float tint_symbol = tint_degrees(val);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
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() {
|
||||
vec3 val = vec3(0.0f, 0.0f, 0.0f);
|
||||
vec3 tint_symbol = tint_degrees(val);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
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() {
|
||||
float val = 0.0f;
|
||||
float tint_symbol = tint_radians(val);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
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() {
|
||||
vec3 val = vec3(0.0f, 0.0f, 0.0f);
|
||||
vec3 tint_symbol = tint_radians(val);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
test_function();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -736,16 +732,15 @@ int tint_int_dot(ivec3 a, ivec3 b) {
|
|||
}
|
||||
|
||||
ivec3 v = ivec3(0, 0, 0);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void test_function() {
|
||||
tint_int_dot(v, v);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
test_function();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -764,16 +759,15 @@ uint tint_int_dot(uvec3 a, uvec3 b) {
|
|||
}
|
||||
|
||||
uvec3 v = uvec3(0u, 0u, 0u);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void test_function() {
|
||||
tint_int_dot(v, v);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
test_function();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
|
|
@ -140,16 +140,15 @@ struct Data {
|
|||
};
|
||||
|
||||
Data str = Data(0.0f);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void test_function() {
|
||||
float expr = str.mem;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
test_function();
|
||||
return;
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -306,13 +305,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
data.b = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -355,13 +353,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
float x = data.a[2][1];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -402,13 +399,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
int x = data.a[2];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -450,13 +446,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
int x = data.a[((2 + 4) - 3)];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -495,13 +490,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
data.a[2] = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -554,13 +548,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
vec3 x = data.c[2].b;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -616,13 +609,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
vec2 x = data.c[2].b.xy;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -678,13 +670,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
float x = data.c[2].b.g;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -740,13 +731,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
float x = data.c[2].b[1];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -798,13 +788,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
data.c[2].b = vec3(1.0f, 2.0f, 3.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
@ -860,13 +849,12 @@ layout(binding = 0) buffer Data_1 {
|
|||
} data;
|
||||
void tint_symbol() {
|
||||
data.c[2].b.y = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(gen.result(), expected);
|
||||
}
|
||||
|
|
|
@ -59,13 +59,12 @@ void a_func() {
|
|||
b.GetDimensions(tint_symbol_1);
|
||||
uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
uint len = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
a_func();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(expect, got);
|
||||
}
|
||||
|
@ -109,13 +108,12 @@ void a_func() {
|
|||
b.GetDimensions(tint_symbol_1);
|
||||
uint tint_symbol_2 = ((tint_symbol_1 - 4u) / 4u);
|
||||
uint len = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
a_func();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
|
||||
EXPECT_EQ(expect, got);
|
||||
|
@ -160,13 +158,12 @@ void a_func() {
|
|||
b.GetDimensions(tint_symbol_1);
|
||||
uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
uint len = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
a_func();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
|
||||
EXPECT_EQ(expect, got);
|
||||
|
@ -196,13 +193,12 @@ precision mediump float;
|
|||
void tint_symbol() {
|
||||
int tint_symbol_1[4] = int[4](1, 2, 3, 4);
|
||||
int pos = tint_symbol_1[3];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(expect, got);
|
||||
}
|
||||
|
@ -243,13 +239,12 @@ struct S {
|
|||
void tint_symbol() {
|
||||
S tint_symbol_1 = S(1, vec3(2.0f, 3.0f, 4.0f), 4);
|
||||
vec3 pos = tint_symbol_1.b;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(expect, got);
|
||||
}
|
||||
|
@ -284,13 +279,12 @@ precision mediump float;
|
|||
void tint_symbol() {
|
||||
int v = 0;
|
||||
int x = v;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(expect, got);
|
||||
}
|
||||
|
@ -337,13 +331,12 @@ precision mediump float;
|
|||
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));
|
||||
vec4 v = a[3][2];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
)";
|
||||
EXPECT_EQ(expect, got);
|
||||
}
|
||||
|
|
|
@ -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 glsl
|
||||
} // namespace writer
|
||||
|
|
|
@ -6,13 +6,12 @@ void main_1() {
|
|||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
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));
|
||||
vec3 v = m[1];
|
||||
float f = v[1];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,12 @@ void main_1() {
|
|||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec3 v = vec3(1.0f, 2.0f, 3.0f);
|
||||
float scalar = v.y;
|
||||
vec2 swizzle2 = v.xz;
|
||||
vec3 swizzle3 = v.xzy;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,12 @@ void main_1() {
|
|||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
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];
|
||||
float f = v[1];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ void main_1() {
|
|||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec3 v = vec3(0.0f, 0.0f, 0.0f);
|
||||
float scalar = v.y;
|
||||
vec2 swizzle2 = v.xz;
|
||||
vec3 swizzle3 = v.xzy;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,11 +5,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
|
|
|
@ -5,11 +5,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
|
|
|
@ -5,11 +5,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
|
|
|
@ -5,11 +5,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
struct S {
|
||||
int arr[4];
|
||||
};
|
||||
|
|
|
@ -5,11 +5,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
|
|
|
@ -13,7 +13,6 @@ float f3(float a[2][3][4]) {
|
|||
return a[1][2][3];
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
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));
|
||||
|
@ -21,10 +20,10 @@ void tint_symbol() {
|
|||
float v1 = f1(a1);
|
||||
float v2 = f2(a2);
|
||||
float v3 = f3(a3);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,15 +16,14 @@ float[2][3][4] f3() {
|
|||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
float a1[4] = f1();
|
||||
float a2[3][4] = f2();
|
||||
float a3[2][3][4] = f3();
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,9 @@ void tint_symbol() {
|
|||
float unsigned_constant[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||
signed_literal = unsigned_constant;
|
||||
signed_constant = unsigned_literal;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
int x = 42;
|
||||
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_20[2][4] = int[2][4](tint_symbol_19, nested_nonempty[1][2]);
|
||||
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() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@ SKIP: FAILED
|
|||
#version 310 es
|
||||
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 {
|
||||
float value;
|
||||
};
|
||||
|
@ -32,17 +35,7 @@ struct VertexOutput {
|
|||
vec4 v_color;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
vec4 position;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
vec4 v_color;
|
||||
vec4 Position;
|
||||
};
|
||||
|
||||
VertexOutput vert_main_inner(vec4 position, vec4 color) {
|
||||
VertexOutput vert_main(vec4 position, vec4 color) {
|
||||
float fade = ((uniforms.scalarOffset + ((time.value * uniforms.scalar) / 10.0f)) % 1.0f);
|
||||
if ((fade < 0.5f)) {
|
||||
fade = (fade * 2.0f);
|
||||
|
@ -62,41 +55,17 @@ VertexOutput vert_main_inner(vec4 position, vec4 color) {
|
|||
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() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.position = position;
|
||||
inputs.color = color;
|
||||
tint_symbol_3 outputs;
|
||||
outputs = vert_main(inputs);
|
||||
v_color = outputs.v_color;
|
||||
gl_Position = outputs.Position;
|
||||
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
VertexOutput inner_result = vert_main(position_1, color_1);
|
||||
gl_Position = inner_result.Position;
|
||||
v_color_1 = inner_result.v_color;
|
||||
gl_Position.y = -(gl_Position.y);
|
||||
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
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:44: '' : compilation terminated
|
||||
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:37: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
@ -104,6 +73,8 @@ ERROR: 2 compilation errors. No code generated.
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(location = 0) in vec4 v_color_1;
|
||||
layout(location = 0) out vec4 value_1;
|
||||
struct Time {
|
||||
float value;
|
||||
};
|
||||
|
@ -121,42 +92,12 @@ struct VertexOutput {
|
|||
vec4 v_color;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
vec4 position;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
vec4 v_color;
|
||||
vec4 Position;
|
||||
};
|
||||
|
||||
struct tint_symbol_5 {
|
||||
vec4 v_color;
|
||||
};
|
||||
|
||||
struct tint_symbol_6 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
vec4 frag_main_inner(vec4 v_color) {
|
||||
vec4 frag_main(vec4 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() {
|
||||
tint_symbol_5 inputs;
|
||||
inputs.v_color = v_color;
|
||||
tint_symbol_6 outputs;
|
||||
outputs = frag_main(inputs);
|
||||
value = outputs.value;
|
||||
vec4 inner_result = frag_main(v_color_1);
|
||||
value_1 = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,11 @@ SKIP: FAILED
|
|||
#version 310 es
|
||||
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 {
|
||||
mat4 modelViewProjectionMatrix;
|
||||
vec3 right;
|
||||
|
@ -27,38 +32,6 @@ struct VertexOutput {
|
|||
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 {
|
||||
float deltaTime;
|
||||
vec4 seed;
|
||||
|
@ -71,61 +44,36 @@ struct Particle {
|
|||
vec3 velocity;
|
||||
};
|
||||
|
||||
struct tint_symbol_10 {
|
||||
uvec3 GlobalInvocationID;
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
uint width;
|
||||
};
|
||||
|
||||
struct tint_symbol_12 {
|
||||
uvec3 coord;
|
||||
};
|
||||
|
||||
struct tint_symbol_14 {
|
||||
uvec3 coord;
|
||||
};
|
||||
|
||||
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;
|
||||
VertexOutput vs_main(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;
|
||||
}
|
||||
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() {
|
||||
tint_symbol_4 inputs;
|
||||
inputs.position = position;
|
||||
inputs.color = color;
|
||||
inputs.quad_pos = quad_pos;
|
||||
tint_symbol_5 outputs;
|
||||
outputs = vs_main(inputs);
|
||||
color = outputs.color;
|
||||
quad_pos = outputs.quad_pos;
|
||||
gl_Position = outputs.position;
|
||||
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
VertexInput tint_symbol_3 = VertexInput(position_1, color_1, quad_pos_1);
|
||||
VertexOutput inner_result = vs_main(tint_symbol_3);
|
||||
gl_Position = inner_result.position;
|
||||
color_2 = inner_result.color;
|
||||
quad_pos_2 = inner_result.quad_pos;
|
||||
gl_Position.y = -(gl_Position.y);
|
||||
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:100: 'color' : redefinition
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
||||
#version 310 es
|
||||
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 {
|
||||
mat4 modelViewProjectionMatrix;
|
||||
vec3 right;
|
||||
|
@ -144,34 +92,6 @@ struct VertexOutput {
|
|||
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 {
|
||||
float deltaTime;
|
||||
vec4 seed;
|
||||
|
@ -184,44 +104,22 @@ struct Particle {
|
|||
vec3 velocity;
|
||||
};
|
||||
|
||||
struct tint_symbol_10 {
|
||||
uvec3 GlobalInvocationID;
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
uint width;
|
||||
};
|
||||
|
||||
struct tint_symbol_12 {
|
||||
uvec3 coord;
|
||||
};
|
||||
|
||||
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;
|
||||
vec4 fs_main(VertexOutput tint_symbol) {
|
||||
vec4 color = tint_symbol.color;
|
||||
color.a = (color.a * max((1.0f - length(tint_symbol.quad_pos)), 0.0f));
|
||||
return color;
|
||||
}
|
||||
layout(location = 0) in vec4 color;
|
||||
layout(location = 1) in vec2 quad_pos;
|
||||
|
||||
layout(location = 0) out vec4 value;
|
||||
|
||||
void main() {
|
||||
tint_symbol_7 inputs;
|
||||
inputs.color = color;
|
||||
inputs.quad_pos = quad_pos;
|
||||
inputs.position = gl_FragCoord;
|
||||
tint_symbol_8 outputs;
|
||||
outputs = fs_main(inputs);
|
||||
value = outputs.value;
|
||||
VertexOutput tint_symbol_3 = VertexOutput(gl_FragCoord, color_1, quad_pos_1);
|
||||
vec4 inner_result = fs_main(tint_symbol_3);
|
||||
value_1 = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
|
@ -250,28 +148,6 @@ struct VertexOutput {
|
|||
vec2 quad_pos;
|
||||
};
|
||||
|
||||
struct tint_symbol_4 {
|
||||
vec3 position;
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
};
|
||||
|
||||
struct tint_symbol_5 {
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_7 {
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_8 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
struct SimulationParams {
|
||||
float deltaTime;
|
||||
vec4 seed;
|
||||
|
@ -292,12 +168,12 @@ layout(binding = 0) uniform SimulationParams_1 {
|
|||
layout(binding = 1) buffer Particles_1 {
|
||||
Particle particles[];
|
||||
} data;
|
||||
struct tint_symbol_10 {
|
||||
uvec3 GlobalInvocationID;
|
||||
struct UBO {
|
||||
uint width;
|
||||
};
|
||||
|
||||
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);
|
||||
uint idx = GlobalInvocationID.x;
|
||||
Particle particle = data.particles[idx];
|
||||
|
@ -328,31 +204,11 @@ void simulate_inner(uvec3 GlobalInvocationID) {
|
|||
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;
|
||||
void simulate(tint_symbol_10 tint_symbol_9) {
|
||||
simulate_inner(tint_symbol_9.GlobalInvocationID);
|
||||
void main() {
|
||||
simulate(gl_GlobalInvocationID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_10 inputs;
|
||||
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||
simulate(inputs);
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:6: 'frac' : no matching overloaded function found
|
||||
ERROR: 0:6: '' : compilation terminated
|
||||
|
@ -381,28 +237,6 @@ struct VertexOutput {
|
|||
vec2 quad_pos;
|
||||
};
|
||||
|
||||
struct tint_symbol_4 {
|
||||
vec3 position;
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
};
|
||||
|
||||
struct tint_symbol_5 {
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_7 {
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_8 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
struct SimulationParams {
|
||||
float deltaTime;
|
||||
vec4 seed;
|
||||
|
@ -415,10 +249,6 @@ struct Particle {
|
|||
vec3 velocity;
|
||||
};
|
||||
|
||||
struct tint_symbol_10 {
|
||||
uvec3 GlobalInvocationID;
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
uint width;
|
||||
};
|
||||
|
@ -433,33 +263,17 @@ layout(binding = 4) buffer Buffer_1 {
|
|||
layout(binding = 5) buffer Buffer_2 {
|
||||
float weights[];
|
||||
} buf_out;
|
||||
struct tint_symbol_12 {
|
||||
uvec3 coord;
|
||||
};
|
||||
|
||||
uniform highp sampler2D tex_in_1;
|
||||
void import_level_inner(uvec3 coord) {
|
||||
void import_level(uvec3 coord) {
|
||||
uint offset = (coord.x + (coord.y * ubo.width));
|
||||
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;
|
||||
void import_level(tint_symbol_12 tint_symbol_11) {
|
||||
import_level_inner(tint_symbol_11.coord);
|
||||
void main() {
|
||||
import_level(gl_GlobalInvocationID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_12 inputs;
|
||||
inputs.coord = gl_GlobalInvocationID;
|
||||
import_level(inputs);
|
||||
}
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
|
@ -481,28 +295,6 @@ struct VertexOutput {
|
|||
vec2 quad_pos;
|
||||
};
|
||||
|
||||
struct tint_symbol_4 {
|
||||
vec3 position;
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
};
|
||||
|
||||
struct tint_symbol_5 {
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_7 {
|
||||
vec4 color;
|
||||
vec2 quad_pos;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_8 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
struct SimulationParams {
|
||||
float deltaTime;
|
||||
vec4 seed;
|
||||
|
@ -515,10 +307,6 @@ struct Particle {
|
|||
vec3 velocity;
|
||||
};
|
||||
|
||||
struct tint_symbol_10 {
|
||||
uvec3 GlobalInvocationID;
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
uint width;
|
||||
};
|
||||
|
@ -533,16 +321,8 @@ layout(binding = 4) buffer Buffer_1 {
|
|||
layout(binding = 5) buffer Buffer_2 {
|
||||
float weights[];
|
||||
} buf_out;
|
||||
struct tint_symbol_12 {
|
||||
uvec3 coord;
|
||||
};
|
||||
|
||||
struct tint_symbol_14 {
|
||||
uvec3 coord;
|
||||
};
|
||||
|
||||
layout(rgba8) uniform highp writeonly image2D tex_out_1;
|
||||
void export_level_inner(uvec3 coord) {
|
||||
void export_level(uvec3 coord) {
|
||||
if (all(lessThan(coord.xy, uvec2(imageSize(tex_out_1))))) {
|
||||
uint dst_offset = (coord.x + (coord.y * 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;
|
||||
void export_level(tint_symbol_14 tint_symbol_13) {
|
||||
export_level_inner(tint_symbol_13.coord);
|
||||
void main() {
|
||||
export_level(gl_GlobalInvocationID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_14 inputs;
|
||||
inputs.coord = gl_GlobalInvocationID;
|
||||
export_level(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@ SKIP: FAILED
|
|||
#version 310 es
|
||||
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;
|
||||
struct Scene {
|
||||
mat4 lightViewProjMatrix;
|
||||
|
@ -24,19 +28,9 @@ struct FragmentInput {
|
|||
|
||||
const vec3 albedo = vec3(0.899999976f, 0.899999976f, 0.899999976f);
|
||||
const float ambientFactor = 0.200000003f;
|
||||
struct tint_symbol_3 {
|
||||
vec3 shadowPos;
|
||||
vec3 fragPos;
|
||||
vec3 fragNorm;
|
||||
};
|
||||
|
||||
struct tint_symbol_4 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
uniform highp sampler2D shadowMap_shadowSampler;
|
||||
|
||||
vec4 tint_symbol_inner(FragmentInput tint_symbol_1) {
|
||||
vec4 tint_symbol(FragmentInput tint_symbol_1) {
|
||||
float visibility = 0.0f;
|
||||
float oneOverShadowDepthTextureSize = (1.0f / shadowDepthTextureSize);
|
||||
{
|
||||
|
@ -55,31 +49,15 @@ vec4 tint_symbol_inner(FragmentInput tint_symbol_1) {
|
|||
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() {
|
||||
tint_symbol_3 inputs;
|
||||
inputs.shadowPos = shadowPos;
|
||||
inputs.fragPos = fragPos;
|
||||
inputs.fragNorm = fragNorm;
|
||||
tint_symbol_4 outputs;
|
||||
outputs = tint_symbol(inputs);
|
||||
value = outputs.value;
|
||||
FragmentInput tint_symbol_2 = FragmentInput(shadowPos_1, fragPos_1, fragNorm_1);
|
||||
vec4 inner_result = tint_symbol(tint_symbol_2);
|
||||
value = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:45: 'assign' : cannot convert from ' temp highp 4-component vector of float' to ' temp mediump float'
|
||||
ERROR: 0:45: '' : compilation terminated
|
||||
ERROR: 0:39: 'assign' : cannot convert from ' temp highp 4-component vector of float' to ' temp mediump float'
|
||||
ERROR: 0:39: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
@ -7,6 +7,17 @@ benchmark/skinned-shadowed-pbr-fragment.wgsl:51:13 warning: use of deprecated la
|
|||
#version 310 es
|
||||
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;
|
||||
vec3 linearTosRGB(vec3 linear) {
|
||||
float INV_GAMMA = (1.0f / GAMMA);
|
||||
|
@ -312,27 +323,9 @@ struct FragmentOutput {
|
|||
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_defaultSampler;
|
||||
FragmentOutput fragmentMain_inner(VertexOutput tint_symbol) {
|
||||
FragmentOutput fragmentMain(VertexOutput tint_symbol) {
|
||||
SurfaceInfo surface = GetSurfaceInfo(tint_symbol);
|
||||
vec3 Lo = vec3(0.0f, 0.0f, 0.0f);
|
||||
if ((globalLights.dirIntensity > 0.0f)) {
|
||||
|
@ -370,48 +363,16 @@ FragmentOutput fragmentMain_inner(VertexOutput tint_symbol) {
|
|||
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() {
|
||||
tint_symbol_4 inputs;
|
||||
inputs.worldPos = worldPos;
|
||||
inputs.view = view;
|
||||
inputs.texcoord = texcoord;
|
||||
inputs.texcoord2 = texcoord2;
|
||||
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;
|
||||
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);
|
||||
FragmentOutput inner_result = fragmentMain(tint_symbol_3);
|
||||
color_2 = inner_result.color;
|
||||
emissive_1 = inner_result.emissive;
|
||||
return;
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:65: 'mad' : no matching overloaded function found
|
||||
ERROR: 0:65: '' : compilation terminated
|
||||
ERROR: 0:76: 'mad' : no matching overloaded function found
|
||||
ERROR: 0:76: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
@ -16,11 +16,7 @@ struct Inner {
|
|||
layout(binding = 0) buffer S_1 {
|
||||
Inner arr[];
|
||||
} s;
|
||||
struct tint_symbol_2 {
|
||||
uint idx;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx) {
|
||||
void tint_symbol(uint idx) {
|
||||
ivec3 a = s.arr[idx].a;
|
||||
int b = s.arr[idx].b;
|
||||
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;
|
||||
void tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||
tint_symbol_inner(tint_symbol_1.idx);
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||
tint_symbol(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,7 @@ struct Inner {
|
|||
layout(binding = 0) buffer S_1 {
|
||||
Inner arr[];
|
||||
} s;
|
||||
struct tint_symbol_2 {
|
||||
uint idx;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx) {
|
||||
void tint_symbol(uint idx) {
|
||||
s.arr[idx].a = ivec3(0, 0, 0);
|
||||
s.arr[idx].b = 0;
|
||||
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].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);
|
||||
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));
|
||||
s.arr[idx].i = tint_symbol_3;
|
||||
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_1;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||
tint_symbol_inner(tint_symbol_1.idx);
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||
tint_symbol(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ layout(binding = 0) buffer S_1 {
|
|||
Inner i;
|
||||
Inner j[4];
|
||||
} s;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
ivec3 a = s.a;
|
||||
int b = s.b;
|
||||
|
@ -42,10 +41,10 @@ void tint_symbol() {
|
|||
mat3x2 h = s.h;
|
||||
Inner i = s.i;
|
||||
Inner j[4] = s.j;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ layout(binding = 0) buffer S_1 {
|
|||
Inner i;
|
||||
Inner j[4];
|
||||
} s;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
s.a = ivec3(0, 0, 0);
|
||||
s.b = 0;
|
||||
|
@ -44,10 +43,10 @@ void tint_symbol() {
|
|||
s.i = tint_symbol_1;
|
||||
Inner tint_symbol_2[4] = Inner[4](Inner(0), Inner(0), Inner(0), Inner(0));
|
||||
s.j = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
float inner[4];
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
float inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
int inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
mat2 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
mat2x3 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
mat3x2 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
mat4 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
S inner[];
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner[0] = tint_symbol.inner[0];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,19 +17,18 @@ layout(binding = 0) buffer S_1 {
|
|||
layout(binding = 1) buffer S_2 {
|
||||
Inner inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1 = tint_symbol;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:20: 'assign' : cannot convert from 'layout( binding=0 column_major shared) buffer block{layout( column_major shared) buffer structure{ global mediump float f} inner}' to 'layout( binding=1 column_major shared) buffer block{layout( column_major shared) buffer structure{ global mediump float f} inner}'
|
||||
ERROR: 0:20: '' : compilation terminated
|
||||
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:19: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
uint inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
ivec2 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
uvec3 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@ layout(binding = 0) buffer tint_symbol_block_1 {
|
|||
layout(binding = 1) buffer tint_symbol_block_2 {
|
||||
vec4 inner;
|
||||
} tint_symbol_1;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol_2() {
|
||||
tint_symbol_1.inner = tint_symbol.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol_2();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,7 @@ layout(binding = 0) uniform S_1 {
|
|||
Inner arr[8];
|
||||
} s;
|
||||
|
||||
struct tint_symbol_2 {
|
||||
uint idx;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx) {
|
||||
void tint_symbol(uint idx) {
|
||||
ivec3 a = s.arr[idx].a;
|
||||
int b = s.arr[idx].b;
|
||||
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;
|
||||
void tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||
tint_symbol_inner(tint_symbol_1.idx);
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||
tint_symbol(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ layout(binding = 0) uniform S_1 {
|
|||
Inner l[4];
|
||||
} s;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
ivec3 a = s.a;
|
||||
int b = s.b;
|
||||
|
@ -49,10 +48,10 @@ void tint_symbol() {
|
|||
mat3x2 j = s.j;
|
||||
Inner k = s.k;
|
||||
Inner l[4] = s.l;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
vec4 inner[4];
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec4 x[4] = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
float inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
float x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
int inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
int x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
mat2 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat2 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
mat2x3 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat2x3 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
mat3x2 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat3x2 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
mat4 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat4 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,19 +15,18 @@ layout(binding = 0) uniform S_1 {
|
|||
Inner inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
S x = u;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
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:18: '' : compilation terminated
|
||||
ERROR: 0:17: '=' : cannot convert from 'layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform structure{ global mediump float f} inner}' to ' temp structure{ global structure{ global mediump float f} inner}'
|
||||
ERROR: 0:17: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
uint inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
uint x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
ivec2 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
ivec2 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
uvec3 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
uvec3 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
|
|||
vec4 inner;
|
||||
} u;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec4 x = u.inner;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,4 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
const int H = 1;
|
||||
|
|
|
@ -20,11 +20,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
void i() {
|
||||
float s = tint_modf(1.0f).whole;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#version 310 es
|
||||
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 {
|
||||
uint vertex_index;
|
||||
int loc0;
|
||||
|
@ -11,52 +15,17 @@ struct VertexInputs1 {
|
|||
vec4 loc3;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
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) {
|
||||
vec4 tint_symbol(VertexInputs0 inputs0, uint loc1, uint instance_index, VertexInputs1 inputs1) {
|
||||
uint foo = (inputs0.vertex_index + instance_index);
|
||||
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() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.loc0 = loc0;
|
||||
inputs.loc1 = loc1;
|
||||
inputs.loc1_1 = loc1_1;
|
||||
inputs.loc3 = loc3;
|
||||
inputs.vertex_index = uint(gl_VertexID);
|
||||
inputs.instance_index = uint(gl_InstanceID);
|
||||
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;
|
||||
VertexInputs0 tint_symbol_1 = VertexInputs0(uint(gl_VertexID), loc0_1);
|
||||
VertexInputs1 tint_symbol_2 = VertexInputs1(loc1_2, loc3_1);
|
||||
vec4 inner_result = tint_symbol(tint_symbol_1, loc1_1, uint(gl_InstanceID), tint_symbol_2);
|
||||
gl_Position = inner_result;
|
||||
gl_Position.y = -(gl_Position.y);
|
||||
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,11 +111,7 @@ void doIgnore() {
|
|||
int g55 = atomicOr(LUT.values[0], 0);
|
||||
}
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uvec3 GlobalInvocationID;
|
||||
};
|
||||
|
||||
void main_count_inner(uvec3 GlobalInvocationID) {
|
||||
void main_count(uvec3 GlobalInvocationID) {
|
||||
uint triangleIndex = GlobalInvocationID.x;
|
||||
if ((triangleIndex >= uniforms.numTriangles)) {
|
||||
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;
|
||||
void main_count(tint_symbol_1 tint_symbol) {
|
||||
main_count_inner(tint_symbol.GlobalInvocationID);
|
||||
void main() {
|
||||
main_count(gl_GlobalInvocationID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_1 inputs;
|
||||
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||
main_count(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,11 +5,6 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
struct A {
|
||||
int a;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(location = 0) out vec2 texcoords_1;
|
||||
struct Uniforms {
|
||||
vec2 u_scale;
|
||||
vec2 u_offset;
|
||||
|
@ -16,16 +17,7 @@ struct VertexOutputs {
|
|||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
uint VertexIndex;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
vec2 texcoords;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
VertexOutputs vs_main_inner(uint VertexIndex) {
|
||||
VertexOutputs vs_main(uint VertexIndex) {
|
||||
vec2 texcoord[3] = vec2[3](vec2(-0.5f, 0.0f), vec2(1.5f, 0.0f), vec2(0.5f, 2.0f));
|
||||
VertexOutputs tint_symbol = VertexOutputs(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
tint_symbol.position = vec4(((texcoord[VertexIndex] * 2.0f) - vec2(1.0f, 1.0f)), 0.0f, 1.0f);
|
||||
|
@ -38,39 +30,19 @@ VertexOutputs vs_main_inner(uint VertexIndex) {
|
|||
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() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.VertexIndex = uint(gl_VertexID);
|
||||
tint_symbol_3 outputs;
|
||||
outputs = vs_main(inputs);
|
||||
texcoords = outputs.texcoords;
|
||||
gl_Position = outputs.position;
|
||||
gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;
|
||||
gl_Position.y = -gl_Position.y;
|
||||
VertexOutputs inner_result = vs_main(uint(gl_VertexID));
|
||||
texcoords_1 = inner_result.texcoords;
|
||||
gl_Position = inner_result.position;
|
||||
gl_Position.y = -(gl_Position.y);
|
||||
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(location = 0) in vec2 texcoord_1;
|
||||
layout(location = 0) out vec4 value;
|
||||
struct Uniforms {
|
||||
vec2 u_scale;
|
||||
vec2 u_offset;
|
||||
|
@ -81,26 +53,9 @@ struct VertexOutputs {
|
|||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
uint VertexIndex;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
vec2 texcoords;
|
||||
vec4 position;
|
||||
};
|
||||
|
||||
struct tint_symbol_5 {
|
||||
vec2 texcoord;
|
||||
};
|
||||
|
||||
struct tint_symbol_6 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
uniform highp sampler2D myTexture_mySampler;
|
||||
|
||||
vec4 fs_main_inner(vec2 texcoord) {
|
||||
vec4 fs_main(vec2 texcoord) {
|
||||
vec2 clampedTexcoord = clamp(texcoord, vec2(0.0f, 0.0f), vec2(1.0f, 1.0f));
|
||||
if (!(all(equal(clampedTexcoord, texcoord)))) {
|
||||
discard;
|
||||
|
@ -109,20 +64,8 @@ vec4 fs_main_inner(vec2 texcoord) {
|
|||
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() {
|
||||
tint_symbol_5 inputs;
|
||||
inputs.texcoord = texcoord;
|
||||
tint_symbol_6 outputs;
|
||||
outputs = fs_main(inputs);
|
||||
value = outputs.value;
|
||||
vec4 inner_result = fs_main(texcoord_1);
|
||||
value = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,14 +20,13 @@ struct Result {
|
|||
layout(binding = 1) buffer Result_1 {
|
||||
int tint_symbol;
|
||||
} result;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
result.tint_symbol = s.data[ubo.dynamic_idx];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,13 +21,12 @@ layout(binding = 1) buffer Result_1 {
|
|||
int tint_symbol;
|
||||
} result;
|
||||
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
result.tint_symbol = s.data[ubo.dynamic_idx];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,13 +23,12 @@ struct SSBO {
|
|||
layout(binding = 1) buffer SSBO_1 {
|
||||
int data[4];
|
||||
} ssbo;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
result.tint_symbol = ssbo.data[ubo.dynamic_idx];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,13 +18,12 @@ struct Result {
|
|||
layout(binding = 2) buffer Result_1 {
|
||||
int tint_symbol;
|
||||
} result;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
result.tint_symbol = ubo.data[ubo.dynamic_idx].x;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,7 @@ layout(binding = 1) buffer Result_1 {
|
|||
int tint_symbol;
|
||||
} result;
|
||||
shared S s;
|
||||
struct tint_symbol_2 {
|
||||
uint local_invocation_index;
|
||||
};
|
||||
|
||||
void f_inner(uint local_invocation_index) {
|
||||
void f(uint local_invocation_index) {
|
||||
{
|
||||
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
||||
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;
|
||||
void f(tint_symbol_2 tint_symbol_1) {
|
||||
f_inner(tint_symbol_1.local_invocation_index);
|
||||
void main() {
|
||||
f(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||
f(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,15 +20,14 @@ struct Result {
|
|||
layout(binding = 1) buffer Result_1 {
|
||||
int tint_symbol;
|
||||
} result;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
s.data[ubo.dynamic_idx] = 1;
|
||||
result.tint_symbol = s.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,15 +24,14 @@ void x(inout S p) {
|
|||
p.data[ubo.dynamic_idx] = 1;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
x(s);
|
||||
result.tint_symbol = s.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,14 +21,13 @@ layout(binding = 1) buffer Result_1 {
|
|||
int tint_symbol;
|
||||
} result;
|
||||
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
s.data[ubo.dynamic_idx] = 1;
|
||||
result.tint_symbol = s.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,14 +25,13 @@ void x(inout S p) {
|
|||
p.data[ubo.dynamic_idx] = 1;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
x(s);
|
||||
result.tint_symbol = s.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,14 +23,13 @@ struct SSBO {
|
|||
layout(binding = 1) buffer SSBO_1 {
|
||||
int data[4];
|
||||
} ssbo;
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void f() {
|
||||
ssbo.data[ubo.dynamic_idx] = 1;
|
||||
result.tint_symbol = ssbo.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,7 @@ layout(binding = 1) buffer Result_1 {
|
|||
int tint_symbol;
|
||||
} result;
|
||||
shared S s;
|
||||
struct tint_symbol_2 {
|
||||
uint local_invocation_index;
|
||||
};
|
||||
|
||||
void f_inner(uint local_invocation_index) {
|
||||
void f(uint local_invocation_index) {
|
||||
{
|
||||
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
||||
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;
|
||||
void f(tint_symbol_2 tint_symbol_1) {
|
||||
f_inner(tint_symbol_1.local_invocation_index);
|
||||
void main() {
|
||||
f(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||
f(inputs);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
struct tint_symbol_2 {
|
||||
vec2 vUV;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
vec4 value;
|
||||
};
|
||||
|
||||
layout(location = 0) in vec2 vUV_1;
|
||||
layout(location = 0) out vec4 value;
|
||||
uniform highp sampler2D randomTexture_Sampler;
|
||||
uniform highp sampler2D depthTexture_Sampler;
|
||||
|
||||
vec4 tint_symbol_inner(vec2 vUV) {
|
||||
vec4 tint_symbol(vec2 vUV) {
|
||||
vec3 random = texture(randomTexture_Sampler, vUV).rgb;
|
||||
int i = 0;
|
||||
while (true) {
|
||||
|
@ -43,20 +37,8 @@ vec4 tint_symbol_inner(vec2 vUV) {
|
|||
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() {
|
||||
tint_symbol_2 inputs;
|
||||
inputs.vUV = vUV;
|
||||
tint_symbol_3 outputs;
|
||||
outputs = tint_symbol(inputs);
|
||||
value = outputs.value;
|
||||
vec4 inner_result = tint_symbol(vUV_1);
|
||||
value = inner_result;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,14 +19,13 @@ layout(binding = 4) uniform Simulation_1 {
|
|||
uint i;
|
||||
} sim;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
Particle particle = particles.p[0];
|
||||
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() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,14 +11,13 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
uint j;
|
||||
} uniforms;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
m1[uniforms.i][0] = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,14 +11,13 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
uint j;
|
||||
} uniforms;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
m1[uniforms.i][uniforms.j] = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
} uniforms;
|
||||
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
m1[0][uniforms.j] = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,14 +11,13 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
uint j;
|
||||
} uniforms;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
m1[uniforms.i] = vec4(1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
} uniforms;
|
||||
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
m1[uniforms.i][0] = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
} uniforms;
|
||||
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
m1[uniforms.i][uniforms.j] = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
} uniforms;
|
||||
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
m1[0][uniforms.j] = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,13 +12,12 @@ layout(binding = 4) uniform Uniforms_1 {
|
|||
} uniforms;
|
||||
|
||||
mat2x4 m1 = mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
m1[uniforms.i] = vec4(1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,17 +16,16 @@ void foo() {
|
|||
}
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
{
|
||||
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,17 +13,16 @@ void foo() {
|
|||
v2b[i] = true;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
{
|
||||
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec2 v2f = vec2(0.0f, 0.0f);
|
||||
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
@ -31,10 +30,10 @@ void tint_symbol() {
|
|||
v4b[i] = true;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec2 v2f = vec2(0.0f, 0.0f);
|
||||
vec2 v2f_2 = vec2(0.0f, 0.0f);
|
||||
|
@ -23,10 +22,10 @@ void tint_symbol() {
|
|||
v2b_2[i] = true;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec2 v2f = vec2(0.0f, 0.0f);
|
||||
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
@ -32,10 +31,10 @@ void tint_symbol() {
|
|||
v4u[i] = 1u;
|
||||
v3b[i] = true;
|
||||
v4b[i] = true;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void tint_symbol() {
|
||||
vec2 v2f = vec2(0.0f, 0.0f);
|
||||
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
@ -28,10 +27,10 @@ void tint_symbol() {
|
|||
v2b[i] = true;
|
||||
v3b[i] = true;
|
||||
v4b[i] = true;
|
||||
return;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
SKIP: FAILED
|
||||
|
||||
#version 310 es
|
||||
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 {
|
||||
vec4 position;
|
||||
};
|
||||
|
@ -38,53 +41,15 @@ struct FragmentOutput {
|
|||
vec4 color;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
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(FragmentInput fragment) {
|
||||
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);
|
||||
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() {
|
||||
tint_symbol_3 inputs;
|
||||
inputs.view_position = view_position;
|
||||
inputs.normal = normal;
|
||||
inputs.uv = uv;
|
||||
inputs.color = color;
|
||||
inputs.position = gl_FragCoord;
|
||||
tint_symbol_4 outputs;
|
||||
outputs = tint_symbol(inputs);
|
||||
color = outputs.color;
|
||||
FragmentInput tint_symbol_2 = FragmentInput(gl_FragCoord, view_position_1, normal_1, uv_1, color_1);
|
||||
FragmentOutput inner_result = tint_symbol(tint_symbol_2);
|
||||
color_2 = inner_result.color;
|
||||
return;
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:69: 'color' : redefinition
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -14,10 +14,9 @@ void tint_symbol() {
|
|||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,58 +3,33 @@ SKIP: FAILED
|
|||
#version 310 es
|
||||
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 {
|
||||
float a;
|
||||
uint mask;
|
||||
};
|
||||
|
||||
struct tint_symbol_3 {
|
||||
float a;
|
||||
float b;
|
||||
uint mask;
|
||||
};
|
||||
|
||||
struct tint_symbol_4 {
|
||||
float a;
|
||||
uint mask;
|
||||
};
|
||||
|
||||
FragIn tint_symbol_inner(FragIn tint_symbol_1, float b) {
|
||||
FragIn tint_symbol(FragIn tint_symbol_1, float b) {
|
||||
if ((tint_symbol_1.mask == 0u)) {
|
||||
return tint_symbol_1;
|
||||
}
|
||||
FragIn tint_symbol_5 = FragIn(b, 1u);
|
||||
return tint_symbol_5;
|
||||
FragIn tint_symbol_2 = FragIn(b, 1u);
|
||||
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() {
|
||||
tint_symbol_3 inputs;
|
||||
inputs.a = a;
|
||||
inputs.b = b;
|
||||
inputs.mask = uint(gl_SampleMask);
|
||||
tint_symbol_4 outputs;
|
||||
outputs = tint_symbol(inputs);
|
||||
a = outputs.a;
|
||||
gl_SampleMask = outputs.mask;
|
||||
FragIn tint_symbol_3 = FragIn(a_1, uint(gl_SampleMask[0]));
|
||||
FragIn inner_result = tint_symbol(tint_symbol_3, b_1);
|
||||
a_2 = inner_result.a;
|
||||
gl_SampleMask_1[0] = inner_result.mask;
|
||||
return;
|
||||
}
|
||||
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:39: 'a' : redefinition
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
ERROR: 0:21: 'gl_SampleMask' : required extension not requested: GL_OES_sample_variables
|
||||
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
Loading…
Reference in New Issue