From d01dd1fa0a8e4c55a17123c505dfb200f7917dbf Mon Sep 17 00:00:00 2001 From: John Stiles Date: Fri, 28 Apr 2023 14:51:43 -0400 Subject: [PATCH] Fuse variable declarations with neighboring init-expressions. When the optimizer is on, we look for variable declarations that are immediately followed by an initialization expression, and fuse them into one statement. (e.g.: `int i; i = 1;` can become `int i = 1;`) This benefits SkRP, since it no longer needs to zero the variable at declaration time, or apply a write-mask when initializing it. Change-Id: I7957e41ed3d4abf30b163b6f8451b24595278fe8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/686636 Auto-Submit: John Stiles Commit-Queue: John Stiles Reviewed-by: Arman Uguray --- src/sksl/ir/SkSLFunctionDefinition.cpp | 112 ++- .../sksl/folding/MatrixVectorNoOpFolding.glsl | 9 +- .../MatrixVectorNoOpFolding.minified.sksl | 2 +- .../sksl/folding/MatrixVectorNoOpFolding.skrp | 12 +- tests/sksl/folding/TernaryFolding.glsl | 3 +- .../sksl/folding/TernaryFolding.minified.sksl | 2 +- tests/sksl/shared/Assignment.glsl | 9 +- tests/sksl/shared/Assignment.metal | 9 +- tests/sksl/shared/Assignment.skrp | 6 +- tests/sksl/shared/GaussianBlur.asm.frag | 938 +++++++++--------- tests/sksl/shared/GaussianBlur.glsl | 9 +- tests/sksl/shared/GaussianBlur.hlsl | 360 +++---- tests/sksl/shared/GaussianBlur.metal | 9 +- tests/sksl/shared/MatrixOpEqualsES2.glsl | 6 +- tests/sksl/shared/MatrixOpEqualsES2.metal | 6 +- tests/sksl/shared/MatrixOpEqualsES2.skrp | 16 +- tests/sksl/shared/MatrixOpEqualsES3.glsl | 12 +- tests/sksl/shared/MatrixOpEqualsES3.metal | 12 +- tests/sksl/shared/MatrixOpEqualsES3.skrp | 24 +- .../OptimizationsStandaloneSettings.glsl | 5 +- tests/sksl/shared/SwizzleAsLValue.glsl | 3 +- tests/sksl/shared/SwizzleAsLValue.metal | 3 +- tests/sksl/shared/SwizzleAsLValue.skrp | 1 - tests/sksl/shared/SwizzleBoolConstants.glsl | 3 +- tests/sksl/shared/SwizzleBoolConstants.metal | 3 +- tests/sksl/shared/SwizzleBoolConstants.skrp | 1 - 26 files changed, 797 insertions(+), 778 deletions(-) diff --git a/src/sksl/ir/SkSLFunctionDefinition.cpp b/src/sksl/ir/SkSLFunctionDefinition.cpp index 8c1a10b5b2ac..91d587e0b2d1 100644 --- a/src/sksl/ir/SkSLFunctionDefinition.cpp +++ b/src/sksl/ir/SkSLFunctionDefinition.cpp @@ -14,16 +14,20 @@ #include "src/sksl/SkSLCompiler.h" #include "src/sksl/SkSLContext.h" #include "src/sksl/SkSLErrorReporter.h" +#include "src/sksl/SkSLOperator.h" #include "src/sksl/SkSLProgramSettings.h" #include "src/sksl/SkSLThreadContext.h" #include "src/sksl/dsl/DSLCore.h" #include "src/sksl/dsl/DSLExpression.h" #include "src/sksl/dsl/DSLStatement.h" #include "src/sksl/dsl/DSLType.h" +#include "src/sksl/ir/SkSLBinaryExpression.h" #include "src/sksl/ir/SkSLBlock.h" #include "src/sksl/ir/SkSLExpression.h" +#include "src/sksl/ir/SkSLExpressionStatement.h" #include "src/sksl/ir/SkSLField.h" #include "src/sksl/ir/SkSLFieldAccess.h" +#include "src/sksl/ir/SkSLNop.h" #include "src/sksl/ir/SkSLReturnStatement.h" #include "src/sksl/ir/SkSLSymbol.h" #include "src/sksl/ir/SkSLSymbolTable.h" @@ -98,6 +102,11 @@ std::unique_ptr FunctionDefinition::Convert(const Context& c } } + ~Finalizer() override { + SkASSERT(fBreakableLevel == 0); + SkASSERT(fContinuableLevel == std::forward_list{0}); + } + void addLocalVariable(const Variable* var, Position pos) { if (var->type().isOrContainsUnsizedArray()) { fContext.fErrors->error(pos, "unsized arrays are not permitted here"); @@ -117,24 +126,90 @@ std::unique_ptr FunctionDefinition::Convert(const Context& c } } - ~Finalizer() override { - SkASSERT(fBreakableLevel == 0); - SkASSERT(fContinuableLevel == std::forward_list{0}); + void fuseVariableDeclarationsWithInitialization(std::unique_ptr& stmt) { + switch (stmt->kind()) { + case Statement::Kind::kNop: + case Statement::Kind::kBlock: + // Blocks and no-ops are inert; it is safe to fuse a variable declaration with + // its initialization across a nop or an open-brace, so we don't null out + // `fUninitializedVarDecl` here. + break; + + case Statement::Kind::kVarDeclaration: + // Look for variable declarations without an initializer. + if (VarDeclaration& decl = stmt->as(); !decl.value()) { + fUninitializedVarDecl = &decl; + break; + } + [[fallthrough]]; + + default: + // We found an intervening statement; it's not safe to fuse a declaration + // with an initializer if we encounter any other code. + fUninitializedVarDecl = nullptr; + break; + + case Statement::Kind::kExpression: { + // We found an expression-statement. If there was a variable declaration + // immediately above it, it might be possible to fuse them. + if (fUninitializedVarDecl) { + VarDeclaration* vardecl = fUninitializedVarDecl; + fUninitializedVarDecl = nullptr; + + std::unique_ptr& nextExpr = stmt->as() + .expression(); + // This statement must be a binary-expression... + if (!nextExpr->is()) { + break; + } + // ... performing simple `var = expr` assignment... + BinaryExpression& binaryExpr = nextExpr->as(); + if (binaryExpr.getOperator().kind() != OperatorKind::EQ) { + break; + } + // ... directly into the variable (not a field/swizzle)... + Expression& leftExpr = *binaryExpr.left(); + if (!leftExpr.is()) { + break; + } + // ... and it must be the same variable as our vardecl. + VariableReference& varRef = leftExpr.as(); + if (varRef.variable() != vardecl->var()) { + break; + } + // We found a match! Move the init-expression directly onto the vardecl, and + // turn the assignment into a no-op. + vardecl->value() = std::move(binaryExpr.right()); + + // Turn the expression-statement into a no-op. + stmt = Nop::Make(); + } + break; + } + } } bool functionReturnsValue() const { return !fFunction.returnType().isVoid(); } - bool visitExpression(Expression& expr) override { + bool visitExpressionPtr(std::unique_ptr& expr) override { // We don't need to scan expressions. return false; } - bool visitStatement(Statement& stmt) override { - switch (stmt.kind()) { + bool visitStatementPtr(std::unique_ptr& stmt) override { + // When the optimizer is on, we look for variable declarations that are immediately + // followed by an initialization expression, and fuse them into one statement. + // (e.g.: `int i; i = 1;` can become `int i = 1;`) + if (fContext.fConfig->fSettings.fOptimize) { + this->fuseVariableDeclarationsWithInitialization(stmt); + } + + // Perform error checking. + switch (stmt->kind()) { case Statement::Kind::kVarDeclaration: - this->addLocalVariable(stmt.as().var(), stmt.fPosition); + this->addLocalVariable(stmt->as().var(), stmt->fPosition); break; case Statement::Kind::kReturn: { @@ -143,12 +218,12 @@ std::unique_ptr FunctionDefinition::Convert(const Context& c // issue, we can add normalization before each return statement. if (ProgramConfig::IsVertex(fContext.fConfig->fKind) && fFunction.isMain()) { fContext.fErrors->error( - stmt.fPosition, + stmt->fPosition, "early returns from vertex programs are not supported"); } // Verify that the return statement matches the function's return type. - ReturnStatement& returnStmt = stmt.as(); + ReturnStatement& returnStmt = stmt->as(); if (returnStmt.expression()) { if (this->functionReturnsValue()) { // Coerce return expression to the function's return type. @@ -174,7 +249,7 @@ std::unique_ptr FunctionDefinition::Convert(const Context& c case Statement::Kind::kFor: { ++fBreakableLevel; ++fContinuableLevel.front(); - bool result = INHERITED::visitStatement(stmt); + bool result = INHERITED::visitStatementPtr(stmt); --fContinuableLevel.front(); --fBreakableLevel; return result; @@ -182,34 +257,36 @@ std::unique_ptr FunctionDefinition::Convert(const Context& c case Statement::Kind::kSwitch: { ++fBreakableLevel; fContinuableLevel.push_front(0); - bool result = INHERITED::visitStatement(stmt); + bool result = INHERITED::visitStatementPtr(stmt); fContinuableLevel.pop_front(); --fBreakableLevel; return result; } case Statement::Kind::kBreak: if (fBreakableLevel == 0) { - fContext.fErrors->error(stmt.fPosition, + fContext.fErrors->error(stmt->fPosition, "break statement must be inside a loop or switch"); } break; + case Statement::Kind::kContinue: if (fContinuableLevel.front() == 0) { if (std::any_of(fContinuableLevel.begin(), fContinuableLevel.end(), [](int level) { return level > 0; })) { - fContext.fErrors->error(stmt.fPosition, + fContext.fErrors->error(stmt->fPosition, "continue statement cannot be used in a switch"); } else { - fContext.fErrors->error(stmt.fPosition, + fContext.fErrors->error(stmt->fPosition, "continue statement must be inside a loop"); } } break; + default: break; } - return INHERITED::visitStatement(stmt); + return INHERITED::visitStatementPtr(stmt); } private: @@ -222,11 +299,14 @@ std::unique_ptr FunctionDefinition::Convert(const Context& c // how deeply nested we are in continuable constructs (for, do). // We keep a stack (via a forward_list) in order to disallow continue inside of switch. std::forward_list fContinuableLevel{0}; + // We track uninitialized variable declarations, and if they are immediately assigned-to, + // we can move the assignment directly into the decl. + VarDeclaration* fUninitializedVarDecl = nullptr; using INHERITED = ProgramWriter; }; - Finalizer(context, function, pos).visitStatement(*body); + Finalizer(context, function, pos).visitStatementPtr(body); if (function.isMain() && ProgramConfig::IsVertex(context.fConfig->fKind)) { append_rtadjust_fixup_to_vertex_main(context, function, body->as()); } diff --git a/tests/sksl/folding/MatrixVectorNoOpFolding.glsl b/tests/sksl/folding/MatrixVectorNoOpFolding.glsl index dc85af4ada84..6ccb3bae2814 100644 --- a/tests/sksl/folding/MatrixVectorNoOpFolding.glsl +++ b/tests/sksl/folding/MatrixVectorNoOpFolding.glsl @@ -52,8 +52,7 @@ bool test_Xno_Xop_Xvec2_XX_Xmat2_Xb() { const vec2 i = vec2(1.0); const vec2 z = vec2(0.0); vec2 v; - vec2 vv; - vv = vec2(0.0); + vec2 vv = vec2(0.0); vv = vec2(0.0); if (vv != z) return false; v = i * testMatrix2x2; @@ -70,8 +69,7 @@ bool test_Xno_Xop_Xvec3_XX_Xmat3_Xb() { const vec3 i = vec3(1.0); const vec3 z = vec3(0.0); vec3 v; - vec3 vv; - vv = vec3(0.0); + vec3 vv = vec3(0.0); vv = vec3(0.0); if (vv != z) return false; v = i * testMatrix3x3; @@ -89,8 +87,7 @@ bool test_Xno_Xop_Xvec4_XX_Xmat4_Xb() { const vec4 z = vec4(0.0); mat4 testMatrix4x4 = mat4(testMatrix2x2[0], testMatrix2x2[1], testMatrix2x2[0], testMatrix2x2[1], testMatrix2x2[0], testMatrix2x2[1], testMatrix2x2[0], testMatrix2x2[1]); vec4 v; - vec4 vv; - vv = vec4(0.0); + vec4 vv = vec4(0.0); vv = vec4(0.0); if (vv != z) return false; v = i * testMatrix4x4; diff --git a/tests/sksl/folding/MatrixVectorNoOpFolding.minified.sksl b/tests/sksl/folding/MatrixVectorNoOpFolding.minified.sksl index 8329a8b031be..188ce0f14c03 100644 --- a/tests/sksl/folding/MatrixVectorNoOpFolding.minified.sksl +++ b/tests/sksl/folding/MatrixVectorNoOpFolding.minified.sksl @@ -1 +1 @@ -uniform float2x2 testMatrix2x2;uniform float3x3 testMatrix3x3;uniform float4 testInputs;uniform half4 colorRed;uniform half4 colorGreen;uniform half unknownInput;bool a(){float2 e;float2 f;e=testInputs.xy;e=testInputs.xy;if(e!=testInputs.xy)return false;if(e!=testInputs.xy)return false;e=-testInputs.xy;e=-testInputs.xy;if(e!=-testInputs.xy)return false;f=float2(0.);f=float2(0.);return f==float2(0.);}bool b(){float3 f;float3 g;f=testInputs.xyz;f=testInputs.xyz;if(f!=testInputs.xyz)return false;if(f!=testInputs.xyz)return false;f=-testInputs.xyz;f=-testInputs.xyz;if(f!=-testInputs.xyz)return false;g=float3(0.);g=float3(0.);return g==float3(0.);}bool c(){float4 g;float4 h;g=testInputs;g=testInputs;if(g!=testInputs)return false;if(g!=testInputs)return false;g=-testInputs;g=-testInputs;if(g!=-testInputs)return false;h=float4(0.);h=float4(0.);return h==float4(0.);}bool d(){float2 h;float2 j;j=float2(0.);j=float2(0.);if(j!=float2(0.))return false;h=float2(1.)*testMatrix2x2;if(h!=float2(3.,7.))return false;h=testMatrix2x2*float2(1.);if(h!=float2(4.,6.))return false;h=float2(-1.)*testMatrix2x2;if(h!=float2(-3.,-7.))return false;h=testMatrix2x2*float2(-1.);return h==float2(-4.,-6.);}bool e(){float3 j;float3 k;k=float3(0.);k=float3(0.);if(k!=float3(0.))return false;j=float3(1.)*testMatrix3x3;if(j!=float3(6.,15.,24.))return false;j=testMatrix3x3*float3(1.);if(j!=float3(12.,15.,18.))return false;j=float3(-1.)*testMatrix3x3;if(j!=float3(-6.,-15.,-24.))return false;j=testMatrix3x3*float3(-1.);return j==float3(-12.,-15.,-18.);}bool f(){float4x4 k=float4x4(testMatrix2x2[0],testMatrix2x2[1],testMatrix2x2[0],testMatrix2x2[1],testMatrix2x2[0],testMatrix2x2[1],testMatrix2x2[0],testMatrix2x2[1]);float4 l;float4 m;m=float4(0.);m=float4(0.);if(m!=float4(0.))return false;l=float4(1.)*k;if(l!=float4(10.))return false;l=k*float4(1.);if(l!=float4(4.,8.,12.,16.))return false;l=float4(-1.)*k;if(l!=float4(-10.))return false;l=k*float4(-1.);return l==float4(-4.,-8.,-12.,-16.);}half4 main(float2 g){return((((a()&&b())&&c())&&d())&&e())&&f()?colorGreen:colorRed;} +uniform float2x2 testMatrix2x2;uniform float3x3 testMatrix3x3;uniform float4 testInputs;uniform half4 colorRed;uniform half4 colorGreen;uniform half unknownInput;bool a(){float2 e;float2 f;e=testInputs.xy;e=testInputs.xy;if(e!=testInputs.xy)return false;if(e!=testInputs.xy)return false;e=-testInputs.xy;e=-testInputs.xy;if(e!=-testInputs.xy)return false;f=float2(0.);f=float2(0.);return f==float2(0.);}bool b(){float3 f;float3 g;f=testInputs.xyz;f=testInputs.xyz;if(f!=testInputs.xyz)return false;if(f!=testInputs.xyz)return false;f=-testInputs.xyz;f=-testInputs.xyz;if(f!=-testInputs.xyz)return false;g=float3(0.);g=float3(0.);return g==float3(0.);}bool c(){float4 g;float4 h;g=testInputs;g=testInputs;if(g!=testInputs)return false;if(g!=testInputs)return false;g=-testInputs;g=-testInputs;if(g!=-testInputs)return false;h=float4(0.);h=float4(0.);return h==float4(0.);}bool d(){float2 h;float2 j=float2(0.);j=float2(0.);if(j!=float2(0.))return false;h=float2(1.)*testMatrix2x2;if(h!=float2(3.,7.))return false;h=testMatrix2x2*float2(1.);if(h!=float2(4.,6.))return false;h=float2(-1.)*testMatrix2x2;if(h!=float2(-3.,-7.))return false;h=testMatrix2x2*float2(-1.);return h==float2(-4.,-6.);}bool e(){float3 j;float3 k=float3(0.);k=float3(0.);if(k!=float3(0.))return false;j=float3(1.)*testMatrix3x3;if(j!=float3(6.,15.,24.))return false;j=testMatrix3x3*float3(1.);if(j!=float3(12.,15.,18.))return false;j=float3(-1.)*testMatrix3x3;if(j!=float3(-6.,-15.,-24.))return false;j=testMatrix3x3*float3(-1.);return j==float3(-12.,-15.,-18.);}bool f(){float4x4 k=float4x4(testMatrix2x2[0],testMatrix2x2[1],testMatrix2x2[0],testMatrix2x2[1],testMatrix2x2[0],testMatrix2x2[1],testMatrix2x2[0],testMatrix2x2[1]);float4 l;float4 m=float4(0.);m=float4(0.);if(m!=float4(0.))return false;l=float4(1.)*k;if(l!=float4(10.))return false;l=k*float4(1.);if(l!=float4(4.,8.,12.,16.))return false;l=float4(-1.)*k;if(l!=float4(-10.))return false;l=k*float4(-1.);return l==float4(-4.,-8.,-12.,-16.);}half4 main(float2 g){return((((a()&&b())&&c())&&d())&&e())&&f()?colorGreen:colorRed;} diff --git a/tests/sksl/folding/MatrixVectorNoOpFolding.skrp b/tests/sksl/folding/MatrixVectorNoOpFolding.skrp index 9379caa45a78..31d392a749d1 100644 --- a/tests/sksl/folding/MatrixVectorNoOpFolding.skrp +++ b/tests/sksl/folding/MatrixVectorNoOpFolding.skrp @@ -201,7 +201,7 @@ label label 0x00000004 load_condition_mask CondMask = $71 copy_constant $45 = 0 merge_condition_mask CondMask = $55 & $56 -branch_if_no_lanes_active branch_if_no_lanes_active +78 (label 3 at #282) +branch_if_no_lanes_active branch_if_no_lanes_active +76 (label 3 at #280) store_return_mask $46 = RetMask splat_2_constants n = 0xBF800000 (-1.0) splat_2_constants i = 0x3F800000 (1.0) @@ -209,8 +209,6 @@ splat_4_constants z, v₃ = 0 splat_2_constants vv₃ = 0 splat_2_constants $47..48 = 0 copy_2_slots_masked vv₃ = Mask($47..48) -splat_2_constants $47..48 = 0 -copy_2_slots_masked vv₃ = Mask($47..48) store_condition_mask $47 = CondMask copy_2_slots_unmasked $48..49 = vv₃ splat_2_constants $50..51 = 0 @@ -283,7 +281,7 @@ label label 0x00000003 load_condition_mask CondMask = $55 copy_constant $27 = 0 merge_condition_mask CondMask = $44 & $45 -branch_if_no_lanes_active branch_if_no_lanes_active +96 (label 2 at #382) +branch_if_no_lanes_active branch_if_no_lanes_active +94 (label 2 at #378) store_return_mask $28 = RetMask splat_3_constants n₁ = 0xBF800000 (-1.0) splat_3_constants i₁ = 0x3F800000 (1.0) @@ -292,8 +290,6 @@ splat_4_constants v₄(1..2), vv₄(0..1) = 0 copy_constant vv₄(2) = 0 splat_3_constants $29..31 = 0 copy_3_slots_masked vv₄ = Mask($29..31) -splat_3_constants $29..31 = 0 -copy_3_slots_masked vv₄ = Mask($29..31) store_condition_mask $29 = CondMask copy_3_slots_unmasked $30..32 = vv₄ splat_3_constants $33..35 = 0 @@ -383,7 +379,7 @@ label label 0x00000002 load_condition_mask CondMask = $44 copy_constant $0 = 0 merge_condition_mask CondMask = $26 & $27 -branch_if_no_lanes_active branch_if_no_lanes_active +102 (label 1 at #488) +branch_if_no_lanes_active branch_if_no_lanes_active +100 (label 1 at #482) store_return_mask $1 = RetMask splat_4_constants n₂ = 0xBF800000 (-1.0) splat_4_constants i₂ = 0x3F800000 (1.0) @@ -396,8 +392,6 @@ splat_4_constants v₅ = 0 splat_4_constants vv₅ = 0 splat_4_constants $2..5 = 0 copy_4_slots_masked vv₅ = Mask($2..5) -splat_4_constants $2..5 = 0 -copy_4_slots_masked vv₅ = Mask($2..5) store_condition_mask $2 = CondMask copy_4_slots_unmasked $3..6 = vv₅ splat_4_constants $7..10 = 0 diff --git a/tests/sksl/folding/TernaryFolding.glsl b/tests/sksl/folding/TernaryFolding.glsl index bd94c322523c..1428543a1a3f 100644 --- a/tests/sksl/folding/TernaryFolding.glsl +++ b/tests/sksl/folding/TernaryFolding.glsl @@ -6,8 +6,7 @@ bool do_side_effect_bb(out bool x) { return false; } vec4 main() { - bool ok; - ok = true; + bool ok = true; vec4 green = colorGreen; vec4 red = colorRed; bool param = false; diff --git a/tests/sksl/folding/TernaryFolding.minified.sksl b/tests/sksl/folding/TernaryFolding.minified.sksl index 1b070da3f658..b8012067d335 100644 --- a/tests/sksl/folding/TernaryFolding.minified.sksl +++ b/tests/sksl/folding/TernaryFolding.minified.sksl @@ -1 +1 @@ -uniform half4 colorRed;uniform half4 colorGreen;bool a(out bool b){b=true;return false;}half4 main(float2 b){bool c;c=true;half4 d=colorGreen;half4 e=colorRed;bool f=false;bool g=(a(f),true);return(c&&f)&&g?d:e;} +uniform half4 colorRed;uniform half4 colorGreen;bool a(out bool b){b=true;return false;}half4 main(float2 b){bool c=true;half4 d=colorGreen;half4 e=colorRed;bool f=false;bool g=(a(f),true);return(c&&f)&&g?d:e;} diff --git a/tests/sksl/shared/Assignment.glsl b/tests/sksl/shared/Assignment.glsl index 6b59aae7dae5..032fa88440b9 100644 --- a/tests/sksl/shared/Assignment.glsl +++ b/tests/sksl/shared/Assignment.glsl @@ -16,12 +16,9 @@ void keepAlive_vf(inout float f) { void keepAlive_vi(inout int i) { } vec4 main() { - int i; - i = 0; - ivec4 i4; - i4 = ivec4(1, 2, 3, 4); - mat3 f3x3; - f3x3 = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + int i = 0; + ivec4 i4 = ivec4(1, 2, 3, 4); + mat3 f3x3 = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); vec4 x; x.w = 0.0; x.yx = vec2(0.0); diff --git a/tests/sksl/shared/Assignment.metal b/tests/sksl/shared/Assignment.metal index 736cb862e7fc..e461933bac02 100644 --- a/tests/sksl/shared/Assignment.metal +++ b/tests/sksl/shared/Assignment.metal @@ -90,12 +90,9 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _unifo (void)_globals; Outputs _out; (void)_out; - int i; - i = 0; - int4 i4; - i4 = int4(1, 2, 3, 4); - float3x3 f3x3; - f3x3 = float3x3(float3(1.0, 2.0, 3.0), float3(4.0, 5.0, 6.0), float3(7.0, 8.0, 9.0)); + int i = 0; + int4 i4 = int4(1, 2, 3, 4); + float3x3 f3x3 = float3x3(float3(1.0, 2.0, 3.0), float3(4.0, 5.0, 6.0), float3(7.0, 8.0, 9.0)); half4 x; x.w = 0.0h; x.yx = half2(0.0h); diff --git a/tests/sksl/shared/Assignment.skrp b/tests/sksl/shared/Assignment.skrp index e05ac03ece2c..3db0531af7ef 100644 --- a/tests/sksl/shared/Assignment.skrp +++ b/tests/sksl/shared/Assignment.skrp @@ -9,15 +9,11 @@ splat_4_constants globalStruct.ah4[1](2..3), globalStruct.ah4[2](0. splat_4_constants globalStruct.ah4[2](2..3), globalStruct.ah4[3](0..1) = 0 splat_4_constants globalStruct.ah4[3](2..3), globalStruct.ah4[4](0..1) = 0 splat_2_constants globalStruct.ah4[4](2..3) = 0 -splat_4_constants i, i4(0..2) = 0 -copy_constant i4(3) = 0 +copy_constant i = 0 copy_constant i4(0) = 0x00000001 (1.401298e-45) copy_constant i4(1) = 0x00000002 (2.802597e-45) copy_constant i4(2) = 0x00000003 (4.203895e-45) copy_constant i4(3) = 0x00000004 (5.605194e-45) -splat_4_constants f3x3(0..3) = 0 -splat_4_constants f3x3(4..7) = 0 -copy_constant f3x3(8) = 0 copy_constant f3x3(0) = 0x3F800000 (1.0) copy_constant f3x3(1) = 0x40000000 (2.0) copy_constant f3x3(2) = 0x40400000 (3.0) diff --git a/tests/sksl/shared/GaussianBlur.asm.frag b/tests/sksl/shared/GaussianBlur.asm.frag index 65aa73844e7c..75f4a96ec083 100644 --- a/tests/sksl/shared/GaussianBlur.asm.frag +++ b/tests/sksl/shared/GaussianBlur.asm.frag @@ -24,10 +24,10 @@ OpName %_5_snappedX "_5_snappedX" OpName %main "main" OpName %outputColor_Stage0 "outputColor_Stage0" OpName %outputCoverage_Stage0 "outputCoverage_Stage0" -OpName %output_Stage1 "output_Stage1" OpName %_6_output "_6_output" OpName %_7_coord "_7_coord" OpName %_8_coordSampled "_8_coordSampled" +OpName %output_Stage1 "output_Stage1" OpDecorate %_arr_v4float_int_7 ArrayStride 16 OpMemberDecorate %uniformBuffer 0 Offset 0 OpMemberDecorate %uniformBuffer 1 Offset 16 @@ -58,136 +58,136 @@ OpDecorate %93 RelaxedPrecision OpDecorate %94 RelaxedPrecision OpDecorate %outputColor_Stage0 RelaxedPrecision OpDecorate %outputCoverage_Stage0 RelaxedPrecision -OpDecorate %output_Stage1 RelaxedPrecision OpDecorate %_6_output RelaxedPrecision +OpDecorate %109 RelaxedPrecision OpDecorate %110 RelaxedPrecision -OpDecorate %111 RelaxedPrecision +OpDecorate %119 RelaxedPrecision OpDecorate %120 RelaxedPrecision OpDecorate %121 RelaxedPrecision OpDecorate %122 RelaxedPrecision -OpDecorate %123 RelaxedPrecision -OpDecorate %125 RelaxedPrecision +OpDecorate %124 RelaxedPrecision +OpDecorate %130 RelaxedPrecision OpDecorate %131 RelaxedPrecision OpDecorate %132 RelaxedPrecision OpDecorate %133 RelaxedPrecision -OpDecorate %134 RelaxedPrecision -OpDecorate %136 RelaxedPrecision +OpDecorate %135 RelaxedPrecision +OpDecorate %141 RelaxedPrecision OpDecorate %142 RelaxedPrecision OpDecorate %143 RelaxedPrecision OpDecorate %144 RelaxedPrecision -OpDecorate %145 RelaxedPrecision -OpDecorate %147 RelaxedPrecision +OpDecorate %146 RelaxedPrecision +OpDecorate %152 RelaxedPrecision OpDecorate %153 RelaxedPrecision OpDecorate %154 RelaxedPrecision OpDecorate %155 RelaxedPrecision -OpDecorate %156 RelaxedPrecision -OpDecorate %158 RelaxedPrecision +OpDecorate %157 RelaxedPrecision +OpDecorate %163 RelaxedPrecision OpDecorate %164 RelaxedPrecision OpDecorate %165 RelaxedPrecision OpDecorate %166 RelaxedPrecision -OpDecorate %167 RelaxedPrecision -OpDecorate %169 RelaxedPrecision +OpDecorate %168 RelaxedPrecision +OpDecorate %174 RelaxedPrecision OpDecorate %175 RelaxedPrecision OpDecorate %176 RelaxedPrecision OpDecorate %177 RelaxedPrecision -OpDecorate %178 RelaxedPrecision -OpDecorate %180 RelaxedPrecision +OpDecorate %179 RelaxedPrecision +OpDecorate %185 RelaxedPrecision OpDecorate %186 RelaxedPrecision OpDecorate %187 RelaxedPrecision OpDecorate %188 RelaxedPrecision -OpDecorate %189 RelaxedPrecision -OpDecorate %191 RelaxedPrecision +OpDecorate %190 RelaxedPrecision +OpDecorate %196 RelaxedPrecision OpDecorate %197 RelaxedPrecision OpDecorate %198 RelaxedPrecision OpDecorate %199 RelaxedPrecision -OpDecorate %200 RelaxedPrecision -OpDecorate %202 RelaxedPrecision +OpDecorate %201 RelaxedPrecision +OpDecorate %207 RelaxedPrecision OpDecorate %208 RelaxedPrecision OpDecorate %209 RelaxedPrecision OpDecorate %210 RelaxedPrecision -OpDecorate %211 RelaxedPrecision -OpDecorate %213 RelaxedPrecision +OpDecorate %212 RelaxedPrecision +OpDecorate %218 RelaxedPrecision OpDecorate %219 RelaxedPrecision OpDecorate %220 RelaxedPrecision OpDecorate %221 RelaxedPrecision -OpDecorate %222 RelaxedPrecision -OpDecorate %224 RelaxedPrecision +OpDecorate %223 RelaxedPrecision +OpDecorate %229 RelaxedPrecision OpDecorate %230 RelaxedPrecision OpDecorate %231 RelaxedPrecision OpDecorate %232 RelaxedPrecision -OpDecorate %233 RelaxedPrecision -OpDecorate %235 RelaxedPrecision +OpDecorate %234 RelaxedPrecision +OpDecorate %240 RelaxedPrecision OpDecorate %241 RelaxedPrecision OpDecorate %242 RelaxedPrecision OpDecorate %243 RelaxedPrecision -OpDecorate %244 RelaxedPrecision -OpDecorate %246 RelaxedPrecision +OpDecorate %245 RelaxedPrecision +OpDecorate %251 RelaxedPrecision OpDecorate %252 RelaxedPrecision OpDecorate %253 RelaxedPrecision OpDecorate %254 RelaxedPrecision -OpDecorate %255 RelaxedPrecision -OpDecorate %257 RelaxedPrecision +OpDecorate %256 RelaxedPrecision +OpDecorate %262 RelaxedPrecision OpDecorate %263 RelaxedPrecision OpDecorate %264 RelaxedPrecision OpDecorate %265 RelaxedPrecision -OpDecorate %266 RelaxedPrecision -OpDecorate %268 RelaxedPrecision +OpDecorate %267 RelaxedPrecision +OpDecorate %273 RelaxedPrecision OpDecorate %274 RelaxedPrecision OpDecorate %275 RelaxedPrecision OpDecorate %276 RelaxedPrecision -OpDecorate %277 RelaxedPrecision -OpDecorate %279 RelaxedPrecision +OpDecorate %278 RelaxedPrecision +OpDecorate %284 RelaxedPrecision OpDecorate %285 RelaxedPrecision OpDecorate %286 RelaxedPrecision OpDecorate %287 RelaxedPrecision -OpDecorate %288 RelaxedPrecision -OpDecorate %290 RelaxedPrecision +OpDecorate %289 RelaxedPrecision +OpDecorate %295 RelaxedPrecision OpDecorate %296 RelaxedPrecision OpDecorate %297 RelaxedPrecision OpDecorate %298 RelaxedPrecision -OpDecorate %299 RelaxedPrecision -OpDecorate %301 RelaxedPrecision +OpDecorate %300 RelaxedPrecision +OpDecorate %306 RelaxedPrecision OpDecorate %307 RelaxedPrecision OpDecorate %308 RelaxedPrecision OpDecorate %309 RelaxedPrecision -OpDecorate %310 RelaxedPrecision -OpDecorate %312 RelaxedPrecision +OpDecorate %311 RelaxedPrecision +OpDecorate %317 RelaxedPrecision OpDecorate %318 RelaxedPrecision OpDecorate %319 RelaxedPrecision OpDecorate %320 RelaxedPrecision -OpDecorate %321 RelaxedPrecision -OpDecorate %323 RelaxedPrecision +OpDecorate %322 RelaxedPrecision +OpDecorate %328 RelaxedPrecision OpDecorate %329 RelaxedPrecision OpDecorate %330 RelaxedPrecision OpDecorate %331 RelaxedPrecision -OpDecorate %332 RelaxedPrecision -OpDecorate %334 RelaxedPrecision +OpDecorate %333 RelaxedPrecision +OpDecorate %339 RelaxedPrecision OpDecorate %340 RelaxedPrecision OpDecorate %341 RelaxedPrecision OpDecorate %342 RelaxedPrecision -OpDecorate %343 RelaxedPrecision -OpDecorate %345 RelaxedPrecision +OpDecorate %344 RelaxedPrecision +OpDecorate %350 RelaxedPrecision OpDecorate %351 RelaxedPrecision OpDecorate %352 RelaxedPrecision OpDecorate %353 RelaxedPrecision -OpDecorate %354 RelaxedPrecision -OpDecorate %356 RelaxedPrecision +OpDecorate %355 RelaxedPrecision +OpDecorate %361 RelaxedPrecision OpDecorate %362 RelaxedPrecision OpDecorate %363 RelaxedPrecision OpDecorate %364 RelaxedPrecision -OpDecorate %365 RelaxedPrecision -OpDecorate %367 RelaxedPrecision +OpDecorate %366 RelaxedPrecision +OpDecorate %372 RelaxedPrecision OpDecorate %373 RelaxedPrecision OpDecorate %374 RelaxedPrecision OpDecorate %375 RelaxedPrecision -OpDecorate %376 RelaxedPrecision -OpDecorate %378 RelaxedPrecision +OpDecorate %377 RelaxedPrecision +OpDecorate %383 RelaxedPrecision OpDecorate %384 RelaxedPrecision OpDecorate %385 RelaxedPrecision OpDecorate %386 RelaxedPrecision -OpDecorate %387 RelaxedPrecision -OpDecorate %389 RelaxedPrecision -OpDecorate %391 RelaxedPrecision +OpDecorate %388 RelaxedPrecision +OpDecorate %390 RelaxedPrecision +OpDecorate %output_Stage1 RelaxedPrecision OpDecorate %392 RelaxedPrecision %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 @@ -231,10 +231,10 @@ OpDecorate %392 RelaxedPrecision %96 = OpTypeFunction %void %100 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 %float_0 = OpConstant %float 0 -%104 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 +%103 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 %float_12 = OpConstant %float 12 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float -%114 = OpConstantComposite %v2float %float_0 %float_0 +%113 = OpConstantComposite %v2float %float_0 %float_0 %int_2 = OpConstant %int 2 %MatrixEffect_Stage1_c0_c0_h4h4f2 = OpFunction %v4float None %28 %29 = OpFunctionParameter %_ptr_Function_v4float @@ -310,424 +310,424 @@ OpFunctionEnd %97 = OpLabel %outputColor_Stage0 = OpVariable %_ptr_Function_v4float Function %outputCoverage_Stage0 = OpVariable %_ptr_Function_v4float Function -%output_Stage1 = OpVariable %_ptr_Function_v4float Function %_6_output = OpVariable %_ptr_Function_v4float Function %_7_coord = OpVariable %_ptr_Function_v2float Function %_8_coordSampled = OpVariable %_ptr_Function_v2float Function -%115 = OpVariable %_ptr_Function_v4float Function -%116 = OpVariable %_ptr_Function_v2float Function -%127 = OpVariable %_ptr_Function_v4float Function -%128 = OpVariable %_ptr_Function_v2float Function -%138 = OpVariable %_ptr_Function_v4float Function -%139 = OpVariable %_ptr_Function_v2float Function -%149 = OpVariable %_ptr_Function_v4float Function -%150 = OpVariable %_ptr_Function_v2float Function -%160 = OpVariable %_ptr_Function_v4float Function -%161 = OpVariable %_ptr_Function_v2float Function -%171 = OpVariable %_ptr_Function_v4float Function -%172 = OpVariable %_ptr_Function_v2float Function -%182 = OpVariable %_ptr_Function_v4float Function -%183 = OpVariable %_ptr_Function_v2float Function -%193 = OpVariable %_ptr_Function_v4float Function -%194 = OpVariable %_ptr_Function_v2float Function -%204 = OpVariable %_ptr_Function_v4float Function -%205 = OpVariable %_ptr_Function_v2float Function -%215 = OpVariable %_ptr_Function_v4float Function -%216 = OpVariable %_ptr_Function_v2float Function -%226 = OpVariable %_ptr_Function_v4float Function -%227 = OpVariable %_ptr_Function_v2float Function -%237 = OpVariable %_ptr_Function_v4float Function -%238 = OpVariable %_ptr_Function_v2float Function -%248 = OpVariable %_ptr_Function_v4float Function -%249 = OpVariable %_ptr_Function_v2float Function -%259 = OpVariable %_ptr_Function_v4float Function -%260 = OpVariable %_ptr_Function_v2float Function -%270 = OpVariable %_ptr_Function_v4float Function -%271 = OpVariable %_ptr_Function_v2float Function -%281 = OpVariable %_ptr_Function_v4float Function -%282 = OpVariable %_ptr_Function_v2float Function -%292 = OpVariable %_ptr_Function_v4float Function -%293 = OpVariable %_ptr_Function_v2float Function -%303 = OpVariable %_ptr_Function_v4float Function -%304 = OpVariable %_ptr_Function_v2float Function -%314 = OpVariable %_ptr_Function_v4float Function -%315 = OpVariable %_ptr_Function_v2float Function -%325 = OpVariable %_ptr_Function_v4float Function -%326 = OpVariable %_ptr_Function_v2float Function -%336 = OpVariable %_ptr_Function_v4float Function -%337 = OpVariable %_ptr_Function_v2float Function -%347 = OpVariable %_ptr_Function_v4float Function -%348 = OpVariable %_ptr_Function_v2float Function -%358 = OpVariable %_ptr_Function_v4float Function -%359 = OpVariable %_ptr_Function_v2float Function -%369 = OpVariable %_ptr_Function_v4float Function -%370 = OpVariable %_ptr_Function_v2float Function -%380 = OpVariable %_ptr_Function_v4float Function -%381 = OpVariable %_ptr_Function_v2float Function +%114 = OpVariable %_ptr_Function_v4float Function +%115 = OpVariable %_ptr_Function_v2float Function +%126 = OpVariable %_ptr_Function_v4float Function +%127 = OpVariable %_ptr_Function_v2float Function +%137 = OpVariable %_ptr_Function_v4float Function +%138 = OpVariable %_ptr_Function_v2float Function +%148 = OpVariable %_ptr_Function_v4float Function +%149 = OpVariable %_ptr_Function_v2float Function +%159 = OpVariable %_ptr_Function_v4float Function +%160 = OpVariable %_ptr_Function_v2float Function +%170 = OpVariable %_ptr_Function_v4float Function +%171 = OpVariable %_ptr_Function_v2float Function +%181 = OpVariable %_ptr_Function_v4float Function +%182 = OpVariable %_ptr_Function_v2float Function +%192 = OpVariable %_ptr_Function_v4float Function +%193 = OpVariable %_ptr_Function_v2float Function +%203 = OpVariable %_ptr_Function_v4float Function +%204 = OpVariable %_ptr_Function_v2float Function +%214 = OpVariable %_ptr_Function_v4float Function +%215 = OpVariable %_ptr_Function_v2float Function +%225 = OpVariable %_ptr_Function_v4float Function +%226 = OpVariable %_ptr_Function_v2float Function +%236 = OpVariable %_ptr_Function_v4float Function +%237 = OpVariable %_ptr_Function_v2float Function +%247 = OpVariable %_ptr_Function_v4float Function +%248 = OpVariable %_ptr_Function_v2float Function +%258 = OpVariable %_ptr_Function_v4float Function +%259 = OpVariable %_ptr_Function_v2float Function +%269 = OpVariable %_ptr_Function_v4float Function +%270 = OpVariable %_ptr_Function_v2float Function +%280 = OpVariable %_ptr_Function_v4float Function +%281 = OpVariable %_ptr_Function_v2float Function +%291 = OpVariable %_ptr_Function_v4float Function +%292 = OpVariable %_ptr_Function_v2float Function +%302 = OpVariable %_ptr_Function_v4float Function +%303 = OpVariable %_ptr_Function_v2float Function +%313 = OpVariable %_ptr_Function_v4float Function +%314 = OpVariable %_ptr_Function_v2float Function +%324 = OpVariable %_ptr_Function_v4float Function +%325 = OpVariable %_ptr_Function_v2float Function +%335 = OpVariable %_ptr_Function_v4float Function +%336 = OpVariable %_ptr_Function_v2float Function +%346 = OpVariable %_ptr_Function_v4float Function +%347 = OpVariable %_ptr_Function_v2float Function +%357 = OpVariable %_ptr_Function_v4float Function +%358 = OpVariable %_ptr_Function_v2float Function +%368 = OpVariable %_ptr_Function_v4float Function +%369 = OpVariable %_ptr_Function_v2float Function +%379 = OpVariable %_ptr_Function_v4float Function +%380 = OpVariable %_ptr_Function_v2float Function +%output_Stage1 = OpVariable %_ptr_Function_v4float Function OpStore %outputColor_Stage0 %100 OpStore %outputCoverage_Stage0 %100 -OpStore %_6_output %104 -%106 = OpLoad %v2float %vLocalCoord_Stage0 -%108 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%110 = OpLoad %v2float %108 -%111 = OpVectorTimesScalar %v2float %110 %float_12 -%112 = OpFSub %v2float %106 %111 -OpStore %_7_coord %112 -OpStore %_8_coordSampled %114 -OpStore %_8_coordSampled %112 -OpStore %115 %100 -OpStore %116 %112 -%117 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %115 %116 -%119 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 -%120 = OpLoad %v4float %119 -%121 = OpCompositeExtract %float %120 0 -%122 = OpVectorTimesScalar %v4float %117 %121 -%123 = OpFAdd %v4float %104 %122 -OpStore %_6_output %123 -%124 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%125 = OpLoad %v2float %124 -%126 = OpFAdd %v2float %112 %125 -OpStore %_7_coord %126 -OpStore %_8_coordSampled %126 -OpStore %127 %100 -OpStore %128 %126 -%129 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %127 %128 -%130 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 -%131 = OpLoad %v4float %130 -%132 = OpCompositeExtract %float %131 1 -%133 = OpVectorTimesScalar %v4float %129 %132 -%134 = OpFAdd %v4float %123 %133 -OpStore %_6_output %134 -%135 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%136 = OpLoad %v2float %135 -%137 = OpFAdd %v2float %126 %136 -OpStore %_7_coord %137 -OpStore %_8_coordSampled %137 -OpStore %138 %100 -OpStore %139 %137 -%140 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %138 %139 -%141 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 -%142 = OpLoad %v4float %141 -%143 = OpCompositeExtract %float %142 2 -%144 = OpVectorTimesScalar %v4float %140 %143 -%145 = OpFAdd %v4float %134 %144 -OpStore %_6_output %145 -%146 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%147 = OpLoad %v2float %146 -%148 = OpFAdd %v2float %137 %147 -OpStore %_7_coord %148 -OpStore %_8_coordSampled %148 -OpStore %149 %100 -OpStore %150 %148 -%151 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %149 %150 -%152 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 -%153 = OpLoad %v4float %152 -%154 = OpCompositeExtract %float %153 3 -%155 = OpVectorTimesScalar %v4float %151 %154 -%156 = OpFAdd %v4float %145 %155 -OpStore %_6_output %156 -%157 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%158 = OpLoad %v2float %157 -%159 = OpFAdd %v2float %148 %158 -OpStore %_7_coord %159 -OpStore %_8_coordSampled %159 -OpStore %160 %100 -OpStore %161 %159 -%162 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %160 %161 -%163 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 -%164 = OpLoad %v4float %163 -%165 = OpCompositeExtract %float %164 0 -%166 = OpVectorTimesScalar %v4float %162 %165 -%167 = OpFAdd %v4float %156 %166 -OpStore %_6_output %167 -%168 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%169 = OpLoad %v2float %168 -%170 = OpFAdd %v2float %159 %169 -OpStore %_7_coord %170 -OpStore %_8_coordSampled %170 -OpStore %171 %100 -OpStore %172 %170 -%173 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %171 %172 -%174 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 -%175 = OpLoad %v4float %174 -%176 = OpCompositeExtract %float %175 1 -%177 = OpVectorTimesScalar %v4float %173 %176 -%178 = OpFAdd %v4float %167 %177 -OpStore %_6_output %178 -%179 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%180 = OpLoad %v2float %179 -%181 = OpFAdd %v2float %170 %180 -OpStore %_7_coord %181 -OpStore %_8_coordSampled %181 -OpStore %182 %100 -OpStore %183 %181 -%184 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %182 %183 -%185 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 -%186 = OpLoad %v4float %185 -%187 = OpCompositeExtract %float %186 2 -%188 = OpVectorTimesScalar %v4float %184 %187 -%189 = OpFAdd %v4float %178 %188 -OpStore %_6_output %189 -%190 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%191 = OpLoad %v2float %190 -%192 = OpFAdd %v2float %181 %191 -OpStore %_7_coord %192 -OpStore %_8_coordSampled %192 -OpStore %193 %100 -OpStore %194 %192 -%195 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %193 %194 -%196 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 -%197 = OpLoad %v4float %196 -%198 = OpCompositeExtract %float %197 3 -%199 = OpVectorTimesScalar %v4float %195 %198 -%200 = OpFAdd %v4float %189 %199 -OpStore %_6_output %200 -%201 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%202 = OpLoad %v2float %201 -%203 = OpFAdd %v2float %192 %202 -OpStore %_7_coord %203 -OpStore %_8_coordSampled %203 -OpStore %204 %100 -OpStore %205 %203 -%206 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %204 %205 -%207 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 -%208 = OpLoad %v4float %207 -%209 = OpCompositeExtract %float %208 0 -%210 = OpVectorTimesScalar %v4float %206 %209 -%211 = OpFAdd %v4float %200 %210 -OpStore %_6_output %211 -%212 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%213 = OpLoad %v2float %212 -%214 = OpFAdd %v2float %203 %213 -OpStore %_7_coord %214 -OpStore %_8_coordSampled %214 -OpStore %215 %100 -OpStore %216 %214 -%217 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %215 %216 -%218 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 -%219 = OpLoad %v4float %218 -%220 = OpCompositeExtract %float %219 1 -%221 = OpVectorTimesScalar %v4float %217 %220 -%222 = OpFAdd %v4float %211 %221 -OpStore %_6_output %222 -%223 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%224 = OpLoad %v2float %223 -%225 = OpFAdd %v2float %214 %224 -OpStore %_7_coord %225 -OpStore %_8_coordSampled %225 -OpStore %226 %100 -OpStore %227 %225 -%228 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %226 %227 -%229 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 -%230 = OpLoad %v4float %229 -%231 = OpCompositeExtract %float %230 2 -%232 = OpVectorTimesScalar %v4float %228 %231 -%233 = OpFAdd %v4float %222 %232 -OpStore %_6_output %233 -%234 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%235 = OpLoad %v2float %234 -%236 = OpFAdd %v2float %225 %235 -OpStore %_7_coord %236 -OpStore %_8_coordSampled %236 -OpStore %237 %100 -OpStore %238 %236 -%239 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %237 %238 -%240 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 -%241 = OpLoad %v4float %240 -%242 = OpCompositeExtract %float %241 3 -%243 = OpVectorTimesScalar %v4float %239 %242 -%244 = OpFAdd %v4float %233 %243 -OpStore %_6_output %244 -%245 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%246 = OpLoad %v2float %245 -%247 = OpFAdd %v2float %236 %246 -OpStore %_7_coord %247 -OpStore %_8_coordSampled %247 -OpStore %248 %100 -OpStore %249 %247 -%250 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %248 %249 -%251 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 -%252 = OpLoad %v4float %251 -%253 = OpCompositeExtract %float %252 0 -%254 = OpVectorTimesScalar %v4float %250 %253 -%255 = OpFAdd %v4float %244 %254 -OpStore %_6_output %255 -%256 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%257 = OpLoad %v2float %256 -%258 = OpFAdd %v2float %247 %257 -OpStore %_7_coord %258 -OpStore %_8_coordSampled %258 -OpStore %259 %100 -OpStore %260 %258 -%261 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %259 %260 -%262 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 -%263 = OpLoad %v4float %262 -%264 = OpCompositeExtract %float %263 1 -%265 = OpVectorTimesScalar %v4float %261 %264 -%266 = OpFAdd %v4float %255 %265 -OpStore %_6_output %266 -%267 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%268 = OpLoad %v2float %267 -%269 = OpFAdd %v2float %258 %268 -OpStore %_7_coord %269 -OpStore %_8_coordSampled %269 -OpStore %270 %100 -OpStore %271 %269 -%272 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %270 %271 -%273 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 -%274 = OpLoad %v4float %273 -%275 = OpCompositeExtract %float %274 2 -%276 = OpVectorTimesScalar %v4float %272 %275 -%277 = OpFAdd %v4float %266 %276 -OpStore %_6_output %277 -%278 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%279 = OpLoad %v2float %278 -%280 = OpFAdd %v2float %269 %279 -OpStore %_7_coord %280 -OpStore %_8_coordSampled %280 -OpStore %281 %100 -OpStore %282 %280 -%283 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %281 %282 -%284 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 -%285 = OpLoad %v4float %284 -%286 = OpCompositeExtract %float %285 3 -%287 = OpVectorTimesScalar %v4float %283 %286 -%288 = OpFAdd %v4float %277 %287 -OpStore %_6_output %288 -%289 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%290 = OpLoad %v2float %289 -%291 = OpFAdd %v2float %280 %290 -OpStore %_7_coord %291 -OpStore %_8_coordSampled %291 -OpStore %292 %100 -OpStore %293 %291 -%294 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %292 %293 -%295 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 -%296 = OpLoad %v4float %295 -%297 = OpCompositeExtract %float %296 0 -%298 = OpVectorTimesScalar %v4float %294 %297 -%299 = OpFAdd %v4float %288 %298 -OpStore %_6_output %299 -%300 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%301 = OpLoad %v2float %300 -%302 = OpFAdd %v2float %291 %301 -OpStore %_7_coord %302 -OpStore %_8_coordSampled %302 -OpStore %303 %100 -OpStore %304 %302 -%305 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %303 %304 -%306 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 -%307 = OpLoad %v4float %306 -%308 = OpCompositeExtract %float %307 1 -%309 = OpVectorTimesScalar %v4float %305 %308 -%310 = OpFAdd %v4float %299 %309 -OpStore %_6_output %310 -%311 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%312 = OpLoad %v2float %311 -%313 = OpFAdd %v2float %302 %312 -OpStore %_7_coord %313 -OpStore %_8_coordSampled %313 -OpStore %314 %100 -OpStore %315 %313 -%316 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %314 %315 -%317 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 -%318 = OpLoad %v4float %317 -%319 = OpCompositeExtract %float %318 2 -%320 = OpVectorTimesScalar %v4float %316 %319 -%321 = OpFAdd %v4float %310 %320 -OpStore %_6_output %321 -%322 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%323 = OpLoad %v2float %322 -%324 = OpFAdd %v2float %313 %323 -OpStore %_7_coord %324 -OpStore %_8_coordSampled %324 -OpStore %325 %100 -OpStore %326 %324 -%327 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %325 %326 -%328 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 -%329 = OpLoad %v4float %328 -%330 = OpCompositeExtract %float %329 3 -%331 = OpVectorTimesScalar %v4float %327 %330 -%332 = OpFAdd %v4float %321 %331 -OpStore %_6_output %332 -%333 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%334 = OpLoad %v2float %333 -%335 = OpFAdd %v2float %324 %334 -OpStore %_7_coord %335 -OpStore %_8_coordSampled %335 -OpStore %336 %100 -OpStore %337 %335 -%338 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %336 %337 -%339 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 -%340 = OpLoad %v4float %339 -%341 = OpCompositeExtract %float %340 0 -%342 = OpVectorTimesScalar %v4float %338 %341 -%343 = OpFAdd %v4float %332 %342 -OpStore %_6_output %343 -%344 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%345 = OpLoad %v2float %344 -%346 = OpFAdd %v2float %335 %345 -OpStore %_7_coord %346 -OpStore %_8_coordSampled %346 -OpStore %347 %100 -OpStore %348 %346 -%349 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %347 %348 -%350 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 -%351 = OpLoad %v4float %350 -%352 = OpCompositeExtract %float %351 1 -%353 = OpVectorTimesScalar %v4float %349 %352 -%354 = OpFAdd %v4float %343 %353 -OpStore %_6_output %354 -%355 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%356 = OpLoad %v2float %355 -%357 = OpFAdd %v2float %346 %356 -OpStore %_7_coord %357 -OpStore %_8_coordSampled %357 -OpStore %358 %100 -OpStore %359 %357 -%360 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %358 %359 -%361 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 -%362 = OpLoad %v4float %361 -%363 = OpCompositeExtract %float %362 2 -%364 = OpVectorTimesScalar %v4float %360 %363 -%365 = OpFAdd %v4float %354 %364 -OpStore %_6_output %365 -%366 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%367 = OpLoad %v2float %366 -%368 = OpFAdd %v2float %357 %367 -OpStore %_7_coord %368 -OpStore %_8_coordSampled %368 -OpStore %369 %100 -OpStore %370 %368 -%371 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %369 %370 -%372 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 -%373 = OpLoad %v4float %372 -%374 = OpCompositeExtract %float %373 3 -%375 = OpVectorTimesScalar %v4float %371 %374 -%376 = OpFAdd %v4float %365 %375 -OpStore %_6_output %376 -%377 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%378 = OpLoad %v2float %377 -%379 = OpFAdd %v2float %368 %378 -OpStore %_7_coord %379 -OpStore %_8_coordSampled %379 -OpStore %380 %100 -OpStore %381 %379 -%382 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %380 %381 -%383 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_6 -%384 = OpLoad %v4float %383 -%385 = OpCompositeExtract %float %384 0 -%386 = OpVectorTimesScalar %v4float %382 %385 -%387 = OpFAdd %v4float %376 %386 -OpStore %_6_output %387 -%388 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 -%389 = OpLoad %v2float %388 -%390 = OpFAdd %v2float %379 %389 -OpStore %_7_coord %390 -%391 = OpFMul %v4float %387 %100 -OpStore %_6_output %391 -OpStore %output_Stage1 %391 -%392 = OpFMul %v4float %391 %100 +OpStore %_6_output %103 +%105 = OpLoad %v2float %vLocalCoord_Stage0 +%107 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%109 = OpLoad %v2float %107 +%110 = OpVectorTimesScalar %v2float %109 %float_12 +%111 = OpFSub %v2float %105 %110 +OpStore %_7_coord %111 +OpStore %_8_coordSampled %113 +OpStore %_8_coordSampled %111 +OpStore %114 %100 +OpStore %115 %111 +%116 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %114 %115 +%118 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 +%119 = OpLoad %v4float %118 +%120 = OpCompositeExtract %float %119 0 +%121 = OpVectorTimesScalar %v4float %116 %120 +%122 = OpFAdd %v4float %103 %121 +OpStore %_6_output %122 +%123 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%124 = OpLoad %v2float %123 +%125 = OpFAdd %v2float %111 %124 +OpStore %_7_coord %125 +OpStore %_8_coordSampled %125 +OpStore %126 %100 +OpStore %127 %125 +%128 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %126 %127 +%129 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 +%130 = OpLoad %v4float %129 +%131 = OpCompositeExtract %float %130 1 +%132 = OpVectorTimesScalar %v4float %128 %131 +%133 = OpFAdd %v4float %122 %132 +OpStore %_6_output %133 +%134 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%135 = OpLoad %v2float %134 +%136 = OpFAdd %v2float %125 %135 +OpStore %_7_coord %136 +OpStore %_8_coordSampled %136 +OpStore %137 %100 +OpStore %138 %136 +%139 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %137 %138 +%140 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 +%141 = OpLoad %v4float %140 +%142 = OpCompositeExtract %float %141 2 +%143 = OpVectorTimesScalar %v4float %139 %142 +%144 = OpFAdd %v4float %133 %143 +OpStore %_6_output %144 +%145 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%146 = OpLoad %v2float %145 +%147 = OpFAdd %v2float %136 %146 +OpStore %_7_coord %147 +OpStore %_8_coordSampled %147 +OpStore %148 %100 +OpStore %149 %147 +%150 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %148 %149 +%151 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_0 +%152 = OpLoad %v4float %151 +%153 = OpCompositeExtract %float %152 3 +%154 = OpVectorTimesScalar %v4float %150 %153 +%155 = OpFAdd %v4float %144 %154 +OpStore %_6_output %155 +%156 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%157 = OpLoad %v2float %156 +%158 = OpFAdd %v2float %147 %157 +OpStore %_7_coord %158 +OpStore %_8_coordSampled %158 +OpStore %159 %100 +OpStore %160 %158 +%161 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %159 %160 +%162 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 +%163 = OpLoad %v4float %162 +%164 = OpCompositeExtract %float %163 0 +%165 = OpVectorTimesScalar %v4float %161 %164 +%166 = OpFAdd %v4float %155 %165 +OpStore %_6_output %166 +%167 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%168 = OpLoad %v2float %167 +%169 = OpFAdd %v2float %158 %168 +OpStore %_7_coord %169 +OpStore %_8_coordSampled %169 +OpStore %170 %100 +OpStore %171 %169 +%172 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %170 %171 +%173 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 +%174 = OpLoad %v4float %173 +%175 = OpCompositeExtract %float %174 1 +%176 = OpVectorTimesScalar %v4float %172 %175 +%177 = OpFAdd %v4float %166 %176 +OpStore %_6_output %177 +%178 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%179 = OpLoad %v2float %178 +%180 = OpFAdd %v2float %169 %179 +OpStore %_7_coord %180 +OpStore %_8_coordSampled %180 +OpStore %181 %100 +OpStore %182 %180 +%183 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %181 %182 +%184 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 +%185 = OpLoad %v4float %184 +%186 = OpCompositeExtract %float %185 2 +%187 = OpVectorTimesScalar %v4float %183 %186 +%188 = OpFAdd %v4float %177 %187 +OpStore %_6_output %188 +%189 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%190 = OpLoad %v2float %189 +%191 = OpFAdd %v2float %180 %190 +OpStore %_7_coord %191 +OpStore %_8_coordSampled %191 +OpStore %192 %100 +OpStore %193 %191 +%194 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %192 %193 +%195 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_1 +%196 = OpLoad %v4float %195 +%197 = OpCompositeExtract %float %196 3 +%198 = OpVectorTimesScalar %v4float %194 %197 +%199 = OpFAdd %v4float %188 %198 +OpStore %_6_output %199 +%200 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%201 = OpLoad %v2float %200 +%202 = OpFAdd %v2float %191 %201 +OpStore %_7_coord %202 +OpStore %_8_coordSampled %202 +OpStore %203 %100 +OpStore %204 %202 +%205 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %203 %204 +%206 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 +%207 = OpLoad %v4float %206 +%208 = OpCompositeExtract %float %207 0 +%209 = OpVectorTimesScalar %v4float %205 %208 +%210 = OpFAdd %v4float %199 %209 +OpStore %_6_output %210 +%211 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%212 = OpLoad %v2float %211 +%213 = OpFAdd %v2float %202 %212 +OpStore %_7_coord %213 +OpStore %_8_coordSampled %213 +OpStore %214 %100 +OpStore %215 %213 +%216 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %214 %215 +%217 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 +%218 = OpLoad %v4float %217 +%219 = OpCompositeExtract %float %218 1 +%220 = OpVectorTimesScalar %v4float %216 %219 +%221 = OpFAdd %v4float %210 %220 +OpStore %_6_output %221 +%222 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%223 = OpLoad %v2float %222 +%224 = OpFAdd %v2float %213 %223 +OpStore %_7_coord %224 +OpStore %_8_coordSampled %224 +OpStore %225 %100 +OpStore %226 %224 +%227 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %225 %226 +%228 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 +%229 = OpLoad %v4float %228 +%230 = OpCompositeExtract %float %229 2 +%231 = OpVectorTimesScalar %v4float %227 %230 +%232 = OpFAdd %v4float %221 %231 +OpStore %_6_output %232 +%233 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%234 = OpLoad %v2float %233 +%235 = OpFAdd %v2float %224 %234 +OpStore %_7_coord %235 +OpStore %_8_coordSampled %235 +OpStore %236 %100 +OpStore %237 %235 +%238 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %236 %237 +%239 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_2 +%240 = OpLoad %v4float %239 +%241 = OpCompositeExtract %float %240 3 +%242 = OpVectorTimesScalar %v4float %238 %241 +%243 = OpFAdd %v4float %232 %242 +OpStore %_6_output %243 +%244 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%245 = OpLoad %v2float %244 +%246 = OpFAdd %v2float %235 %245 +OpStore %_7_coord %246 +OpStore %_8_coordSampled %246 +OpStore %247 %100 +OpStore %248 %246 +%249 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %247 %248 +%250 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 +%251 = OpLoad %v4float %250 +%252 = OpCompositeExtract %float %251 0 +%253 = OpVectorTimesScalar %v4float %249 %252 +%254 = OpFAdd %v4float %243 %253 +OpStore %_6_output %254 +%255 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%256 = OpLoad %v2float %255 +%257 = OpFAdd %v2float %246 %256 +OpStore %_7_coord %257 +OpStore %_8_coordSampled %257 +OpStore %258 %100 +OpStore %259 %257 +%260 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %258 %259 +%261 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 +%262 = OpLoad %v4float %261 +%263 = OpCompositeExtract %float %262 1 +%264 = OpVectorTimesScalar %v4float %260 %263 +%265 = OpFAdd %v4float %254 %264 +OpStore %_6_output %265 +%266 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%267 = OpLoad %v2float %266 +%268 = OpFAdd %v2float %257 %267 +OpStore %_7_coord %268 +OpStore %_8_coordSampled %268 +OpStore %269 %100 +OpStore %270 %268 +%271 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %269 %270 +%272 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 +%273 = OpLoad %v4float %272 +%274 = OpCompositeExtract %float %273 2 +%275 = OpVectorTimesScalar %v4float %271 %274 +%276 = OpFAdd %v4float %265 %275 +OpStore %_6_output %276 +%277 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%278 = OpLoad %v2float %277 +%279 = OpFAdd %v2float %268 %278 +OpStore %_7_coord %279 +OpStore %_8_coordSampled %279 +OpStore %280 %100 +OpStore %281 %279 +%282 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %280 %281 +%283 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_3 +%284 = OpLoad %v4float %283 +%285 = OpCompositeExtract %float %284 3 +%286 = OpVectorTimesScalar %v4float %282 %285 +%287 = OpFAdd %v4float %276 %286 +OpStore %_6_output %287 +%288 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%289 = OpLoad %v2float %288 +%290 = OpFAdd %v2float %279 %289 +OpStore %_7_coord %290 +OpStore %_8_coordSampled %290 +OpStore %291 %100 +OpStore %292 %290 +%293 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %291 %292 +%294 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 +%295 = OpLoad %v4float %294 +%296 = OpCompositeExtract %float %295 0 +%297 = OpVectorTimesScalar %v4float %293 %296 +%298 = OpFAdd %v4float %287 %297 +OpStore %_6_output %298 +%299 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%300 = OpLoad %v2float %299 +%301 = OpFAdd %v2float %290 %300 +OpStore %_7_coord %301 +OpStore %_8_coordSampled %301 +OpStore %302 %100 +OpStore %303 %301 +%304 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %302 %303 +%305 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 +%306 = OpLoad %v4float %305 +%307 = OpCompositeExtract %float %306 1 +%308 = OpVectorTimesScalar %v4float %304 %307 +%309 = OpFAdd %v4float %298 %308 +OpStore %_6_output %309 +%310 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%311 = OpLoad %v2float %310 +%312 = OpFAdd %v2float %301 %311 +OpStore %_7_coord %312 +OpStore %_8_coordSampled %312 +OpStore %313 %100 +OpStore %314 %312 +%315 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %313 %314 +%316 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 +%317 = OpLoad %v4float %316 +%318 = OpCompositeExtract %float %317 2 +%319 = OpVectorTimesScalar %v4float %315 %318 +%320 = OpFAdd %v4float %309 %319 +OpStore %_6_output %320 +%321 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%322 = OpLoad %v2float %321 +%323 = OpFAdd %v2float %312 %322 +OpStore %_7_coord %323 +OpStore %_8_coordSampled %323 +OpStore %324 %100 +OpStore %325 %323 +%326 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %324 %325 +%327 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_4 +%328 = OpLoad %v4float %327 +%329 = OpCompositeExtract %float %328 3 +%330 = OpVectorTimesScalar %v4float %326 %329 +%331 = OpFAdd %v4float %320 %330 +OpStore %_6_output %331 +%332 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%333 = OpLoad %v2float %332 +%334 = OpFAdd %v2float %323 %333 +OpStore %_7_coord %334 +OpStore %_8_coordSampled %334 +OpStore %335 %100 +OpStore %336 %334 +%337 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %335 %336 +%338 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 +%339 = OpLoad %v4float %338 +%340 = OpCompositeExtract %float %339 0 +%341 = OpVectorTimesScalar %v4float %337 %340 +%342 = OpFAdd %v4float %331 %341 +OpStore %_6_output %342 +%343 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%344 = OpLoad %v2float %343 +%345 = OpFAdd %v2float %334 %344 +OpStore %_7_coord %345 +OpStore %_8_coordSampled %345 +OpStore %346 %100 +OpStore %347 %345 +%348 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %346 %347 +%349 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 +%350 = OpLoad %v4float %349 +%351 = OpCompositeExtract %float %350 1 +%352 = OpVectorTimesScalar %v4float %348 %351 +%353 = OpFAdd %v4float %342 %352 +OpStore %_6_output %353 +%354 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%355 = OpLoad %v2float %354 +%356 = OpFAdd %v2float %345 %355 +OpStore %_7_coord %356 +OpStore %_8_coordSampled %356 +OpStore %357 %100 +OpStore %358 %356 +%359 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %357 %358 +%360 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 +%361 = OpLoad %v4float %360 +%362 = OpCompositeExtract %float %361 2 +%363 = OpVectorTimesScalar %v4float %359 %362 +%364 = OpFAdd %v4float %353 %363 +OpStore %_6_output %364 +%365 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%366 = OpLoad %v2float %365 +%367 = OpFAdd %v2float %356 %366 +OpStore %_7_coord %367 +OpStore %_8_coordSampled %367 +OpStore %368 %100 +OpStore %369 %367 +%370 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %368 %369 +%371 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_5 +%372 = OpLoad %v4float %371 +%373 = OpCompositeExtract %float %372 3 +%374 = OpVectorTimesScalar %v4float %370 %373 +%375 = OpFAdd %v4float %364 %374 +OpStore %_6_output %375 +%376 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%377 = OpLoad %v2float %376 +%378 = OpFAdd %v2float %367 %377 +OpStore %_7_coord %378 +OpStore %_8_coordSampled %378 +OpStore %379 %100 +OpStore %380 %378 +%381 = OpFunctionCall %v4float %MatrixEffect_Stage1_c0_c0_h4h4f2 %379 %380 +%382 = OpAccessChain %_ptr_Uniform_v4float %4 %int_2 %int_6 +%383 = OpLoad %v4float %382 +%384 = OpCompositeExtract %float %383 0 +%385 = OpVectorTimesScalar %v4float %381 %384 +%386 = OpFAdd %v4float %375 %385 +OpStore %_6_output %386 +%387 = OpAccessChain %_ptr_Uniform_v2float %4 %int_1 +%388 = OpLoad %v2float %387 +%389 = OpFAdd %v2float %378 %388 +OpStore %_7_coord %389 +%390 = OpFMul %v4float %386 %100 +OpStore %_6_output %390 +OpStore %output_Stage1 %390 +%392 = OpFMul %v4float %390 %100 OpStore %sk_FragColor %392 OpReturn OpFunctionEnd diff --git a/tests/sksl/shared/GaussianBlur.glsl b/tests/sksl/shared/GaussianBlur.glsl index 7dd694bd7df5..6667eac5c915 100644 --- a/tests/sksl/shared/GaussianBlur.glsl +++ b/tests/sksl/shared/GaussianBlur.glsl @@ -17,8 +17,7 @@ vec4 MatrixEffect_Stage1_c0_c0_h4h4f2(vec4 _input, vec2 _coords) { vec2 _2_subsetCoord; _2_subsetCoord.x = _1_inCoord.x; _2_subsetCoord.y = _1_inCoord.y; - vec2 _3_clampedCoord; - _3_clampedCoord = _2_subsetCoord; + vec2 _3_clampedCoord = _2_subsetCoord; vec4 _4_textureColor = texture(uTextureSampler_0_Stage1, _3_clampedCoord * unorm_Stage1_c0_c0_c0.zw); float _5_snappedX = floor(_1_inCoord.x + 0.001) + 0.5; if (_5_snappedX < usubset_Stage1_c0_c0_c0.x || _5_snappedX > usubset_Stage1_c0_c0_c0.z) { @@ -33,9 +32,7 @@ void main() { outputColor_Stage0 = vec4(1.0); outputCoverage_Stage0 = vec4(1.0); } - vec4 output_Stage1; - vec4 _6_output; - _6_output = vec4(0.0); + vec4 _6_output = vec4(0.0); vec2 _7_coord = vLocalCoord_Stage0 - 12.0 * uIncrement_Stage1_c0; vec2 _8_coordSampled = vec2(0.0); _8_coordSampled = _7_coord; @@ -114,7 +111,7 @@ void main() { _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(outputColor_Stage0, _8_coordSampled) * uKernel_Stage1_c0[6].x; _7_coord += uIncrement_Stage1_c0; _6_output *= outputColor_Stage0; - output_Stage1 = _6_output; + vec4 output_Stage1 = _6_output; { sk_FragColor = output_Stage1 * outputCoverage_Stage0; } diff --git a/tests/sksl/shared/GaussianBlur.hlsl b/tests/sksl/shared/GaussianBlur.hlsl index 3d7041184787..c57d3fd96bff 100644 --- a/tests/sksl/shared/GaussianBlur.hlsl +++ b/tests/sksl/shared/GaussianBlur.hlsl @@ -59,187 +59,187 @@ void frag_main() float4 outputColor_Stage0 = 1.0f.xxxx; float4 outputCoverage_Stage0 = 1.0f.xxxx; float4 _RESERVED_IDENTIFIER_FIXUP_6_output = 0.0f.xxxx; - float2 _112 = vLocalCoord_Stage0 - (_4_uIncrement_Stage1_c0 * 12.0f); - float2 _RESERVED_IDENTIFIER_FIXUP_7_coord = _112; + float2 _111 = vLocalCoord_Stage0 - (_4_uIncrement_Stage1_c0 * 12.0f); + float2 _RESERVED_IDENTIFIER_FIXUP_7_coord = _111; float2 _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = 0.0f.xx; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _112; - float4 _115 = 1.0f.xxxx; - float2 _116 = _112; - float4 _123 = 0.0f.xxxx + (MatrixEffect_Stage1_c0_c0_h4h4f2(_115, _116) * _4_uKernel_Stage1_c0[0].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _123; - float2 _126 = _112 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _126; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _126; - float4 _127 = 1.0f.xxxx; - float2 _128 = _126; - float4 _134 = _123 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_127, _128) * _4_uKernel_Stage1_c0[0].y); - _RESERVED_IDENTIFIER_FIXUP_6_output = _134; - float2 _137 = _126 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _137; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _137; - float4 _138 = 1.0f.xxxx; - float2 _139 = _137; - float4 _145 = _134 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_138, _139) * _4_uKernel_Stage1_c0[0].z); - _RESERVED_IDENTIFIER_FIXUP_6_output = _145; - float2 _148 = _137 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _148; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _148; - float4 _149 = 1.0f.xxxx; - float2 _150 = _148; - float4 _156 = _145 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_149, _150) * _4_uKernel_Stage1_c0[0].w); - _RESERVED_IDENTIFIER_FIXUP_6_output = _156; - float2 _159 = _148 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _159; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _159; - float4 _160 = 1.0f.xxxx; - float2 _161 = _159; - float4 _167 = _156 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_160, _161) * _4_uKernel_Stage1_c0[1].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _167; - float2 _170 = _159 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _170; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _170; - float4 _171 = 1.0f.xxxx; - float2 _172 = _170; - float4 _178 = _167 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_171, _172) * _4_uKernel_Stage1_c0[1].y); - _RESERVED_IDENTIFIER_FIXUP_6_output = _178; - float2 _181 = _170 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _181; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _181; - float4 _182 = 1.0f.xxxx; - float2 _183 = _181; - float4 _189 = _178 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_182, _183) * _4_uKernel_Stage1_c0[1].z); - _RESERVED_IDENTIFIER_FIXUP_6_output = _189; - float2 _192 = _181 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _192; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _192; - float4 _193 = 1.0f.xxxx; - float2 _194 = _192; - float4 _200 = _189 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_193, _194) * _4_uKernel_Stage1_c0[1].w); - _RESERVED_IDENTIFIER_FIXUP_6_output = _200; - float2 _203 = _192 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _203; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _203; - float4 _204 = 1.0f.xxxx; - float2 _205 = _203; - float4 _211 = _200 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_204, _205) * _4_uKernel_Stage1_c0[2].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _211; - float2 _214 = _203 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _214; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _214; - float4 _215 = 1.0f.xxxx; - float2 _216 = _214; - float4 _222 = _211 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_215, _216) * _4_uKernel_Stage1_c0[2].y); - _RESERVED_IDENTIFIER_FIXUP_6_output = _222; - float2 _225 = _214 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _225; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _225; - float4 _226 = 1.0f.xxxx; - float2 _227 = _225; - float4 _233 = _222 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_226, _227) * _4_uKernel_Stage1_c0[2].z); - _RESERVED_IDENTIFIER_FIXUP_6_output = _233; - float2 _236 = _225 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _236; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _236; - float4 _237 = 1.0f.xxxx; - float2 _238 = _236; - float4 _244 = _233 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_237, _238) * _4_uKernel_Stage1_c0[2].w); - _RESERVED_IDENTIFIER_FIXUP_6_output = _244; - float2 _247 = _236 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _247; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _247; - float4 _248 = 1.0f.xxxx; - float2 _249 = _247; - float4 _255 = _244 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_248, _249) * _4_uKernel_Stage1_c0[3].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _255; - float2 _258 = _247 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _258; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _258; - float4 _259 = 1.0f.xxxx; - float2 _260 = _258; - float4 _266 = _255 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_259, _260) * _4_uKernel_Stage1_c0[3].y); - _RESERVED_IDENTIFIER_FIXUP_6_output = _266; - float2 _269 = _258 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _269; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _269; - float4 _270 = 1.0f.xxxx; - float2 _271 = _269; - float4 _277 = _266 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_270, _271) * _4_uKernel_Stage1_c0[3].z); - _RESERVED_IDENTIFIER_FIXUP_6_output = _277; - float2 _280 = _269 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _280; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _280; - float4 _281 = 1.0f.xxxx; - float2 _282 = _280; - float4 _288 = _277 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_281, _282) * _4_uKernel_Stage1_c0[3].w); - _RESERVED_IDENTIFIER_FIXUP_6_output = _288; - float2 _291 = _280 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _291; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _291; - float4 _292 = 1.0f.xxxx; - float2 _293 = _291; - float4 _299 = _288 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_292, _293) * _4_uKernel_Stage1_c0[4].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _299; - float2 _302 = _291 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _302; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _302; - float4 _303 = 1.0f.xxxx; - float2 _304 = _302; - float4 _310 = _299 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_303, _304) * _4_uKernel_Stage1_c0[4].y); - _RESERVED_IDENTIFIER_FIXUP_6_output = _310; - float2 _313 = _302 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _313; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _313; - float4 _314 = 1.0f.xxxx; - float2 _315 = _313; - float4 _321 = _310 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_314, _315) * _4_uKernel_Stage1_c0[4].z); - _RESERVED_IDENTIFIER_FIXUP_6_output = _321; - float2 _324 = _313 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _324; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _324; - float4 _325 = 1.0f.xxxx; - float2 _326 = _324; - float4 _332 = _321 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_325, _326) * _4_uKernel_Stage1_c0[4].w); - _RESERVED_IDENTIFIER_FIXUP_6_output = _332; - float2 _335 = _324 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _335; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _335; - float4 _336 = 1.0f.xxxx; - float2 _337 = _335; - float4 _343 = _332 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_336, _337) * _4_uKernel_Stage1_c0[5].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _343; - float2 _346 = _335 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _346; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _346; - float4 _347 = 1.0f.xxxx; - float2 _348 = _346; - float4 _354 = _343 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_347, _348) * _4_uKernel_Stage1_c0[5].y); - _RESERVED_IDENTIFIER_FIXUP_6_output = _354; - float2 _357 = _346 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _357; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _357; - float4 _358 = 1.0f.xxxx; - float2 _359 = _357; - float4 _365 = _354 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_358, _359) * _4_uKernel_Stage1_c0[5].z); - _RESERVED_IDENTIFIER_FIXUP_6_output = _365; - float2 _368 = _357 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _368; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _368; - float4 _369 = 1.0f.xxxx; - float2 _370 = _368; - float4 _376 = _365 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_369, _370) * _4_uKernel_Stage1_c0[5].w); - _RESERVED_IDENTIFIER_FIXUP_6_output = _376; - float2 _379 = _368 + _4_uIncrement_Stage1_c0; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _379; - _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _379; - float4 _380 = 1.0f.xxxx; - float2 _381 = _379; - float4 _387 = _376 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_380, _381) * _4_uKernel_Stage1_c0[6].x); - _RESERVED_IDENTIFIER_FIXUP_6_output = _387; - _RESERVED_IDENTIFIER_FIXUP_7_coord = _379 + _4_uIncrement_Stage1_c0; - float4 _391 = _387 * 1.0f.xxxx; - _RESERVED_IDENTIFIER_FIXUP_6_output = _391; - float4 output_Stage1 = _391; - sk_FragColor = _391 * 1.0f.xxxx; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _111; + float4 _114 = 1.0f.xxxx; + float2 _115 = _111; + float4 _122 = 0.0f.xxxx + (MatrixEffect_Stage1_c0_c0_h4h4f2(_114, _115) * _4_uKernel_Stage1_c0[0].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _122; + float2 _125 = _111 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _125; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _125; + float4 _126 = 1.0f.xxxx; + float2 _127 = _125; + float4 _133 = _122 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_126, _127) * _4_uKernel_Stage1_c0[0].y); + _RESERVED_IDENTIFIER_FIXUP_6_output = _133; + float2 _136 = _125 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _136; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _136; + float4 _137 = 1.0f.xxxx; + float2 _138 = _136; + float4 _144 = _133 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_137, _138) * _4_uKernel_Stage1_c0[0].z); + _RESERVED_IDENTIFIER_FIXUP_6_output = _144; + float2 _147 = _136 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _147; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _147; + float4 _148 = 1.0f.xxxx; + float2 _149 = _147; + float4 _155 = _144 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_148, _149) * _4_uKernel_Stage1_c0[0].w); + _RESERVED_IDENTIFIER_FIXUP_6_output = _155; + float2 _158 = _147 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _158; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _158; + float4 _159 = 1.0f.xxxx; + float2 _160 = _158; + float4 _166 = _155 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_159, _160) * _4_uKernel_Stage1_c0[1].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _166; + float2 _169 = _158 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _169; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _169; + float4 _170 = 1.0f.xxxx; + float2 _171 = _169; + float4 _177 = _166 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_170, _171) * _4_uKernel_Stage1_c0[1].y); + _RESERVED_IDENTIFIER_FIXUP_6_output = _177; + float2 _180 = _169 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _180; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _180; + float4 _181 = 1.0f.xxxx; + float2 _182 = _180; + float4 _188 = _177 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_181, _182) * _4_uKernel_Stage1_c0[1].z); + _RESERVED_IDENTIFIER_FIXUP_6_output = _188; + float2 _191 = _180 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _191; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _191; + float4 _192 = 1.0f.xxxx; + float2 _193 = _191; + float4 _199 = _188 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_192, _193) * _4_uKernel_Stage1_c0[1].w); + _RESERVED_IDENTIFIER_FIXUP_6_output = _199; + float2 _202 = _191 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _202; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _202; + float4 _203 = 1.0f.xxxx; + float2 _204 = _202; + float4 _210 = _199 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_203, _204) * _4_uKernel_Stage1_c0[2].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _210; + float2 _213 = _202 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _213; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _213; + float4 _214 = 1.0f.xxxx; + float2 _215 = _213; + float4 _221 = _210 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_214, _215) * _4_uKernel_Stage1_c0[2].y); + _RESERVED_IDENTIFIER_FIXUP_6_output = _221; + float2 _224 = _213 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _224; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _224; + float4 _225 = 1.0f.xxxx; + float2 _226 = _224; + float4 _232 = _221 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_225, _226) * _4_uKernel_Stage1_c0[2].z); + _RESERVED_IDENTIFIER_FIXUP_6_output = _232; + float2 _235 = _224 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _235; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _235; + float4 _236 = 1.0f.xxxx; + float2 _237 = _235; + float4 _243 = _232 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_236, _237) * _4_uKernel_Stage1_c0[2].w); + _RESERVED_IDENTIFIER_FIXUP_6_output = _243; + float2 _246 = _235 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _246; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _246; + float4 _247 = 1.0f.xxxx; + float2 _248 = _246; + float4 _254 = _243 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_247, _248) * _4_uKernel_Stage1_c0[3].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _254; + float2 _257 = _246 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _257; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _257; + float4 _258 = 1.0f.xxxx; + float2 _259 = _257; + float4 _265 = _254 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_258, _259) * _4_uKernel_Stage1_c0[3].y); + _RESERVED_IDENTIFIER_FIXUP_6_output = _265; + float2 _268 = _257 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _268; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _268; + float4 _269 = 1.0f.xxxx; + float2 _270 = _268; + float4 _276 = _265 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_269, _270) * _4_uKernel_Stage1_c0[3].z); + _RESERVED_IDENTIFIER_FIXUP_6_output = _276; + float2 _279 = _268 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _279; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _279; + float4 _280 = 1.0f.xxxx; + float2 _281 = _279; + float4 _287 = _276 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_280, _281) * _4_uKernel_Stage1_c0[3].w); + _RESERVED_IDENTIFIER_FIXUP_6_output = _287; + float2 _290 = _279 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _290; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _290; + float4 _291 = 1.0f.xxxx; + float2 _292 = _290; + float4 _298 = _287 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_291, _292) * _4_uKernel_Stage1_c0[4].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _298; + float2 _301 = _290 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _301; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _301; + float4 _302 = 1.0f.xxxx; + float2 _303 = _301; + float4 _309 = _298 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_302, _303) * _4_uKernel_Stage1_c0[4].y); + _RESERVED_IDENTIFIER_FIXUP_6_output = _309; + float2 _312 = _301 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _312; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _312; + float4 _313 = 1.0f.xxxx; + float2 _314 = _312; + float4 _320 = _309 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_313, _314) * _4_uKernel_Stage1_c0[4].z); + _RESERVED_IDENTIFIER_FIXUP_6_output = _320; + float2 _323 = _312 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _323; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _323; + float4 _324 = 1.0f.xxxx; + float2 _325 = _323; + float4 _331 = _320 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_324, _325) * _4_uKernel_Stage1_c0[4].w); + _RESERVED_IDENTIFIER_FIXUP_6_output = _331; + float2 _334 = _323 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _334; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _334; + float4 _335 = 1.0f.xxxx; + float2 _336 = _334; + float4 _342 = _331 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_335, _336) * _4_uKernel_Stage1_c0[5].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _342; + float2 _345 = _334 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _345; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _345; + float4 _346 = 1.0f.xxxx; + float2 _347 = _345; + float4 _353 = _342 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_346, _347) * _4_uKernel_Stage1_c0[5].y); + _RESERVED_IDENTIFIER_FIXUP_6_output = _353; + float2 _356 = _345 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _356; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _356; + float4 _357 = 1.0f.xxxx; + float2 _358 = _356; + float4 _364 = _353 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_357, _358) * _4_uKernel_Stage1_c0[5].z); + _RESERVED_IDENTIFIER_FIXUP_6_output = _364; + float2 _367 = _356 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _367; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _367; + float4 _368 = 1.0f.xxxx; + float2 _369 = _367; + float4 _375 = _364 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_368, _369) * _4_uKernel_Stage1_c0[5].w); + _RESERVED_IDENTIFIER_FIXUP_6_output = _375; + float2 _378 = _367 + _4_uIncrement_Stage1_c0; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _378; + _RESERVED_IDENTIFIER_FIXUP_8_coordSampled = _378; + float4 _379 = 1.0f.xxxx; + float2 _380 = _378; + float4 _386 = _375 + (MatrixEffect_Stage1_c0_c0_h4h4f2(_379, _380) * _4_uKernel_Stage1_c0[6].x); + _RESERVED_IDENTIFIER_FIXUP_6_output = _386; + _RESERVED_IDENTIFIER_FIXUP_7_coord = _378 + _4_uIncrement_Stage1_c0; + float4 _390 = _386 * 1.0f.xxxx; + _RESERVED_IDENTIFIER_FIXUP_6_output = _390; + float4 output_Stage1 = _390; + sk_FragColor = _390 * 1.0f.xxxx; } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/tests/sksl/shared/GaussianBlur.metal b/tests/sksl/shared/GaussianBlur.metal index e2d012edb8e4..8cef456d7516 100644 --- a/tests/sksl/shared/GaussianBlur.metal +++ b/tests/sksl/shared/GaussianBlur.metal @@ -44,8 +44,7 @@ half4 MatrixEffect_Stage1_c0_c0_h4h4f2(thread Globals& _globals, half4 _input, f float2 _2_subsetCoord; _2_subsetCoord.x = _1_inCoord.x; _2_subsetCoord.y = _1_inCoord.y; - float2 _3_clampedCoord; - _3_clampedCoord = _2_subsetCoord; + float2 _3_clampedCoord = _2_subsetCoord; half4 _4_textureColor = sample(_globals.uTextureSampler_0_Stage1, _3_clampedCoord * _globals._anonInterface0->unorm_Stage1_c0_c0_c0.zw); float _5_snappedX = floor(_1_inCoord.x + 0.001) + 0.5; if (_5_snappedX < _globals._anonInterface0->usubset_Stage1_c0_c0_c0.x || _5_snappedX > _globals._anonInterface0->usubset_Stage1_c0_c0_c0.z) { @@ -64,9 +63,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d uTextureS outputColor_Stage0 = half4(1.0h); outputCoverage_Stage0 = half4(1.0h); } - half4 output_Stage1; - half4 _6_output; - _6_output = half4(0.0h); + half4 _6_output = half4(0.0h); float2 _7_coord = _in.vLocalCoord_Stage0 - float2(12.0h * _globals._anonInterface0->uIncrement_Stage1_c0); float2 _8_coordSampled = float2(0.0); _8_coordSampled = _7_coord; @@ -145,7 +142,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d uTextureS _6_output += MatrixEffect_Stage1_c0_c0_h4h4f2(_globals, outputColor_Stage0, _8_coordSampled) * _globals._anonInterface0->uKernel_Stage1_c0[6].x; _7_coord += float2(_globals._anonInterface0->uIncrement_Stage1_c0); _6_output *= outputColor_Stage0; - output_Stage1 = _6_output; + half4 output_Stage1 = _6_output; { _out.sk_FragColor = output_Stage1 * outputCoverage_Stage0; } diff --git a/tests/sksl/shared/MatrixOpEqualsES2.glsl b/tests/sksl/shared/MatrixOpEqualsES2.glsl index da66d28c40dc..3aeb744927e6 100644 --- a/tests/sksl/shared/MatrixOpEqualsES2.glsl +++ b/tests/sksl/shared/MatrixOpEqualsES2.glsl @@ -7,8 +7,7 @@ bool test_matrix_op_matrix_half_b() { { const mat3 splat_4 = mat3(4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0); const mat3 splat_2 = mat3(2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0); - mat3 m; - m = mat3(2.0); + mat3 m = mat3(2.0); m += splat_4; ok = ok && m == mat3(6.0, 4.0, 4.0, 4.0, 6.0, 4.0, 4.0, 4.0, 6.0); m = mat3(2.0); @@ -59,8 +58,7 @@ vec4 main() { { const mat3 _1_splat_4 = mat3(4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0); const mat3 _2_splat_2 = mat3(2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0); - mat3 _3_m; - _3_m = mat3(2.0); + mat3 _3_m = mat3(2.0); _3_m += _1_splat_4; _0_ok = _0_ok && _3_m == mat3(6.0, 4.0, 4.0, 4.0, 6.0, 4.0, 4.0, 4.0, 6.0); _3_m = mat3(2.0); diff --git a/tests/sksl/shared/MatrixOpEqualsES2.metal b/tests/sksl/shared/MatrixOpEqualsES2.metal index 05a2a196f939..fa0be0b2dafb 100644 --- a/tests/sksl/shared/MatrixOpEqualsES2.metal +++ b/tests/sksl/shared/MatrixOpEqualsES2.metal @@ -125,8 +125,7 @@ bool test_matrix_op_matrix_half_b() { { const half3x3 splat_4 = half3x3(half3(4.0h, 4.0h, 4.0h), half3(4.0h, 4.0h, 4.0h), half3(4.0h, 4.0h, 4.0h)); const half3x3 splat_2 = half3x3(half3(2.0h, 2.0h, 2.0h), half3(2.0h, 2.0h, 2.0h), half3(2.0h, 2.0h, 2.0h)); - half3x3 m; - m = half3x3(2.0h); + half3x3 m = half3x3(2.0h); m += splat_4; ok = ok && m == half3x3(half3(6.0h, 4.0h, 4.0h), half3(4.0h, 6.0h, 4.0h), half3(4.0h, 4.0h, 6.0h)); m = half3x3(2.0h); @@ -179,8 +178,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _unifo { const float3x3 _1_splat_4 = float3x3(float3(4.0, 4.0, 4.0), float3(4.0, 4.0, 4.0), float3(4.0, 4.0, 4.0)); const float3x3 _2_splat_2 = float3x3(float3(2.0, 2.0, 2.0), float3(2.0, 2.0, 2.0), float3(2.0, 2.0, 2.0)); - float3x3 _3_m; - _3_m = float3x3(2.0); + float3x3 _3_m = float3x3(2.0); _3_m += _1_splat_4; _0_ok = _0_ok && _3_m == float3x3(float3(6.0, 4.0, 4.0), float3(4.0, 6.0, 4.0), float3(4.0, 4.0, 6.0)); _3_m = float3x3(2.0); diff --git a/tests/sksl/shared/MatrixOpEqualsES2.skrp b/tests/sksl/shared/MatrixOpEqualsES2.skrp index 894ace68cd91..abe11ff717a2 100644 --- a/tests/sksl/shared/MatrixOpEqualsES2.skrp +++ b/tests/sksl/shared/MatrixOpEqualsES2.skrp @@ -7,9 +7,6 @@ copy_constant _1_splat_4(8) = 0x40800000 (4.0) splat_4_constants _2_splat_2(0..3) = 0x40000000 (2.0) splat_4_constants _2_splat_2(4..7) = 0x40000000 (2.0) copy_constant _2_splat_2(8) = 0x40000000 (2.0) -splat_4_constants _3_m(0..3) = 0 -splat_4_constants _3_m(4..7) = 0 -copy_constant _3_m(8) = 0 copy_constant $0 = 0 copy_constant $1 = 0x40000000 (2.0) shuffle $0..8 = ($0..8)[1 0 0 0 1 0 0 0 1] @@ -349,7 +346,7 @@ store_condition_mask $34 = CondMask copy_slot_unmasked $35 = _0_ok copy_constant $0 = 0 merge_condition_mask CondMask = $34 & $35 -branch_if_no_lanes_active branch_if_no_lanes_active +349 (label 1 at #701) +branch_if_no_lanes_active branch_if_no_lanes_active +346 (label 1 at #695) copy_constant ok = 0xFFFFFFFF splat_4_constants splat_4(0..3) = 0x40800000 (4.0) splat_4_constants splat_4(4..7) = 0x40800000 (4.0) @@ -357,15 +354,12 @@ copy_constant splat_4(8) = 0x40800000 (4.0) splat_4_constants splat_2(0..3) = 0x40000000 (2.0) splat_4_constants splat_2(4..7) = 0x40000000 (2.0) copy_constant splat_2(8) = 0x40000000 (2.0) -splat_4_constants m(0..3) = 0 -splat_4_constants m(4..7) = 0 -copy_constant m(8) = 0 copy_constant $1 = 0 copy_constant $2 = 0x40000000 (2.0) shuffle $1..9 = ($1..9)[1 0 0 0 1 0 0 0 1] -copy_4_slots_masked m(0..3) = Mask($1..4) -copy_4_slots_masked m(4..7) = Mask($5..8) -copy_slot_masked m(8) = Mask($9) +copy_4_slots_unmasked m(0..3) = $1..4 +copy_4_slots_unmasked m(4..7) = $5..8 +copy_slot_unmasked m(8) = $9 copy_4_slots_unmasked $10..13 = splat_4(0..3) copy_4_slots_unmasked $14..17 = splat_4(4..7) copy_slot_unmasked $18 = splat_4(8) @@ -499,7 +493,6 @@ copy_constant $19 = 0x40000000 (2.0) cmpeq_n_floats $2..10 = equal($2..10, $11..19) bitwise_and_4_ints $3..6 &= $7..10 bitwise_and_2_ints $3..4 &= $5..6 -stack_rewind bitwise_and_int $3 &= $4 bitwise_and_int $2 &= $3 bitwise_and_int $1 &= $2 @@ -507,6 +500,7 @@ copy_slot_masked ok = Mask($1) copy_4_slots_unmasked $1..4 = splat_4(0..3) copy_4_slots_unmasked $5..8 = splat_4(4..7) copy_slot_unmasked $9 = splat_4(8) +stack_rewind copy_4_slots_masked m(0..3) = Mask($1..4) copy_4_slots_masked m(4..7) = Mask($5..8) copy_slot_masked m(8) = Mask($9) diff --git a/tests/sksl/shared/MatrixOpEqualsES3.glsl b/tests/sksl/shared/MatrixOpEqualsES3.glsl index d8c21824066f..d2fb05ac79c7 100644 --- a/tests/sksl/shared/MatrixOpEqualsES3.glsl +++ b/tests/sksl/shared/MatrixOpEqualsES3.glsl @@ -6,8 +6,7 @@ bool test_matrix_op_matrix_half_b() { bool ok = true; { const mat3x2 splat_4 = mat3x2(4.0, 4.0, 4.0, 4.0, 4.0, 4.0); - mat3x2 m; - m = mat3x2(2.0); + mat3x2 m = mat3x2(2.0); m += splat_4; ok = ok && m == mat3x2(6.0, 4.0, 4.0, 6.0, 4.0, 4.0); m = mat3x2(2.0); @@ -19,8 +18,7 @@ bool test_matrix_op_matrix_half_b() { } { const mat2x3 splat_4 = mat2x3(4.0, 4.0, 4.0, 4.0, 4.0, 4.0); - mat2x3 m; - m = splat_4; + mat2x3 m = splat_4; m += mat2x3(2.0); ok = ok && m == mat2x3(6.0, 4.0, 4.0, 4.0, 6.0, 4.0); m = splat_4; @@ -56,8 +54,7 @@ vec4 main() { bool _0_ok = true; { const mat3x2 _1_splat_4 = mat3x2(4.0, 4.0, 4.0, 4.0, 4.0, 4.0); - mat3x2 _2_m; - _2_m = mat3x2(2.0); + mat3x2 _2_m = mat3x2(2.0); _2_m += _1_splat_4; _0_ok = _0_ok && _2_m == mat3x2(6.0, 4.0, 4.0, 6.0, 4.0, 4.0); _2_m = mat3x2(2.0); @@ -69,8 +66,7 @@ vec4 main() { } { const mat2x3 _3_splat_4 = mat2x3(4.0, 4.0, 4.0, 4.0, 4.0, 4.0); - mat2x3 _4_m; - _4_m = _3_splat_4; + mat2x3 _4_m = _3_splat_4; _4_m += mat2x3(2.0); _0_ok = _0_ok && _4_m == mat2x3(6.0, 4.0, 4.0, 4.0, 6.0, 4.0); _4_m = _3_splat_4; diff --git a/tests/sksl/shared/MatrixOpEqualsES3.metal b/tests/sksl/shared/MatrixOpEqualsES3.metal index a7090e7d9191..6a3bf639b0be 100644 --- a/tests/sksl/shared/MatrixOpEqualsES3.metal +++ b/tests/sksl/shared/MatrixOpEqualsES3.metal @@ -174,8 +174,7 @@ bool test_matrix_op_matrix_half_b() { bool ok = true; { const half3x2 splat_4 = half3x2(half2(4.0h, 4.0h), half2(4.0h, 4.0h), half2(4.0h, 4.0h)); - half3x2 m; - m = half3x2(2.0h); + half3x2 m = half3x2(2.0h); m += splat_4; ok = ok && m == half3x2(half2(6.0h, 4.0h), half2(4.0h, 6.0h), half2(4.0h, 4.0h)); m = half3x2(2.0h); @@ -187,8 +186,7 @@ bool test_matrix_op_matrix_half_b() { } { const half2x3 splat_4 = half2x3(half3(4.0h, 4.0h, 4.0h), half3(4.0h, 4.0h, 4.0h)); - half2x3 m; - m = splat_4; + half2x3 m = splat_4; m += half2x3(2.0h); ok = ok && m == half2x3(half3(6.0h, 4.0h, 4.0h), half3(4.0h, 6.0h, 4.0h)); m = splat_4; @@ -226,8 +224,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _unifo bool _0_ok = true; { const float3x2 _1_splat_4 = float3x2(float2(4.0, 4.0), float2(4.0, 4.0), float2(4.0, 4.0)); - float3x2 _2_m; - _2_m = float3x2(2.0); + float3x2 _2_m = float3x2(2.0); _2_m += _1_splat_4; _0_ok = _0_ok && _2_m == float3x2(float2(6.0, 4.0), float2(4.0, 6.0), float2(4.0, 4.0)); _2_m = float3x2(2.0); @@ -239,8 +236,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _unifo } { const float2x3 _3_splat_4 = float2x3(float3(4.0, 4.0, 4.0), float3(4.0, 4.0, 4.0)); - float2x3 _4_m; - _4_m = _3_splat_4; + float2x3 _4_m = _3_splat_4; _4_m += float2x3(2.0); _0_ok = _0_ok && _4_m == float2x3(float3(6.0, 4.0, 4.0), float3(4.0, 6.0, 4.0)); _4_m = _3_splat_4; diff --git a/tests/sksl/shared/MatrixOpEqualsES3.skrp b/tests/sksl/shared/MatrixOpEqualsES3.skrp index 3b17dee5cb60..19b78e26f2b7 100644 --- a/tests/sksl/shared/MatrixOpEqualsES3.skrp +++ b/tests/sksl/shared/MatrixOpEqualsES3.skrp @@ -3,8 +3,6 @@ init_lane_masks CondMask = LoopMask = RetMask = true copy_constant _0_ok = 0xFFFFFFFF splat_4_constants _1_splat_4(0..3) = 0x40800000 (4.0) splat_2_constants _1_splat_4(4..5) = 0x40800000 (4.0) -splat_4_constants _2_m(0..3) = 0 -splat_2_constants _2_m(4..5) = 0 copy_constant $0 = 0 copy_constant $1 = 0x40000000 (2.0) shuffle $0..5 = ($0..5)[1 0 0 1 0 0] @@ -75,8 +73,6 @@ bitwise_and_int $0 &= $1 copy_slot_unmasked _0_ok = $0 splat_4_constants _3_splat_4(0..3) = 0x40800000 (4.0) splat_2_constants _3_splat_4(4..5) = 0x40800000 (4.0) -splat_4_constants _4_m(0..3) = 0 -splat_2_constants _4_m(4..5) = 0 copy_4_slots_unmasked _4_m(0..3) = _3_splat_4(0..3) copy_2_slots_unmasked _4_m(4..5) = _3_splat_4(4..5) copy_4_slots_unmasked $0..3 = _4_m(0..3) @@ -292,17 +288,15 @@ store_condition_mask $26 = CondMask copy_slot_unmasked $27 = _0_ok copy_constant $0 = 0 merge_condition_mask CondMask = $26 & $27 -branch_if_no_lanes_active branch_if_no_lanes_active +292 (label 1 at #587) +branch_if_no_lanes_active branch_if_no_lanes_active +288 (label 1 at #579) copy_constant ok = 0xFFFFFFFF splat_4_constants splat_4(0..3) = 0x40800000 (4.0) splat_2_constants splat_4(4..5) = 0x40800000 (4.0) -splat_4_constants m(0..3) = 0 -splat_2_constants m(4..5) = 0 copy_constant $1 = 0 copy_constant $2 = 0x40000000 (2.0) shuffle $1..6 = ($1..6)[1 0 0 1 0 0] -copy_4_slots_masked m(0..3) = Mask($1..4) -copy_2_slots_masked m(4..5) = Mask($5..6) +copy_4_slots_unmasked m(0..3) = $1..4 +copy_2_slots_unmasked m(4..5) = $5..6 copy_4_slots_unmasked $7..10 = splat_4(0..3) copy_2_slots_unmasked $11..12 = splat_4(4..5) add_n_floats $1..6 += $7..12 @@ -368,12 +362,10 @@ bitwise_and_int $1 &= $2 copy_slot_masked ok = Mask($1) splat_4_constants splat_4₁(0..3) = 0x40800000 (4.0) splat_2_constants splat_4₁(4..5) = 0x40800000 (4.0) -splat_4_constants m₁(0..3) = 0 -splat_2_constants m₁(4..5) = 0 -copy_4_slots_unmasked $1..4 = splat_4₁(0..3) -copy_2_slots_unmasked $5..6 = splat_4₁(4..5) -copy_4_slots_masked m₁(0..3) = Mask($1..4) -copy_2_slots_masked m₁(4..5) = Mask($5..6) +copy_4_slots_unmasked m₁(0..3) = splat_4₁(0..3) +copy_2_slots_unmasked m₁(4..5) = splat_4₁(4..5) +copy_4_slots_unmasked $1..4 = m₁(0..3) +copy_2_slots_unmasked $5..6 = m₁(4..5) copy_constant $7 = 0 copy_constant $8 = 0x40000000 (2.0) shuffle $7..12 = ($7..12)[1 0 0 0 1 0] @@ -499,7 +491,6 @@ copy_constant $13 = 0x40A00000 (5.0) copy_constant $14 = 0x40C00000 (6.0) copy_constant $15 = 0x40E00000 (7.0) copy_constant $16 = 0x41000000 (8.0) -stack_rewind sub_n_floats $1..8 -= $9..16 copy_4_slots_masked m₃(0..3) = Mask($1..4) copy_4_slots_masked m₃(4..7) = Mask($5..8) @@ -508,6 +499,7 @@ copy_4_slots_unmasked $2..5 = m₃(0..3) copy_4_slots_unmasked $6..9 = m₃(4..7) copy_constant $10 = 0x41100000 (9.0) copy_constant $11 = 0x41900000 (18.0) +stack_rewind copy_constant $12 = 0x41D80000 (27.0) copy_constant $13 = 0x42100000 (36.0) copy_constant $14 = 0x42340000 (45.0) diff --git a/tests/sksl/shared/OptimizationsStandaloneSettings.glsl b/tests/sksl/shared/OptimizationsStandaloneSettings.glsl index 4a844edf3d34..462dfa521e6e 100644 --- a/tests/sksl/shared/OptimizationsStandaloneSettings.glsl +++ b/tests/sksl/shared/OptimizationsStandaloneSettings.glsl @@ -3,10 +3,7 @@ out vec4 sk_FragColor; uniform vec4 colorGreen; uniform vec4 colorRed; bool flatten_known_if_b() { - int value; - { - value = 1; - } + int value = 1; return value == 1; } bool eliminate_empty_if_else_b() { diff --git a/tests/sksl/shared/SwizzleAsLValue.glsl b/tests/sksl/shared/SwizzleAsLValue.glsl index ead1e4f43269..457463173ca8 100644 --- a/tests/sksl/shared/SwizzleAsLValue.glsl +++ b/tests/sksl/shared/SwizzleAsLValue.glsl @@ -3,8 +3,7 @@ out vec4 sk_FragColor; uniform vec4 colorGreen; uniform vec4 colorRed; vec4 main() { - vec4 color; - color = colorGreen * 0.5; + vec4 color = colorGreen * 0.5; color.w = 2.0; color.y *= 4.0; color.yzw *= vec3(0.5); diff --git a/tests/sksl/shared/SwizzleAsLValue.metal b/tests/sksl/shared/SwizzleAsLValue.metal index b329ba76e038..270a577489f7 100644 --- a/tests/sksl/shared/SwizzleAsLValue.metal +++ b/tests/sksl/shared/SwizzleAsLValue.metal @@ -13,8 +13,7 @@ struct Outputs { fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { Outputs _out; (void)_out; - float4 color; - color = float4(_uniforms.colorGreen) * 0.5; + float4 color = float4(_uniforms.colorGreen) * 0.5; color.w = 2.0; color.y = color.y * 4.0; color.yzw = color.yzw * float3(0.5); diff --git a/tests/sksl/shared/SwizzleAsLValue.skrp b/tests/sksl/shared/SwizzleAsLValue.skrp index 9fc760ffb7a1..f6db1efb64ba 100644 --- a/tests/sksl/shared/SwizzleAsLValue.skrp +++ b/tests/sksl/shared/SwizzleAsLValue.skrp @@ -1,6 +1,5 @@ store_src_rg v0..1 = src.rg init_lane_masks CondMask = LoopMask = RetMask = true -splat_4_constants color = 0 copy_4_uniforms $0..3 = colorGreen splat_4_constants $4..7 = 0x3F000000 (0.5) mul_4_floats $0..3 *= $4..7 diff --git a/tests/sksl/shared/SwizzleBoolConstants.glsl b/tests/sksl/shared/SwizzleBoolConstants.glsl index 8253d222a81d..d973dd99b21a 100644 --- a/tests/sksl/shared/SwizzleBoolConstants.glsl +++ b/tests/sksl/shared/SwizzleBoolConstants.glsl @@ -4,8 +4,7 @@ uniform vec4 colorGreen; uniform vec4 colorRed; vec4 main() { bvec4 v = bvec4(bool(colorGreen.y)); - bvec4 result; - result = bvec4(v.x, true, true, true); + bvec4 result = bvec4(v.x, true, true, true); result = bvec4(v.xy, false, true); result = bvec4(v.x, true, true, false); result = bvec4(false, v.y, true, true); diff --git a/tests/sksl/shared/SwizzleBoolConstants.metal b/tests/sksl/shared/SwizzleBoolConstants.metal index a7519963d510..61061a0b00bc 100644 --- a/tests/sksl/shared/SwizzleBoolConstants.metal +++ b/tests/sksl/shared/SwizzleBoolConstants.metal @@ -14,8 +14,7 @@ fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _unifo Outputs _out; (void)_out; bool4 v = bool4(bool(_uniforms.colorGreen.y)); - bool4 result; - result = bool4(v.x, true, true, true); + bool4 result = bool4(v.x, true, true, true); result = bool4(v.xy, false, true); result = bool4(v.x, true, true, false); result = bool4(false, v.y, true, true); diff --git a/tests/sksl/shared/SwizzleBoolConstants.skrp b/tests/sksl/shared/SwizzleBoolConstants.skrp index 5e0abd8b3144..18f79db0839d 100644 --- a/tests/sksl/shared/SwizzleBoolConstants.skrp +++ b/tests/sksl/shared/SwizzleBoolConstants.skrp @@ -4,7 +4,6 @@ copy_uniform $0 = colorGreen(1) cmpne_imm_float $0 = notEqual($0, 0) swizzle_4 $0..3 = ($0..3).xxxx copy_4_slots_unmasked v = $0..3 -splat_4_constants result = 0 copy_slot_unmasked result(0) = v(0) splat_3_constants result(1..3) = 0xFFFFFFFF copy_2_slots_unmasked result(0..1) = v(0..1)