tint: remove LoopToForLoop and FoldTrivialSingleUseLets transforms for HLSL and GLSL

Change-Id: I18c807b2449dc2842cb9dbfaeba98dae640d2355
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102621
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano 2022-09-19 14:05:21 +00:00 committed by Dawn LUCI CQ
parent d6afca1955
commit e14a27bc7f
617 changed files with 3539 additions and 2634 deletions

View File

@ -25,7 +25,6 @@
#include "src/tint/sem/type_manager.h"
#include "src/tint/transform/binding_remapper.h"
#include "src/tint/transform/first_index_offset.h"
#include "src/tint/transform/fold_trivial_single_use_lets.h"
#include "src/tint/transform/manager.h"
#include "src/tint/transform/multiplanar_external_texture.h"
#include "src/tint/transform/renamer.h"

View File

@ -498,14 +498,10 @@ libtint_source_set("libtint_core_all_src") {
"transform/expand_compound_assignment.h",
"transform/first_index_offset.cc",
"transform/first_index_offset.h",
"transform/fold_trivial_single_use_lets.cc",
"transform/fold_trivial_single_use_lets.h",
"transform/for_loop_to_loop.cc",
"transform/for_loop_to_loop.h",
"transform/localize_struct_array_assignment.cc",
"transform/localize_struct_array_assignment.h",
"transform/loop_to_for_loop.cc",
"transform/loop_to_for_loop.h",
"transform/manager.cc",
"transform/manager.h",
"transform/module_scope_var_to_entry_point_param.cc",
@ -1202,10 +1198,8 @@ if (tint_build_unittests) {
"transform/disable_uniformity_analysis_test.cc",
"transform/expand_compound_assignment_test.cc",
"transform/first_index_offset_test.cc",
"transform/fold_trivial_single_use_lets_test.cc",
"transform/for_loop_to_loop_test.cc",
"transform/localize_struct_array_assignment_test.cc",
"transform/loop_to_for_loop_test.cc",
"transform/module_scope_var_to_entry_point_param_test.cc",
"transform/multiplanar_external_texture_test.cc",
"transform/num_workgroups_from_uniform_test.cc",

View File

@ -410,14 +410,10 @@ set(TINT_LIB_SRCS
transform/expand_compound_assignment.h
transform/first_index_offset.cc
transform/first_index_offset.h
transform/fold_trivial_single_use_lets.cc
transform/fold_trivial_single_use_lets.h
transform/for_loop_to_loop.cc
transform/for_loop_to_loop.h
transform/localize_struct_array_assignment.cc
transform/localize_struct_array_assignment.h
transform/loop_to_for_loop.cc
transform/loop_to_for_loop.h
transform/manager.cc
transform/manager.h
transform/module_scope_var_to_entry_point_param.cc
@ -1117,11 +1113,9 @@ if(TINT_BUILD_TESTS)
transform/disable_uniformity_analysis_test.cc
transform/expand_compound_assignment_test.cc
transform/first_index_offset_test.cc
transform/fold_trivial_single_use_lets_test.cc
transform/for_loop_to_loop_test.cc
transform/expand_compound_assignment.cc
transform/localize_struct_array_assignment_test.cc
transform/loop_to_for_loop_test.cc
transform/module_scope_var_to_entry_point_param_test.cc
transform/multiplanar_external_texture_test.cc
transform/num_workgroups_from_uniform_test.cc

View File

@ -1025,11 +1025,6 @@ int main(int argc, const char** argv) {
m.Add<tint::transform::FirstIndexOffset>();
return true;
}},
{"fold_trivial_single_use_lets",
[](tint::inspector::Inspector&, tint::transform::Manager& m, tint::transform::DataMap&) {
m.Add<tint::transform::FoldTrivialSingleUseLets>();
return true;
}},
{"renamer",
[](tint::inspector::Inspector&, tint::transform::Manager& m, tint::transform::DataMap&) {
m.Add<tint::transform::Renamer>();

View File

@ -1,105 +0,0 @@
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/transform/fold_trivial_single_use_lets.h"
#include "src/tint/program_builder.h"
#include "src/tint/sem/block_statement.h"
#include "src/tint/sem/function.h"
#include "src/tint/sem/materialize.h"
#include "src/tint/sem/statement.h"
#include "src/tint/sem/variable.h"
#include "src/tint/utils/scoped_assignment.h"
TINT_INSTANTIATE_TYPEINFO(tint::transform::FoldTrivialSingleUseLets);
namespace tint::transform {
namespace {
/// @returns a @p stmt cast to a ast::VariableDeclStatement iff the statement is a let declaration,
/// with an initializer that's an identifier or literal expression.
const ast::VariableDeclStatement* AsTrivialLetDecl(const ast::Statement* stmt) {
auto* var_decl = stmt->As<ast::VariableDeclStatement>();
if (!var_decl) {
return nullptr;
}
auto* let = var_decl->variable->As<ast::Let>();
if (!let) {
return nullptr;
}
auto* ctor = let->constructor;
if (!IsAnyOf<ast::IdentifierExpression, ast::LiteralExpression>(ctor)) {
return nullptr;
}
return var_decl;
}
} // namespace
FoldTrivialSingleUseLets::FoldTrivialSingleUseLets() = default;
FoldTrivialSingleUseLets::~FoldTrivialSingleUseLets() = default;
void FoldTrivialSingleUseLets::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
for (auto* node : ctx.src->ASTNodes().Objects()) {
// For each statement in each block of the entire program...
if (auto* block = node->As<ast::BlockStatement>()) {
auto& stmts = block->statements;
for (size_t stmt_idx = 0; stmt_idx < stmts.Length(); stmt_idx++) {
auto* stmt = stmts[stmt_idx];
// Is the statement a trivial let declaration with a single user?
if (auto* let_decl = AsTrivialLetDecl(stmt)) {
auto* let = let_decl->variable;
auto* sem_let = ctx.src->Sem().Get(let);
auto& users = sem_let->Users();
if (users.size() != 1) {
continue; // Does not have a single user.
}
auto* user = users[0];
auto* user_stmt = user->Stmt()->Declaration();
// Scan forward to find the statement of use. If there's a statement between the
// declaration and the use, then we cannot safely fold.
for (size_t i = stmt_idx; i < stmts.Length(); i++) {
if (user_stmt == stmts[i]) {
auto* user_expr = user->Declaration();
ctx.Remove(stmts, let_decl);
auto* initializer = ctx.Clone(let->constructor);
if (auto* materialize =
sem_let->Constructor()->As<sem::Materialize>()) {
// The let initializer was an abstract numeric that was implicitly
// materialized to a concrete type. As we're inlining the
// initializer into the use, we need to make this cast explicit,
// otherwise we'll have a different type for the substitution.
auto* concrete_ty = CreateASTTypeFor(ctx, materialize->Type());
initializer = ctx.dst->Construct(concrete_ty, initializer);
}
ctx.Replace(user_expr, initializer);
}
if (!AsTrivialLetDecl(stmts[i])) {
// Stop if we hit a statement that isn't the single use of the
// let, and isn't a let itself.
break;
}
}
}
}
}
}
ctx.Clone();
}
} // namespace tint::transform

View File

@ -1,56 +0,0 @@
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_TINT_TRANSFORM_FOLD_TRIVIAL_SINGLE_USE_LETS_H_
#define SRC_TINT_TRANSFORM_FOLD_TRIVIAL_SINGLE_USE_LETS_H_
#include <string>
#include <unordered_map>
#include "src/tint/transform/transform.h"
namespace tint::transform {
/// FoldTrivialSingleUseLets is an optimizer for folding away trivial `let`
/// statements into their single place of use. This transform is intended to
/// clean up the SSA `let`s produced by the SPIR-V reader.
/// `let`s can only be folded if:
/// * There is a single usage of the `let` value.
/// * The `let` is constructed with a ScalarConstructorExpression, or with an
/// IdentifierExpression.
/// * There are only other foldable `let`s between the `let` declaration and its
/// single usage.
/// These rules prevent any hoisting of the let that may affect execution
/// behaviour.
class FoldTrivialSingleUseLets final : public Castable<FoldTrivialSingleUseLets, Transform> {
public:
/// Constructor
FoldTrivialSingleUseLets();
/// Destructor
~FoldTrivialSingleUseLets() override;
protected:
/// Runs the transform using the CloneContext built for transforming a
/// program. Run() is responsible for calling Clone() on the CloneContext.
/// @param ctx the CloneContext primed with the input program and
/// ProgramBuilder
/// @param inputs optional extra transform-specific input data
/// @param outputs optional extra transform-specific output data
void Run(CloneContext& ctx, const DataMap& inputs, DataMap& outputs) const override;
};
} // namespace tint::transform
#endif // SRC_TINT_TRANSFORM_FOLD_TRIVIAL_SINGLE_USE_LETS_H_

View File

@ -1,247 +0,0 @@
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/transform/fold_trivial_single_use_lets.h"
#include "src/tint/transform/test_helper.h"
namespace tint::transform {
namespace {
using FoldTrivialSingleUseLetsTest = TransformTest;
TEST_F(FoldTrivialSingleUseLetsTest, EmptyModule) {
auto* src = "";
auto* expect = "";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, Single_Concrete) {
auto* src = R"(
fn f() {
let x = 1i;
_ = x;
}
)";
auto* expect = R"(
fn f() {
_ = 1i;
}
)";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, Single_Abstract) {
auto* src = R"(
fn f() {
let x = 1;
_ = x;
}
)";
auto* expect = R"(
fn f() {
_ = i32(1);
}
)";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, Multiple_Concrete) {
auto* src = R"(
fn f() {
let x = 1u;
let y = 2u;
let z = 3u;
_ = x + y + z;
}
)";
auto* expect = R"(
fn f() {
_ = ((1u + 2u) + 3u);
}
)";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, Multiple_Abstract) {
auto* src = R"(
fn f() {
let x = 1;
let y = 2;
let z = 3;
_ = x + y + z;
}
)";
auto* expect = R"(
fn f() {
_ = ((i32(1) + i32(2)) + i32(3));
}
)";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, Chained_Concrete) {
auto* src = R"(
fn f() {
let x = 1i;
let y = x;
let z = y;
_ = z;
}
)";
auto* expect = R"(
fn f() {
_ = 1i;
}
)";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, Chained_Abstract) {
auto* src = R"(
fn f() {
let x = 1;
let y = x;
let z = y;
_ = z;
}
)";
auto* expect = R"(
fn f() {
_ = i32(1);
}
)";
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, NoFold_NonTrivialLet) {
auto* src = R"(
fn function_with_possible_side_effect() -> i32 {
return 1;
}
fn f() {
let x = 1;
let y = function_with_possible_side_effect();
_ = (x + y);
}
)";
auto* expect = src;
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, NoFold_NonTrivialLet_OutOfOrder) {
auto* src = R"(
fn f() {
let x = 1;
let y = function_with_possible_side_effect();
_ = (x + y);
}
fn function_with_possible_side_effect() -> i32 {
return 1;
}
)";
auto* expect = src;
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, NoFold_UseInSubBlock) {
auto* src = R"(
fn f() {
let x = 1;
{
_ = x;
}
}
)";
auto* expect = src;
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, NoFold_MultipleUses) {
auto* src = R"(
fn f() {
let x = 1;
_ = (x + x);
}
)";
auto* expect = src;
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(FoldTrivialSingleUseLetsTest, NoFold_Shadowing) {
auto* src = R"(
fn f() {
var y = 1;
let x = y;
{
let y = false;
_ = (x + x);
}
}
)";
auto* expect = src;
auto got = Run<FoldTrivialSingleUseLets>(src);
EXPECT_EQ(expect, str(got));
}
} // namespace
} // namespace tint::transform

View File

@ -1,136 +0,0 @@
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/transform/loop_to_for_loop.h"
#include "src/tint/ast/break_statement.h"
#include "src/tint/ast/for_loop_statement.h"
#include "src/tint/program_builder.h"
#include "src/tint/sem/block_statement.h"
#include "src/tint/sem/function.h"
#include "src/tint/sem/statement.h"
#include "src/tint/sem/variable.h"
#include "src/tint/utils/scoped_assignment.h"
TINT_INSTANTIATE_TYPEINFO(tint::transform::LoopToForLoop);
namespace tint::transform {
namespace {
bool IsBlockWithSingleBreak(const ast::BlockStatement* block) {
if (block->statements.Length() != 1) {
return false;
}
return block->statements[0]->Is<ast::BreakStatement>();
}
bool IsVarUsedByStmt(const sem::Info& sem, const ast::Variable* var, const ast::Statement* stmt) {
auto* var_sem = sem.Get(var);
for (auto* user : var_sem->Users()) {
if (auto* s = user->Stmt()) {
if (s->Declaration() == stmt) {
return true;
}
}
}
return false;
}
} // namespace
LoopToForLoop::LoopToForLoop() = default;
LoopToForLoop::~LoopToForLoop() = default;
bool LoopToForLoop::ShouldRun(const Program* program, const DataMap&) const {
for (auto* node : program->ASTNodes().Objects()) {
if (node->Is<ast::LoopStatement>()) {
return true;
}
}
return false;
}
void LoopToForLoop::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
ctx.ReplaceAll([&](const ast::LoopStatement* loop) -> const ast::Statement* {
// For loop condition is taken from the first statement in the loop.
// This requires an if-statement with either:
// * A true block with no else statements, and the true block contains a
// single 'break' statement.
// * An empty true block with a single, no-condition else statement
// containing a single 'break' statement.
// Examples:
// loop { if (condition) { break; } ... }
// loop { if (condition) {} else { break; } ... }
auto& stmts = loop->body->statements;
if (stmts.IsEmpty()) {
return nullptr;
}
auto* if_stmt = stmts[0]->As<ast::IfStatement>();
if (!if_stmt) {
return nullptr;
}
auto* else_stmt = tint::As<ast::BlockStatement>(if_stmt->else_statement);
bool negate_condition = false;
if (IsBlockWithSingleBreak(if_stmt->body) && if_stmt->else_statement == nullptr) {
negate_condition = true;
} else if (if_stmt->body->Empty() && else_stmt && IsBlockWithSingleBreak(else_stmt)) {
negate_condition = false;
} else {
return nullptr;
}
// The continuing block must be empty or contain a single, assignment or
// function call statement.
const ast::Statement* continuing = nullptr;
if (auto* loop_cont = loop->continuing) {
if (loop_cont->statements.Length() != 1) {
return nullptr;
}
continuing = loop_cont->statements[0];
if (!continuing->IsAnyOf<ast::AssignmentStatement, ast::CallStatement>()) {
return nullptr;
}
// And the continuing statement must not use any of the variables declared
// in the loop body.
for (auto* stmt : loop->body->statements) {
if (auto* var_decl = stmt->As<ast::VariableDeclStatement>()) {
if (IsVarUsedByStmt(ctx.src->Sem(), var_decl->variable, continuing)) {
return nullptr;
}
}
}
continuing = ctx.Clone(continuing);
}
auto* condition = ctx.Clone(if_stmt->condition);
if (negate_condition) {
condition = ctx.dst->create<ast::UnaryOpExpression>(ast::UnaryOp::kNot, condition);
}
ast::Statement* initializer = nullptr;
ctx.Remove(loop->body->statements, if_stmt);
auto* body = ctx.Clone(loop->body);
return ctx.dst->create<ast::ForLoopStatement>(initializer, condition, continuing, body);
});
ctx.Clone();
}
} // namespace tint::transform

View File

@ -1,49 +0,0 @@
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_TINT_TRANSFORM_LOOP_TO_FOR_LOOP_H_
#define SRC_TINT_TRANSFORM_LOOP_TO_FOR_LOOP_H_
#include "src/tint/transform/transform.h"
namespace tint::transform {
/// LoopToForLoop is a Transform that attempts to convert WGSL `loop {}`
/// statements into a for-loop statement.
class LoopToForLoop final : public Castable<LoopToForLoop, Transform> {
public:
/// Constructor
LoopToForLoop();
/// Destructor
~LoopToForLoop() override;
/// @param program the program to inspect
/// @param data optional extra transform-specific input data
/// @returns true if this transform should be run for the given program
bool ShouldRun(const Program* program, const DataMap& data = {}) const override;
protected:
/// Runs the transform using the CloneContext built for transforming a
/// program. Run() is responsible for calling Clone() on the CloneContext.
/// @param ctx the CloneContext primed with the input program and
/// ProgramBuilder
/// @param inputs optional extra transform-specific input data
/// @param outputs optional extra transform-specific output data
void Run(CloneContext& ctx, const DataMap& inputs, DataMap& outputs) const override;
};
} // namespace tint::transform
#endif // SRC_TINT_TRANSFORM_LOOP_TO_FOR_LOOP_H_

View File

@ -1,358 +0,0 @@
// Copyright 2021 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/transform/loop_to_for_loop.h"
#include "src/tint/transform/test_helper.h"
namespace tint::transform {
namespace {
using LoopToForLoopTest = TransformTest;
TEST_F(LoopToForLoopTest, ShouldRunEmptyModule) {
auto* src = R"()";
EXPECT_FALSE(ShouldRun<LoopToForLoop>(src));
}
TEST_F(LoopToForLoopTest, ShouldRunHasForLoop) {
auto* src = R"(
fn f() {
loop {
break;
}
}
)";
EXPECT_TRUE(ShouldRun<LoopToForLoop>(src));
}
TEST_F(LoopToForLoopTest, EmptyModule) {
auto* src = "";
auto* expect = "";
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, IfBreak) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if (i > 15) {
break;
}
_ = 123;
continuing {
i = i + 1;
}
}
}
)";
auto* expect = R"(
fn f() {
var i : i32;
i = 0;
for(; !((i > 15)); i = (i + 1)) {
_ = 123;
}
}
)";
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, IfElseBreak) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if (i < 15) {
} else {
break;
}
_ = 123;
continuing {
i = i + 1;
}
}
}
)";
auto* expect = R"(
fn f() {
var i : i32;
i = 0;
for(; (i < 15); i = (i + 1)) {
_ = 123;
}
}
)";
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, Nested) {
auto* src = R"(
let N = 16u;
fn f() {
var i : u32 = 0u;
loop {
if (i >= N) {
break;
}
{
var j : u32 = 0u;
loop {
if (j >= N) {
break;
}
_ = i;
_ = j;
continuing {
j = (j + 1u);
}
}
}
continuing {
i = (i + 1u);
}
}
}
)";
auto* expect = R"(
const N = 16u;
fn f() {
var i : u32 = 0u;
for(; !((i >= N)); i = (i + 1u)) {
{
var j : u32 = 0u;
for(; !((j >= N)); j = (j + 1u)) {
_ = i;
_ = j;
}
}
}
}
)";
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_IfMultipleStmts) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i < 15)) {
_ = i;
break;
}
_ = 123;
continuing {
i = (i + 1);
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_IfElseMultipleStmts) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i < 15)) {
} else {
_ = i;
break;
}
_ = 123;
continuing {
i = (i + 1);
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_ContinuingIsCompound) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i < 15)) {
break;
}
_ = 123;
continuing {
if (false) {
}
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_ContinuingMultipleStmts) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i < 15)) {
break;
}
_ = 123;
continuing {
i = (i + 1);
_ = i;
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_ContinuingUsesVarDeclInLoopBody) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i < 15)) {
break;
}
var j : i32;
continuing {
i = (i + j);
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_IfBreakWithElse) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i > 15)) {
break;
} else {
}
_ = 123;
continuing {
i = (i + 1);
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
TEST_F(LoopToForLoopTest, NoTransform_IfBreakWithElseIf) {
auto* src = R"(
fn f() {
var i : i32;
i = 0;
loop {
if ((i > 15)) {
break;
} else if (true) {
}
_ = 123;
continuing {
i = (i + 1);
}
}
}
)";
auto* expect = src;
auto got = Run<LoopToForLoop>(src);
EXPECT_EQ(expect, str(got));
}
} // namespace
} // namespace tint::transform

View File

@ -55,8 +55,6 @@
#include "src/tint/transform/decompose_memory_access.h"
#include "src/tint/transform/disable_uniformity_analysis.h"
#include "src/tint/transform/expand_compound_assignment.h"
#include "src/tint/transform/fold_trivial_single_use_lets.h"
#include "src/tint/transform/loop_to_for_loop.h"
#include "src/tint/transform/manager.h"
#include "src/tint/transform/pad_structs.h"
#include "src/tint/transform/promote_initializers_to_let.h"
@ -208,11 +206,6 @@ SanitizedResult Sanitize(const Program* in,
/* preserve_unicode */ false);
manager.Add<transform::Unshadow>();
// Attempt to convert `loop`s into for-loops. This is to try and massage the
// output into something that will not cause FXC to choke or misbehave.
manager.Add<transform::FoldTrivialSingleUseLets>();
manager.Add<transform::LoopToForLoop>();
if (!options.disable_workgroup_init) {
// ZeroInitWorkgroupMemory must come before CanonicalizeEntryPointIO as
// ZeroInitWorkgroupMemory may inject new builtin parameters.

View File

@ -55,9 +55,7 @@
#include "src/tint/transform/decompose_memory_access.h"
#include "src/tint/transform/disable_uniformity_analysis.h"
#include "src/tint/transform/expand_compound_assignment.h"
#include "src/tint/transform/fold_trivial_single_use_lets.h"
#include "src/tint/transform/localize_struct_array_assignment.h"
#include "src/tint/transform/loop_to_for_loop.h"
#include "src/tint/transform/manager.h"
#include "src/tint/transform/num_workgroups_from_uniform.h"
#include "src/tint/transform/promote_initializers_to_let.h"
@ -206,11 +204,6 @@ SanitizedResult Sanitize(const Program* in, const Options& options) {
manager.Add<transform::SimplifyPointers>();
manager.Add<transform::LocalizeStructArrayAssignment>();
// Attempt to convert `loop`s into for-loops. This is to try and massage the
// output into something that will not cause FXC to choke or misbehave.
manager.Add<transform::FoldTrivialSingleUseLets>();
manager.Add<transform::LoopToForLoop>();
if (!options.disable_workgroup_init) {
// ZeroInitWorkgroupMemory must come before CanonicalizeEntryPointIO as
// ZeroInitWorkgroupMemory may inject new builtin parameters.

View File

@ -7,7 +7,11 @@ void main_1() {
float f = 0.0f;
float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f);
f = determinant(float3x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f)));
v = float4(sin(f), cos(f), exp2(f), log(f));
const float x_33 = f;
const float x_35 = f;
const float x_37 = f;
const float x_39 = f;
v = float4(sin(x_33), cos(x_35), exp2(x_37), log(x_39));
const float4 x_42 = v;
const float4 x_44 = asfloat(x_7[0]);
if ((distance(x_42, x_44) < 0.100000001f)) {

View File

@ -7,7 +7,11 @@ void main_1() {
float f = 0.0f;
float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f);
f = determinant(float3x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f)));
v = float4(sin(f), cos(f), exp2(f), log(f));
const float x_33 = f;
const float x_35 = f;
const float x_37 = f;
const float x_39 = f;
v = float4(sin(x_33), cos(x_35), exp2(x_37), log(x_39));
const float4 x_42 = v;
const float4 x_44 = asfloat(x_7[0]);
if ((distance(x_42, x_44) < 0.100000001f)) {

View File

@ -11,7 +11,11 @@ void main_1() {
float f = 0.0f;
vec4 v = vec4(0.0f, 0.0f, 0.0f, 0.0f);
f = determinant(mat3(vec3(1.0f, 0.0f, 0.0f), vec3(0.0f, 1.0f, 0.0f), vec3(0.0f, 0.0f, 1.0f)));
v = vec4(sin(f), cos(f), exp2(f), log(f));
float x_33 = f;
float x_35 = f;
float x_37 = f;
float x_39 = f;
v = vec4(sin(x_33), cos(x_35), exp2(x_37), log(x_39));
vec4 x_42 = v;
vec4 x_44 = x_7.ref;
if ((distance(x_42, x_44) < 0.100000001f)) {

View File

@ -1,5 +1,7 @@
[numthreads(1, 1, 1)]
void f() {
const int c = 1;
const int a = 1;
const int b = 0;
const int c = (a / (b == 0 ? 1 : b));
return;
}

View File

@ -1,5 +1,7 @@
[numthreads(1, 1, 1)]
void f() {
const int c = 1;
const int a = 1;
const int b = 0;
const int c = (a / (b == 0 ? 1 : b));
return;
}

View File

@ -1,7 +1,9 @@
#version 310 es
void f() {
int c = 1;
int a = 1;
int b = 0;
int c = (a / b);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -33,7 +33,8 @@ void main_1() {
const float4x4 x_69 = tint_symbol_4(x_14, 0u);
const float3 x_70 = p;
gl_Position = mul(float4(x_70.x, x_70.y, x_70.z, 1.0f), x_69);
vUV = uv;
const float2 x_83 = uv;
vUV = x_83;
const float x_87 = gl_Position.y;
gl_Position.y = (x_87 * -1.0f);
return;

View File

@ -33,7 +33,8 @@ void main_1() {
const float4x4 x_69 = tint_symbol_4(x_14, 0u);
const float3 x_70 = p;
gl_Position = mul(float4(x_70.x, x_70.y, x_70.z, 1.0f), x_69);
vUV = uv;
const float2 x_83 = uv;
vUV = x_83;
const float x_87 = gl_Position.y;
gl_Position.y = (x_87 * -1.0f);
return;

View File

@ -44,7 +44,8 @@ void main_1() {
mat4 x_69 = x_14.worldViewProjection;
vec3 x_70 = p;
tint_symbol = (x_69 * vec4(x_70.x, x_70.y, x_70.z, 1.0f));
vUV = uv;
vec2 x_83 = uv;
vUV = x_83;
float x_87 = tint_symbol.y;
tint_symbol.y = (x_87 * -1.0f);
return;

View File

@ -41,11 +41,13 @@ void main_1() {
float3 finalDiffuse = float3(0.0f, 0.0f, 0.0f);
float3 finalSpecular = float3(0.0f, 0.0f, 0.0f);
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((fClipDistance3 > 0.0f)) {
const float x_9 = fClipDistance3;
if ((x_9 > 0.0f)) {
tint_discard = true;
return;
}
if ((fClipDistance4 > 0.0f)) {
const float x_17 = fClipDistance4;
if ((x_17 > 0.0f)) {
tint_discard = true;
return;
}
@ -64,7 +66,8 @@ void main_1() {
const float4 x_74 = (0.0f).xxxx;
const float4 x_76 = baseColor;
const float3 x_78 = (float3(x_76.x, x_76.y, x_76.z) * float3(x_74.x, x_74.y, x_74.z));
baseColor = float4(x_78.x, x_78.y, x_78.z, baseColor.w);
const float4 x_79 = baseColor;
baseColor = float4(x_78.x, x_78.y, x_78.z, x_79.w);
baseAmbientColor = (1.0f).xxx;
glossiness = 0.0f;
diffuseBase = (0.0f).xxx;
@ -80,17 +83,23 @@ void main_1() {
const float4 x_108 = baseColor;
finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), (0.0f).xxx, (1.0f).xxx) * float3(x_108.x, x_108.y, x_108.z));
finalSpecular = (0.0f).xxx;
const float3 x_113 = finalDiffuse;
const float3 x_114 = baseAmbientColor;
const float3 x_116 = finalSpecular;
const float4 x_118 = reflectionColor;
const float4 x_121 = refractionColor;
const float3 x_123 = ((((finalDiffuse * baseAmbientColor) + finalSpecular) + float3(x_118.x, x_118.y, x_118.z)) + float3(x_121.x, x_121.y, x_121.z));
color = float4(x_123.x, x_123.y, x_123.z, alpha);
const float3 x_123 = ((((x_113 * x_114) + x_116) + float3(x_118.x, x_118.y, x_118.z)) + float3(x_121.x, x_121.y, x_121.z));
const float x_124 = alpha;
color = float4(x_123.x, x_123.y, x_123.z, x_124);
const float4 x_129 = color;
const float3 x_132 = max(float3(x_129.x, x_129.y, x_129.z), (0.0f).xxx);
color = float4(x_132.x, x_132.y, x_132.z, color.w);
const float4 x_133 = color;
color = float4(x_132.x, x_132.y, x_132.z, x_133.w);
const float x_140 = asfloat(x_137[0].x);
const float x_142 = color.w;
color.w = (x_142 * x_140);
glFragColor = color;
const float4 x_147 = color;
glFragColor = x_147;
return;
}

View File

@ -41,11 +41,13 @@ void main_1() {
float3 finalDiffuse = float3(0.0f, 0.0f, 0.0f);
float3 finalSpecular = float3(0.0f, 0.0f, 0.0f);
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((fClipDistance3 > 0.0f)) {
const float x_9 = fClipDistance3;
if ((x_9 > 0.0f)) {
tint_discard = true;
return;
}
if ((fClipDistance4 > 0.0f)) {
const float x_17 = fClipDistance4;
if ((x_17 > 0.0f)) {
tint_discard = true;
return;
}
@ -64,7 +66,8 @@ void main_1() {
const float4 x_74 = (0.0f).xxxx;
const float4 x_76 = baseColor;
const float3 x_78 = (float3(x_76.x, x_76.y, x_76.z) * float3(x_74.x, x_74.y, x_74.z));
baseColor = float4(x_78.x, x_78.y, x_78.z, baseColor.w);
const float4 x_79 = baseColor;
baseColor = float4(x_78.x, x_78.y, x_78.z, x_79.w);
baseAmbientColor = (1.0f).xxx;
glossiness = 0.0f;
diffuseBase = (0.0f).xxx;
@ -80,17 +83,23 @@ void main_1() {
const float4 x_108 = baseColor;
finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), (0.0f).xxx, (1.0f).xxx) * float3(x_108.x, x_108.y, x_108.z));
finalSpecular = (0.0f).xxx;
const float3 x_113 = finalDiffuse;
const float3 x_114 = baseAmbientColor;
const float3 x_116 = finalSpecular;
const float4 x_118 = reflectionColor;
const float4 x_121 = refractionColor;
const float3 x_123 = ((((finalDiffuse * baseAmbientColor) + finalSpecular) + float3(x_118.x, x_118.y, x_118.z)) + float3(x_121.x, x_121.y, x_121.z));
color = float4(x_123.x, x_123.y, x_123.z, alpha);
const float3 x_123 = ((((x_113 * x_114) + x_116) + float3(x_118.x, x_118.y, x_118.z)) + float3(x_121.x, x_121.y, x_121.z));
const float x_124 = alpha;
color = float4(x_123.x, x_123.y, x_123.z, x_124);
const float4 x_129 = color;
const float3 x_132 = max(float3(x_129.x, x_129.y, x_129.z), (0.0f).xxx);
color = float4(x_132.x, x_132.y, x_132.z, color.w);
const float4 x_133 = color;
color = float4(x_132.x, x_132.y, x_132.z, x_133.w);
const float x_140 = asfloat(x_137[0].x);
const float x_142 = color.w;
color.w = (x_142 * x_140);
glFragColor = color;
const float4 x_147 = color;
glFragColor = x_147;
return;
}

View File

@ -56,11 +56,13 @@ void main_1() {
vec3 finalDiffuse = vec3(0.0f, 0.0f, 0.0f);
vec3 finalSpecular = vec3(0.0f, 0.0f, 0.0f);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((fClipDistance3 > 0.0f)) {
float x_9 = fClipDistance3;
if ((x_9 > 0.0f)) {
tint_discard = true;
return;
}
if ((fClipDistance4 > 0.0f)) {
float x_17 = fClipDistance4;
if ((x_17 > 0.0f)) {
tint_discard = true;
return;
}
@ -79,7 +81,8 @@ void main_1() {
vec4 x_74 = vec4(0.0f);
vec4 x_76 = baseColor;
vec3 x_78 = (vec3(x_76.x, x_76.y, x_76.z) * vec3(x_74.x, x_74.y, x_74.z));
baseColor = vec4(x_78.x, x_78.y, x_78.z, baseColor.w);
vec4 x_79 = baseColor;
baseColor = vec4(x_78.x, x_78.y, x_78.z, x_79.w);
baseAmbientColor = vec3(1.0f);
glossiness = 0.0f;
diffuseBase = vec3(0.0f);
@ -95,17 +98,23 @@ void main_1() {
vec4 x_108 = baseColor;
finalDiffuse = (clamp((((x_96 * x_97) + x_99) + x_103), vec3(0.0f), vec3(1.0f)) * vec3(x_108.x, x_108.y, x_108.z));
finalSpecular = vec3(0.0f);
vec3 x_113 = finalDiffuse;
vec3 x_114 = baseAmbientColor;
vec3 x_116 = finalSpecular;
vec4 x_118 = reflectionColor;
vec4 x_121 = refractionColor;
vec3 x_123 = ((((finalDiffuse * baseAmbientColor) + finalSpecular) + vec3(x_118.x, x_118.y, x_118.z)) + vec3(x_121.x, x_121.y, x_121.z));
color = vec4(x_123.x, x_123.y, x_123.z, alpha);
vec3 x_123 = ((((x_113 * x_114) + x_116) + vec3(x_118.x, x_118.y, x_118.z)) + vec3(x_121.x, x_121.y, x_121.z));
float x_124 = alpha;
color = vec4(x_123.x, x_123.y, x_123.z, x_124);
vec4 x_129 = color;
vec3 x_132 = max(vec3(x_129.x, x_129.y, x_129.z), vec3(0.0f));
color = vec4(x_132.x, x_132.y, x_132.z, color.w);
vec4 x_133 = color;
color = vec4(x_132.x, x_132.y, x_132.z, x_133.w);
float x_140 = x_137.visibility;
float x_142 = color.w;
color.w = (x_142 * x_140);
glFragColor = color;
vec4 x_147 = color;
glFragColor = x_147;
return;
}

View File

@ -52,8 +52,9 @@ void main_inner(uint3 GlobalInvocationID) {
frustumPlanes[5] = float4(0.0f, 0.0f, 1.0f, -(viewFar));
const int TILE_SIZE = 16;
const int TILE_COUNT_X = 2;
const int TILE_COUNT_Y = 2;
{
[loop] for(int y_1 = 0; (y_1 < 2); y_1 = (y_1 + 1)) {
[loop] for(int y_1 = 0; (y_1 < TILE_COUNT_Y); y_1 = (y_1 + 1)) {
{
[loop] for(int x_1 = 0; (x_1 < TILE_COUNT_X); x_1 = (x_1 + 1)) {
int2 tilePixel0Idx = int2((x_1 * TILE_SIZE), (y_1 * TILE_SIZE));

View File

@ -52,8 +52,9 @@ void main_inner(uint3 GlobalInvocationID) {
frustumPlanes[5] = float4(0.0f, 0.0f, 1.0f, -(viewFar));
const int TILE_SIZE = 16;
const int TILE_COUNT_X = 2;
const int TILE_COUNT_Y = 2;
{
[loop] for(int y_1 = 0; (y_1 < 2); y_1 = (y_1 + 1)) {
[loop] for(int y_1 = 0; (y_1 < TILE_COUNT_Y); y_1 = (y_1 + 1)) {
{
[loop] for(int x_1 = 0; (x_1 < TILE_COUNT_X); x_1 = (x_1 + 1)) {
int2 tilePixel0Idx = int2((x_1 * TILE_SIZE), (y_1 * TILE_SIZE));

View File

@ -61,8 +61,9 @@ void tint_symbol_2(uvec3 GlobalInvocationID) {
frustumPlanes[5] = vec4(0.0f, 0.0f, 1.0f, -(viewFar));
int TILE_SIZE = 16;
int TILE_COUNT_X = 2;
int TILE_COUNT_Y = 2;
{
for(int y_1 = 0; (y_1 < 2); y_1 = (y_1 + 1)) {
for(int y_1 = 0; (y_1 < TILE_COUNT_Y); y_1 = (y_1 + 1)) {
{
for(int x_1 = 0; (x_1 < TILE_COUNT_X); x_1 = (x_1 + 1)) {
ivec2 tilePixel0Idx = ivec2((x_1 * TILE_SIZE), (y_1 * TILE_SIZE));

View File

@ -1,5 +1,6 @@
[numthreads(1, 1, 1)]
void compute_main() {
float b = max(1.230000019f, 1.17549435e-38f);
const float a = 1.230000019f;
float b = max(a, 1.17549435e-38f);
return;
}

View File

@ -1,5 +1,6 @@
[numthreads(1, 1, 1)]
void compute_main() {
float b = max(1.230000019f, 1.17549435e-38f);
const float a = 1.230000019f;
float b = max(a, 1.17549435e-38f);
return;
}

View File

@ -1,7 +1,8 @@
#version 310 es
void compute_main() {
float b = max(1.230000019f, 1.17549435e-38f);
float a = 1.230000019f;
float b = max(a, 1.17549435e-38f);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -77,7 +77,8 @@ void main_1() {
bool x_111 = false;
bool x_114 = false;
bool x_115 = false;
outputColor_S0 = vcolor_S0;
const float4 x_72 = vcolor_S0;
outputColor_S0 = x_72;
const float x_77 = asfloat(x_4[1].x);
x_8_unknown = x_77;
x_9_ok = true;

View File

@ -77,7 +77,8 @@ void main_1() {
bool x_111 = false;
bool x_114 = false;
bool x_115 = false;
outputColor_S0 = vcolor_S0;
const float4 x_72 = vcolor_S0;
outputColor_S0 = x_72;
const float x_77 = asfloat(x_4[1].x);
x_8_unknown = x_77;
x_9_ok = true;

View File

@ -88,7 +88,8 @@ void main_1() {
bool x_111 = false;
bool x_114 = false;
bool x_115 = false;
outputColor_S0 = vcolor_S0;
vec4 x_72 = vcolor_S0;
outputColor_S0 = x_72;
float x_77 = x_4.unknownInput_S1_c0;
x_8_unknown = x_77;
x_9_ok = true;

View File

@ -1,5 +1,6 @@
[numthreads(1, 1, 1)]
void main() {
bool v = (false ? true : true);
const bool a = true;
bool v = (false ? true : (a & true));
return;
}

View File

@ -1,5 +1,6 @@
[numthreads(1, 1, 1)]
void main() {
bool v = (false ? true : true);
const bool a = true;
bool v = (false ? true : (a & true));
return;
}

View File

@ -1,7 +1,8 @@
#version 310 es
void tint_symbol() {
bool v = (false ? true : true);
bool a = true;
bool v = (false ? true : bool(uint(a) & uint(true)));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -1,10 +1,12 @@
[numthreads(1, 1, 1)]
void f0() {
const int a = 2147483647;
const int b = 1;
const int c = -2147483648;
const int c = (a + 1);
return;
}
void f1() {
const int b = 2147483647;
const int a = 1;
const int b = (-2147483648 - a);
}

View File

@ -1,10 +1,12 @@
[numthreads(1, 1, 1)]
void f0() {
const int a = 2147483647;
const int b = 1;
const int c = -2147483648;
const int c = (a + 1);
return;
}
void f1() {
const int b = 2147483647;
const int a = 1;
const int b = (-2147483648 - a);
}

View File

@ -1,8 +1,9 @@
#version 310 es
void f0() {
int a = 2147483647;
int b = 1;
int c = -2147483648;
int c = (a + 1);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,7 +7,8 @@ void main_1() {
srcValue = x_18;
const uint x_22 = srcValue.x;
srcValue.x = (x_22 + asuint(1));
Dst[(0).xx] = srcValue;
const uint4 x_27 = srcValue;
Dst[(0).xx] = x_27;
return;
}

View File

@ -7,7 +7,8 @@ void main_1() {
srcValue = x_18;
const uint x_22 = srcValue.x;
srcValue.x = (x_22 + asuint(1));
Dst[(0).xx] = srcValue;
const uint4 x_27 = srcValue;
Dst[(0).xx] = x_27;
return;
}

View File

@ -8,7 +8,8 @@ void main_1() {
srcValue = x_18;
uint x_22 = srcValue.x;
srcValue.x = (x_22 + uint(1));
imageStore(Dst, ivec2(0), srcValue);
uvec4 x_27 = srcValue;
imageStore(Dst, ivec2(0), x_27);
return;
}

View File

@ -8,6 +8,7 @@ void main() {
srcValue = x_22;
const uint x_24 = srcValue.x;
const uint x_25 = (x_24 + 1u);
Dst[(0).xx] = srcValue.xxxx;
const uint4 x_27 = srcValue;
Dst[(0).xx] = x_27.xxxx;
return;
}

View File

@ -8,6 +8,7 @@ void main() {
srcValue = x_22;
const uint x_24 = srcValue.x;
const uint x_25 = (x_24 + 1u);
Dst[(0).xx] = srcValue.xxxx;
const uint4 x_27 = srcValue;
Dst[(0).xx] = x_27.xxxx;
return;
}

View File

@ -8,7 +8,8 @@ void tint_symbol() {
srcValue = x_22;
uint x_24 = srcValue.x;
uint x_25 = (x_24 + 1u);
imageStore(Dst, ivec2(0), srcValue.xxxx);
uvec4 x_27 = srcValue;
imageStore(Dst, ivec2(0), x_27.xxxx);
return;
}

View File

@ -40,25 +40,37 @@ static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f);
float3 Mat4x3GetCol0_(Mat4x3_ m) {
Mat4x3_ m1 = (Mat4x3_)0;
m1 = m;
return float3(m1.mx.x, m1.my.x, m1.mz.x);
const Mat4x3_ x_e2 = m1;
const Mat4x3_ x_e5 = m1;
const Mat4x3_ x_e8 = m1;
return float3(x_e2.mx.x, x_e5.my.x, x_e8.mz.x);
}
float3 Mat4x3GetCol1_(Mat4x3_ m2) {
Mat4x3_ m3 = (Mat4x3_)0;
m3 = m2;
return float3(m3.mx.y, m3.my.y, m3.mz.y);
const Mat4x3_ x_e2 = m3;
const Mat4x3_ x_e5 = m3;
const Mat4x3_ x_e8 = m3;
return float3(x_e2.mx.y, x_e5.my.y, x_e8.mz.y);
}
float3 Mat4x3GetCol2_(Mat4x3_ m4) {
Mat4x3_ m5 = (Mat4x3_)0;
m5 = m4;
return float3(m5.mx.z, m5.my.z, m5.mz.z);
const Mat4x3_ x_e2 = m5;
const Mat4x3_ x_e5 = m5;
const Mat4x3_ x_e8 = m5;
return float3(x_e2.mx.z, x_e5.my.z, x_e8.mz.z);
}
float3 Mat4x3GetCol3_(Mat4x3_ m6) {
Mat4x3_ m7 = (Mat4x3_)0;
m7 = m6;
return float3(m7.mx.w, m7.my.w, m7.mz.w);
const Mat4x3_ x_e2 = m7;
const Mat4x3_ x_e5 = m7;
const Mat4x3_ x_e8 = m7;
return float3(x_e2.mx.w, x_e5.my.w, x_e8.mz.w);
}
float4 Mul(Mat4x4_ m8, float4 v) {
@ -66,7 +78,15 @@ float4 Mul(Mat4x4_ m8, float4 v) {
float4 v1 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m9 = m8;
v1 = v;
return float4(dot(m9.mx, v1), dot(m9.my, v1), dot(m9.mz, v1), dot(m9.mw, v1));
const Mat4x4_ x_e4 = m9;
const float4 x_e6 = v1;
const Mat4x4_ x_e8 = m9;
const float4 x_e10 = v1;
const Mat4x4_ x_e12 = m9;
const float4 x_e14 = v1;
const Mat4x4_ x_e16 = m9;
const float4 x_e18 = v1;
return float4(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10), dot(x_e12.mz, x_e14), dot(x_e16.mw, x_e18));
}
float3 Mul1(Mat4x3_ m10, float4 v2) {
@ -74,7 +94,13 @@ float3 Mul1(Mat4x3_ m10, float4 v2) {
float4 v3 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m11 = m10;
v3 = v2;
return float3(dot(m11.mx, v3), dot(m11.my, v3), dot(m11.mz, v3));
const Mat4x3_ x_e4 = m11;
const float4 x_e6 = v3;
const Mat4x3_ x_e8 = m11;
const float4 x_e10 = v3;
const Mat4x3_ x_e12 = m11;
const float4 x_e14 = v3;
return float3(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10), dot(x_e12.mz, x_e14));
}
float2 Mul2(Mat4x2_ m12, float4 v4) {
@ -82,7 +108,11 @@ float2 Mul2(Mat4x2_ m12, float4 v4) {
float4 v5 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m13 = m12;
v5 = v4;
return float2(dot(m13.mx, v5), dot(m13.my, v5));
const Mat4x2_ x_e4 = m13;
const float4 x_e6 = v5;
const Mat4x2_ x_e8 = m13;
const float4 x_e10 = v5;
return float2(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10));
}
float4 Mul3(float3 v6, Mat4x3_ m14) {
@ -90,25 +120,35 @@ float4 Mul3(float3 v6, Mat4x3_ m14) {
Mat4x3_ m15 = (Mat4x3_)0;
v7 = v6;
m15 = m14;
const float3 x_e6 = Mat4x3GetCol0_(m15);
const Mat4x3_ x_e5 = m15;
const float3 x_e6 = Mat4x3GetCol0_(x_e5);
const float3 x_e7 = v7;
const float3 x_e11 = Mat4x3GetCol1_(m15);
const Mat4x3_ x_e10 = m15;
const float3 x_e11 = Mat4x3GetCol1_(x_e10);
const float3 x_e12 = v7;
const float3 x_e16 = Mat4x3GetCol2_(m15);
const Mat4x3_ x_e15 = m15;
const float3 x_e16 = Mat4x3GetCol2_(x_e15);
const float3 x_e17 = v7;
const float3 x_e21 = Mat4x3GetCol3_(m15);
return float4(dot(x_e6, x_e7), dot(x_e11, x_e12), dot(x_e16, x_e17), dot(x_e21, v7));
const Mat4x3_ x_e20 = m15;
const float3 x_e21 = Mat4x3GetCol3_(x_e20);
const float3 x_e22 = v7;
return float4(dot(x_e6, x_e7), dot(x_e11, x_e12), dot(x_e16, x_e17), dot(x_e21, x_e22));
}
Mat4x4_ x_Mat4x4_(float n) {
float n1 = 0.0f;
Mat4x4_ o = (Mat4x4_)0;
n1 = n;
o.mx = float4(n1, 0.0f, 0.0f, 0.0f);
o.my = float4(0.0f, n1, 0.0f, 0.0f);
o.mz = float4(0.0f, 0.0f, n1, 0.0f);
o.mw = float4(0.0f, 0.0f, 0.0f, n1);
return o;
const float x_e4 = n1;
o.mx = float4(x_e4, 0.0f, 0.0f, 0.0f);
const float x_e11 = n1;
o.my = float4(0.0f, x_e11, 0.0f, 0.0f);
const float x_e18 = n1;
o.mz = float4(0.0f, 0.0f, x_e18, 0.0f);
const float x_e25 = n1;
o.mw = float4(0.0f, 0.0f, 0.0f, x_e25);
const Mat4x4_ x_e27 = o;
return x_e27;
}
Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
@ -117,10 +157,14 @@ Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
m17 = m16;
const Mat4x4_ x_e4 = x_Mat4x4_(1.0f);
o1 = x_e4;
o1.mx = m17.mx;
o1.my = m17.my;
o1.mz = m17.mz;
return o1;
const Mat4x3_ x_e7 = m17;
o1.mx = x_e7.mx;
const Mat4x3_ x_e10 = m17;
o1.my = x_e10.my;
const Mat4x3_ x_e13 = m17;
o1.mz = x_e13.mz;
const Mat4x4_ x_e15 = o1;
return x_e15;
}
Mat4x4_ x_Mat4x4_2(Mat4x2_ m18) {
@ -129,29 +173,40 @@ Mat4x4_ x_Mat4x4_2(Mat4x2_ m18) {
m19 = m18;
const Mat4x4_ x_e4 = x_Mat4x4_(1.0f);
o2 = x_e4;
o2.mx = m19.mx;
o2.my = m19.my;
return o2;
const Mat4x2_ x_e7 = m19;
o2.mx = x_e7.mx;
const Mat4x2_ x_e10 = m19;
o2.my = x_e10.my;
const Mat4x4_ x_e12 = o2;
return x_e12;
}
Mat4x3_ x_Mat4x3_(float n2) {
float n3 = 0.0f;
Mat4x3_ o3 = (Mat4x3_)0;
n3 = n2;
o3.mx = float4(n3, 0.0f, 0.0f, 0.0f);
o3.my = float4(0.0f, n3, 0.0f, 0.0f);
o3.mz = float4(0.0f, 0.0f, n3, 0.0f);
return o3;
const float x_e4 = n3;
o3.mx = float4(x_e4, 0.0f, 0.0f, 0.0f);
const float x_e11 = n3;
o3.my = float4(0.0f, x_e11, 0.0f, 0.0f);
const float x_e18 = n3;
o3.mz = float4(0.0f, 0.0f, x_e18, 0.0f);
const Mat4x3_ x_e21 = o3;
return x_e21;
}
Mat4x3_ x_Mat4x3_1(Mat4x4_ m20) {
Mat4x4_ m21 = (Mat4x4_)0;
Mat4x3_ o4 = (Mat4x3_)0;
m21 = m20;
o4.mx = m21.mx;
o4.my = m21.my;
o4.mz = m21.mz;
return o4;
const Mat4x4_ x_e4 = m21;
o4.mx = x_e4.mx;
const Mat4x4_ x_e7 = m21;
o4.my = x_e7.my;
const Mat4x4_ x_e10 = m21;
o4.mz = x_e10.mz;
const Mat4x3_ x_e12 = o4;
return x_e12;
}
Mat4x3_ tint_symbol_3(uint4 buffer[96], uint offset) {
@ -181,26 +236,35 @@ Mat4x2_ tint_symbol_8(uint4 buffer[3], uint offset) {
void main1() {
Mat4x3_ t_PosMtx = (Mat4x3_)0;
float2 t_TexSpaceCoord = float2(0.0f, 0.0f);
const Mat4x3_ x_e18 = tint_symbol_3(global2, (48u * uint(int(a_PosMtxIdx1))));
const float x_e15 = a_PosMtxIdx1;
const Mat4x3_ x_e18 = tint_symbol_3(global2, (48u * uint(int(x_e15))));
t_PosMtx = x_e18;
const Mat4x4_ x_e24 = x_Mat4x4_1(t_PosMtx);
const Mat4x3_ x_e23 = t_PosMtx;
const Mat4x4_ x_e24 = x_Mat4x4_1(x_e23);
const float3 x_e25 = a_Position1;
const Mat4x4_ x_e30 = x_Mat4x4_1(t_PosMtx);
const float4 x_e34 = Mul(x_e30, float4(a_Position1, 1.0f));
const Mat4x3_ x_e29 = t_PosMtx;
const Mat4x4_ x_e30 = x_Mat4x4_1(x_e29);
const float3 x_e31 = a_Position1;
const float4 x_e34 = Mul(x_e30, float4(x_e31, 1.0f));
const Mat4x4_ x_e35 = tint_symbol_5(global, 0u);
const Mat4x4_ x_e38 = x_Mat4x4_1(t_PosMtx);
const Mat4x3_ x_e37 = t_PosMtx;
const Mat4x4_ x_e38 = x_Mat4x4_1(x_e37);
const float3 x_e39 = a_Position1;
const Mat4x4_ x_e44 = x_Mat4x4_1(t_PosMtx);
const float4 x_e48 = Mul(x_e44, float4(a_Position1, 1.0f));
const Mat4x3_ x_e43 = t_PosMtx;
const Mat4x4_ x_e44 = x_Mat4x4_1(x_e43);
const float3 x_e45 = a_Position1;
const float4 x_e48 = Mul(x_e44, float4(x_e45, 1.0f));
const float4 x_e49 = Mul(x_e35, x_e48);
gl_Position = x_e49;
v_Color = a_Color1;
const float4 x_e50 = a_Color1;
v_Color = x_e50;
const float4 x_e52 = asfloat(global1[2]);
if ((x_e52.x == 2.0f)) {
{
const float3 x_e59 = a_Normal1;
const Mat4x2_ x_e64 = tint_symbol_8(global1, 0u);
const float2 x_e68 = Mul2(x_e64, float4(a_Normal1, 1.0f));
const float3 x_e65 = a_Normal1;
const float2 x_e68 = Mul2(x_e64, float4(x_e65, 1.0f));
v_TexCoord = x_e68.xy;
return;
}
@ -208,7 +272,8 @@ void main1() {
{
const float2 x_e73 = a_UV1;
const Mat4x2_ x_e79 = tint_symbol_8(global1, 0u);
const float2 x_e84 = Mul2(x_e79, float4(a_UV1, 1.0f, 1.0f));
const float2 x_e80 = a_UV1;
const float2 x_e84 = Mul2(x_e79, float4(x_e80, 1.0f, 1.0f));
v_TexCoord = x_e84.xy;
return;
}
@ -235,7 +300,10 @@ VertexOutput main_inner(float3 a_Position, float2 a_UV, float4 a_Color, float3 a
a_Normal1 = a_Normal;
a_PosMtxIdx1 = a_PosMtxIdx;
main1();
const VertexOutput tint_symbol_12 = {v_Color, v_TexCoord, gl_Position};
const float4 x_e11 = v_Color;
const float2 x_e13 = v_TexCoord;
const float4 x_e15 = gl_Position;
const VertexOutput tint_symbol_12 = {x_e11, x_e13, x_e15};
return tint_symbol_12;
}

View File

@ -40,25 +40,37 @@ static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f);
float3 Mat4x3GetCol0_(Mat4x3_ m) {
Mat4x3_ m1 = (Mat4x3_)0;
m1 = m;
return float3(m1.mx.x, m1.my.x, m1.mz.x);
const Mat4x3_ x_e2 = m1;
const Mat4x3_ x_e5 = m1;
const Mat4x3_ x_e8 = m1;
return float3(x_e2.mx.x, x_e5.my.x, x_e8.mz.x);
}
float3 Mat4x3GetCol1_(Mat4x3_ m2) {
Mat4x3_ m3 = (Mat4x3_)0;
m3 = m2;
return float3(m3.mx.y, m3.my.y, m3.mz.y);
const Mat4x3_ x_e2 = m3;
const Mat4x3_ x_e5 = m3;
const Mat4x3_ x_e8 = m3;
return float3(x_e2.mx.y, x_e5.my.y, x_e8.mz.y);
}
float3 Mat4x3GetCol2_(Mat4x3_ m4) {
Mat4x3_ m5 = (Mat4x3_)0;
m5 = m4;
return float3(m5.mx.z, m5.my.z, m5.mz.z);
const Mat4x3_ x_e2 = m5;
const Mat4x3_ x_e5 = m5;
const Mat4x3_ x_e8 = m5;
return float3(x_e2.mx.z, x_e5.my.z, x_e8.mz.z);
}
float3 Mat4x3GetCol3_(Mat4x3_ m6) {
Mat4x3_ m7 = (Mat4x3_)0;
m7 = m6;
return float3(m7.mx.w, m7.my.w, m7.mz.w);
const Mat4x3_ x_e2 = m7;
const Mat4x3_ x_e5 = m7;
const Mat4x3_ x_e8 = m7;
return float3(x_e2.mx.w, x_e5.my.w, x_e8.mz.w);
}
float4 Mul(Mat4x4_ m8, float4 v) {
@ -66,7 +78,15 @@ float4 Mul(Mat4x4_ m8, float4 v) {
float4 v1 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m9 = m8;
v1 = v;
return float4(dot(m9.mx, v1), dot(m9.my, v1), dot(m9.mz, v1), dot(m9.mw, v1));
const Mat4x4_ x_e4 = m9;
const float4 x_e6 = v1;
const Mat4x4_ x_e8 = m9;
const float4 x_e10 = v1;
const Mat4x4_ x_e12 = m9;
const float4 x_e14 = v1;
const Mat4x4_ x_e16 = m9;
const float4 x_e18 = v1;
return float4(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10), dot(x_e12.mz, x_e14), dot(x_e16.mw, x_e18));
}
float3 Mul1(Mat4x3_ m10, float4 v2) {
@ -74,7 +94,13 @@ float3 Mul1(Mat4x3_ m10, float4 v2) {
float4 v3 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m11 = m10;
v3 = v2;
return float3(dot(m11.mx, v3), dot(m11.my, v3), dot(m11.mz, v3));
const Mat4x3_ x_e4 = m11;
const float4 x_e6 = v3;
const Mat4x3_ x_e8 = m11;
const float4 x_e10 = v3;
const Mat4x3_ x_e12 = m11;
const float4 x_e14 = v3;
return float3(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10), dot(x_e12.mz, x_e14));
}
float2 Mul2(Mat4x2_ m12, float4 v4) {
@ -82,7 +108,11 @@ float2 Mul2(Mat4x2_ m12, float4 v4) {
float4 v5 = float4(0.0f, 0.0f, 0.0f, 0.0f);
m13 = m12;
v5 = v4;
return float2(dot(m13.mx, v5), dot(m13.my, v5));
const Mat4x2_ x_e4 = m13;
const float4 x_e6 = v5;
const Mat4x2_ x_e8 = m13;
const float4 x_e10 = v5;
return float2(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10));
}
float4 Mul3(float3 v6, Mat4x3_ m14) {
@ -90,25 +120,35 @@ float4 Mul3(float3 v6, Mat4x3_ m14) {
Mat4x3_ m15 = (Mat4x3_)0;
v7 = v6;
m15 = m14;
const float3 x_e6 = Mat4x3GetCol0_(m15);
const Mat4x3_ x_e5 = m15;
const float3 x_e6 = Mat4x3GetCol0_(x_e5);
const float3 x_e7 = v7;
const float3 x_e11 = Mat4x3GetCol1_(m15);
const Mat4x3_ x_e10 = m15;
const float3 x_e11 = Mat4x3GetCol1_(x_e10);
const float3 x_e12 = v7;
const float3 x_e16 = Mat4x3GetCol2_(m15);
const Mat4x3_ x_e15 = m15;
const float3 x_e16 = Mat4x3GetCol2_(x_e15);
const float3 x_e17 = v7;
const float3 x_e21 = Mat4x3GetCol3_(m15);
return float4(dot(x_e6, x_e7), dot(x_e11, x_e12), dot(x_e16, x_e17), dot(x_e21, v7));
const Mat4x3_ x_e20 = m15;
const float3 x_e21 = Mat4x3GetCol3_(x_e20);
const float3 x_e22 = v7;
return float4(dot(x_e6, x_e7), dot(x_e11, x_e12), dot(x_e16, x_e17), dot(x_e21, x_e22));
}
Mat4x4_ x_Mat4x4_(float n) {
float n1 = 0.0f;
Mat4x4_ o = (Mat4x4_)0;
n1 = n;
o.mx = float4(n1, 0.0f, 0.0f, 0.0f);
o.my = float4(0.0f, n1, 0.0f, 0.0f);
o.mz = float4(0.0f, 0.0f, n1, 0.0f);
o.mw = float4(0.0f, 0.0f, 0.0f, n1);
return o;
const float x_e4 = n1;
o.mx = float4(x_e4, 0.0f, 0.0f, 0.0f);
const float x_e11 = n1;
o.my = float4(0.0f, x_e11, 0.0f, 0.0f);
const float x_e18 = n1;
o.mz = float4(0.0f, 0.0f, x_e18, 0.0f);
const float x_e25 = n1;
o.mw = float4(0.0f, 0.0f, 0.0f, x_e25);
const Mat4x4_ x_e27 = o;
return x_e27;
}
Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
@ -117,10 +157,14 @@ Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
m17 = m16;
const Mat4x4_ x_e4 = x_Mat4x4_(1.0f);
o1 = x_e4;
o1.mx = m17.mx;
o1.my = m17.my;
o1.mz = m17.mz;
return o1;
const Mat4x3_ x_e7 = m17;
o1.mx = x_e7.mx;
const Mat4x3_ x_e10 = m17;
o1.my = x_e10.my;
const Mat4x3_ x_e13 = m17;
o1.mz = x_e13.mz;
const Mat4x4_ x_e15 = o1;
return x_e15;
}
Mat4x4_ x_Mat4x4_2(Mat4x2_ m18) {
@ -129,29 +173,40 @@ Mat4x4_ x_Mat4x4_2(Mat4x2_ m18) {
m19 = m18;
const Mat4x4_ x_e4 = x_Mat4x4_(1.0f);
o2 = x_e4;
o2.mx = m19.mx;
o2.my = m19.my;
return o2;
const Mat4x2_ x_e7 = m19;
o2.mx = x_e7.mx;
const Mat4x2_ x_e10 = m19;
o2.my = x_e10.my;
const Mat4x4_ x_e12 = o2;
return x_e12;
}
Mat4x3_ x_Mat4x3_(float n2) {
float n3 = 0.0f;
Mat4x3_ o3 = (Mat4x3_)0;
n3 = n2;
o3.mx = float4(n3, 0.0f, 0.0f, 0.0f);
o3.my = float4(0.0f, n3, 0.0f, 0.0f);
o3.mz = float4(0.0f, 0.0f, n3, 0.0f);
return o3;
const float x_e4 = n3;
o3.mx = float4(x_e4, 0.0f, 0.0f, 0.0f);
const float x_e11 = n3;
o3.my = float4(0.0f, x_e11, 0.0f, 0.0f);
const float x_e18 = n3;
o3.mz = float4(0.0f, 0.0f, x_e18, 0.0f);
const Mat4x3_ x_e21 = o3;
return x_e21;
}
Mat4x3_ x_Mat4x3_1(Mat4x4_ m20) {
Mat4x4_ m21 = (Mat4x4_)0;
Mat4x3_ o4 = (Mat4x3_)0;
m21 = m20;
o4.mx = m21.mx;
o4.my = m21.my;
o4.mz = m21.mz;
return o4;
const Mat4x4_ x_e4 = m21;
o4.mx = x_e4.mx;
const Mat4x4_ x_e7 = m21;
o4.my = x_e7.my;
const Mat4x4_ x_e10 = m21;
o4.mz = x_e10.mz;
const Mat4x3_ x_e12 = o4;
return x_e12;
}
Mat4x3_ tint_symbol_3(uint4 buffer[96], uint offset) {
@ -181,26 +236,35 @@ Mat4x2_ tint_symbol_8(uint4 buffer[3], uint offset) {
void main1() {
Mat4x3_ t_PosMtx = (Mat4x3_)0;
float2 t_TexSpaceCoord = float2(0.0f, 0.0f);
const Mat4x3_ x_e18 = tint_symbol_3(global2, (48u * uint(int(a_PosMtxIdx1))));
const float x_e15 = a_PosMtxIdx1;
const Mat4x3_ x_e18 = tint_symbol_3(global2, (48u * uint(int(x_e15))));
t_PosMtx = x_e18;
const Mat4x4_ x_e24 = x_Mat4x4_1(t_PosMtx);
const Mat4x3_ x_e23 = t_PosMtx;
const Mat4x4_ x_e24 = x_Mat4x4_1(x_e23);
const float3 x_e25 = a_Position1;
const Mat4x4_ x_e30 = x_Mat4x4_1(t_PosMtx);
const float4 x_e34 = Mul(x_e30, float4(a_Position1, 1.0f));
const Mat4x3_ x_e29 = t_PosMtx;
const Mat4x4_ x_e30 = x_Mat4x4_1(x_e29);
const float3 x_e31 = a_Position1;
const float4 x_e34 = Mul(x_e30, float4(x_e31, 1.0f));
const Mat4x4_ x_e35 = tint_symbol_5(global, 0u);
const Mat4x4_ x_e38 = x_Mat4x4_1(t_PosMtx);
const Mat4x3_ x_e37 = t_PosMtx;
const Mat4x4_ x_e38 = x_Mat4x4_1(x_e37);
const float3 x_e39 = a_Position1;
const Mat4x4_ x_e44 = x_Mat4x4_1(t_PosMtx);
const float4 x_e48 = Mul(x_e44, float4(a_Position1, 1.0f));
const Mat4x3_ x_e43 = t_PosMtx;
const Mat4x4_ x_e44 = x_Mat4x4_1(x_e43);
const float3 x_e45 = a_Position1;
const float4 x_e48 = Mul(x_e44, float4(x_e45, 1.0f));
const float4 x_e49 = Mul(x_e35, x_e48);
gl_Position = x_e49;
v_Color = a_Color1;
const float4 x_e50 = a_Color1;
v_Color = x_e50;
const float4 x_e52 = asfloat(global1[2]);
if ((x_e52.x == 2.0f)) {
{
const float3 x_e59 = a_Normal1;
const Mat4x2_ x_e64 = tint_symbol_8(global1, 0u);
const float2 x_e68 = Mul2(x_e64, float4(a_Normal1, 1.0f));
const float3 x_e65 = a_Normal1;
const float2 x_e68 = Mul2(x_e64, float4(x_e65, 1.0f));
v_TexCoord = x_e68.xy;
return;
}
@ -208,7 +272,8 @@ void main1() {
{
const float2 x_e73 = a_UV1;
const Mat4x2_ x_e79 = tint_symbol_8(global1, 0u);
const float2 x_e84 = Mul2(x_e79, float4(a_UV1, 1.0f, 1.0f));
const float2 x_e80 = a_UV1;
const float2 x_e84 = Mul2(x_e79, float4(x_e80, 1.0f, 1.0f));
v_TexCoord = x_e84.xy;
return;
}
@ -235,7 +300,10 @@ VertexOutput main_inner(float3 a_Position, float2 a_UV, float4 a_Color, float3 a
a_Normal1 = a_Normal;
a_PosMtxIdx1 = a_PosMtxIdx;
main1();
const VertexOutput tint_symbol_12 = {v_Color, v_TexCoord, gl_Position};
const float4 x_e11 = v_Color;
const float2 x_e13 = v_TexCoord;
const float4 x_e15 = gl_Position;
const VertexOutput tint_symbol_12 = {x_e11, x_e13, x_e15};
return tint_symbol_12;
}

View File

@ -57,7 +57,15 @@ vec4 Mul(Mat4x4_ m8, vec4 v) {
vec4 v1 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
m9 = m8;
v1 = v;
return vec4(dot(m9.mx, v1), dot(m9.my, v1), dot(m9.mz, v1), dot(m9.mw, v1));
Mat4x4_ x_e4 = m9;
vec4 x_e6 = v1;
Mat4x4_ x_e8 = m9;
vec4 x_e10 = v1;
Mat4x4_ x_e12 = m9;
vec4 x_e14 = v1;
Mat4x4_ x_e16 = m9;
vec4 x_e18 = v1;
return vec4(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10), dot(x_e12.mz, x_e14), dot(x_e16.mw, x_e18));
}
vec2 Mul2(Mat4x2_ m12, vec4 v4) {
@ -65,18 +73,27 @@ vec2 Mul2(Mat4x2_ m12, vec4 v4) {
vec4 v5 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
m13 = m12;
v5 = v4;
return vec2(dot(m13.mx, v5), dot(m13.my, v5));
Mat4x2_ x_e4 = m13;
vec4 x_e6 = v5;
Mat4x2_ x_e8 = m13;
vec4 x_e10 = v5;
return vec2(dot(x_e4.mx, x_e6), dot(x_e8.my, x_e10));
}
Mat4x4_ x_Mat4x4_(float n) {
float n1 = 0.0f;
Mat4x4_ o = Mat4x4_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
n1 = n;
o.mx = vec4(n1, 0.0f, 0.0f, 0.0f);
o.my = vec4(0.0f, n1, 0.0f, 0.0f);
o.mz = vec4(0.0f, 0.0f, n1, 0.0f);
o.mw = vec4(0.0f, 0.0f, 0.0f, n1);
return o;
float x_e4 = n1;
o.mx = vec4(x_e4, 0.0f, 0.0f, 0.0f);
float x_e11 = n1;
o.my = vec4(0.0f, x_e11, 0.0f, 0.0f);
float x_e18 = n1;
o.mz = vec4(0.0f, 0.0f, x_e18, 0.0f);
float x_e25 = n1;
o.mw = vec4(0.0f, 0.0f, 0.0f, x_e25);
Mat4x4_ x_e27 = o;
return x_e27;
}
Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
@ -85,35 +102,48 @@ Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
m17 = m16;
Mat4x4_ x_e4 = x_Mat4x4_(1.0f);
o1 = x_e4;
o1.mx = m17.mx;
o1.my = m17.my;
o1.mz = m17.mz;
return o1;
Mat4x3_ x_e7 = m17;
o1.mx = x_e7.mx;
Mat4x3_ x_e10 = m17;
o1.my = x_e10.my;
Mat4x3_ x_e13 = m17;
o1.mz = x_e13.mz;
Mat4x4_ x_e15 = o1;
return x_e15;
}
void main1() {
Mat4x3_ t_PosMtx = Mat4x3_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
vec2 t_TexSpaceCoord = vec2(0.0f, 0.0f);
Mat4x3_ x_e18 = global2.u_PosMtx[int(a_PosMtxIdx1)];
float x_e15 = a_PosMtxIdx1;
Mat4x3_ x_e18 = global2.u_PosMtx[int(x_e15)];
t_PosMtx = x_e18;
Mat4x4_ x_e24 = x_Mat4x4_1(t_PosMtx);
Mat4x3_ x_e23 = t_PosMtx;
Mat4x4_ x_e24 = x_Mat4x4_1(x_e23);
vec3 x_e25 = a_Position1;
Mat4x4_ x_e30 = x_Mat4x4_1(t_PosMtx);
vec4 x_e34 = Mul(x_e30, vec4(a_Position1, 1.0f));
Mat4x3_ x_e29 = t_PosMtx;
Mat4x4_ x_e30 = x_Mat4x4_1(x_e29);
vec3 x_e31 = a_Position1;
vec4 x_e34 = Mul(x_e30, vec4(x_e31, 1.0f));
Mat4x4_ x_e35 = global.u_Projection;
Mat4x4_ x_e38 = x_Mat4x4_1(t_PosMtx);
Mat4x3_ x_e37 = t_PosMtx;
Mat4x4_ x_e38 = x_Mat4x4_1(x_e37);
vec3 x_e39 = a_Position1;
Mat4x4_ x_e44 = x_Mat4x4_1(t_PosMtx);
vec4 x_e48 = Mul(x_e44, vec4(a_Position1, 1.0f));
Mat4x3_ x_e43 = t_PosMtx;
Mat4x4_ x_e44 = x_Mat4x4_1(x_e43);
vec3 x_e45 = a_Position1;
vec4 x_e48 = Mul(x_e44, vec4(x_e45, 1.0f));
vec4 x_e49 = Mul(x_e35, x_e48);
tint_symbol = x_e49;
v_Color = a_Color1;
vec4 x_e50 = a_Color1;
v_Color = x_e50;
vec4 x_e52 = global1.u_Misc0_;
if ((x_e52.x == 2.0f)) {
{
vec3 x_e59 = a_Normal1;
Mat4x2_ x_e64 = global1.u_TexMtx[0];
vec2 x_e68 = Mul2(x_e64, vec4(a_Normal1, 1.0f));
vec3 x_e65 = a_Normal1;
vec2 x_e68 = Mul2(x_e64, vec4(x_e65, 1.0f));
v_TexCoord = x_e68.xy;
return;
}
@ -121,7 +151,8 @@ void main1() {
{
vec2 x_e73 = a_UV1;
Mat4x2_ x_e79 = global1.u_TexMtx[0];
vec2 x_e84 = Mul2(x_e79, vec4(a_UV1, 1.0f, 1.0f));
vec2 x_e80 = a_UV1;
vec2 x_e84 = Mul2(x_e79, vec4(x_e80, 1.0f, 1.0f));
v_TexCoord = x_e84.xy;
return;
}
@ -135,7 +166,10 @@ VertexOutput tint_symbol_1(vec3 a_Position, vec2 a_UV, vec4 a_Color, vec3 a_Norm
a_Normal1 = a_Normal;
a_PosMtxIdx1 = a_PosMtxIdx;
main1();
VertexOutput tint_symbol_2 = VertexOutput(v_Color, v_TexCoord, tint_symbol);
vec4 x_e11 = v_Color;
vec2 x_e13 = v_TexCoord;
vec4 x_e15 = tint_symbol;
VertexOutput tint_symbol_2 = VertexOutput(x_e11, x_e13, x_e15);
return tint_symbol_2;
}

View File

@ -57,7 +57,8 @@ float mm_readA_i1_i1_(inout int row, inout int col) {
} else {
x_430 = 0.0f;
}
return x_430;
const float x_450 = x_430;
return x_450;
}
float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
@ -86,7 +87,8 @@ float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
} else {
x_468 = 0.0f;
}
return x_468;
const float x_487 = x_468;
return x_487;
}
int getOutputFlatIndex_vi3_(inout int3 coords) {
@ -114,7 +116,8 @@ void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout floa
param = int3(x_115, x_116, x_117);
const int x_120 = getOutputFlatIndex_vi3_(param);
flatIndex_1 = x_120;
param_1 = flatIndex_1;
const int x_122 = flatIndex_1;
param_1 = x_122;
const float x_124 = value_1;
param_2 = x_124;
setOutput_i1_f1_(param_1, param_2);
@ -131,7 +134,8 @@ void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) {
const int x_492 = row_2;
const int x_493 = col_2;
outCoord = int3(x_491, x_492, x_493);
param_14 = batch;
const int x_496 = batch;
param_14 = x_496;
const int x_498 = row_2;
param_15 = x_498;
const int x_500 = col_2;
@ -188,14 +192,30 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
const int x_152 = dimInner;
numTiles = (((x_152 - 1) / 64) + 1);
innerRow = 0;
{
[loop] for(; (innerRow < 1); innerRow = (innerRow + 1)) {
[loop] while (true) {
const int x_163 = innerRow;
if ((x_163 < 1)) {
} else {
break;
}
innerCol = 0;
[loop] while (true) {
const int x_171 = innerCol;
if ((x_171 < 1)) {
} else {
break;
}
const int x_177 = innerRow;
const int x_178 = innerCol;
acc[x_177][x_178] = 0.0f;
{
[loop] for(; (innerCol < 1); innerCol = (innerCol + 1)) {
acc[innerRow][innerCol] = 0.0f;
const int x_181 = innerCol;
innerCol = (x_181 + 1);
}
}
{
const int x_183 = innerRow;
innerRow = (x_183 + 1);
}
}
const uint x_187 = gl_LocalInvocationID.x;
@ -203,91 +223,179 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
const uint x_192 = gl_LocalInvocationID.y;
tileRowB = (asint(x_192) * 1);
t = 0;
{
[loop] for(; (t < numTiles); t = (t + 1)) {
[loop] while (true) {
const int x_201 = t;
const int x_202 = numTiles;
if ((x_201 < x_202)) {
} else {
break;
}
innerRow_1 = 0;
{
[loop] for(; (innerRow_1 < 1); innerRow_1 = (innerRow_1 + 1)) {
[loop] while (true) {
const int x_210 = innerRow_1;
if ((x_210 < 1)) {
} else {
break;
}
innerCol_1 = 0;
{
[loop] for(; (innerCol_1 < 64); innerCol_1 = (innerCol_1 + 1)) {
inputRow = (tileRow + innerRow_1);
inputCol = (tileColA + innerCol_1);
[loop] while (true) {
const int x_218 = innerCol_1;
if ((x_218 < 64)) {
} else {
break;
}
const int x_221 = tileRow;
const int x_222 = innerRow_1;
inputRow = (x_221 + x_222);
const int x_225 = tileColA;
const int x_226 = innerCol_1;
inputCol = (x_225 + x_226);
const int x_233 = inputRow;
const int x_234 = inputCol;
const int x_235 = globalRow;
const int x_236 = innerRow_1;
const int x_238 = t;
const int x_240 = inputCol;
param_3 = (globalRow + innerRow_1);
param_3 = (x_235 + x_236);
param_4 = ((x_238 * 64) + x_240);
const float x_244 = mm_readA_i1_i1_(param_3, param_4);
mm_Asub[x_233][x_234] = x_244;
{
const int x_247 = innerCol_1;
innerCol_1 = (x_247 + 1);
}
}
{
const int x_249 = innerRow_1;
innerRow_1 = (x_249 + 1);
}
}
innerRow_2 = 0;
{
[loop] for(; (innerRow_2 < 1); innerRow_2 = (innerRow_2 + 1)) {
[loop] while (true) {
const int x_257 = innerRow_2;
if ((x_257 < 1)) {
} else {
break;
}
innerCol_2 = 0;
{
[loop] for(; (innerCol_2 < 1); innerCol_2 = (innerCol_2 + 1)) {
inputRow_1 = (tileRowB + innerRow_2);
inputCol_1 = (tileCol + innerCol_2);
[loop] while (true) {
const int x_265 = innerCol_2;
if ((x_265 < 1)) {
} else {
break;
}
const int x_268 = tileRowB;
const int x_269 = innerRow_2;
inputRow_1 = (x_268 + x_269);
const int x_272 = tileCol;
const int x_273 = innerCol_2;
inputCol_1 = (x_272 + x_273);
const int x_278 = inputRow_1;
const int x_279 = inputCol_1;
const int x_280 = t;
const int x_282 = inputRow_1;
const int x_284 = globalCol;
const int x_285 = innerCol_2;
param_5 = ((t * 64) + inputRow_1);
param_5 = ((x_280 * 64) + x_282);
param_6 = (x_284 + x_285);
const float x_289 = mm_readB_i1_i1_(param_5, param_6);
mm_Bsub[x_278][x_279] = x_289;
{
const int x_291 = innerCol_2;
innerCol_2 = (x_291 + 1);
}
}
{
const int x_293 = innerRow_2;
innerRow_2 = (x_293 + 1);
}
}
GroupMemoryBarrierWithGroupSync();
k = 0;
{
[loop] for(; (k < 64); k = (k + 1)) {
[loop] while (true) {
const int x_302 = k;
if ((x_302 < 64)) {
} else {
break;
}
inner = 0;
{
[loop] for(; (inner < 1); inner = (inner + 1)) {
[loop] while (true) {
const int x_310 = inner;
if ((x_310 < 1)) {
} else {
break;
}
const int x_314 = inner;
const float x_320 = mm_Bsub[k][(tileCol + inner)];
const int x_315 = k;
const int x_316 = tileCol;
const int x_317 = inner;
const float x_320 = mm_Bsub[x_315][(x_316 + x_317)];
BCached[x_314] = x_320;
{
const int x_322 = inner;
inner = (x_322 + 1);
}
}
innerRow_3 = 0;
{
[loop] for(; (innerRow_3 < 1); innerRow_3 = (innerRow_3 + 1)) {
const float x_338 = mm_Asub[(tileRow + innerRow_3)][k];
[loop] while (true) {
const int x_330 = innerRow_3;
if ((x_330 < 1)) {
} else {
break;
}
const int x_333 = tileRow;
const int x_334 = innerRow_3;
const int x_336 = k;
const float x_338 = mm_Asub[(x_333 + x_334)][x_336];
ACached = x_338;
innerCol_3 = 0;
{
[loop] for(; (innerCol_3 < 1); innerCol_3 = (innerCol_3 + 1)) {
[loop] while (true) {
const int x_345 = innerCol_3;
if ((x_345 < 1)) {
} else {
break;
}
const int x_347 = innerRow_3;
const int x_348 = innerCol_3;
const float x_349 = ACached;
const float x_352 = BCached[innerCol_3];
const int x_350 = innerCol_3;
const float x_352 = BCached[x_350];
const float x_355 = acc[x_347][x_348];
acc[x_347][x_348] = (x_355 + (x_349 * x_352));
{
const int x_358 = innerCol_3;
innerCol_3 = (x_358 + 1);
}
}
{
const int x_360 = innerRow_3;
innerRow_3 = (x_360 + 1);
}
}
{
const int x_362 = k;
k = (x_362 + 1);
}
}
GroupMemoryBarrierWithGroupSync();
{
const int x_364 = t;
t = (x_364 + 1);
}
}
innerRow_4 = 0;
{
[loop] for(; (innerRow_4 < 1); innerRow_4 = (innerRow_4 + 1)) {
[loop] while (true) {
const int x_372 = innerRow_4;
if ((x_372 < 1)) {
} else {
break;
}
innerCol_4 = 0;
[loop] while (true) {
bool x_393 = false;
bool x_394 = false;
if ((innerCol_4 < 1)) {
const int x_380 = innerCol_4;
if ((x_380 < 1)) {
} else {
break;
}
@ -304,20 +412,26 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
x_394 = x_393;
}
if (x_394) {
const int x_397 = globalRow;
const int x_398 = innerRow_4;
const int x_400 = globalCol;
const int x_401 = innerCol_4;
const int x_403 = innerRow_4;
const int x_404 = innerCol_4;
param_7 = (globalRow + innerRow_4);
param_7 = (x_397 + x_398);
param_8 = (x_400 + x_401);
const float x_409 = acc[x_403][x_404];
param_9 = x_409;
mm_write_i1_i1_f1_(param_7, param_8, param_9);
}
{
innerCol_4 = (innerCol_4 + 1);
const int x_411 = innerCol_4;
innerCol_4 = (x_411 + 1);
}
}
{
const int x_413 = innerRow_4;
innerRow_4 = (x_413 + 1);
}
}
return;
@ -335,9 +449,12 @@ void main_1() {
dimBOuter_1 = x_75;
const uint x_505 = gl_GlobalInvocationID.z;
batch = asint(x_505);
param_18 = dimAOuter_1;
param_19 = dimInner_1;
param_20 = dimBOuter_1;
const int x_508 = dimAOuter_1;
param_18 = x_508;
const int x_510 = dimInner_1;
param_19 = x_510;
const int x_512 = dimBOuter_1;
param_20 = x_512;
mm_matMul_i1_i1_i1_(param_18, param_19, param_20);
return;
}

View File

@ -57,7 +57,8 @@ float mm_readA_i1_i1_(inout int row, inout int col) {
} else {
x_430 = 0.0f;
}
return x_430;
const float x_450 = x_430;
return x_450;
}
float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
@ -86,7 +87,8 @@ float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
} else {
x_468 = 0.0f;
}
return x_468;
const float x_487 = x_468;
return x_487;
}
int getOutputFlatIndex_vi3_(inout int3 coords) {
@ -114,7 +116,8 @@ void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout floa
param = int3(x_115, x_116, x_117);
const int x_120 = getOutputFlatIndex_vi3_(param);
flatIndex_1 = x_120;
param_1 = flatIndex_1;
const int x_122 = flatIndex_1;
param_1 = x_122;
const float x_124 = value_1;
param_2 = x_124;
setOutput_i1_f1_(param_1, param_2);
@ -131,7 +134,8 @@ void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) {
const int x_492 = row_2;
const int x_493 = col_2;
outCoord = int3(x_491, x_492, x_493);
param_14 = batch;
const int x_496 = batch;
param_14 = x_496;
const int x_498 = row_2;
param_15 = x_498;
const int x_500 = col_2;
@ -188,14 +192,30 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
const int x_152 = dimInner;
numTiles = (((x_152 - 1) / 64) + 1);
innerRow = 0;
{
[loop] for(; (innerRow < 1); innerRow = (innerRow + 1)) {
[loop] while (true) {
const int x_163 = innerRow;
if ((x_163 < 1)) {
} else {
break;
}
innerCol = 0;
[loop] while (true) {
const int x_171 = innerCol;
if ((x_171 < 1)) {
} else {
break;
}
const int x_177 = innerRow;
const int x_178 = innerCol;
acc[x_177][x_178] = 0.0f;
{
[loop] for(; (innerCol < 1); innerCol = (innerCol + 1)) {
acc[innerRow][innerCol] = 0.0f;
const int x_181 = innerCol;
innerCol = (x_181 + 1);
}
}
{
const int x_183 = innerRow;
innerRow = (x_183 + 1);
}
}
const uint x_187 = gl_LocalInvocationID.x;
@ -203,91 +223,179 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
const uint x_192 = gl_LocalInvocationID.y;
tileRowB = (asint(x_192) * 1);
t = 0;
{
[loop] for(; (t < numTiles); t = (t + 1)) {
[loop] while (true) {
const int x_201 = t;
const int x_202 = numTiles;
if ((x_201 < x_202)) {
} else {
break;
}
innerRow_1 = 0;
{
[loop] for(; (innerRow_1 < 1); innerRow_1 = (innerRow_1 + 1)) {
[loop] while (true) {
const int x_210 = innerRow_1;
if ((x_210 < 1)) {
} else {
break;
}
innerCol_1 = 0;
{
[loop] for(; (innerCol_1 < 64); innerCol_1 = (innerCol_1 + 1)) {
inputRow = (tileRow + innerRow_1);
inputCol = (tileColA + innerCol_1);
[loop] while (true) {
const int x_218 = innerCol_1;
if ((x_218 < 64)) {
} else {
break;
}
const int x_221 = tileRow;
const int x_222 = innerRow_1;
inputRow = (x_221 + x_222);
const int x_225 = tileColA;
const int x_226 = innerCol_1;
inputCol = (x_225 + x_226);
const int x_233 = inputRow;
const int x_234 = inputCol;
const int x_235 = globalRow;
const int x_236 = innerRow_1;
const int x_238 = t;
const int x_240 = inputCol;
param_3 = (globalRow + innerRow_1);
param_3 = (x_235 + x_236);
param_4 = ((x_238 * 64) + x_240);
const float x_244 = mm_readA_i1_i1_(param_3, param_4);
mm_Asub[x_233][x_234] = x_244;
{
const int x_247 = innerCol_1;
innerCol_1 = (x_247 + 1);
}
}
{
const int x_249 = innerRow_1;
innerRow_1 = (x_249 + 1);
}
}
innerRow_2 = 0;
{
[loop] for(; (innerRow_2 < 1); innerRow_2 = (innerRow_2 + 1)) {
[loop] while (true) {
const int x_257 = innerRow_2;
if ((x_257 < 1)) {
} else {
break;
}
innerCol_2 = 0;
{
[loop] for(; (innerCol_2 < 1); innerCol_2 = (innerCol_2 + 1)) {
inputRow_1 = (tileRowB + innerRow_2);
inputCol_1 = (tileCol + innerCol_2);
[loop] while (true) {
const int x_265 = innerCol_2;
if ((x_265 < 1)) {
} else {
break;
}
const int x_268 = tileRowB;
const int x_269 = innerRow_2;
inputRow_1 = (x_268 + x_269);
const int x_272 = tileCol;
const int x_273 = innerCol_2;
inputCol_1 = (x_272 + x_273);
const int x_278 = inputRow_1;
const int x_279 = inputCol_1;
const int x_280 = t;
const int x_282 = inputRow_1;
const int x_284 = globalCol;
const int x_285 = innerCol_2;
param_5 = ((t * 64) + inputRow_1);
param_5 = ((x_280 * 64) + x_282);
param_6 = (x_284 + x_285);
const float x_289 = mm_readB_i1_i1_(param_5, param_6);
mm_Bsub[x_278][x_279] = x_289;
{
const int x_291 = innerCol_2;
innerCol_2 = (x_291 + 1);
}
}
{
const int x_293 = innerRow_2;
innerRow_2 = (x_293 + 1);
}
}
GroupMemoryBarrierWithGroupSync();
k = 0;
{
[loop] for(; (k < 64); k = (k + 1)) {
[loop] while (true) {
const int x_302 = k;
if ((x_302 < 64)) {
} else {
break;
}
inner = 0;
{
[loop] for(; (inner < 1); inner = (inner + 1)) {
[loop] while (true) {
const int x_310 = inner;
if ((x_310 < 1)) {
} else {
break;
}
const int x_314 = inner;
const float x_320 = mm_Bsub[k][(tileCol + inner)];
const int x_315 = k;
const int x_316 = tileCol;
const int x_317 = inner;
const float x_320 = mm_Bsub[x_315][(x_316 + x_317)];
BCached[x_314] = x_320;
{
const int x_322 = inner;
inner = (x_322 + 1);
}
}
innerRow_3 = 0;
{
[loop] for(; (innerRow_3 < 1); innerRow_3 = (innerRow_3 + 1)) {
const float x_338 = mm_Asub[(tileRow + innerRow_3)][k];
[loop] while (true) {
const int x_330 = innerRow_3;
if ((x_330 < 1)) {
} else {
break;
}
const int x_333 = tileRow;
const int x_334 = innerRow_3;
const int x_336 = k;
const float x_338 = mm_Asub[(x_333 + x_334)][x_336];
ACached = x_338;
innerCol_3 = 0;
{
[loop] for(; (innerCol_3 < 1); innerCol_3 = (innerCol_3 + 1)) {
[loop] while (true) {
const int x_345 = innerCol_3;
if ((x_345 < 1)) {
} else {
break;
}
const int x_347 = innerRow_3;
const int x_348 = innerCol_3;
const float x_349 = ACached;
const float x_352 = BCached[innerCol_3];
const int x_350 = innerCol_3;
const float x_352 = BCached[x_350];
const float x_355 = acc[x_347][x_348];
acc[x_347][x_348] = (x_355 + (x_349 * x_352));
{
const int x_358 = innerCol_3;
innerCol_3 = (x_358 + 1);
}
}
{
const int x_360 = innerRow_3;
innerRow_3 = (x_360 + 1);
}
}
{
const int x_362 = k;
k = (x_362 + 1);
}
}
GroupMemoryBarrierWithGroupSync();
{
const int x_364 = t;
t = (x_364 + 1);
}
}
innerRow_4 = 0;
{
[loop] for(; (innerRow_4 < 1); innerRow_4 = (innerRow_4 + 1)) {
[loop] while (true) {
const int x_372 = innerRow_4;
if ((x_372 < 1)) {
} else {
break;
}
innerCol_4 = 0;
[loop] while (true) {
bool x_393 = false;
bool x_394 = false;
if ((innerCol_4 < 1)) {
const int x_380 = innerCol_4;
if ((x_380 < 1)) {
} else {
break;
}
@ -304,20 +412,26 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
x_394 = x_393;
}
if (x_394) {
const int x_397 = globalRow;
const int x_398 = innerRow_4;
const int x_400 = globalCol;
const int x_401 = innerCol_4;
const int x_403 = innerRow_4;
const int x_404 = innerCol_4;
param_7 = (globalRow + innerRow_4);
param_7 = (x_397 + x_398);
param_8 = (x_400 + x_401);
const float x_409 = acc[x_403][x_404];
param_9 = x_409;
mm_write_i1_i1_f1_(param_7, param_8, param_9);
}
{
innerCol_4 = (innerCol_4 + 1);
const int x_411 = innerCol_4;
innerCol_4 = (x_411 + 1);
}
}
{
const int x_413 = innerRow_4;
innerRow_4 = (x_413 + 1);
}
}
return;
@ -335,9 +449,12 @@ void main_1() {
dimBOuter_1 = x_75;
const uint x_505 = gl_GlobalInvocationID.z;
batch = asint(x_505);
param_18 = dimAOuter_1;
param_19 = dimInner_1;
param_20 = dimBOuter_1;
const int x_508 = dimAOuter_1;
param_18 = x_508;
const int x_510 = dimInner_1;
param_19 = x_510;
const int x_512 = dimBOuter_1;
param_20 = x_512;
mm_matMul_i1_i1_i1_(param_18, param_19, param_20);
return;
}

View File

@ -80,7 +80,8 @@ float mm_readA_i1_i1_(inout int row, inout int col) {
} else {
x_430 = 0.0f;
}
return x_430;
float x_450 = x_430;
return x_450;
}
float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
@ -109,7 +110,8 @@ float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
} else {
x_468 = 0.0f;
}
return x_468;
float x_487 = x_468;
return x_487;
}
int getOutputFlatIndex_vi3_(inout ivec3 coords) {
@ -137,7 +139,8 @@ void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout floa
param = ivec3(x_115, x_116, x_117);
int x_120 = getOutputFlatIndex_vi3_(param);
flatIndex_1 = x_120;
param_1 = flatIndex_1;
int x_122 = flatIndex_1;
param_1 = x_122;
float x_124 = value_1;
param_2 = x_124;
setOutput_i1_f1_(param_1, param_2);
@ -154,7 +157,8 @@ void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) {
int x_492 = row_2;
int x_493 = col_2;
outCoord = ivec3(x_491, x_492, x_493);
param_14 = batch;
int x_496 = batch;
param_14 = x_496;
int x_498 = row_2;
param_15 = x_498;
int x_500 = col_2;
@ -211,14 +215,30 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
int x_152 = dimInner;
numTiles = (((x_152 - 1) / 64) + 1);
innerRow = 0;
{
for(; (innerRow < 1); innerRow = (innerRow + 1)) {
while (true) {
int x_163 = innerRow;
if ((x_163 < 1)) {
} else {
break;
}
innerCol = 0;
while (true) {
int x_171 = innerCol;
if ((x_171 < 1)) {
} else {
break;
}
int x_177 = innerRow;
int x_178 = innerCol;
acc[x_177][x_178] = 0.0f;
{
for(; (innerCol < 1); innerCol = (innerCol + 1)) {
acc[innerRow][innerCol] = 0.0f;
int x_181 = innerCol;
innerCol = (x_181 + 1);
}
}
{
int x_183 = innerRow;
innerRow = (x_183 + 1);
}
}
uint x_187 = tint_symbol.x;
@ -226,91 +246,179 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
uint x_192 = tint_symbol.y;
tileRowB = (int(x_192) * 1);
t = 0;
{
for(; (t < numTiles); t = (t + 1)) {
while (true) {
int x_201 = t;
int x_202 = numTiles;
if ((x_201 < x_202)) {
} else {
break;
}
innerRow_1 = 0;
{
for(; (innerRow_1 < 1); innerRow_1 = (innerRow_1 + 1)) {
while (true) {
int x_210 = innerRow_1;
if ((x_210 < 1)) {
} else {
break;
}
innerCol_1 = 0;
{
for(; (innerCol_1 < 64); innerCol_1 = (innerCol_1 + 1)) {
inputRow = (tileRow + innerRow_1);
inputCol = (tileColA + innerCol_1);
while (true) {
int x_218 = innerCol_1;
if ((x_218 < 64)) {
} else {
break;
}
int x_221 = tileRow;
int x_222 = innerRow_1;
inputRow = (x_221 + x_222);
int x_225 = tileColA;
int x_226 = innerCol_1;
inputCol = (x_225 + x_226);
int x_233 = inputRow;
int x_234 = inputCol;
int x_235 = globalRow;
int x_236 = innerRow_1;
int x_238 = t;
int x_240 = inputCol;
param_3 = (globalRow + innerRow_1);
param_3 = (x_235 + x_236);
param_4 = ((x_238 * 64) + x_240);
float x_244 = mm_readA_i1_i1_(param_3, param_4);
mm_Asub[x_233][x_234] = x_244;
{
int x_247 = innerCol_1;
innerCol_1 = (x_247 + 1);
}
}
{
int x_249 = innerRow_1;
innerRow_1 = (x_249 + 1);
}
}
innerRow_2 = 0;
{
for(; (innerRow_2 < 1); innerRow_2 = (innerRow_2 + 1)) {
while (true) {
int x_257 = innerRow_2;
if ((x_257 < 1)) {
} else {
break;
}
innerCol_2 = 0;
{
for(; (innerCol_2 < 1); innerCol_2 = (innerCol_2 + 1)) {
inputRow_1 = (tileRowB + innerRow_2);
inputCol_1 = (tileCol + innerCol_2);
while (true) {
int x_265 = innerCol_2;
if ((x_265 < 1)) {
} else {
break;
}
int x_268 = tileRowB;
int x_269 = innerRow_2;
inputRow_1 = (x_268 + x_269);
int x_272 = tileCol;
int x_273 = innerCol_2;
inputCol_1 = (x_272 + x_273);
int x_278 = inputRow_1;
int x_279 = inputCol_1;
int x_280 = t;
int x_282 = inputRow_1;
int x_284 = globalCol;
int x_285 = innerCol_2;
param_5 = ((t * 64) + inputRow_1);
param_5 = ((x_280 * 64) + x_282);
param_6 = (x_284 + x_285);
float x_289 = mm_readB_i1_i1_(param_5, param_6);
mm_Bsub[x_278][x_279] = x_289;
{
int x_291 = innerCol_2;
innerCol_2 = (x_291 + 1);
}
}
{
int x_293 = innerRow_2;
innerRow_2 = (x_293 + 1);
}
}
barrier();
k = 0;
{
for(; (k < 64); k = (k + 1)) {
while (true) {
int x_302 = k;
if ((x_302 < 64)) {
} else {
break;
}
inner = 0;
{
for(; (inner < 1); inner = (inner + 1)) {
while (true) {
int x_310 = inner;
if ((x_310 < 1)) {
} else {
break;
}
int x_314 = inner;
float x_320 = mm_Bsub[k][(tileCol + inner)];
int x_315 = k;
int x_316 = tileCol;
int x_317 = inner;
float x_320 = mm_Bsub[x_315][(x_316 + x_317)];
BCached[x_314] = x_320;
{
int x_322 = inner;
inner = (x_322 + 1);
}
}
innerRow_3 = 0;
{
for(; (innerRow_3 < 1); innerRow_3 = (innerRow_3 + 1)) {
float x_338 = mm_Asub[(tileRow + innerRow_3)][k];
while (true) {
int x_330 = innerRow_3;
if ((x_330 < 1)) {
} else {
break;
}
int x_333 = tileRow;
int x_334 = innerRow_3;
int x_336 = k;
float x_338 = mm_Asub[(x_333 + x_334)][x_336];
ACached = x_338;
innerCol_3 = 0;
{
for(; (innerCol_3 < 1); innerCol_3 = (innerCol_3 + 1)) {
while (true) {
int x_345 = innerCol_3;
if ((x_345 < 1)) {
} else {
break;
}
int x_347 = innerRow_3;
int x_348 = innerCol_3;
float x_349 = ACached;
float x_352 = BCached[innerCol_3];
int x_350 = innerCol_3;
float x_352 = BCached[x_350];
float x_355 = acc[x_347][x_348];
acc[x_347][x_348] = (x_355 + (x_349 * x_352));
{
int x_358 = innerCol_3;
innerCol_3 = (x_358 + 1);
}
}
{
int x_360 = innerRow_3;
innerRow_3 = (x_360 + 1);
}
}
{
int x_362 = k;
k = (x_362 + 1);
}
}
barrier();
{
int x_364 = t;
t = (x_364 + 1);
}
}
innerRow_4 = 0;
{
for(; (innerRow_4 < 1); innerRow_4 = (innerRow_4 + 1)) {
while (true) {
int x_372 = innerRow_4;
if ((x_372 < 1)) {
} else {
break;
}
innerCol_4 = 0;
while (true) {
bool x_393 = false;
bool x_394 = false;
if ((innerCol_4 < 1)) {
int x_380 = innerCol_4;
if ((x_380 < 1)) {
} else {
break;
}
@ -327,20 +435,26 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB
x_394 = x_393;
}
if (x_394) {
int x_397 = globalRow;
int x_398 = innerRow_4;
int x_400 = globalCol;
int x_401 = innerCol_4;
int x_403 = innerRow_4;
int x_404 = innerCol_4;
param_7 = (globalRow + innerRow_4);
param_7 = (x_397 + x_398);
param_8 = (x_400 + x_401);
float x_409 = acc[x_403][x_404];
param_9 = x_409;
mm_write_i1_i1_f1_(param_7, param_8, param_9);
}
{
innerCol_4 = (innerCol_4 + 1);
int x_411 = innerCol_4;
innerCol_4 = (x_411 + 1);
}
}
{
int x_413 = innerRow_4;
innerRow_4 = (x_413 + 1);
}
}
return;
@ -358,9 +472,12 @@ void main_1() {
dimBOuter_1 = x_75;
uint x_505 = tint_symbol_1.z;
batch = int(x_505);
param_18 = dimAOuter_1;
param_19 = dimInner_1;
param_20 = dimBOuter_1;
int x_508 = dimAOuter_1;
param_18 = x_508;
int x_510 = dimInner_1;
param_19 = x_510;
int x_512 = dimBOuter_1;
param_20 = x_512;
mm_matMul_i1_i1_i1_(param_18, param_19, param_20);
return;
}

View File

@ -36,9 +36,12 @@ float4x4 getFrameData_f1_(inout float frameID) {
const float x_15 = frameID;
const float x_25 = asfloat(x_20[6].w);
fX = (x_15 / x_25);
const float4 x_40 = frameMapTexture.SampleBias(frameMapSampler, float2(fX, 0.0f), 0.0f);
const float4 x_47 = frameMapTexture.SampleBias(frameMapSampler, float2(fX, 0.25f), 0.0f);
const float4 x_54 = frameMapTexture.SampleBias(frameMapSampler, float2(fX, 0.5f), 0.0f);
const float x_37 = fX;
const float4 x_40 = frameMapTexture.SampleBias(frameMapSampler, float2(x_37, 0.0f), 0.0f);
const float x_44 = fX;
const float4 x_47 = frameMapTexture.SampleBias(frameMapSampler, float2(x_44, 0.25f), 0.0f);
const float x_51 = fX;
const float4 x_54 = frameMapTexture.SampleBias(frameMapSampler, float2(x_51, 0.5f), 0.0f);
return float4x4(float4(x_40.x, x_40.y, x_40.z, x_40.w), float4(x_47.x, x_47.y, x_47.z, x_47.w), float4(x_54.x, x_54.y, x_54.z, x_54.w), (0.0f).xxxx);
}
@ -62,10 +65,12 @@ void main_1() {
float alpha = 0.0f;
float3 mixed = float3(0.0f, 0.0f, 0.0f);
color = (0.0f).xxxx;
tileUV = frac(tUV);
const float2 x_86 = tUV;
tileUV = frac(x_86);
const float x_91 = tileUV.y;
tileUV.y = (1.0f - x_91);
tileID = floor(tUV);
const float2 x_95 = tUV;
tileID = floor(x_95);
const float2 x_101 = asfloat(x_20[6].xy);
sheetUnits = ((1.0f).xx / x_101);
const float x_106 = asfloat(x_20[6].w);
@ -73,9 +78,14 @@ void main_1() {
const float2 x_111 = asfloat(x_20[5].zw);
stageUnits = ((1.0f).xx / x_111);
i = 0;
{
[loop] for(; (i < 2); i = (i + 1)) {
switch(i) {
[loop] while (true) {
const int x_122 = i;
if ((x_122 < 2)) {
} else {
break;
}
const int x_126 = i;
switch(x_126) {
case 1: {
const float2 x_150 = tileID;
const float2 x_154 = asfloat(x_20[5].zw);
@ -104,29 +114,40 @@ void main_1() {
const float x_184 = animationData.z;
mt = ((x_181 * x_184) % 1.0f);
f = 0.0f;
{
[loop] for(; (f < 8.0f); f = (f + 1.0f)) {
[loop] while (true) {
const float x_193 = f;
if ((x_193 < 8.0f)) {
} else {
break;
}
const float x_197 = animationData.y;
if ((x_197 > mt)) {
const float x_198 = mt;
if ((x_197 > x_198)) {
const float x_203 = animationData.x;
frameID_1 = x_203;
break;
}
const float x_208 = frameID_1;
const float x_211 = asfloat(x_20[6].w);
const float4 x_217 = animationMapTexture.SampleBias(animationMapSampler, float2(((x_208 + 0.5f) / x_211), (0.125f * f)), 0.0f);
const float x_214 = f;
const float4 x_217 = animationMapTexture.SampleBias(animationMapSampler, float2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), 0.0f);
animationData = x_217;
{
const float x_218 = f;
f = (x_218 + 1.0f);
}
}
}
param = (frameID_1 + 0.5f);
const float x_222 = frameID_1;
param = (x_222 + 0.5f);
const float4x4 x_225 = getFrameData_f1_(param);
frameData = x_225;
const float4 x_228 = frameData[0];
const float2 x_231 = asfloat(x_20[6].xy);
frameSize = (float2(x_228.w, x_228.z) / x_231);
const float4 x_235 = frameData[0];
offset_1 = (float2(x_235.x, x_235.y) * sheetUnits);
const float2 x_237 = sheetUnits;
offset_1 = (float2(x_235.x, x_235.y) * x_237);
const float4 x_241 = frameData[2];
const float4 x_244 = frameData[0];
ratio = (float2(x_241.x, x_241.y) / float2(x_244.w, x_244.z));
@ -135,11 +156,18 @@ void main_1() {
const float2 x_252 = tileUV;
tileUV = float2(x_252.y, x_252.x);
}
if ((i == 0)) {
const float4 x_268 = spriteSheetTexture.Sample(spriteSheetSampler, ((tileUV * frameSize) + offset_1));
const int x_254 = i;
if ((x_254 == 0)) {
const float2 x_263 = tileUV;
const float2 x_264 = frameSize;
const float2 x_266 = offset_1;
const float4 x_268 = spriteSheetTexture.Sample(spriteSheetSampler, ((x_263 * x_264) + x_266));
color = x_268;
} else {
const float4 x_279 = spriteSheetTexture.Sample(spriteSheetSampler, ((tileUV * frameSize) + offset_1));
const float2 x_274 = tileUV;
const float2 x_275 = frameSize;
const float2 x_277 = offset_1;
const float4 x_279 = spriteSheetTexture.Sample(spriteSheetSampler, ((x_274 * x_275) + x_277));
nc = x_279;
const float x_283 = color.w;
const float x_285 = nc.w;
@ -149,15 +177,21 @@ void main_1() {
const float x_295 = nc.w;
mixed = lerp(float3(x_290.x, x_290.y, x_290.z), float3(x_292.x, x_292.y, x_292.z), float3(x_295, x_295, x_295));
const float3 x_298 = mixed;
color = float4(x_298.x, x_298.y, x_298.z, alpha);
const float x_299 = alpha;
color = float4(x_298.x, x_298.y, x_298.z, x_299);
}
{
const int x_304 = i;
i = (x_304 + 1);
}
}
const float3 x_310 = asfloat(x_20[7].xyz);
const float4 x_311 = color;
const float3 x_313 = (float3(x_311.x, x_311.y, x_311.z) * x_310);
color = float4(x_313.x, x_313.y, x_313.z, color.w);
glFragColor = color;
const float4 x_314 = color;
color = float4(x_313.x, x_313.y, x_313.z, x_314.w);
const float4 x_318 = color;
glFragColor = x_318;
return;
}

View File

@ -36,9 +36,12 @@ float4x4 getFrameData_f1_(inout float frameID) {
const float x_15 = frameID;
const float x_25 = asfloat(x_20[6].w);
fX = (x_15 / x_25);
const float4 x_40 = frameMapTexture.SampleBias(frameMapSampler, float2(fX, 0.0f), 0.0f);
const float4 x_47 = frameMapTexture.SampleBias(frameMapSampler, float2(fX, 0.25f), 0.0f);
const float4 x_54 = frameMapTexture.SampleBias(frameMapSampler, float2(fX, 0.5f), 0.0f);
const float x_37 = fX;
const float4 x_40 = frameMapTexture.SampleBias(frameMapSampler, float2(x_37, 0.0f), 0.0f);
const float x_44 = fX;
const float4 x_47 = frameMapTexture.SampleBias(frameMapSampler, float2(x_44, 0.25f), 0.0f);
const float x_51 = fX;
const float4 x_54 = frameMapTexture.SampleBias(frameMapSampler, float2(x_51, 0.5f), 0.0f);
return float4x4(float4(x_40.x, x_40.y, x_40.z, x_40.w), float4(x_47.x, x_47.y, x_47.z, x_47.w), float4(x_54.x, x_54.y, x_54.z, x_54.w), (0.0f).xxxx);
}
@ -62,10 +65,12 @@ void main_1() {
float alpha = 0.0f;
float3 mixed = float3(0.0f, 0.0f, 0.0f);
color = (0.0f).xxxx;
tileUV = frac(tUV);
const float2 x_86 = tUV;
tileUV = frac(x_86);
const float x_91 = tileUV.y;
tileUV.y = (1.0f - x_91);
tileID = floor(tUV);
const float2 x_95 = tUV;
tileID = floor(x_95);
const float2 x_101 = asfloat(x_20[6].xy);
sheetUnits = ((1.0f).xx / x_101);
const float x_106 = asfloat(x_20[6].w);
@ -73,9 +78,14 @@ void main_1() {
const float2 x_111 = asfloat(x_20[5].zw);
stageUnits = ((1.0f).xx / x_111);
i = 0;
{
[loop] for(; (i < 2); i = (i + 1)) {
switch(i) {
[loop] while (true) {
const int x_122 = i;
if ((x_122 < 2)) {
} else {
break;
}
const int x_126 = i;
switch(x_126) {
case 1: {
const float2 x_150 = tileID;
const float2 x_154 = asfloat(x_20[5].zw);
@ -104,29 +114,40 @@ void main_1() {
const float x_184 = animationData.z;
mt = ((x_181 * x_184) % 1.0f);
f = 0.0f;
{
[loop] for(; (f < 8.0f); f = (f + 1.0f)) {
[loop] while (true) {
const float x_193 = f;
if ((x_193 < 8.0f)) {
} else {
break;
}
const float x_197 = animationData.y;
if ((x_197 > mt)) {
const float x_198 = mt;
if ((x_197 > x_198)) {
const float x_203 = animationData.x;
frameID_1 = x_203;
break;
}
const float x_208 = frameID_1;
const float x_211 = asfloat(x_20[6].w);
const float4 x_217 = animationMapTexture.SampleBias(animationMapSampler, float2(((x_208 + 0.5f) / x_211), (0.125f * f)), 0.0f);
const float x_214 = f;
const float4 x_217 = animationMapTexture.SampleBias(animationMapSampler, float2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), 0.0f);
animationData = x_217;
{
const float x_218 = f;
f = (x_218 + 1.0f);
}
}
}
param = (frameID_1 + 0.5f);
const float x_222 = frameID_1;
param = (x_222 + 0.5f);
const float4x4 x_225 = getFrameData_f1_(param);
frameData = x_225;
const float4 x_228 = frameData[0];
const float2 x_231 = asfloat(x_20[6].xy);
frameSize = (float2(x_228.w, x_228.z) / x_231);
const float4 x_235 = frameData[0];
offset_1 = (float2(x_235.x, x_235.y) * sheetUnits);
const float2 x_237 = sheetUnits;
offset_1 = (float2(x_235.x, x_235.y) * x_237);
const float4 x_241 = frameData[2];
const float4 x_244 = frameData[0];
ratio = (float2(x_241.x, x_241.y) / float2(x_244.w, x_244.z));
@ -135,11 +156,18 @@ void main_1() {
const float2 x_252 = tileUV;
tileUV = float2(x_252.y, x_252.x);
}
if ((i == 0)) {
const float4 x_268 = spriteSheetTexture.Sample(spriteSheetSampler, ((tileUV * frameSize) + offset_1));
const int x_254 = i;
if ((x_254 == 0)) {
const float2 x_263 = tileUV;
const float2 x_264 = frameSize;
const float2 x_266 = offset_1;
const float4 x_268 = spriteSheetTexture.Sample(spriteSheetSampler, ((x_263 * x_264) + x_266));
color = x_268;
} else {
const float4 x_279 = spriteSheetTexture.Sample(spriteSheetSampler, ((tileUV * frameSize) + offset_1));
const float2 x_274 = tileUV;
const float2 x_275 = frameSize;
const float2 x_277 = offset_1;
const float4 x_279 = spriteSheetTexture.Sample(spriteSheetSampler, ((x_274 * x_275) + x_277));
nc = x_279;
const float x_283 = color.w;
const float x_285 = nc.w;
@ -149,15 +177,21 @@ void main_1() {
const float x_295 = nc.w;
mixed = lerp(float3(x_290.x, x_290.y, x_290.z), float3(x_292.x, x_292.y, x_292.z), float3(x_295, x_295, x_295));
const float3 x_298 = mixed;
color = float4(x_298.x, x_298.y, x_298.z, alpha);
const float x_299 = alpha;
color = float4(x_298.x, x_298.y, x_298.z, x_299);
}
{
const int x_304 = i;
i = (x_304 + 1);
}
}
const float3 x_310 = asfloat(x_20[7].xyz);
const float4 x_311 = color;
const float3 x_313 = (float3(x_311.x, x_311.y, x_311.z) * x_310);
color = float4(x_313.x, x_313.y, x_313.z, color.w);
glFragColor = color;
const float4 x_314 = color;
color = float4(x_313.x, x_313.y, x_313.z, x_314.w);
const float4 x_318 = color;
glFragColor = x_318;
return;
}

View File

@ -55,9 +55,12 @@ mat4 getFrameData_f1_(inout float frameID) {
float x_15 = frameID;
float x_25 = x_20.spriteCount;
fX = (x_15 / x_25);
vec4 x_40 = texture(frameMapTexture_frameMapSampler, vec2(fX, 0.0f), 0.0f);
vec4 x_47 = texture(frameMapTexture_frameMapSampler, vec2(fX, 0.25f), 0.0f);
vec4 x_54 = texture(frameMapTexture_frameMapSampler, vec2(fX, 0.5f), 0.0f);
float x_37 = fX;
vec4 x_40 = texture(frameMapTexture_frameMapSampler, vec2(x_37, 0.0f), 0.0f);
float x_44 = fX;
vec4 x_47 = texture(frameMapTexture_frameMapSampler, vec2(x_44, 0.25f), 0.0f);
float x_51 = fX;
vec4 x_54 = texture(frameMapTexture_frameMapSampler, vec2(x_51, 0.5f), 0.0f);
return mat4(vec4(x_40.x, x_40.y, x_40.z, x_40.w), vec4(x_47.x, x_47.y, x_47.z, x_47.w), vec4(x_54.x, x_54.y, x_54.z, x_54.w), vec4(0.0f));
}
@ -85,10 +88,12 @@ void main_1() {
float alpha = 0.0f;
vec3 mixed = vec3(0.0f, 0.0f, 0.0f);
color = vec4(0.0f);
tileUV = fract(tUV);
vec2 x_86 = tUV;
tileUV = fract(x_86);
float x_91 = tileUV.y;
tileUV.y = (1.0f - x_91);
tileID = floor(tUV);
vec2 x_95 = tUV;
tileID = floor(x_95);
vec2 x_101 = x_20.spriteMapSize;
sheetUnits = (vec2(1.0f) / x_101);
float x_106 = x_20.spriteCount;
@ -96,9 +101,14 @@ void main_1() {
vec2 x_111 = x_20.stageSize;
stageUnits = (vec2(1.0f) / x_111);
i = 0;
{
for(; (i < 2); i = (i + 1)) {
switch(i) {
while (true) {
int x_122 = i;
if ((x_122 < 2)) {
} else {
break;
}
int x_126 = i;
switch(x_126) {
case 1: {
vec2 x_150 = tileID;
vec2 x_154 = x_20.stageSize;
@ -127,29 +137,40 @@ void main_1() {
float x_184 = animationData.z;
mt = tint_float_modulo((x_181 * x_184), 1.0f);
f = 0.0f;
{
for(; (f < 8.0f); f = (f + 1.0f)) {
while (true) {
float x_193 = f;
if ((x_193 < 8.0f)) {
} else {
break;
}
float x_197 = animationData.y;
if ((x_197 > mt)) {
float x_198 = mt;
if ((x_197 > x_198)) {
float x_203 = animationData.x;
frameID_1 = x_203;
break;
}
float x_208 = frameID_1;
float x_211 = x_20.spriteCount;
vec4 x_217 = texture(animationMapTexture_animationMapSampler, vec2(((x_208 + 0.5f) / x_211), (0.125f * f)), 0.0f);
float x_214 = f;
vec4 x_217 = texture(animationMapTexture_animationMapSampler, vec2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), 0.0f);
animationData = x_217;
{
float x_218 = f;
f = (x_218 + 1.0f);
}
}
}
param = (frameID_1 + 0.5f);
float x_222 = frameID_1;
param = (x_222 + 0.5f);
mat4 x_225 = getFrameData_f1_(param);
frameData = x_225;
vec4 x_228 = frameData[0];
vec2 x_231 = x_20.spriteMapSize;
frameSize = (vec2(x_228.w, x_228.z) / x_231);
vec4 x_235 = frameData[0];
offset_1 = (vec2(x_235.x, x_235.y) * sheetUnits);
vec2 x_237 = sheetUnits;
offset_1 = (vec2(x_235.x, x_235.y) * x_237);
vec4 x_241 = frameData[2];
vec4 x_244 = frameData[0];
ratio = (vec2(x_241.x, x_241.y) / vec2(x_244.w, x_244.z));
@ -158,11 +179,18 @@ void main_1() {
vec2 x_252 = tileUV;
tileUV = vec2(x_252.y, x_252.x);
}
if ((i == 0)) {
vec4 x_268 = texture(spriteSheetTexture_spriteSheetSampler, ((tileUV * frameSize) + offset_1));
int x_254 = i;
if ((x_254 == 0)) {
vec2 x_263 = tileUV;
vec2 x_264 = frameSize;
vec2 x_266 = offset_1;
vec4 x_268 = texture(spriteSheetTexture_spriteSheetSampler, ((x_263 * x_264) + x_266));
color = x_268;
} else {
vec4 x_279 = texture(spriteSheetTexture_spriteSheetSampler, ((tileUV * frameSize) + offset_1));
vec2 x_274 = tileUV;
vec2 x_275 = frameSize;
vec2 x_277 = offset_1;
vec4 x_279 = texture(spriteSheetTexture_spriteSheetSampler, ((x_274 * x_275) + x_277));
nc = x_279;
float x_283 = color.w;
float x_285 = nc.w;
@ -172,15 +200,21 @@ void main_1() {
float x_295 = nc.w;
mixed = mix(vec3(x_290.x, x_290.y, x_290.z), vec3(x_292.x, x_292.y, x_292.z), vec3(x_295, x_295, x_295));
vec3 x_298 = mixed;
color = vec4(x_298.x, x_298.y, x_298.z, alpha);
float x_299 = alpha;
color = vec4(x_298.x, x_298.y, x_298.z, x_299);
}
{
int x_304 = i;
i = (x_304 + 1);
}
}
vec3 x_310 = x_20.colorMul;
vec4 x_311 = color;
vec3 x_313 = (vec3(x_311.x, x_311.y, x_311.z) * x_310);
color = vec4(x_313.x, x_313.y, x_313.z, color.w);
glFragColor = color;
vec4 x_314 = color;
color = vec4(x_313.x, x_313.y, x_313.z, x_314.w);
vec4 x_318 = color;
glFragColor = x_318;
return;
}

View File

@ -58,7 +58,8 @@ float3x3 cotangent_frame_vf3_vf3_vf2_vf2_(inout float3 normal_1, inout float3 p,
const float3 x_146 = normal_1;
dp2perp = cross(x_145, x_146);
const float3 x_149 = normal_1;
dp1perp = cross(x_149, dp1);
const float3 x_150 = dp1;
dp1perp = cross(x_149, x_150);
const float3 x_153 = dp2perp;
const float x_155 = duv1.x;
const float3 x_157 = dp1perp;
@ -70,12 +71,22 @@ float3x3 cotangent_frame_vf3_vf3_vf2_vf2_(inout float3 normal_1, inout float3 p,
const float x_169 = duv2.y;
bitangent = ((x_163 * x_165) + (x_167 * x_169));
const float x_173 = tangentSpaceParams.x;
tangent = (tangent * x_173);
const float3 x_174 = tangent;
tangent = (x_174 * x_173);
const float x_177 = tangentSpaceParams.y;
bitangent = (bitangent * x_177);
invmax = rsqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));
const float3 x_191 = (tangent * invmax);
const float3 x_194 = (bitangent * invmax);
const float3 x_178 = bitangent;
bitangent = (x_178 * x_177);
const float3 x_181 = tangent;
const float3 x_182 = tangent;
const float3 x_184 = bitangent;
const float3 x_185 = bitangent;
invmax = rsqrt(max(dot(x_181, x_182), dot(x_184, x_185)));
const float3 x_189 = tangent;
const float x_190 = invmax;
const float3 x_191 = (x_189 * x_190);
const float3 x_192 = bitangent;
const float x_193 = invmax;
const float3 x_194 = (x_192 * x_193);
const float3 x_195 = normal_1;
return float3x3(float3(x_191.x, x_191.y, x_191.z), float3(x_194.x, x_194.y, x_194.z), float3(x_195.x, x_195.y, x_195.z));
}
@ -104,7 +115,8 @@ float3x3 transposeMat3_mf33_(inout float3x3 inMatrix) {
const float x_93 = i2.z;
const float3 x_94 = float3(x_89, x_91, x_93);
outMatrix = float3x3(float3(x_78.x, x_78.y, x_78.z), float3(x_86.x, x_86.y, x_86.z), float3(x_94.x, x_94.y, x_94.z));
return outMatrix;
const float3x3 x_110 = outMatrix;
return x_110;
}
float3 perturbNormalBase_mf33_vf3_f1_(inout float3x3 cotangentFrame, inout float3 normal, inout float scale) {
@ -143,14 +155,16 @@ lightingInfo computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(inout float3
const float4 x_228 = lightData;
angleW = normalize((x_227 + float3(x_228.x, x_228.y, x_228.z)));
const float3 x_233 = vNormal;
specComp = max(0.0f, dot(x_233, angleW));
const float3 x_234 = angleW;
specComp = max(0.0f, dot(x_233, x_234));
const float x_237 = specComp;
const float x_238 = glossiness;
specComp = pow(x_237, max(1.0f, x_238));
const float x_241 = specComp;
const float3 x_242 = specularColor;
result.specular = (x_242 * x_241);
return result;
const lightingInfo x_245 = result;
return x_245;
}
void main_1() {
@ -209,7 +223,8 @@ void main_1() {
float3 output3 = float3(0.0f, 0.0f, 0.0f);
u_Float = 100.0f;
u_Color = (0.5f).xxx;
const float4 x_262 = TextureSamplerTexture.Sample(TextureSamplerSampler, vMainuv);
const float2 x_261 = vMainuv;
const float4 x_262 = TextureSamplerTexture.Sample(TextureSamplerSampler, x_261);
tempTextureRead = x_262;
const float4 x_264 = tempTextureRead;
const float x_273 = asfloat(x_269[10].x);
@ -221,69 +236,128 @@ void main_1() {
uvOffset = (0.0f).xx;
const float x_292 = asfloat(x_269[8].x);
normalScale = (1.0f / x_292);
if (gl_FrontFacing) {
x_299 = v_uv;
const bool x_298 = gl_FrontFacing;
if (x_298) {
const float2 x_303 = v_uv;
x_299 = x_303;
} else {
x_299 = -(v_uv);
const float2 x_305 = v_uv;
x_299 = -(x_305);
}
TBNUV = x_299;
const float2 x_307 = x_299;
TBNUV = x_307;
const float4 x_310 = v_output2;
param_3 = (float3(x_310.x, x_310.y, x_310.z) * normalScale);
const float x_312 = normalScale;
param_3 = (float3(x_310.x, x_310.y, x_310.z) * x_312);
const float4 x_317 = v_output1;
param_4 = float3(x_317.x, x_317.y, x_317.z);
param_5 = TBNUV;
const float2 x_320 = TBNUV;
param_5 = x_320;
const float2 x_324 = asfloat(x_269[10].zw);
param_6 = x_324;
const float3x3 x_325 = cotangent_frame_vf3_vf3_vf2_vf2_(param_3, param_4, param_5, param_6);
TBN = x_325;
param_7 = TBN;
const float3x3 x_328 = TBN;
param_7 = x_328;
const float3x3 x_329 = transposeMat3_mf33_(param_7);
invTBN = x_329;
const float3 x_334 = mul(-(output5), invTBN);
parallaxLimit = (length(float2(x_334.x, x_334.y)) / mul(-(output5), invTBN).z);
const float3x3 x_331 = invTBN;
const float3 x_332 = output5;
const float3 x_334 = mul(-(x_332), x_331);
const float3x3 x_337 = invTBN;
const float3 x_338 = output5;
parallaxLimit = (length(float2(x_334.x, x_334.y)) / mul(-(x_338), x_337).z);
const float x_345 = asfloat(x_269[9].w);
parallaxLimit = (parallaxLimit * x_345);
const float3 x_352 = mul(-(output5), invTBN);
const float x_346 = parallaxLimit;
parallaxLimit = (x_346 * x_345);
const float3x3 x_349 = invTBN;
const float3 x_350 = output5;
const float3 x_352 = mul(-(x_350), x_349);
vOffsetDir = normalize(float2(x_352.x, x_352.y));
vMaxOffset = (vOffsetDir * parallaxLimit);
const float2 x_356 = vOffsetDir;
const float x_357 = parallaxLimit;
vMaxOffset = (x_356 * x_357);
const float3x3 x_361 = invTBN;
const float3 x_362 = output5;
const float3x3 x_365 = invTBN;
const float4 x_366 = v_output2;
numSamples = (15.0f + (dot(mul(-(output5), invTBN), mul(float3(x_366.x, x_366.y, x_366.z), invTBN)) * -11.0f));
stepSize = (1.0f / numSamples);
numSamples = (15.0f + (dot(mul(-(x_362), x_361), mul(float3(x_366.x, x_366.y, x_366.z), x_365)) * -11.0f));
const float x_374 = numSamples;
stepSize = (1.0f / x_374);
currRayHeight = 1.0f;
vCurrOffset = (0.0f).xx;
vLastOffset = (0.0f).xx;
lastSampledHeight = 1.0f;
currSampledHeight = 1.0f;
i = 0;
{
[loop] for(; (i < 15); i = (i + 1)) {
const float4 x_397 = TextureSamplerTexture.Sample(TextureSamplerSampler, (v_uv + vCurrOffset));
[loop] while (true) {
const int x_388 = i;
if ((x_388 < 15)) {
} else {
break;
}
const float2 x_394 = v_uv;
const float2 x_395 = vCurrOffset;
const float4 x_397 = TextureSamplerTexture.Sample(TextureSamplerSampler, (x_394 + x_395));
currSampledHeight = x_397.w;
if ((currSampledHeight > currRayHeight)) {
delta1 = (currSampledHeight - currRayHeight);
delta2 = ((currRayHeight + stepSize) - lastSampledHeight);
ratio = (delta1 / (delta1 + delta2));
vCurrOffset = ((vLastOffset * ratio) + (vCurrOffset * (1.0f - ratio)));
const float x_400 = currSampledHeight;
const float x_401 = currRayHeight;
if ((x_400 > x_401)) {
const float x_406 = currSampledHeight;
const float x_407 = currRayHeight;
delta1 = (x_406 - x_407);
const float x_410 = currRayHeight;
const float x_411 = stepSize;
const float x_413 = lastSampledHeight;
delta2 = ((x_410 + x_411) - x_413);
const float x_416 = delta1;
const float x_417 = delta1;
const float x_418 = delta2;
ratio = (x_416 / (x_417 + x_418));
const float x_421 = ratio;
const float2 x_422 = vLastOffset;
const float x_424 = ratio;
const float2 x_426 = vCurrOffset;
vCurrOffset = ((x_422 * x_421) + (x_426 * (1.0f - x_424)));
break;
} else {
currRayHeight = (currRayHeight - stepSize);
vLastOffset = vCurrOffset;
vCurrOffset = (vCurrOffset + (vMaxOffset * stepSize));
lastSampledHeight = currSampledHeight;
const float x_431 = stepSize;
const float x_432 = currRayHeight;
currRayHeight = (x_432 - x_431);
const float2 x_434 = vCurrOffset;
vLastOffset = x_434;
const float x_435 = stepSize;
const float2 x_436 = vMaxOffset;
const float2 x_438 = vCurrOffset;
vCurrOffset = (x_438 + (x_436 * x_435));
const float x_440 = currSampledHeight;
lastSampledHeight = x_440;
}
{
const int x_441 = i;
i = (x_441 + 1);
}
}
}
parallaxOcclusion_0 = vCurrOffset;
uvOffset = parallaxOcclusion_0;
const float4 x_452 = TextureSamplerTexture.Sample(TextureSamplerSampler, (v_uv + uvOffset));
const float2 x_444 = vCurrOffset;
parallaxOcclusion_0 = x_444;
const float2 x_445 = parallaxOcclusion_0;
uvOffset = x_445;
const float2 x_449 = v_uv;
const float2 x_450 = uvOffset;
const float4 x_452 = TextureSamplerTexture.Sample(TextureSamplerSampler, (x_449 + x_450));
const float x_454 = asfloat(x_269[8].x);
param_8 = TBN;
const float3x3 x_457 = TBN;
param_8 = x_457;
param_9 = float3(x_452.x, x_452.y, x_452.z);
param_10 = (1.0f / x_454);
const float3 x_461 = perturbNormal_mf33_vf3_f1_(param_8, param_9, param_10);
output4 = float4(x_461.x, x_461.y, x_461.z, output4.w);
output6 = (v_uv + uvOffset);
const float4 x_475 = TextureSampler1Texture.Sample(TextureSampler1Sampler, output6);
const float4 x_462 = output4;
output4 = float4(x_461.x, x_461.y, x_461.z, x_462.w);
const float2 x_465 = v_uv;
const float2 x_466 = uvOffset;
output6 = (x_465 + x_466);
const float2 x_474 = output6;
const float4 x_475 = TextureSampler1Texture.Sample(TextureSampler1Sampler, x_474);
tempTextureRead1 = x_475;
const float4 x_477 = tempTextureRead1;
rgb1 = float3(x_477.x, x_477.y, x_477.z);
@ -291,13 +365,16 @@ void main_1() {
const float4 x_482 = v_output1;
viewDirectionW_1 = normalize((x_481 - float3(x_482.x, x_482.y, x_482.z)));
shadow = 1.0f;
glossiness_1 = (1.0f * u_Float);
const float x_488 = u_Float;
glossiness_1 = (1.0f * x_488);
diffuseBase = (0.0f).xxx;
specularBase = (0.0f).xxx;
const float4 x_494 = output4;
normalW = float3(x_494.x, x_494.y, x_494.z);
param_11 = viewDirectionW_1;
param_12 = normalW;
const float3 x_501 = viewDirectionW_1;
param_11 = x_501;
const float3 x_503 = normalW;
param_12 = x_503;
const float4 x_507 = asfloat(light0[0]);
param_13 = x_507;
const float4 x_510 = asfloat(light0[1]);
@ -306,17 +383,28 @@ void main_1() {
param_15 = float3(x_514.x, x_514.y, x_514.z);
const float3 x_518 = asfloat(light0[3].xyz);
param_16 = x_518;
param_17 = glossiness_1;
const float x_520 = glossiness_1;
param_17 = x_520;
const lightingInfo x_521 = computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(param_11, param_12, param_13, param_14, param_15, param_16, param_17);
info = x_521;
shadow = 1.0f;
const float3 x_523 = info.diffuse;
diffuseBase = (diffuseBase + (x_523 * shadow));
const float x_524 = shadow;
const float3 x_526 = diffuseBase;
diffuseBase = (x_526 + (x_523 * x_524));
const float3 x_529 = info.specular;
specularBase = (specularBase + (x_529 * shadow));
diffuseOutput = (diffuseBase * rgb1);
specularOutput = (specularBase * u_Color);
output3 = (diffuseOutput + specularOutput);
const float x_530 = shadow;
const float3 x_532 = specularBase;
specularBase = (x_532 + (x_529 * x_530));
const float3 x_535 = diffuseBase;
const float3 x_536 = rgb1;
diffuseOutput = (x_535 * x_536);
const float3 x_539 = specularBase;
const float3 x_540 = u_Color;
specularOutput = (x_539 * x_540);
const float3 x_543 = diffuseOutput;
const float3 x_544 = specularOutput;
output3 = (x_543 + x_544);
const float3 x_548 = output3;
glFragColor = float4(x_548.x, x_548.y, x_548.z, 1.0f);
return;

View File

@ -58,7 +58,8 @@ float3x3 cotangent_frame_vf3_vf3_vf2_vf2_(inout float3 normal_1, inout float3 p,
const float3 x_146 = normal_1;
dp2perp = cross(x_145, x_146);
const float3 x_149 = normal_1;
dp1perp = cross(x_149, dp1);
const float3 x_150 = dp1;
dp1perp = cross(x_149, x_150);
const float3 x_153 = dp2perp;
const float x_155 = duv1.x;
const float3 x_157 = dp1perp;
@ -70,12 +71,22 @@ float3x3 cotangent_frame_vf3_vf3_vf2_vf2_(inout float3 normal_1, inout float3 p,
const float x_169 = duv2.y;
bitangent = ((x_163 * x_165) + (x_167 * x_169));
const float x_173 = tangentSpaceParams.x;
tangent = (tangent * x_173);
const float3 x_174 = tangent;
tangent = (x_174 * x_173);
const float x_177 = tangentSpaceParams.y;
bitangent = (bitangent * x_177);
invmax = rsqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));
const float3 x_191 = (tangent * invmax);
const float3 x_194 = (bitangent * invmax);
const float3 x_178 = bitangent;
bitangent = (x_178 * x_177);
const float3 x_181 = tangent;
const float3 x_182 = tangent;
const float3 x_184 = bitangent;
const float3 x_185 = bitangent;
invmax = rsqrt(max(dot(x_181, x_182), dot(x_184, x_185)));
const float3 x_189 = tangent;
const float x_190 = invmax;
const float3 x_191 = (x_189 * x_190);
const float3 x_192 = bitangent;
const float x_193 = invmax;
const float3 x_194 = (x_192 * x_193);
const float3 x_195 = normal_1;
return float3x3(float3(x_191.x, x_191.y, x_191.z), float3(x_194.x, x_194.y, x_194.z), float3(x_195.x, x_195.y, x_195.z));
}
@ -104,7 +115,8 @@ float3x3 transposeMat3_mf33_(inout float3x3 inMatrix) {
const float x_93 = i2.z;
const float3 x_94 = float3(x_89, x_91, x_93);
outMatrix = float3x3(float3(x_78.x, x_78.y, x_78.z), float3(x_86.x, x_86.y, x_86.z), float3(x_94.x, x_94.y, x_94.z));
return outMatrix;
const float3x3 x_110 = outMatrix;
return x_110;
}
float3 perturbNormalBase_mf33_vf3_f1_(inout float3x3 cotangentFrame, inout float3 normal, inout float scale) {
@ -143,14 +155,16 @@ lightingInfo computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(inout float3
const float4 x_228 = lightData;
angleW = normalize((x_227 + float3(x_228.x, x_228.y, x_228.z)));
const float3 x_233 = vNormal;
specComp = max(0.0f, dot(x_233, angleW));
const float3 x_234 = angleW;
specComp = max(0.0f, dot(x_233, x_234));
const float x_237 = specComp;
const float x_238 = glossiness;
specComp = pow(x_237, max(1.0f, x_238));
const float x_241 = specComp;
const float3 x_242 = specularColor;
result.specular = (x_242 * x_241);
return result;
const lightingInfo x_245 = result;
return x_245;
}
void main_1() {
@ -209,7 +223,8 @@ void main_1() {
float3 output3 = float3(0.0f, 0.0f, 0.0f);
u_Float = 100.0f;
u_Color = (0.5f).xxx;
const float4 x_262 = TextureSamplerTexture.Sample(TextureSamplerSampler, vMainuv);
const float2 x_261 = vMainuv;
const float4 x_262 = TextureSamplerTexture.Sample(TextureSamplerSampler, x_261);
tempTextureRead = x_262;
const float4 x_264 = tempTextureRead;
const float x_273 = asfloat(x_269[10].x);
@ -221,69 +236,128 @@ void main_1() {
uvOffset = (0.0f).xx;
const float x_292 = asfloat(x_269[8].x);
normalScale = (1.0f / x_292);
if (gl_FrontFacing) {
x_299 = v_uv;
const bool x_298 = gl_FrontFacing;
if (x_298) {
const float2 x_303 = v_uv;
x_299 = x_303;
} else {
x_299 = -(v_uv);
const float2 x_305 = v_uv;
x_299 = -(x_305);
}
TBNUV = x_299;
const float2 x_307 = x_299;
TBNUV = x_307;
const float4 x_310 = v_output2;
param_3 = (float3(x_310.x, x_310.y, x_310.z) * normalScale);
const float x_312 = normalScale;
param_3 = (float3(x_310.x, x_310.y, x_310.z) * x_312);
const float4 x_317 = v_output1;
param_4 = float3(x_317.x, x_317.y, x_317.z);
param_5 = TBNUV;
const float2 x_320 = TBNUV;
param_5 = x_320;
const float2 x_324 = asfloat(x_269[10].zw);
param_6 = x_324;
const float3x3 x_325 = cotangent_frame_vf3_vf3_vf2_vf2_(param_3, param_4, param_5, param_6);
TBN = x_325;
param_7 = TBN;
const float3x3 x_328 = TBN;
param_7 = x_328;
const float3x3 x_329 = transposeMat3_mf33_(param_7);
invTBN = x_329;
const float3 x_334 = mul(-(output5), invTBN);
parallaxLimit = (length(float2(x_334.x, x_334.y)) / mul(-(output5), invTBN).z);
const float3x3 x_331 = invTBN;
const float3 x_332 = output5;
const float3 x_334 = mul(-(x_332), x_331);
const float3x3 x_337 = invTBN;
const float3 x_338 = output5;
parallaxLimit = (length(float2(x_334.x, x_334.y)) / mul(-(x_338), x_337).z);
const float x_345 = asfloat(x_269[9].w);
parallaxLimit = (parallaxLimit * x_345);
const float3 x_352 = mul(-(output5), invTBN);
const float x_346 = parallaxLimit;
parallaxLimit = (x_346 * x_345);
const float3x3 x_349 = invTBN;
const float3 x_350 = output5;
const float3 x_352 = mul(-(x_350), x_349);
vOffsetDir = normalize(float2(x_352.x, x_352.y));
vMaxOffset = (vOffsetDir * parallaxLimit);
const float2 x_356 = vOffsetDir;
const float x_357 = parallaxLimit;
vMaxOffset = (x_356 * x_357);
const float3x3 x_361 = invTBN;
const float3 x_362 = output5;
const float3x3 x_365 = invTBN;
const float4 x_366 = v_output2;
numSamples = (15.0f + (dot(mul(-(output5), invTBN), mul(float3(x_366.x, x_366.y, x_366.z), invTBN)) * -11.0f));
stepSize = (1.0f / numSamples);
numSamples = (15.0f + (dot(mul(-(x_362), x_361), mul(float3(x_366.x, x_366.y, x_366.z), x_365)) * -11.0f));
const float x_374 = numSamples;
stepSize = (1.0f / x_374);
currRayHeight = 1.0f;
vCurrOffset = (0.0f).xx;
vLastOffset = (0.0f).xx;
lastSampledHeight = 1.0f;
currSampledHeight = 1.0f;
i = 0;
{
[loop] for(; (i < 15); i = (i + 1)) {
const float4 x_397 = TextureSamplerTexture.Sample(TextureSamplerSampler, (v_uv + vCurrOffset));
[loop] while (true) {
const int x_388 = i;
if ((x_388 < 15)) {
} else {
break;
}
const float2 x_394 = v_uv;
const float2 x_395 = vCurrOffset;
const float4 x_397 = TextureSamplerTexture.Sample(TextureSamplerSampler, (x_394 + x_395));
currSampledHeight = x_397.w;
if ((currSampledHeight > currRayHeight)) {
delta1 = (currSampledHeight - currRayHeight);
delta2 = ((currRayHeight + stepSize) - lastSampledHeight);
ratio = (delta1 / (delta1 + delta2));
vCurrOffset = ((vLastOffset * ratio) + (vCurrOffset * (1.0f - ratio)));
const float x_400 = currSampledHeight;
const float x_401 = currRayHeight;
if ((x_400 > x_401)) {
const float x_406 = currSampledHeight;
const float x_407 = currRayHeight;
delta1 = (x_406 - x_407);
const float x_410 = currRayHeight;
const float x_411 = stepSize;
const float x_413 = lastSampledHeight;
delta2 = ((x_410 + x_411) - x_413);
const float x_416 = delta1;
const float x_417 = delta1;
const float x_418 = delta2;
ratio = (x_416 / (x_417 + x_418));
const float x_421 = ratio;
const float2 x_422 = vLastOffset;
const float x_424 = ratio;
const float2 x_426 = vCurrOffset;
vCurrOffset = ((x_422 * x_421) + (x_426 * (1.0f - x_424)));
break;
} else {
currRayHeight = (currRayHeight - stepSize);
vLastOffset = vCurrOffset;
vCurrOffset = (vCurrOffset + (vMaxOffset * stepSize));
lastSampledHeight = currSampledHeight;
const float x_431 = stepSize;
const float x_432 = currRayHeight;
currRayHeight = (x_432 - x_431);
const float2 x_434 = vCurrOffset;
vLastOffset = x_434;
const float x_435 = stepSize;
const float2 x_436 = vMaxOffset;
const float2 x_438 = vCurrOffset;
vCurrOffset = (x_438 + (x_436 * x_435));
const float x_440 = currSampledHeight;
lastSampledHeight = x_440;
}
{
const int x_441 = i;
i = (x_441 + 1);
}
}
}
parallaxOcclusion_0 = vCurrOffset;
uvOffset = parallaxOcclusion_0;
const float4 x_452 = TextureSamplerTexture.Sample(TextureSamplerSampler, (v_uv + uvOffset));
const float2 x_444 = vCurrOffset;
parallaxOcclusion_0 = x_444;
const float2 x_445 = parallaxOcclusion_0;
uvOffset = x_445;
const float2 x_449 = v_uv;
const float2 x_450 = uvOffset;
const float4 x_452 = TextureSamplerTexture.Sample(TextureSamplerSampler, (x_449 + x_450));
const float x_454 = asfloat(x_269[8].x);
param_8 = TBN;
const float3x3 x_457 = TBN;
param_8 = x_457;
param_9 = float3(x_452.x, x_452.y, x_452.z);
param_10 = (1.0f / x_454);
const float3 x_461 = perturbNormal_mf33_vf3_f1_(param_8, param_9, param_10);
output4 = float4(x_461.x, x_461.y, x_461.z, output4.w);
output6 = (v_uv + uvOffset);
const float4 x_475 = TextureSampler1Texture.Sample(TextureSampler1Sampler, output6);
const float4 x_462 = output4;
output4 = float4(x_461.x, x_461.y, x_461.z, x_462.w);
const float2 x_465 = v_uv;
const float2 x_466 = uvOffset;
output6 = (x_465 + x_466);
const float2 x_474 = output6;
const float4 x_475 = TextureSampler1Texture.Sample(TextureSampler1Sampler, x_474);
tempTextureRead1 = x_475;
const float4 x_477 = tempTextureRead1;
rgb1 = float3(x_477.x, x_477.y, x_477.z);
@ -291,13 +365,16 @@ void main_1() {
const float4 x_482 = v_output1;
viewDirectionW_1 = normalize((x_481 - float3(x_482.x, x_482.y, x_482.z)));
shadow = 1.0f;
glossiness_1 = (1.0f * u_Float);
const float x_488 = u_Float;
glossiness_1 = (1.0f * x_488);
diffuseBase = (0.0f).xxx;
specularBase = (0.0f).xxx;
const float4 x_494 = output4;
normalW = float3(x_494.x, x_494.y, x_494.z);
param_11 = viewDirectionW_1;
param_12 = normalW;
const float3 x_501 = viewDirectionW_1;
param_11 = x_501;
const float3 x_503 = normalW;
param_12 = x_503;
const float4 x_507 = asfloat(light0[0]);
param_13 = x_507;
const float4 x_510 = asfloat(light0[1]);
@ -306,17 +383,28 @@ void main_1() {
param_15 = float3(x_514.x, x_514.y, x_514.z);
const float3 x_518 = asfloat(light0[3].xyz);
param_16 = x_518;
param_17 = glossiness_1;
const float x_520 = glossiness_1;
param_17 = x_520;
const lightingInfo x_521 = computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(param_11, param_12, param_13, param_14, param_15, param_16, param_17);
info = x_521;
shadow = 1.0f;
const float3 x_523 = info.diffuse;
diffuseBase = (diffuseBase + (x_523 * shadow));
const float x_524 = shadow;
const float3 x_526 = diffuseBase;
diffuseBase = (x_526 + (x_523 * x_524));
const float3 x_529 = info.specular;
specularBase = (specularBase + (x_529 * shadow));
diffuseOutput = (diffuseBase * rgb1);
specularOutput = (specularBase * u_Color);
output3 = (diffuseOutput + specularOutput);
const float x_530 = shadow;
const float3 x_532 = specularBase;
specularBase = (x_532 + (x_529 * x_530));
const float3 x_535 = diffuseBase;
const float3 x_536 = rgb1;
diffuseOutput = (x_535 * x_536);
const float3 x_539 = specularBase;
const float3 x_540 = u_Color;
specularOutput = (x_539 * x_540);
const float3 x_543 = diffuseOutput;
const float3 x_544 = specularOutput;
output3 = (x_543 + x_544);
const float3 x_548 = output3;
glFragColor = float4(x_548.x, x_548.y, x_548.z, 1.0f);
return;

View File

@ -79,7 +79,8 @@ mat3 cotangent_frame_vf3_vf3_vf2_vf2_(inout vec3 normal_1, inout vec3 p, inout v
vec3 x_146 = normal_1;
dp2perp = cross(x_145, x_146);
vec3 x_149 = normal_1;
dp1perp = cross(x_149, dp1);
vec3 x_150 = dp1;
dp1perp = cross(x_149, x_150);
vec3 x_153 = dp2perp;
float x_155 = duv1.x;
vec3 x_157 = dp1perp;
@ -91,12 +92,22 @@ mat3 cotangent_frame_vf3_vf3_vf2_vf2_(inout vec3 normal_1, inout vec3 p, inout v
float x_169 = duv2.y;
bitangent = ((x_163 * x_165) + (x_167 * x_169));
float x_173 = tangentSpaceParams.x;
tangent = (tangent * x_173);
vec3 x_174 = tangent;
tangent = (x_174 * x_173);
float x_177 = tangentSpaceParams.y;
bitangent = (bitangent * x_177);
invmax = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));
vec3 x_191 = (tangent * invmax);
vec3 x_194 = (bitangent * invmax);
vec3 x_178 = bitangent;
bitangent = (x_178 * x_177);
vec3 x_181 = tangent;
vec3 x_182 = tangent;
vec3 x_184 = bitangent;
vec3 x_185 = bitangent;
invmax = inversesqrt(max(dot(x_181, x_182), dot(x_184, x_185)));
vec3 x_189 = tangent;
float x_190 = invmax;
vec3 x_191 = (x_189 * x_190);
vec3 x_192 = bitangent;
float x_193 = invmax;
vec3 x_194 = (x_192 * x_193);
vec3 x_195 = normal_1;
return mat3(vec3(x_191.x, x_191.y, x_191.z), vec3(x_194.x, x_194.y, x_194.z), vec3(x_195.x, x_195.y, x_195.z));
}
@ -125,7 +136,8 @@ mat3 transposeMat3_mf33_(inout mat3 inMatrix) {
float x_93 = i2.z;
vec3 x_94 = vec3(x_89, x_91, x_93);
outMatrix = mat3(vec3(x_78.x, x_78.y, x_78.z), vec3(x_86.x, x_86.y, x_86.z), vec3(x_94.x, x_94.y, x_94.z));
return outMatrix;
mat3 x_110 = outMatrix;
return x_110;
}
vec3 perturbNormalBase_mf33_vf3_f1_(inout mat3 cotangentFrame, inout vec3 normal, inout float scale) {
@ -164,14 +176,16 @@ lightingInfo computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(inout vec3 v
vec4 x_228 = lightData;
angleW = normalize((x_227 + vec3(x_228.x, x_228.y, x_228.z)));
vec3 x_233 = vNormal;
specComp = max(0.0f, dot(x_233, angleW));
vec3 x_234 = angleW;
specComp = max(0.0f, dot(x_233, x_234));
float x_237 = specComp;
float x_238 = glossiness;
specComp = pow(x_237, max(1.0f, x_238));
float x_241 = specComp;
vec3 x_242 = specularColor;
result.specular = (x_242 * x_241);
return result;
lightingInfo x_245 = result;
return x_245;
}
uniform highp sampler2D TextureSamplerTexture_TextureSamplerSampler;
@ -233,7 +247,8 @@ void main_1() {
vec3 output3 = vec3(0.0f, 0.0f, 0.0f);
u_Float = 100.0f;
u_Color = vec3(0.5f);
vec4 x_262 = texture(TextureSamplerTexture_TextureSamplerSampler, vMainuv);
vec2 x_261 = vMainuv;
vec4 x_262 = texture(TextureSamplerTexture_TextureSamplerSampler, x_261);
tempTextureRead = x_262;
vec4 x_264 = tempTextureRead;
float x_273 = x_269.textureInfoName;
@ -245,69 +260,128 @@ void main_1() {
uvOffset = vec2(0.0f);
float x_292 = x_269.u_bumpStrength;
normalScale = (1.0f / x_292);
if (tint_symbol) {
x_299 = v_uv;
bool x_298 = tint_symbol;
if (x_298) {
vec2 x_303 = v_uv;
x_299 = x_303;
} else {
x_299 = -(v_uv);
vec2 x_305 = v_uv;
x_299 = -(x_305);
}
TBNUV = x_299;
vec2 x_307 = x_299;
TBNUV = x_307;
vec4 x_310 = v_output2;
param_3 = (vec3(x_310.x, x_310.y, x_310.z) * normalScale);
float x_312 = normalScale;
param_3 = (vec3(x_310.x, x_310.y, x_310.z) * x_312);
vec4 x_317 = v_output1;
param_4 = vec3(x_317.x, x_317.y, x_317.z);
param_5 = TBNUV;
vec2 x_320 = TBNUV;
param_5 = x_320;
vec2 x_324 = x_269.tangentSpaceParameter0;
param_6 = x_324;
mat3 x_325 = cotangent_frame_vf3_vf3_vf2_vf2_(param_3, param_4, param_5, param_6);
TBN = x_325;
param_7 = TBN;
mat3 x_328 = TBN;
param_7 = x_328;
mat3 x_329 = transposeMat3_mf33_(param_7);
invTBN = x_329;
vec3 x_334 = (invTBN * -(output5));
parallaxLimit = (length(vec2(x_334.x, x_334.y)) / (invTBN * -(output5)).z);
mat3 x_331 = invTBN;
vec3 x_332 = output5;
vec3 x_334 = (x_331 * -(x_332));
mat3 x_337 = invTBN;
vec3 x_338 = output5;
parallaxLimit = (length(vec2(x_334.x, x_334.y)) / (x_337 * -(x_338)).z);
float x_345 = x_269.u_parallaxScale;
parallaxLimit = (parallaxLimit * x_345);
vec3 x_352 = (invTBN * -(output5));
float x_346 = parallaxLimit;
parallaxLimit = (x_346 * x_345);
mat3 x_349 = invTBN;
vec3 x_350 = output5;
vec3 x_352 = (x_349 * -(x_350));
vOffsetDir = normalize(vec2(x_352.x, x_352.y));
vMaxOffset = (vOffsetDir * parallaxLimit);
vec2 x_356 = vOffsetDir;
float x_357 = parallaxLimit;
vMaxOffset = (x_356 * x_357);
mat3 x_361 = invTBN;
vec3 x_362 = output5;
mat3 x_365 = invTBN;
vec4 x_366 = v_output2;
numSamples = (15.0f + (dot((invTBN * -(output5)), (invTBN * vec3(x_366.x, x_366.y, x_366.z))) * -11.0f));
stepSize = (1.0f / numSamples);
numSamples = (15.0f + (dot((x_361 * -(x_362)), (x_365 * vec3(x_366.x, x_366.y, x_366.z))) * -11.0f));
float x_374 = numSamples;
stepSize = (1.0f / x_374);
currRayHeight = 1.0f;
vCurrOffset = vec2(0.0f);
vLastOffset = vec2(0.0f);
lastSampledHeight = 1.0f;
currSampledHeight = 1.0f;
i = 0;
{
for(; (i < 15); i = (i + 1)) {
vec4 x_397 = texture(TextureSamplerTexture_TextureSamplerSampler, (v_uv + vCurrOffset));
while (true) {
int x_388 = i;
if ((x_388 < 15)) {
} else {
break;
}
vec2 x_394 = v_uv;
vec2 x_395 = vCurrOffset;
vec4 x_397 = texture(TextureSamplerTexture_TextureSamplerSampler, (x_394 + x_395));
currSampledHeight = x_397.w;
if ((currSampledHeight > currRayHeight)) {
delta1 = (currSampledHeight - currRayHeight);
delta2 = ((currRayHeight + stepSize) - lastSampledHeight);
ratio = (delta1 / (delta1 + delta2));
vCurrOffset = ((vLastOffset * ratio) + (vCurrOffset * (1.0f - ratio)));
float x_400 = currSampledHeight;
float x_401 = currRayHeight;
if ((x_400 > x_401)) {
float x_406 = currSampledHeight;
float x_407 = currRayHeight;
delta1 = (x_406 - x_407);
float x_410 = currRayHeight;
float x_411 = stepSize;
float x_413 = lastSampledHeight;
delta2 = ((x_410 + x_411) - x_413);
float x_416 = delta1;
float x_417 = delta1;
float x_418 = delta2;
ratio = (x_416 / (x_417 + x_418));
float x_421 = ratio;
vec2 x_422 = vLastOffset;
float x_424 = ratio;
vec2 x_426 = vCurrOffset;
vCurrOffset = ((x_422 * x_421) + (x_426 * (1.0f - x_424)));
break;
} else {
currRayHeight = (currRayHeight - stepSize);
vLastOffset = vCurrOffset;
vCurrOffset = (vCurrOffset + (vMaxOffset * stepSize));
lastSampledHeight = currSampledHeight;
float x_431 = stepSize;
float x_432 = currRayHeight;
currRayHeight = (x_432 - x_431);
vec2 x_434 = vCurrOffset;
vLastOffset = x_434;
float x_435 = stepSize;
vec2 x_436 = vMaxOffset;
vec2 x_438 = vCurrOffset;
vCurrOffset = (x_438 + (x_436 * x_435));
float x_440 = currSampledHeight;
lastSampledHeight = x_440;
}
{
int x_441 = i;
i = (x_441 + 1);
}
}
}
parallaxOcclusion_0 = vCurrOffset;
uvOffset = parallaxOcclusion_0;
vec4 x_452 = texture(TextureSamplerTexture_TextureSamplerSampler, (v_uv + uvOffset));
vec2 x_444 = vCurrOffset;
parallaxOcclusion_0 = x_444;
vec2 x_445 = parallaxOcclusion_0;
uvOffset = x_445;
vec2 x_449 = v_uv;
vec2 x_450 = uvOffset;
vec4 x_452 = texture(TextureSamplerTexture_TextureSamplerSampler, (x_449 + x_450));
float x_454 = x_269.u_bumpStrength;
param_8 = TBN;
mat3 x_457 = TBN;
param_8 = x_457;
param_9 = vec3(x_452.x, x_452.y, x_452.z);
param_10 = (1.0f / x_454);
vec3 x_461 = perturbNormal_mf33_vf3_f1_(param_8, param_9, param_10);
output4 = vec4(x_461.x, x_461.y, x_461.z, output4.w);
output6 = (v_uv + uvOffset);
vec4 x_475 = texture(TextureSampler1Texture_TextureSampler1Sampler, output6);
vec4 x_462 = output4;
output4 = vec4(x_461.x, x_461.y, x_461.z, x_462.w);
vec2 x_465 = v_uv;
vec2 x_466 = uvOffset;
output6 = (x_465 + x_466);
vec2 x_474 = output6;
vec4 x_475 = texture(TextureSampler1Texture_TextureSampler1Sampler, x_474);
tempTextureRead1 = x_475;
vec4 x_477 = tempTextureRead1;
rgb1 = vec3(x_477.x, x_477.y, x_477.z);
@ -315,13 +389,16 @@ void main_1() {
vec4 x_482 = v_output1;
viewDirectionW_1 = normalize((x_481 - vec3(x_482.x, x_482.y, x_482.z)));
shadow = 1.0f;
glossiness_1 = (1.0f * u_Float);
float x_488 = u_Float;
glossiness_1 = (1.0f * x_488);
diffuseBase = vec3(0.0f);
specularBase = vec3(0.0f);
vec4 x_494 = output4;
normalW = vec3(x_494.x, x_494.y, x_494.z);
param_11 = viewDirectionW_1;
param_12 = normalW;
vec3 x_501 = viewDirectionW_1;
param_11 = x_501;
vec3 x_503 = normalW;
param_12 = x_503;
vec4 x_507 = light0.vLightData;
param_13 = x_507;
vec4 x_510 = light0.vLightDiffuse;
@ -330,17 +407,28 @@ void main_1() {
param_15 = vec3(x_514.x, x_514.y, x_514.z);
vec3 x_518 = light0.vLightGround;
param_16 = x_518;
param_17 = glossiness_1;
float x_520 = glossiness_1;
param_17 = x_520;
lightingInfo x_521 = computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(param_11, param_12, param_13, param_14, param_15, param_16, param_17);
info = x_521;
shadow = 1.0f;
vec3 x_523 = info.diffuse;
diffuseBase = (diffuseBase + (x_523 * shadow));
float x_524 = shadow;
vec3 x_526 = diffuseBase;
diffuseBase = (x_526 + (x_523 * x_524));
vec3 x_529 = info.specular;
specularBase = (specularBase + (x_529 * shadow));
diffuseOutput = (diffuseBase * rgb1);
specularOutput = (specularBase * u_Color);
output3 = (diffuseOutput + specularOutput);
float x_530 = shadow;
vec3 x_532 = specularBase;
specularBase = (x_532 + (x_529 * x_530));
vec3 x_535 = diffuseBase;
vec3 x_536 = rgb1;
diffuseOutput = (x_535 * x_536);
vec3 x_539 = specularBase;
vec3 x_540 = u_Color;
specularOutput = (x_539 * x_540);
vec3 x_543 = diffuseOutput;
vec3 x_544 = specularOutput;
output3 = (x_543 + x_544);
vec3 x_548 = output3;
glFragColor = vec4(x_548.x, x_548.y, x_548.z, 1.0f);
return;

View File

@ -40,9 +40,11 @@ void main_1() {
if ((x_63 < x_70)) {
const float x_75 = getAAtOutCoords_();
a_1 = x_75;
param = a_1;
const float x_77 = a_1;
param = x_77;
const float x_78 = unaryOperation_f1_(param);
param_1 = index;
const int x_80 = index;
param_1 = x_80;
param_2 = x_78;
setOutput_i1_f1_(param_1, param_2);
}

View File

@ -40,9 +40,11 @@ void main_1() {
if ((x_63 < x_70)) {
const float x_75 = getAAtOutCoords_();
a_1 = x_75;
param = a_1;
const float x_77 = a_1;
param = x_77;
const float x_78 = unaryOperation_f1_(param);
param_1 = index;
const int x_80 = index;
param_1 = x_80;
param_2 = x_78;
setOutput_i1_f1_(param_1, param_2);
}

View File

@ -55,9 +55,11 @@ void main_1() {
if ((x_63 < x_70)) {
float x_75 = getAAtOutCoords_();
a_1 = x_75;
param = a_1;
float x_77 = a_1;
param = x_77;
float x_78 = unaryOperation_f1_(param);
param_1 = index;
int x_80 = index;
param_1 = x_80;
param_2 = x_78;
setOutput_i1_f1_(param_1, param_2);
}

View File

@ -23,7 +23,8 @@ float binaryOperation_f1_f1_(inout float a, inout float b) {
const float x_38 = b;
x_26 = (sign(x_34) * pow(abs(x_36), x_38));
}
return x_26;
const float x_41 = x_26;
return x_41;
}
void main_1() {

View File

@ -23,7 +23,8 @@ float binaryOperation_f1_f1_(inout float a, inout float b) {
const float x_38 = b;
x_26 = (sign(x_34) * pow(abs(x_36), x_38));
}
return x_26;
const float x_41 = x_26;
return x_41;
}
void main_1() {

View File

@ -28,7 +28,8 @@ float binaryOperation_f1_f1_(inout float a, inout float b) {
float x_38 = b;
x_26 = (sign(x_34) * pow(abs(x_36), x_38));
}
return x_26;
float x_41 = x_26;
return x_41;
}
void main_1() {

View File

@ -4,10 +4,19 @@ groupshared uint wg[3][2][1];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 6u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_25 = idx;
if (!((x_25 < 6u))) {
break;
}
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg[(idx / 2u)][(idx % 2u)][(idx % 1u)], 0u, atomic_result);
InterlockedExchange(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -17,7 +26,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_57 = local_invocation_index_1;
compute_main_inner(x_57);
return;
}

View File

@ -4,10 +4,19 @@ groupshared uint wg[3][2][1];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 6u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_25 = idx;
if (!((x_25 < 6u))) {
break;
}
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg[(idx / 2u)][(idx % 2u)][(idx % 1u)], 0u, atomic_result);
InterlockedExchange(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -17,7 +26,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_57 = local_invocation_index_1;
compute_main_inner(x_57);
return;
}

View File

@ -5,9 +5,18 @@ shared uint wg[3][2][1];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
while (true) {
uint x_25 = idx;
if (!((x_25 < 6u))) {
break;
}
uint x_31 = idx;
uint x_33 = idx;
uint x_35 = idx;
atomicExchange(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)], 0u);
{
for(; !(!((idx < 6u))); idx = (idx + 1u)) {
atomicExchange(wg[(idx / 2u)][(idx % 2u)][(idx % 1u)], 0u);
uint x_42 = idx;
idx = (x_42 + 1u);
}
}
barrier();
@ -16,7 +25,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_57 = local_invocation_index_1;
compute_main_inner(x_57);
return;
}

View File

@ -4,10 +4,17 @@ groupshared uint wg[4];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 4u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_21 = idx;
if (!((x_21 < 4u))) {
break;
}
const uint x_26 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg[idx], 0u, atomic_result);
InterlockedExchange(wg[x_26], 0u, atomic_result);
{
const uint x_33 = idx;
idx = (x_33 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -17,7 +24,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_47 = local_invocation_index_1;
compute_main_inner(x_47);
return;
}

View File

@ -4,10 +4,17 @@ groupshared uint wg[4];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 4u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_21 = idx;
if (!((x_21 < 4u))) {
break;
}
const uint x_26 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg[idx], 0u, atomic_result);
InterlockedExchange(wg[x_26], 0u, atomic_result);
{
const uint x_33 = idx;
idx = (x_33 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -17,7 +24,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_47 = local_invocation_index_1;
compute_main_inner(x_47);
return;
}

View File

@ -5,9 +5,16 @@ shared uint wg[4];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
while (true) {
uint x_21 = idx;
if (!((x_21 < 4u))) {
break;
}
uint x_26 = idx;
atomicExchange(wg[x_26], 0u);
{
for(; !(!((idx < 4u))); idx = (idx + 1u)) {
atomicExchange(wg[idx], 0u);
uint x_33 = idx;
idx = (x_33 + 1u);
}
}
barrier();
@ -16,7 +23,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_47 = local_invocation_index_1;
compute_main_inner(x_47);
return;
}

View File

@ -4,10 +4,19 @@ groupshared uint wg[3][2][1];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 6u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_25 = idx;
if (!((x_25 < 6u))) {
break;
}
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg[(idx / 2u)][(idx % 2u)][(idx % 1u)], 0u, atomic_result);
InterlockedExchange(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -17,7 +26,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_57 = local_invocation_index_1;
compute_main_inner(x_57);
return;
}

View File

@ -4,10 +4,19 @@ groupshared uint wg[3][2][1];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 6u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_25 = idx;
if (!((x_25 < 6u))) {
break;
}
const uint x_31 = idx;
const uint x_33 = idx;
const uint x_35 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg[(idx / 2u)][(idx % 2u)][(idx % 1u)], 0u, atomic_result);
InterlockedExchange(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)], 0u, atomic_result);
{
const uint x_42 = idx;
idx = (x_42 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -17,7 +26,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_57 = local_invocation_index_1;
compute_main_inner(x_57);
return;
}

View File

@ -5,9 +5,18 @@ shared uint wg[3][2][1];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
while (true) {
uint x_25 = idx;
if (!((x_25 < 6u))) {
break;
}
uint x_31 = idx;
uint x_33 = idx;
uint x_35 = idx;
atomicExchange(wg[(x_31 / 2u)][(x_33 % 2u)][(x_35 % 1u)], 0u);
{
for(; !(!((idx < 6u))); idx = (idx + 1u)) {
atomicExchange(wg[(idx / 2u)][(idx % 2u)][(idx % 1u)], 0u);
uint x_42 = idx;
idx = (x_42 + 1u);
}
}
barrier();
@ -16,7 +25,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_57 = local_invocation_index_1;
compute_main_inner(x_57);
return;
}

View File

@ -10,13 +10,19 @@ groupshared S_atomic wg[10];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 10u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_23 = idx;
if (!((x_23 < 10u))) {
break;
}
const uint x_28 = idx;
wg[x_28].x = 0;
uint atomic_result = 0u;
InterlockedExchange(wg[x_28].a, 0u, atomic_result);
wg[x_28].y = 0u;
{
const uint x_41 = idx;
idx = (x_41 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -26,7 +32,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_53 = local_invocation_index_1;
compute_main_inner(x_53);
return;
}

View File

@ -10,13 +10,19 @@ groupshared S_atomic wg[10];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 10u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_23 = idx;
if (!((x_23 < 10u))) {
break;
}
const uint x_28 = idx;
wg[x_28].x = 0;
uint atomic_result = 0u;
InterlockedExchange(wg[x_28].a, 0u, atomic_result);
wg[x_28].y = 0u;
{
const uint x_41 = idx;
idx = (x_41 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -26,7 +32,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_53 = local_invocation_index_1;
compute_main_inner(x_53);
return;
}

View File

@ -17,12 +17,18 @@ shared S_atomic wg[10];
void compute_main_inner(uint local_invocation_index) {
uint idx = 0u;
idx = local_invocation_index;
{
for(; !(!((idx < 10u))); idx = (idx + 1u)) {
while (true) {
uint x_23 = idx;
if (!((x_23 < 10u))) {
break;
}
uint x_28 = idx;
wg[x_28].x = 0;
atomicExchange(wg[x_28].a, 0u);
wg[x_28].y = 0u;
{
uint x_41 = idx;
idx = (x_41 + 1u);
}
}
barrier();
@ -31,7 +37,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_53 = local_invocation_index_1;
compute_main_inner(x_53);
return;
}

View File

@ -22,7 +22,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_39 = local_invocation_index_1;
compute_main_inner(x_39);
return;
}

View File

@ -22,7 +22,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_39 = local_invocation_index_1;
compute_main_inner(x_39);
return;
}

View File

@ -25,7 +25,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_39 = local_invocation_index_1;
compute_main_inner(x_39);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_35 = local_invocation_index_1;
compute_main_inner(x_35);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_35 = local_invocation_index_1;
compute_main_inner(x_35);
return;
}

View File

@ -24,7 +24,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_35 = local_invocation_index_1;
compute_main_inner(x_35);
return;
}

View File

@ -39,7 +39,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_44 = local_invocation_index_1;
compute_main_inner(x_44);
return;
}

View File

@ -39,7 +39,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_44 = local_invocation_index_1;
compute_main_inner(x_44);
return;
}

View File

@ -61,7 +61,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_44 = local_invocation_index_1;
compute_main_inner(x_44);
return;
}

View File

@ -12,10 +12,17 @@ void compute_main_inner(uint local_invocation_index) {
wg.x = 0;
wg.y = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 10u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_30 = idx;
if (!((x_30 < 10u))) {
break;
}
const uint x_35 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg.a[idx], 0u, atomic_result);
InterlockedExchange(wg.a[x_35], 0u, atomic_result);
{
const uint x_41 = idx;
idx = (x_41 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -25,7 +32,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_53 = local_invocation_index_1;
compute_main_inner(x_53);
return;
}

View File

@ -12,10 +12,17 @@ void compute_main_inner(uint local_invocation_index) {
wg.x = 0;
wg.y = 0u;
idx = local_invocation_index;
{
[loop] for(; !(!((idx < 10u))); idx = (idx + 1u)) {
[loop] while (true) {
const uint x_30 = idx;
if (!((x_30 < 10u))) {
break;
}
const uint x_35 = idx;
uint atomic_result = 0u;
InterlockedExchange(wg.a[idx], 0u, atomic_result);
InterlockedExchange(wg.a[x_35], 0u, atomic_result);
{
const uint x_41 = idx;
idx = (x_41 + 1u);
}
}
GroupMemoryBarrierWithGroupSync();
@ -25,7 +32,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_53 = local_invocation_index_1;
compute_main_inner(x_53);
return;
}

View File

@ -19,9 +19,16 @@ void compute_main_inner(uint local_invocation_index) {
wg.x = 0;
wg.y = 0u;
idx = local_invocation_index;
while (true) {
uint x_30 = idx;
if (!((x_30 < 10u))) {
break;
}
uint x_35 = idx;
atomicExchange(wg.a[x_35], 0u);
{
for(; !(!((idx < 10u))); idx = (idx + 1u)) {
atomicExchange(wg.a[idx], 0u);
uint x_41 = idx;
idx = (x_41 + 1u);
}
}
barrier();
@ -30,7 +37,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_53 = local_invocation_index_1;
compute_main_inner(x_53);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_35 = local_invocation_index_1;
compute_main_inner(x_35);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_35 = local_invocation_index_1;
compute_main_inner(x_35);
return;
}

View File

@ -24,7 +24,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_35 = local_invocation_index_1;
compute_main_inner(x_35);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_31 = local_invocation_index_1;
compute_main_inner(x_31);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_31 = local_invocation_index_1;
compute_main_inner(x_31);
return;
}

View File

@ -17,7 +17,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_31 = local_invocation_index_1;
compute_main_inner(x_31);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_30 = local_invocation_index_1;
compute_main_inner(x_30);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_30 = local_invocation_index_1;
compute_main_inner(x_30);
return;
}

View File

@ -17,7 +17,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_30 = local_invocation_index_1;
compute_main_inner(x_30);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_31 = local_invocation_index_1;
compute_main_inner(x_31);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_31 = local_invocation_index_1;
compute_main_inner(x_31);
return;
}

View File

@ -17,7 +17,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
uint x_31 = local_invocation_index_1;
compute_main_inner(x_31);
return;
}

View File

@ -19,7 +19,8 @@ void compute_main_inner(uint local_invocation_index) {
}
void compute_main_1() {
compute_main_inner(local_invocation_index_1);
const uint x_30 = local_invocation_index_1;
compute_main_inner(x_30);
return;
}

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