Fix comma operator support with matrices in Metal.

MetalCodeGen would incorrectly identify `(someMatrix, someScalar)` as a
math operation between `someMatrix` and `someScalar` and attempt to
convert `someScalar` to a matrix. If `someScalar` was a Boolean type,
this would lead to an assertion.

The binary expression is now checked more thoroughly before converting
the scalar into a matrix.

Change-Id: Id7e104d5533d8c43375927d4815b83e1a3c36be1
Bug: skia:11125
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410682
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/resources/sksl/shared/Matrices.sksl b/resources/sksl/shared/Matrices.sksl
index 7f3e8b7..f625437 100644
--- a/resources/sksl/shared/Matrices.sksl
+++ b/resources/sksl/shared/Matrices.sksl
@@ -82,6 +82,13 @@
     return ok;
 }
 
+bool test_comma() {
+    float2x2 x, y;
+    return (x = float2x2(1, 2, 3, 4),
+            y = 0.5 * float2x2(2, 4, 6, 8),
+            x == y);
+}
+
 half4 main(float2 coords) {
-    return test_float() && test_half() ? colorGreen : colorRed;
+    return test_float() && test_half() && test_comma() ? colorGreen : colorRed;
 }
diff --git a/src/sksl/codegen/SkSLMetalCodeGenerator.cpp b/src/sksl/codegen/SkSLMetalCodeGenerator.cpp
index 864acfc..91a0e41 100644
--- a/src/sksl/codegen/SkSLMetalCodeGenerator.cpp
+++ b/src/sksl/codegen/SkSLMetalCodeGenerator.cpp
@@ -1437,7 +1437,8 @@
     if (needParens) {
         this->write("(");
     }
-    bool needMatrixSplatOnScalar = rightType.isMatrix() && leftType.isScalar() &&
+    bool needMatrixSplatOnScalar = rightType.isMatrix() && leftType.isNumber() &&
+                                   op.isValidForMatrixOrVector() &&
                                    op.removeAssignment().kind() != Token::Kind::TK_STAR;
     if (needMatrixSplatOnScalar) {
         this->writeNumberAsMatrix(left, rightType);
@@ -1461,7 +1462,8 @@
         this->write(String(" ") + OperatorName(op) + " ");
     }
 
-    needMatrixSplatOnScalar = leftType.isMatrix() && rightType.isScalar() &&
+    needMatrixSplatOnScalar = leftType.isMatrix() && rightType.isNumber() &&
+                              op.isValidForMatrixOrVector() &&
                               op.removeAssignment().kind() != Token::Kind::TK_STAR;
     if (needMatrixSplatOnScalar) {
         this->writeNumberAsMatrix(right, leftType);
diff --git a/tests/sksl/shared/Matrices.asm.frag b/tests/sksl/shared/Matrices.asm.frag
index e510af4..ff38182 100644
--- a/tests/sksl/shared/Matrices.asm.frag
+++ b/tests/sksl/shared/Matrices.asm.frag
@@ -19,6 +19,9 @@
 OpName %m9 "m9"
 OpName %m10 "m10"
 OpName %m11 "m11"
+OpName %test_comma_b "test_comma_b"
+OpName %x "x"
+OpName %y "y"
 OpName %main "main"
 OpName %_0_ok "_0_ok"
 OpName %_1_m1 "_1_m1"
@@ -38,53 +41,52 @@
 OpMemberDecorate %_UniformBuffer 1 Offset 16
 OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
 OpDecorate %_UniformBuffer Block
-OpDecorate %11 Binding 0
-OpDecorate %11 DescriptorSet 0
+OpDecorate %12 Binding 0
+OpDecorate %12 DescriptorSet 0
 OpDecorate %m1 RelaxedPrecision
-OpDecorate %36 RelaxedPrecision
 OpDecorate %37 RelaxedPrecision
 OpDecorate %38 RelaxedPrecision
-OpDecorate %40 RelaxedPrecision
-OpDecorate %43 RelaxedPrecision
+OpDecorate %39 RelaxedPrecision
+OpDecorate %41 RelaxedPrecision
 OpDecorate %44 RelaxedPrecision
 OpDecorate %45 RelaxedPrecision
 OpDecorate %46 RelaxedPrecision
+OpDecorate %47 RelaxedPrecision
 OpDecorate %m3 RelaxedPrecision
-OpDecorate %59 RelaxedPrecision
 OpDecorate %60 RelaxedPrecision
-OpDecorate %63 RelaxedPrecision
+OpDecorate %61 RelaxedPrecision
 OpDecorate %64 RelaxedPrecision
 OpDecorate %65 RelaxedPrecision
 OpDecorate %66 RelaxedPrecision
+OpDecorate %67 RelaxedPrecision
 OpDecorate %m4 RelaxedPrecision
-OpDecorate %79 RelaxedPrecision
 OpDecorate %80 RelaxedPrecision
 OpDecorate %81 RelaxedPrecision
 OpDecorate %82 RelaxedPrecision
-OpDecorate %85 RelaxedPrecision
+OpDecorate %83 RelaxedPrecision
 OpDecorate %86 RelaxedPrecision
 OpDecorate %87 RelaxedPrecision
 OpDecorate %88 RelaxedPrecision
-OpDecorate %99 RelaxedPrecision
+OpDecorate %89 RelaxedPrecision
 OpDecorate %100 RelaxedPrecision
 OpDecorate %101 RelaxedPrecision
 OpDecorate %102 RelaxedPrecision
-OpDecorate %105 RelaxedPrecision
-OpDecorate %109 RelaxedPrecision
+OpDecorate %103 RelaxedPrecision
+OpDecorate %106 RelaxedPrecision
 OpDecorate %110 RelaxedPrecision
 OpDecorate %111 RelaxedPrecision
+OpDecorate %112 RelaxedPrecision
 OpDecorate %m5 RelaxedPrecision
-OpDecorate %126 RelaxedPrecision
 OpDecorate %127 RelaxedPrecision
 OpDecorate %128 RelaxedPrecision
 OpDecorate %129 RelaxedPrecision
 OpDecorate %130 RelaxedPrecision
 OpDecorate %131 RelaxedPrecision
-OpDecorate %134 RelaxedPrecision
+OpDecorate %132 RelaxedPrecision
 OpDecorate %135 RelaxedPrecision
 OpDecorate %136 RelaxedPrecision
 OpDecorate %137 RelaxedPrecision
-OpDecorate %148 RelaxedPrecision
+OpDecorate %138 RelaxedPrecision
 OpDecorate %149 RelaxedPrecision
 OpDecorate %150 RelaxedPrecision
 OpDecorate %151 RelaxedPrecision
@@ -94,45 +96,45 @@
 OpDecorate %155 RelaxedPrecision
 OpDecorate %156 RelaxedPrecision
 OpDecorate %157 RelaxedPrecision
-OpDecorate %160 RelaxedPrecision
-OpDecorate %163 RelaxedPrecision
+OpDecorate %158 RelaxedPrecision
+OpDecorate %161 RelaxedPrecision
 OpDecorate %164 RelaxedPrecision
 OpDecorate %165 RelaxedPrecision
+OpDecorate %166 RelaxedPrecision
 OpDecorate %m7 RelaxedPrecision
-OpDecorate %178 RelaxedPrecision
 OpDecorate %179 RelaxedPrecision
 OpDecorate %180 RelaxedPrecision
 OpDecorate %181 RelaxedPrecision
-OpDecorate %184 RelaxedPrecision
+OpDecorate %182 RelaxedPrecision
 OpDecorate %185 RelaxedPrecision
 OpDecorate %186 RelaxedPrecision
 OpDecorate %187 RelaxedPrecision
+OpDecorate %188 RelaxedPrecision
 OpDecorate %m9 RelaxedPrecision
-OpDecorate %203 RelaxedPrecision
 OpDecorate %204 RelaxedPrecision
 OpDecorate %205 RelaxedPrecision
 OpDecorate %206 RelaxedPrecision
 OpDecorate %207 RelaxedPrecision
-OpDecorate %210 RelaxedPrecision
+OpDecorate %208 RelaxedPrecision
 OpDecorate %211 RelaxedPrecision
 OpDecorate %212 RelaxedPrecision
 OpDecorate %213 RelaxedPrecision
 OpDecorate %214 RelaxedPrecision
+OpDecorate %215 RelaxedPrecision
 OpDecorate %m10 RelaxedPrecision
-OpDecorate %235 RelaxedPrecision
 OpDecorate %236 RelaxedPrecision
 OpDecorate %237 RelaxedPrecision
 OpDecorate %238 RelaxedPrecision
 OpDecorate %239 RelaxedPrecision
 OpDecorate %240 RelaxedPrecision
-OpDecorate %243 RelaxedPrecision
+OpDecorate %241 RelaxedPrecision
 OpDecorate %244 RelaxedPrecision
 OpDecorate %245 RelaxedPrecision
 OpDecorate %246 RelaxedPrecision
 OpDecorate %247 RelaxedPrecision
 OpDecorate %248 RelaxedPrecision
+OpDecorate %249 RelaxedPrecision
 OpDecorate %m11 RelaxedPrecision
-OpDecorate %272 RelaxedPrecision
 OpDecorate %273 RelaxedPrecision
 OpDecorate %274 RelaxedPrecision
 OpDecorate %275 RelaxedPrecision
@@ -153,27 +155,28 @@
 OpDecorate %290 RelaxedPrecision
 OpDecorate %291 RelaxedPrecision
 OpDecorate %292 RelaxedPrecision
-OpDecorate %295 RelaxedPrecision
+OpDecorate %293 RelaxedPrecision
 OpDecorate %296 RelaxedPrecision
 OpDecorate %297 RelaxedPrecision
 OpDecorate %298 RelaxedPrecision
 OpDecorate %299 RelaxedPrecision
 OpDecorate %300 RelaxedPrecision
-OpDecorate %321 RelaxedPrecision
-OpDecorate %330 RelaxedPrecision
-OpDecorate %349 RelaxedPrecision
-OpDecorate %370 RelaxedPrecision
-OpDecorate %390 RelaxedPrecision
-OpDecorate %414 RelaxedPrecision
-OpDecorate %440 RelaxedPrecision
-OpDecorate %461 RelaxedPrecision
-OpDecorate %483 RelaxedPrecision
-OpDecorate %512 RelaxedPrecision
-OpDecorate %562 RelaxedPrecision
-OpDecorate %591 RelaxedPrecision
-OpDecorate %604 RelaxedPrecision
-OpDecorate %606 RelaxedPrecision
-OpDecorate %607 RelaxedPrecision
+OpDecorate %301 RelaxedPrecision
+OpDecorate %322 RelaxedPrecision
+OpDecorate %353 RelaxedPrecision
+OpDecorate %372 RelaxedPrecision
+OpDecorate %393 RelaxedPrecision
+OpDecorate %413 RelaxedPrecision
+OpDecorate %437 RelaxedPrecision
+OpDecorate %463 RelaxedPrecision
+OpDecorate %484 RelaxedPrecision
+OpDecorate %506 RelaxedPrecision
+OpDecorate %535 RelaxedPrecision
+OpDecorate %585 RelaxedPrecision
+OpDecorate %614 RelaxedPrecision
+OpDecorate %631 RelaxedPrecision
+OpDecorate %633 RelaxedPrecision
+OpDecorate %634 RelaxedPrecision
 %float = OpTypeFloat 32
 %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -183,14 +186,14 @@
 %sk_Clockwise = OpVariable %_ptr_Input_bool Input
 %_UniformBuffer = OpTypeStruct %v4float %v4float
 %_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
-%11 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
+%12 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
 %void = OpTypeVoid
-%16 = OpTypeFunction %void
+%17 = OpTypeFunction %void
 %v2float = OpTypeVector %float 2
 %float_0 = OpConstant %float 0
-%20 = OpConstantComposite %v2float %float_0 %float_0
+%21 = OpConstantComposite %v2float %float_0 %float_0
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-%24 = OpTypeFunction %bool
+%25 = OpTypeFunction %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
 %true = OpConstantTrue %bool
 %mat2v2float = OpTypeMatrix %v2float 2
@@ -220,20 +223,21 @@
 %float_11 = OpConstant %float 11
 %v4bool = OpTypeVector %bool 4
 %float_20 = OpConstant %float 20
-%322 = OpTypeFunction %v4float %_ptr_Function_v2float
+%float_0_5 = OpConstant %float 0.5
+%345 = OpTypeFunction %v4float %_ptr_Function_v2float
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %int_0 = OpConstant %int 0
-%_entrypoint_v = OpFunction %void None %16
-%17 = OpLabel
-%21 = OpVariable %_ptr_Function_v2float Function
-OpStore %21 %20
-%23 = OpFunctionCall %v4float %main %21
-OpStore %sk_FragColor %23
+%_entrypoint_v = OpFunction %void None %17
+%18 = OpLabel
+%22 = OpVariable %_ptr_Function_v2float Function
+OpStore %22 %21
+%24 = OpFunctionCall %v4float %main %22
+OpStore %sk_FragColor %24
 OpReturn
 OpFunctionEnd
-%test_half_b = OpFunction %bool None %24
-%25 = OpLabel
+%test_half_b = OpFunction %bool None %25
+%26 = OpLabel
 %ok = OpVariable %_ptr_Function_bool Function
 %m1 = OpVariable %_ptr_Function_mat2v2float Function
 %m3 = OpVariable %_ptr_Function_mat2v2float Function
@@ -244,320 +248,346 @@
 %m10 = OpVariable %_ptr_Function_mat4v4float Function
 %m11 = OpVariable %_ptr_Function_mat4v4float Function
 OpStore %ok %true
-%37 = OpCompositeConstruct %v2float %float_1 %float_2
-%38 = OpCompositeConstruct %v2float %float_3 %float_4
-%36 = OpCompositeConstruct %mat2v2float %37 %38
-OpStore %m1 %36
-%40 = OpLoad %bool %ok
-OpSelectionMerge %42 None
-OpBranchConditional %40 %41 %42
-%41 = OpLabel
-%43 = OpLoad %mat2v2float %m1
-%45 = OpCompositeConstruct %v2float %float_1 %float_2
-%46 = OpCompositeConstruct %v2float %float_3 %float_4
-%44 = OpCompositeConstruct %mat2v2float %45 %46
-%48 = OpCompositeExtract %v2float %43 0
-%49 = OpCompositeExtract %v2float %44 0
-%50 = OpFOrdEqual %v2bool %48 %49
-%51 = OpAll %bool %50
-%52 = OpCompositeExtract %v2float %43 1
-%53 = OpCompositeExtract %v2float %44 1
-%54 = OpFOrdEqual %v2bool %52 %53
-%55 = OpAll %bool %54
-%56 = OpLogicalAnd %bool %51 %55
-OpBranch %42
+%38 = OpCompositeConstruct %v2float %float_1 %float_2
+%39 = OpCompositeConstruct %v2float %float_3 %float_4
+%37 = OpCompositeConstruct %mat2v2float %38 %39
+OpStore %m1 %37
+%41 = OpLoad %bool %ok
+OpSelectionMerge %43 None
+OpBranchConditional %41 %42 %43
 %42 = OpLabel
-%57 = OpPhi %bool %false %25 %56 %41
-OpStore %ok %57
-%59 = OpLoad %mat2v2float %m1
-OpStore %m3 %59
-%60 = OpLoad %bool %ok
-OpSelectionMerge %62 None
-OpBranchConditional %60 %61 %62
-%61 = OpLabel
-%63 = OpLoad %mat2v2float %m3
-%65 = OpCompositeConstruct %v2float %float_1 %float_2
-%66 = OpCompositeConstruct %v2float %float_3 %float_4
-%64 = OpCompositeConstruct %mat2v2float %65 %66
-%67 = OpCompositeExtract %v2float %63 0
-%68 = OpCompositeExtract %v2float %64 0
-%69 = OpFOrdEqual %v2bool %67 %68
-%70 = OpAll %bool %69
-%71 = OpCompositeExtract %v2float %63 1
-%72 = OpCompositeExtract %v2float %64 1
-%73 = OpFOrdEqual %v2bool %71 %72
-%74 = OpAll %bool %73
-%75 = OpLogicalAnd %bool %70 %74
-OpBranch %62
+%44 = OpLoad %mat2v2float %m1
+%46 = OpCompositeConstruct %v2float %float_1 %float_2
+%47 = OpCompositeConstruct %v2float %float_3 %float_4
+%45 = OpCompositeConstruct %mat2v2float %46 %47
+%49 = OpCompositeExtract %v2float %44 0
+%50 = OpCompositeExtract %v2float %45 0
+%51 = OpFOrdEqual %v2bool %49 %50
+%52 = OpAll %bool %51
+%53 = OpCompositeExtract %v2float %44 1
+%54 = OpCompositeExtract %v2float %45 1
+%55 = OpFOrdEqual %v2bool %53 %54
+%56 = OpAll %bool %55
+%57 = OpLogicalAnd %bool %52 %56
+OpBranch %43
+%43 = OpLabel
+%58 = OpPhi %bool %false %26 %57 %42
+OpStore %ok %58
+%60 = OpLoad %mat2v2float %m1
+OpStore %m3 %60
+%61 = OpLoad %bool %ok
+OpSelectionMerge %63 None
+OpBranchConditional %61 %62 %63
 %62 = OpLabel
-%76 = OpPhi %bool %false %42 %75 %61
-OpStore %ok %76
-%80 = OpCompositeConstruct %v2float %float_6 %float_0
-%81 = OpCompositeConstruct %v2float %float_0 %float_6
-%79 = OpCompositeConstruct %mat2v2float %80 %81
-OpStore %m4 %79
-%82 = OpLoad %bool %ok
-OpSelectionMerge %84 None
-OpBranchConditional %82 %83 %84
-%83 = OpLabel
-%85 = OpLoad %mat2v2float %m4
-%87 = OpCompositeConstruct %v2float %float_6 %float_0
-%88 = OpCompositeConstruct %v2float %float_0 %float_6
-%86 = OpCompositeConstruct %mat2v2float %87 %88
-%89 = OpCompositeExtract %v2float %85 0
-%90 = OpCompositeExtract %v2float %86 0
-%91 = OpFOrdEqual %v2bool %89 %90
-%92 = OpAll %bool %91
-%93 = OpCompositeExtract %v2float %85 1
-%94 = OpCompositeExtract %v2float %86 1
-%95 = OpFOrdEqual %v2bool %93 %94
-%96 = OpAll %bool %95
-%97 = OpLogicalAnd %bool %92 %96
-OpBranch %84
+%64 = OpLoad %mat2v2float %m3
+%66 = OpCompositeConstruct %v2float %float_1 %float_2
+%67 = OpCompositeConstruct %v2float %float_3 %float_4
+%65 = OpCompositeConstruct %mat2v2float %66 %67
+%68 = OpCompositeExtract %v2float %64 0
+%69 = OpCompositeExtract %v2float %65 0
+%70 = OpFOrdEqual %v2bool %68 %69
+%71 = OpAll %bool %70
+%72 = OpCompositeExtract %v2float %64 1
+%73 = OpCompositeExtract %v2float %65 1
+%74 = OpFOrdEqual %v2bool %72 %73
+%75 = OpAll %bool %74
+%76 = OpLogicalAnd %bool %71 %75
+OpBranch %63
+%63 = OpLabel
+%77 = OpPhi %bool %false %43 %76 %62
+OpStore %ok %77
+%81 = OpCompositeConstruct %v2float %float_6 %float_0
+%82 = OpCompositeConstruct %v2float %float_0 %float_6
+%80 = OpCompositeConstruct %mat2v2float %81 %82
+OpStore %m4 %80
+%83 = OpLoad %bool %ok
+OpSelectionMerge %85 None
+OpBranchConditional %83 %84 %85
 %84 = OpLabel
-%98 = OpPhi %bool %false %62 %97 %83
-OpStore %ok %98
-%99 = OpLoad %mat2v2float %m3
-%100 = OpLoad %mat2v2float %m4
-%101 = OpMatrixTimesMatrix %mat2v2float %99 %100
-OpStore %m3 %101
-%102 = OpLoad %bool %ok
-OpSelectionMerge %104 None
-OpBranchConditional %102 %103 %104
-%103 = OpLabel
-%105 = OpLoad %mat2v2float %m3
-%110 = OpCompositeConstruct %v2float %float_6 %float_12
-%111 = OpCompositeConstruct %v2float %float_18 %float_24
-%109 = OpCompositeConstruct %mat2v2float %110 %111
-%112 = OpCompositeExtract %v2float %105 0
-%113 = OpCompositeExtract %v2float %109 0
-%114 = OpFOrdEqual %v2bool %112 %113
-%115 = OpAll %bool %114
-%116 = OpCompositeExtract %v2float %105 1
-%117 = OpCompositeExtract %v2float %109 1
-%118 = OpFOrdEqual %v2bool %116 %117
-%119 = OpAll %bool %118
-%120 = OpLogicalAnd %bool %115 %119
-OpBranch %104
+%86 = OpLoad %mat2v2float %m4
+%88 = OpCompositeConstruct %v2float %float_6 %float_0
+%89 = OpCompositeConstruct %v2float %float_0 %float_6
+%87 = OpCompositeConstruct %mat2v2float %88 %89
+%90 = OpCompositeExtract %v2float %86 0
+%91 = OpCompositeExtract %v2float %87 0
+%92 = OpFOrdEqual %v2bool %90 %91
+%93 = OpAll %bool %92
+%94 = OpCompositeExtract %v2float %86 1
+%95 = OpCompositeExtract %v2float %87 1
+%96 = OpFOrdEqual %v2bool %94 %95
+%97 = OpAll %bool %96
+%98 = OpLogicalAnd %bool %93 %97
+OpBranch %85
+%85 = OpLabel
+%99 = OpPhi %bool %false %63 %98 %84
+OpStore %ok %99
+%100 = OpLoad %mat2v2float %m3
+%101 = OpLoad %mat2v2float %m4
+%102 = OpMatrixTimesMatrix %mat2v2float %100 %101
+OpStore %m3 %102
+%103 = OpLoad %bool %ok
+OpSelectionMerge %105 None
+OpBranchConditional %103 %104 %105
 %104 = OpLabel
-%121 = OpPhi %bool %false %84 %120 %103
-OpStore %ok %121
-%125 = OpAccessChain %_ptr_Function_v2float %m1 %int_1
-%126 = OpLoad %v2float %125
-%127 = OpCompositeExtract %float %126 1
-%129 = OpCompositeConstruct %v2float %127 %float_0
-%130 = OpCompositeConstruct %v2float %float_0 %127
-%128 = OpCompositeConstruct %mat2v2float %129 %130
-OpStore %m5 %128
-%131 = OpLoad %bool %ok
-OpSelectionMerge %133 None
-OpBranchConditional %131 %132 %133
-%132 = OpLabel
-%134 = OpLoad %mat2v2float %m5
-%136 = OpCompositeConstruct %v2float %float_4 %float_0
-%137 = OpCompositeConstruct %v2float %float_0 %float_4
-%135 = OpCompositeConstruct %mat2v2float %136 %137
-%138 = OpCompositeExtract %v2float %134 0
-%139 = OpCompositeExtract %v2float %135 0
-%140 = OpFOrdEqual %v2bool %138 %139
-%141 = OpAll %bool %140
-%142 = OpCompositeExtract %v2float %134 1
-%143 = OpCompositeExtract %v2float %135 1
-%144 = OpFOrdEqual %v2bool %142 %143
-%145 = OpAll %bool %144
-%146 = OpLogicalAnd %bool %141 %145
-OpBranch %133
+%106 = OpLoad %mat2v2float %m3
+%111 = OpCompositeConstruct %v2float %float_6 %float_12
+%112 = OpCompositeConstruct %v2float %float_18 %float_24
+%110 = OpCompositeConstruct %mat2v2float %111 %112
+%113 = OpCompositeExtract %v2float %106 0
+%114 = OpCompositeExtract %v2float %110 0
+%115 = OpFOrdEqual %v2bool %113 %114
+%116 = OpAll %bool %115
+%117 = OpCompositeExtract %v2float %106 1
+%118 = OpCompositeExtract %v2float %110 1
+%119 = OpFOrdEqual %v2bool %117 %118
+%120 = OpAll %bool %119
+%121 = OpLogicalAnd %bool %116 %120
+OpBranch %105
+%105 = OpLabel
+%122 = OpPhi %bool %false %85 %121 %104
+OpStore %ok %122
+%126 = OpAccessChain %_ptr_Function_v2float %m1 %int_1
+%127 = OpLoad %v2float %126
+%128 = OpCompositeExtract %float %127 1
+%130 = OpCompositeConstruct %v2float %128 %float_0
+%131 = OpCompositeConstruct %v2float %float_0 %128
+%129 = OpCompositeConstruct %mat2v2float %130 %131
+OpStore %m5 %129
+%132 = OpLoad %bool %ok
+OpSelectionMerge %134 None
+OpBranchConditional %132 %133 %134
 %133 = OpLabel
-%147 = OpPhi %bool %false %104 %146 %132
-OpStore %ok %147
-%148 = OpLoad %mat2v2float %m1
-%149 = OpLoad %mat2v2float %m5
-%150 = OpCompositeExtract %v2float %148 0
+%135 = OpLoad %mat2v2float %m5
+%137 = OpCompositeConstruct %v2float %float_4 %float_0
+%138 = OpCompositeConstruct %v2float %float_0 %float_4
+%136 = OpCompositeConstruct %mat2v2float %137 %138
+%139 = OpCompositeExtract %v2float %135 0
+%140 = OpCompositeExtract %v2float %136 0
+%141 = OpFOrdEqual %v2bool %139 %140
+%142 = OpAll %bool %141
+%143 = OpCompositeExtract %v2float %135 1
+%144 = OpCompositeExtract %v2float %136 1
+%145 = OpFOrdEqual %v2bool %143 %144
+%146 = OpAll %bool %145
+%147 = OpLogicalAnd %bool %142 %146
+OpBranch %134
+%134 = OpLabel
+%148 = OpPhi %bool %false %105 %147 %133
+OpStore %ok %148
+%149 = OpLoad %mat2v2float %m1
+%150 = OpLoad %mat2v2float %m5
 %151 = OpCompositeExtract %v2float %149 0
-%152 = OpFAdd %v2float %150 %151
-%153 = OpCompositeExtract %v2float %148 1
+%152 = OpCompositeExtract %v2float %150 0
+%153 = OpFAdd %v2float %151 %152
 %154 = OpCompositeExtract %v2float %149 1
-%155 = OpFAdd %v2float %153 %154
-%156 = OpCompositeConstruct %mat2v2float %152 %155
-OpStore %m1 %156
-%157 = OpLoad %bool %ok
-OpSelectionMerge %159 None
-OpBranchConditional %157 %158 %159
-%158 = OpLabel
-%160 = OpLoad %mat2v2float %m1
-%164 = OpCompositeConstruct %v2float %float_5 %float_2
-%165 = OpCompositeConstruct %v2float %float_3 %float_8
-%163 = OpCompositeConstruct %mat2v2float %164 %165
-%166 = OpCompositeExtract %v2float %160 0
-%167 = OpCompositeExtract %v2float %163 0
-%168 = OpFOrdEqual %v2bool %166 %167
-%169 = OpAll %bool %168
-%170 = OpCompositeExtract %v2float %160 1
-%171 = OpCompositeExtract %v2float %163 1
-%172 = OpFOrdEqual %v2bool %170 %171
-%173 = OpAll %bool %172
-%174 = OpLogicalAnd %bool %169 %173
-OpBranch %159
+%155 = OpCompositeExtract %v2float %150 1
+%156 = OpFAdd %v2float %154 %155
+%157 = OpCompositeConstruct %mat2v2float %153 %156
+OpStore %m1 %157
+%158 = OpLoad %bool %ok
+OpSelectionMerge %160 None
+OpBranchConditional %158 %159 %160
 %159 = OpLabel
-%175 = OpPhi %bool %false %133 %174 %158
-OpStore %ok %175
-%179 = OpCompositeConstruct %v2float %float_5 %float_6
-%180 = OpCompositeConstruct %v2float %float_7 %float_8
-%178 = OpCompositeConstruct %mat2v2float %179 %180
-OpStore %m7 %178
-%181 = OpLoad %bool %ok
-OpSelectionMerge %183 None
-OpBranchConditional %181 %182 %183
-%182 = OpLabel
-%184 = OpLoad %mat2v2float %m7
-%186 = OpCompositeConstruct %v2float %float_5 %float_6
-%187 = OpCompositeConstruct %v2float %float_7 %float_8
-%185 = OpCompositeConstruct %mat2v2float %186 %187
-%188 = OpCompositeExtract %v2float %184 0
-%189 = OpCompositeExtract %v2float %185 0
-%190 = OpFOrdEqual %v2bool %188 %189
-%191 = OpAll %bool %190
-%192 = OpCompositeExtract %v2float %184 1
-%193 = OpCompositeExtract %v2float %185 1
-%194 = OpFOrdEqual %v2bool %192 %193
-%195 = OpAll %bool %194
-%196 = OpLogicalAnd %bool %191 %195
-OpBranch %183
+%161 = OpLoad %mat2v2float %m1
+%165 = OpCompositeConstruct %v2float %float_5 %float_2
+%166 = OpCompositeConstruct %v2float %float_3 %float_8
+%164 = OpCompositeConstruct %mat2v2float %165 %166
+%167 = OpCompositeExtract %v2float %161 0
+%168 = OpCompositeExtract %v2float %164 0
+%169 = OpFOrdEqual %v2bool %167 %168
+%170 = OpAll %bool %169
+%171 = OpCompositeExtract %v2float %161 1
+%172 = OpCompositeExtract %v2float %164 1
+%173 = OpFOrdEqual %v2bool %171 %172
+%174 = OpAll %bool %173
+%175 = OpLogicalAnd %bool %170 %174
+OpBranch %160
+%160 = OpLabel
+%176 = OpPhi %bool %false %134 %175 %159
+OpStore %ok %176
+%180 = OpCompositeConstruct %v2float %float_5 %float_6
+%181 = OpCompositeConstruct %v2float %float_7 %float_8
+%179 = OpCompositeConstruct %mat2v2float %180 %181
+OpStore %m7 %179
+%182 = OpLoad %bool %ok
+OpSelectionMerge %184 None
+OpBranchConditional %182 %183 %184
 %183 = OpLabel
-%197 = OpPhi %bool %false %159 %196 %182
-OpStore %ok %197
-%204 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
-%205 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
-%206 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
-%203 = OpCompositeConstruct %mat3v3float %204 %205 %206
-OpStore %m9 %203
-%207 = OpLoad %bool %ok
-OpSelectionMerge %209 None
-OpBranchConditional %207 %208 %209
-%208 = OpLabel
-%210 = OpLoad %mat3v3float %m9
-%212 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
-%213 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
-%214 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
-%211 = OpCompositeConstruct %mat3v3float %212 %213 %214
-%216 = OpCompositeExtract %v3float %210 0
-%217 = OpCompositeExtract %v3float %211 0
-%218 = OpFOrdEqual %v3bool %216 %217
-%219 = OpAll %bool %218
-%220 = OpCompositeExtract %v3float %210 1
-%221 = OpCompositeExtract %v3float %211 1
-%222 = OpFOrdEqual %v3bool %220 %221
-%223 = OpAll %bool %222
-%224 = OpLogicalAnd %bool %219 %223
-%225 = OpCompositeExtract %v3float %210 2
-%226 = OpCompositeExtract %v3float %211 2
-%227 = OpFOrdEqual %v3bool %225 %226
-%228 = OpAll %bool %227
-%229 = OpLogicalAnd %bool %224 %228
-OpBranch %209
+%185 = OpLoad %mat2v2float %m7
+%187 = OpCompositeConstruct %v2float %float_5 %float_6
+%188 = OpCompositeConstruct %v2float %float_7 %float_8
+%186 = OpCompositeConstruct %mat2v2float %187 %188
+%189 = OpCompositeExtract %v2float %185 0
+%190 = OpCompositeExtract %v2float %186 0
+%191 = OpFOrdEqual %v2bool %189 %190
+%192 = OpAll %bool %191
+%193 = OpCompositeExtract %v2float %185 1
+%194 = OpCompositeExtract %v2float %186 1
+%195 = OpFOrdEqual %v2bool %193 %194
+%196 = OpAll %bool %195
+%197 = OpLogicalAnd %bool %192 %196
+OpBranch %184
+%184 = OpLabel
+%198 = OpPhi %bool %false %160 %197 %183
+OpStore %ok %198
+%205 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
+%206 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
+%207 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
+%204 = OpCompositeConstruct %mat3v3float %205 %206 %207
+OpStore %m9 %204
+%208 = OpLoad %bool %ok
+OpSelectionMerge %210 None
+OpBranchConditional %208 %209 %210
 %209 = OpLabel
-%230 = OpPhi %bool %false %183 %229 %208
-OpStore %ok %230
-%236 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
-%237 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
-%238 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
-%239 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
-%235 = OpCompositeConstruct %mat4v4float %236 %237 %238 %239
-OpStore %m10 %235
-%240 = OpLoad %bool %ok
-OpSelectionMerge %242 None
-OpBranchConditional %240 %241 %242
-%241 = OpLabel
-%243 = OpLoad %mat4v4float %m10
-%245 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
-%246 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
-%247 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
-%248 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
-%244 = OpCompositeConstruct %mat4v4float %245 %246 %247 %248
-%250 = OpCompositeExtract %v4float %243 0
-%251 = OpCompositeExtract %v4float %244 0
-%252 = OpFOrdEqual %v4bool %250 %251
-%253 = OpAll %bool %252
-%254 = OpCompositeExtract %v4float %243 1
-%255 = OpCompositeExtract %v4float %244 1
-%256 = OpFOrdEqual %v4bool %254 %255
-%257 = OpAll %bool %256
-%258 = OpLogicalAnd %bool %253 %257
-%259 = OpCompositeExtract %v4float %243 2
-%260 = OpCompositeExtract %v4float %244 2
-%261 = OpFOrdEqual %v4bool %259 %260
-%262 = OpAll %bool %261
-%263 = OpLogicalAnd %bool %258 %262
-%264 = OpCompositeExtract %v4float %243 3
-%265 = OpCompositeExtract %v4float %244 3
-%266 = OpFOrdEqual %v4bool %264 %265
-%267 = OpAll %bool %266
-%268 = OpLogicalAnd %bool %263 %267
-OpBranch %242
+%211 = OpLoad %mat3v3float %m9
+%213 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
+%214 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
+%215 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
+%212 = OpCompositeConstruct %mat3v3float %213 %214 %215
+%217 = OpCompositeExtract %v3float %211 0
+%218 = OpCompositeExtract %v3float %212 0
+%219 = OpFOrdEqual %v3bool %217 %218
+%220 = OpAll %bool %219
+%221 = OpCompositeExtract %v3float %211 1
+%222 = OpCompositeExtract %v3float %212 1
+%223 = OpFOrdEqual %v3bool %221 %222
+%224 = OpAll %bool %223
+%225 = OpLogicalAnd %bool %220 %224
+%226 = OpCompositeExtract %v3float %211 2
+%227 = OpCompositeExtract %v3float %212 2
+%228 = OpFOrdEqual %v3bool %226 %227
+%229 = OpAll %bool %228
+%230 = OpLogicalAnd %bool %225 %229
+OpBranch %210
+%210 = OpLabel
+%231 = OpPhi %bool %false %184 %230 %209
+OpStore %ok %231
+%237 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
+%238 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
+%239 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
+%240 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
+%236 = OpCompositeConstruct %mat4v4float %237 %238 %239 %240
+OpStore %m10 %236
+%241 = OpLoad %bool %ok
+OpSelectionMerge %243 None
+OpBranchConditional %241 %242 %243
 %242 = OpLabel
-%269 = OpPhi %bool %false %209 %268 %241
-OpStore %ok %269
-%273 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
+%244 = OpLoad %mat4v4float %m10
+%246 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
+%247 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
+%248 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
+%249 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
+%245 = OpCompositeConstruct %mat4v4float %246 %247 %248 %249
+%251 = OpCompositeExtract %v4float %244 0
+%252 = OpCompositeExtract %v4float %245 0
+%253 = OpFOrdEqual %v4bool %251 %252
+%254 = OpAll %bool %253
+%255 = OpCompositeExtract %v4float %244 1
+%256 = OpCompositeExtract %v4float %245 1
+%257 = OpFOrdEqual %v4bool %255 %256
+%258 = OpAll %bool %257
+%259 = OpLogicalAnd %bool %254 %258
+%260 = OpCompositeExtract %v4float %244 2
+%261 = OpCompositeExtract %v4float %245 2
+%262 = OpFOrdEqual %v4bool %260 %261
+%263 = OpAll %bool %262
+%264 = OpLogicalAnd %bool %259 %263
+%265 = OpCompositeExtract %v4float %244 3
+%266 = OpCompositeExtract %v4float %245 3
+%267 = OpFOrdEqual %v4bool %265 %266
+%268 = OpAll %bool %267
+%269 = OpLogicalAnd %bool %264 %268
+OpBranch %243
+%243 = OpLabel
+%270 = OpPhi %bool %false %210 %269 %242
+OpStore %ok %270
 %274 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
 %275 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
 %276 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
-%272 = OpCompositeConstruct %mat4v4float %273 %274 %275 %276
-OpStore %m11 %272
-%277 = OpLoad %mat4v4float %m11
-%278 = OpLoad %mat4v4float %m10
-%279 = OpCompositeExtract %v4float %277 0
+%277 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
+%273 = OpCompositeConstruct %mat4v4float %274 %275 %276 %277
+OpStore %m11 %273
+%278 = OpLoad %mat4v4float %m11
+%279 = OpLoad %mat4v4float %m10
 %280 = OpCompositeExtract %v4float %278 0
-%281 = OpFSub %v4float %279 %280
-%282 = OpCompositeExtract %v4float %277 1
+%281 = OpCompositeExtract %v4float %279 0
+%282 = OpFSub %v4float %280 %281
 %283 = OpCompositeExtract %v4float %278 1
-%284 = OpFSub %v4float %282 %283
-%285 = OpCompositeExtract %v4float %277 2
+%284 = OpCompositeExtract %v4float %279 1
+%285 = OpFSub %v4float %283 %284
 %286 = OpCompositeExtract %v4float %278 2
-%287 = OpFSub %v4float %285 %286
-%288 = OpCompositeExtract %v4float %277 3
+%287 = OpCompositeExtract %v4float %279 2
+%288 = OpFSub %v4float %286 %287
 %289 = OpCompositeExtract %v4float %278 3
-%290 = OpFSub %v4float %288 %289
-%291 = OpCompositeConstruct %mat4v4float %281 %284 %287 %290
-OpStore %m11 %291
-%292 = OpLoad %bool %ok
-OpSelectionMerge %294 None
-OpBranchConditional %292 %293 %294
-%293 = OpLabel
-%295 = OpLoad %mat4v4float %m11
-%297 = OpCompositeConstruct %v4float %float_9 %float_20 %float_20 %float_20
-%298 = OpCompositeConstruct %v4float %float_20 %float_9 %float_20 %float_20
-%299 = OpCompositeConstruct %v4float %float_20 %float_20 %float_9 %float_20
-%300 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_9
-%296 = OpCompositeConstruct %mat4v4float %297 %298 %299 %300
-%301 = OpCompositeExtract %v4float %295 0
-%302 = OpCompositeExtract %v4float %296 0
-%303 = OpFOrdEqual %v4bool %301 %302
-%304 = OpAll %bool %303
-%305 = OpCompositeExtract %v4float %295 1
-%306 = OpCompositeExtract %v4float %296 1
-%307 = OpFOrdEqual %v4bool %305 %306
-%308 = OpAll %bool %307
-%309 = OpLogicalAnd %bool %304 %308
-%310 = OpCompositeExtract %v4float %295 2
-%311 = OpCompositeExtract %v4float %296 2
-%312 = OpFOrdEqual %v4bool %310 %311
-%313 = OpAll %bool %312
-%314 = OpLogicalAnd %bool %309 %313
-%315 = OpCompositeExtract %v4float %295 3
-%316 = OpCompositeExtract %v4float %296 3
-%317 = OpFOrdEqual %v4bool %315 %316
-%318 = OpAll %bool %317
-%319 = OpLogicalAnd %bool %314 %318
-OpBranch %294
+%290 = OpCompositeExtract %v4float %279 3
+%291 = OpFSub %v4float %289 %290
+%292 = OpCompositeConstruct %mat4v4float %282 %285 %288 %291
+OpStore %m11 %292
+%293 = OpLoad %bool %ok
+OpSelectionMerge %295 None
+OpBranchConditional %293 %294 %295
 %294 = OpLabel
-%320 = OpPhi %bool %false %242 %319 %293
-OpStore %ok %320
-%321 = OpLoad %bool %ok
-OpReturnValue %321
+%296 = OpLoad %mat4v4float %m11
+%298 = OpCompositeConstruct %v4float %float_9 %float_20 %float_20 %float_20
+%299 = OpCompositeConstruct %v4float %float_20 %float_9 %float_20 %float_20
+%300 = OpCompositeConstruct %v4float %float_20 %float_20 %float_9 %float_20
+%301 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_9
+%297 = OpCompositeConstruct %mat4v4float %298 %299 %300 %301
+%302 = OpCompositeExtract %v4float %296 0
+%303 = OpCompositeExtract %v4float %297 0
+%304 = OpFOrdEqual %v4bool %302 %303
+%305 = OpAll %bool %304
+%306 = OpCompositeExtract %v4float %296 1
+%307 = OpCompositeExtract %v4float %297 1
+%308 = OpFOrdEqual %v4bool %306 %307
+%309 = OpAll %bool %308
+%310 = OpLogicalAnd %bool %305 %309
+%311 = OpCompositeExtract %v4float %296 2
+%312 = OpCompositeExtract %v4float %297 2
+%313 = OpFOrdEqual %v4bool %311 %312
+%314 = OpAll %bool %313
+%315 = OpLogicalAnd %bool %310 %314
+%316 = OpCompositeExtract %v4float %296 3
+%317 = OpCompositeExtract %v4float %297 3
+%318 = OpFOrdEqual %v4bool %316 %317
+%319 = OpAll %bool %318
+%320 = OpLogicalAnd %bool %315 %319
+OpBranch %295
+%295 = OpLabel
+%321 = OpPhi %bool %false %243 %320 %294
+OpStore %ok %321
+%322 = OpLoad %bool %ok
+OpReturnValue %322
 OpFunctionEnd
-%main = OpFunction %v4float None %322
-%323 = OpFunctionParameter %_ptr_Function_v2float
-%324 = OpLabel
+%test_comma_b = OpFunction %bool None %25
+%323 = OpLabel
+%x = OpVariable %_ptr_Function_mat2v2float Function
+%y = OpVariable %_ptr_Function_mat2v2float Function
+%327 = OpCompositeConstruct %v2float %float_1 %float_2
+%328 = OpCompositeConstruct %v2float %float_3 %float_4
+%326 = OpCompositeConstruct %mat2v2float %327 %328
+OpStore %x %326
+%331 = OpCompositeConstruct %v2float %float_2 %float_4
+%332 = OpCompositeConstruct %v2float %float_6 %float_8
+%330 = OpCompositeConstruct %mat2v2float %331 %332
+%333 = OpMatrixTimesScalar %mat2v2float %330 %float_0_5
+OpStore %y %333
+%334 = OpLoad %mat2v2float %x
+%335 = OpLoad %mat2v2float %y
+%336 = OpCompositeExtract %v2float %334 0
+%337 = OpCompositeExtract %v2float %335 0
+%338 = OpFOrdEqual %v2bool %336 %337
+%339 = OpAll %bool %338
+%340 = OpCompositeExtract %v2float %334 1
+%341 = OpCompositeExtract %v2float %335 1
+%342 = OpFOrdEqual %v2bool %340 %341
+%343 = OpAll %bool %342
+%344 = OpLogicalAnd %bool %339 %343
+OpReturnValue %344
+OpFunctionEnd
+%main = OpFunction %v4float None %345
+%346 = OpFunctionParameter %_ptr_Function_v2float
+%347 = OpLabel
 %_0_ok = OpVariable %_ptr_Function_bool Function
 %_1_m1 = OpVariable %_ptr_Function_mat2v2float Function
 %_2_m3 = OpVariable %_ptr_Function_mat2v2float Function
@@ -567,337 +597,344 @@
 %_6_m9 = OpVariable %_ptr_Function_mat3v3float Function
 %_7_m10 = OpVariable %_ptr_Function_mat4v4float Function
 %_8_m11 = OpVariable %_ptr_Function_mat4v4float Function
-%596 = OpVariable %_ptr_Function_v4float Function
+%623 = OpVariable %_ptr_Function_v4float Function
 OpStore %_0_ok %true
-%328 = OpCompositeConstruct %v2float %float_1 %float_2
-%329 = OpCompositeConstruct %v2float %float_3 %float_4
-%327 = OpCompositeConstruct %mat2v2float %328 %329
-OpStore %_1_m1 %327
-%330 = OpLoad %bool %_0_ok
-OpSelectionMerge %332 None
-OpBranchConditional %330 %331 %332
-%331 = OpLabel
-%333 = OpLoad %mat2v2float %_1_m1
-%335 = OpCompositeConstruct %v2float %float_1 %float_2
-%336 = OpCompositeConstruct %v2float %float_3 %float_4
-%334 = OpCompositeConstruct %mat2v2float %335 %336
-%337 = OpCompositeExtract %v2float %333 0
-%338 = OpCompositeExtract %v2float %334 0
-%339 = OpFOrdEqual %v2bool %337 %338
-%340 = OpAll %bool %339
-%341 = OpCompositeExtract %v2float %333 1
-%342 = OpCompositeExtract %v2float %334 1
-%343 = OpFOrdEqual %v2bool %341 %342
-%344 = OpAll %bool %343
-%345 = OpLogicalAnd %bool %340 %344
-OpBranch %332
-%332 = OpLabel
-%346 = OpPhi %bool %false %324 %345 %331
-OpStore %_0_ok %346
-%348 = OpLoad %mat2v2float %_1_m1
-OpStore %_2_m3 %348
-%349 = OpLoad %bool %_0_ok
-OpSelectionMerge %351 None
-OpBranchConditional %349 %350 %351
-%350 = OpLabel
-%352 = OpLoad %mat2v2float %_2_m3
-%354 = OpCompositeConstruct %v2float %float_1 %float_2
-%355 = OpCompositeConstruct %v2float %float_3 %float_4
-%353 = OpCompositeConstruct %mat2v2float %354 %355
-%356 = OpCompositeExtract %v2float %352 0
-%357 = OpCompositeExtract %v2float %353 0
-%358 = OpFOrdEqual %v2bool %356 %357
-%359 = OpAll %bool %358
-%360 = OpCompositeExtract %v2float %352 1
-%361 = OpCompositeExtract %v2float %353 1
+%351 = OpCompositeConstruct %v2float %float_1 %float_2
+%352 = OpCompositeConstruct %v2float %float_3 %float_4
+%350 = OpCompositeConstruct %mat2v2float %351 %352
+OpStore %_1_m1 %350
+%353 = OpLoad %bool %_0_ok
+OpSelectionMerge %355 None
+OpBranchConditional %353 %354 %355
+%354 = OpLabel
+%356 = OpLoad %mat2v2float %_1_m1
+%358 = OpCompositeConstruct %v2float %float_1 %float_2
+%359 = OpCompositeConstruct %v2float %float_3 %float_4
+%357 = OpCompositeConstruct %mat2v2float %358 %359
+%360 = OpCompositeExtract %v2float %356 0
+%361 = OpCompositeExtract %v2float %357 0
 %362 = OpFOrdEqual %v2bool %360 %361
 %363 = OpAll %bool %362
-%364 = OpLogicalAnd %bool %359 %363
-OpBranch %351
-%351 = OpLabel
-%365 = OpPhi %bool %false %332 %364 %350
-OpStore %_0_ok %365
-%368 = OpCompositeConstruct %v2float %float_6 %float_0
-%369 = OpCompositeConstruct %v2float %float_0 %float_6
-%367 = OpCompositeConstruct %mat2v2float %368 %369
-OpStore %_3_m4 %367
-%370 = OpLoad %bool %_0_ok
-OpSelectionMerge %372 None
-OpBranchConditional %370 %371 %372
-%371 = OpLabel
-%373 = OpLoad %mat2v2float %_3_m4
-%375 = OpCompositeConstruct %v2float %float_6 %float_0
-%376 = OpCompositeConstruct %v2float %float_0 %float_6
-%374 = OpCompositeConstruct %mat2v2float %375 %376
-%377 = OpCompositeExtract %v2float %373 0
-%378 = OpCompositeExtract %v2float %374 0
-%379 = OpFOrdEqual %v2bool %377 %378
-%380 = OpAll %bool %379
-%381 = OpCompositeExtract %v2float %373 1
-%382 = OpCompositeExtract %v2float %374 1
-%383 = OpFOrdEqual %v2bool %381 %382
-%384 = OpAll %bool %383
-%385 = OpLogicalAnd %bool %380 %384
-OpBranch %372
-%372 = OpLabel
-%386 = OpPhi %bool %false %351 %385 %371
-OpStore %_0_ok %386
-%387 = OpLoad %mat2v2float %_2_m3
-%388 = OpLoad %mat2v2float %_3_m4
-%389 = OpMatrixTimesMatrix %mat2v2float %387 %388
-OpStore %_2_m3 %389
-%390 = OpLoad %bool %_0_ok
-OpSelectionMerge %392 None
-OpBranchConditional %390 %391 %392
-%391 = OpLabel
-%393 = OpLoad %mat2v2float %_2_m3
-%395 = OpCompositeConstruct %v2float %float_6 %float_12
-%396 = OpCompositeConstruct %v2float %float_18 %float_24
-%394 = OpCompositeConstruct %mat2v2float %395 %396
-%397 = OpCompositeExtract %v2float %393 0
-%398 = OpCompositeExtract %v2float %394 0
-%399 = OpFOrdEqual %v2bool %397 %398
-%400 = OpAll %bool %399
-%401 = OpCompositeExtract %v2float %393 1
-%402 = OpCompositeExtract %v2float %394 1
-%403 = OpFOrdEqual %v2bool %401 %402
-%404 = OpAll %bool %403
-%405 = OpLogicalAnd %bool %400 %404
-OpBranch %392
-%392 = OpLabel
-%406 = OpPhi %bool %false %372 %405 %391
-OpStore %_0_ok %406
-%408 = OpAccessChain %_ptr_Function_v2float %_1_m1 %int_1
-%409 = OpLoad %v2float %408
-%410 = OpCompositeExtract %float %409 1
-%412 = OpCompositeConstruct %v2float %410 %float_0
-%413 = OpCompositeConstruct %v2float %float_0 %410
-%411 = OpCompositeConstruct %mat2v2float %412 %413
-OpStore %_4_m5 %411
-%414 = OpLoad %bool %_0_ok
-OpSelectionMerge %416 None
-OpBranchConditional %414 %415 %416
-%415 = OpLabel
-%417 = OpLoad %mat2v2float %_4_m5
-%419 = OpCompositeConstruct %v2float %float_4 %float_0
-%420 = OpCompositeConstruct %v2float %float_0 %float_4
-%418 = OpCompositeConstruct %mat2v2float %419 %420
+%364 = OpCompositeExtract %v2float %356 1
+%365 = OpCompositeExtract %v2float %357 1
+%366 = OpFOrdEqual %v2bool %364 %365
+%367 = OpAll %bool %366
+%368 = OpLogicalAnd %bool %363 %367
+OpBranch %355
+%355 = OpLabel
+%369 = OpPhi %bool %false %347 %368 %354
+OpStore %_0_ok %369
+%371 = OpLoad %mat2v2float %_1_m1
+OpStore %_2_m3 %371
+%372 = OpLoad %bool %_0_ok
+OpSelectionMerge %374 None
+OpBranchConditional %372 %373 %374
+%373 = OpLabel
+%375 = OpLoad %mat2v2float %_2_m3
+%377 = OpCompositeConstruct %v2float %float_1 %float_2
+%378 = OpCompositeConstruct %v2float %float_3 %float_4
+%376 = OpCompositeConstruct %mat2v2float %377 %378
+%379 = OpCompositeExtract %v2float %375 0
+%380 = OpCompositeExtract %v2float %376 0
+%381 = OpFOrdEqual %v2bool %379 %380
+%382 = OpAll %bool %381
+%383 = OpCompositeExtract %v2float %375 1
+%384 = OpCompositeExtract %v2float %376 1
+%385 = OpFOrdEqual %v2bool %383 %384
+%386 = OpAll %bool %385
+%387 = OpLogicalAnd %bool %382 %386
+OpBranch %374
+%374 = OpLabel
+%388 = OpPhi %bool %false %355 %387 %373
+OpStore %_0_ok %388
+%391 = OpCompositeConstruct %v2float %float_6 %float_0
+%392 = OpCompositeConstruct %v2float %float_0 %float_6
+%390 = OpCompositeConstruct %mat2v2float %391 %392
+OpStore %_3_m4 %390
+%393 = OpLoad %bool %_0_ok
+OpSelectionMerge %395 None
+OpBranchConditional %393 %394 %395
+%394 = OpLabel
+%396 = OpLoad %mat2v2float %_3_m4
+%398 = OpCompositeConstruct %v2float %float_6 %float_0
+%399 = OpCompositeConstruct %v2float %float_0 %float_6
+%397 = OpCompositeConstruct %mat2v2float %398 %399
+%400 = OpCompositeExtract %v2float %396 0
+%401 = OpCompositeExtract %v2float %397 0
+%402 = OpFOrdEqual %v2bool %400 %401
+%403 = OpAll %bool %402
+%404 = OpCompositeExtract %v2float %396 1
+%405 = OpCompositeExtract %v2float %397 1
+%406 = OpFOrdEqual %v2bool %404 %405
+%407 = OpAll %bool %406
+%408 = OpLogicalAnd %bool %403 %407
+OpBranch %395
+%395 = OpLabel
+%409 = OpPhi %bool %false %374 %408 %394
+OpStore %_0_ok %409
+%410 = OpLoad %mat2v2float %_2_m3
+%411 = OpLoad %mat2v2float %_3_m4
+%412 = OpMatrixTimesMatrix %mat2v2float %410 %411
+OpStore %_2_m3 %412
+%413 = OpLoad %bool %_0_ok
+OpSelectionMerge %415 None
+OpBranchConditional %413 %414 %415
+%414 = OpLabel
+%416 = OpLoad %mat2v2float %_2_m3
+%418 = OpCompositeConstruct %v2float %float_6 %float_12
+%419 = OpCompositeConstruct %v2float %float_18 %float_24
+%417 = OpCompositeConstruct %mat2v2float %418 %419
+%420 = OpCompositeExtract %v2float %416 0
 %421 = OpCompositeExtract %v2float %417 0
-%422 = OpCompositeExtract %v2float %418 0
-%423 = OpFOrdEqual %v2bool %421 %422
-%424 = OpAll %bool %423
+%422 = OpFOrdEqual %v2bool %420 %421
+%423 = OpAll %bool %422
+%424 = OpCompositeExtract %v2float %416 1
 %425 = OpCompositeExtract %v2float %417 1
-%426 = OpCompositeExtract %v2float %418 1
-%427 = OpFOrdEqual %v2bool %425 %426
-%428 = OpAll %bool %427
-%429 = OpLogicalAnd %bool %424 %428
-OpBranch %416
-%416 = OpLabel
-%430 = OpPhi %bool %false %392 %429 %415
-OpStore %_0_ok %430
-%431 = OpLoad %mat2v2float %_1_m1
-%432 = OpLoad %mat2v2float %_4_m5
-%433 = OpCompositeExtract %v2float %431 0
-%434 = OpCompositeExtract %v2float %432 0
-%435 = OpFAdd %v2float %433 %434
-%436 = OpCompositeExtract %v2float %431 1
-%437 = OpCompositeExtract %v2float %432 1
-%438 = OpFAdd %v2float %436 %437
-%439 = OpCompositeConstruct %mat2v2float %435 %438
-OpStore %_1_m1 %439
-%440 = OpLoad %bool %_0_ok
-OpSelectionMerge %442 None
-OpBranchConditional %440 %441 %442
-%441 = OpLabel
-%443 = OpLoad %mat2v2float %_1_m1
-%445 = OpCompositeConstruct %v2float %float_5 %float_2
-%446 = OpCompositeConstruct %v2float %float_3 %float_8
-%444 = OpCompositeConstruct %mat2v2float %445 %446
-%447 = OpCompositeExtract %v2float %443 0
-%448 = OpCompositeExtract %v2float %444 0
-%449 = OpFOrdEqual %v2bool %447 %448
-%450 = OpAll %bool %449
-%451 = OpCompositeExtract %v2float %443 1
-%452 = OpCompositeExtract %v2float %444 1
-%453 = OpFOrdEqual %v2bool %451 %452
-%454 = OpAll %bool %453
-%455 = OpLogicalAnd %bool %450 %454
-OpBranch %442
-%442 = OpLabel
-%456 = OpPhi %bool %false %416 %455 %441
-OpStore %_0_ok %456
-%459 = OpCompositeConstruct %v2float %float_5 %float_6
-%460 = OpCompositeConstruct %v2float %float_7 %float_8
-%458 = OpCompositeConstruct %mat2v2float %459 %460
-OpStore %_5_m7 %458
-%461 = OpLoad %bool %_0_ok
-OpSelectionMerge %463 None
-OpBranchConditional %461 %462 %463
-%462 = OpLabel
-%464 = OpLoad %mat2v2float %_5_m7
-%466 = OpCompositeConstruct %v2float %float_5 %float_6
-%467 = OpCompositeConstruct %v2float %float_7 %float_8
-%465 = OpCompositeConstruct %mat2v2float %466 %467
-%468 = OpCompositeExtract %v2float %464 0
-%469 = OpCompositeExtract %v2float %465 0
-%470 = OpFOrdEqual %v2bool %468 %469
-%471 = OpAll %bool %470
-%472 = OpCompositeExtract %v2float %464 1
-%473 = OpCompositeExtract %v2float %465 1
-%474 = OpFOrdEqual %v2bool %472 %473
-%475 = OpAll %bool %474
-%476 = OpLogicalAnd %bool %471 %475
-OpBranch %463
-%463 = OpLabel
-%477 = OpPhi %bool %false %442 %476 %462
-OpStore %_0_ok %477
-%480 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
-%481 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
-%482 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
-%479 = OpCompositeConstruct %mat3v3float %480 %481 %482
-OpStore %_6_m9 %479
-%483 = OpLoad %bool %_0_ok
-OpSelectionMerge %485 None
-OpBranchConditional %483 %484 %485
-%484 = OpLabel
-%486 = OpLoad %mat3v3float %_6_m9
-%488 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
-%489 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
-%490 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
-%487 = OpCompositeConstruct %mat3v3float %488 %489 %490
-%491 = OpCompositeExtract %v3float %486 0
-%492 = OpCompositeExtract %v3float %487 0
-%493 = OpFOrdEqual %v3bool %491 %492
+%426 = OpFOrdEqual %v2bool %424 %425
+%427 = OpAll %bool %426
+%428 = OpLogicalAnd %bool %423 %427
+OpBranch %415
+%415 = OpLabel
+%429 = OpPhi %bool %false %395 %428 %414
+OpStore %_0_ok %429
+%431 = OpAccessChain %_ptr_Function_v2float %_1_m1 %int_1
+%432 = OpLoad %v2float %431
+%433 = OpCompositeExtract %float %432 1
+%435 = OpCompositeConstruct %v2float %433 %float_0
+%436 = OpCompositeConstruct %v2float %float_0 %433
+%434 = OpCompositeConstruct %mat2v2float %435 %436
+OpStore %_4_m5 %434
+%437 = OpLoad %bool %_0_ok
+OpSelectionMerge %439 None
+OpBranchConditional %437 %438 %439
+%438 = OpLabel
+%440 = OpLoad %mat2v2float %_4_m5
+%442 = OpCompositeConstruct %v2float %float_4 %float_0
+%443 = OpCompositeConstruct %v2float %float_0 %float_4
+%441 = OpCompositeConstruct %mat2v2float %442 %443
+%444 = OpCompositeExtract %v2float %440 0
+%445 = OpCompositeExtract %v2float %441 0
+%446 = OpFOrdEqual %v2bool %444 %445
+%447 = OpAll %bool %446
+%448 = OpCompositeExtract %v2float %440 1
+%449 = OpCompositeExtract %v2float %441 1
+%450 = OpFOrdEqual %v2bool %448 %449
+%451 = OpAll %bool %450
+%452 = OpLogicalAnd %bool %447 %451
+OpBranch %439
+%439 = OpLabel
+%453 = OpPhi %bool %false %415 %452 %438
+OpStore %_0_ok %453
+%454 = OpLoad %mat2v2float %_1_m1
+%455 = OpLoad %mat2v2float %_4_m5
+%456 = OpCompositeExtract %v2float %454 0
+%457 = OpCompositeExtract %v2float %455 0
+%458 = OpFAdd %v2float %456 %457
+%459 = OpCompositeExtract %v2float %454 1
+%460 = OpCompositeExtract %v2float %455 1
+%461 = OpFAdd %v2float %459 %460
+%462 = OpCompositeConstruct %mat2v2float %458 %461
+OpStore %_1_m1 %462
+%463 = OpLoad %bool %_0_ok
+OpSelectionMerge %465 None
+OpBranchConditional %463 %464 %465
+%464 = OpLabel
+%466 = OpLoad %mat2v2float %_1_m1
+%468 = OpCompositeConstruct %v2float %float_5 %float_2
+%469 = OpCompositeConstruct %v2float %float_3 %float_8
+%467 = OpCompositeConstruct %mat2v2float %468 %469
+%470 = OpCompositeExtract %v2float %466 0
+%471 = OpCompositeExtract %v2float %467 0
+%472 = OpFOrdEqual %v2bool %470 %471
+%473 = OpAll %bool %472
+%474 = OpCompositeExtract %v2float %466 1
+%475 = OpCompositeExtract %v2float %467 1
+%476 = OpFOrdEqual %v2bool %474 %475
+%477 = OpAll %bool %476
+%478 = OpLogicalAnd %bool %473 %477
+OpBranch %465
+%465 = OpLabel
+%479 = OpPhi %bool %false %439 %478 %464
+OpStore %_0_ok %479
+%482 = OpCompositeConstruct %v2float %float_5 %float_6
+%483 = OpCompositeConstruct %v2float %float_7 %float_8
+%481 = OpCompositeConstruct %mat2v2float %482 %483
+OpStore %_5_m7 %481
+%484 = OpLoad %bool %_0_ok
+OpSelectionMerge %486 None
+OpBranchConditional %484 %485 %486
+%485 = OpLabel
+%487 = OpLoad %mat2v2float %_5_m7
+%489 = OpCompositeConstruct %v2float %float_5 %float_6
+%490 = OpCompositeConstruct %v2float %float_7 %float_8
+%488 = OpCompositeConstruct %mat2v2float %489 %490
+%491 = OpCompositeExtract %v2float %487 0
+%492 = OpCompositeExtract %v2float %488 0
+%493 = OpFOrdEqual %v2bool %491 %492
 %494 = OpAll %bool %493
-%495 = OpCompositeExtract %v3float %486 1
-%496 = OpCompositeExtract %v3float %487 1
-%497 = OpFOrdEqual %v3bool %495 %496
+%495 = OpCompositeExtract %v2float %487 1
+%496 = OpCompositeExtract %v2float %488 1
+%497 = OpFOrdEqual %v2bool %495 %496
 %498 = OpAll %bool %497
 %499 = OpLogicalAnd %bool %494 %498
-%500 = OpCompositeExtract %v3float %486 2
-%501 = OpCompositeExtract %v3float %487 2
-%502 = OpFOrdEqual %v3bool %500 %501
-%503 = OpAll %bool %502
-%504 = OpLogicalAnd %bool %499 %503
-OpBranch %485
-%485 = OpLabel
-%505 = OpPhi %bool %false %463 %504 %484
-OpStore %_0_ok %505
-%508 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
-%509 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
-%510 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
-%511 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
-%507 = OpCompositeConstruct %mat4v4float %508 %509 %510 %511
-OpStore %_7_m10 %507
-%512 = OpLoad %bool %_0_ok
-OpSelectionMerge %514 None
-OpBranchConditional %512 %513 %514
-%513 = OpLabel
-%515 = OpLoad %mat4v4float %_7_m10
-%517 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
-%518 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
-%519 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
-%520 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
-%516 = OpCompositeConstruct %mat4v4float %517 %518 %519 %520
-%521 = OpCompositeExtract %v4float %515 0
-%522 = OpCompositeExtract %v4float %516 0
-%523 = OpFOrdEqual %v4bool %521 %522
-%524 = OpAll %bool %523
-%525 = OpCompositeExtract %v4float %515 1
-%526 = OpCompositeExtract %v4float %516 1
-%527 = OpFOrdEqual %v4bool %525 %526
-%528 = OpAll %bool %527
-%529 = OpLogicalAnd %bool %524 %528
-%530 = OpCompositeExtract %v4float %515 2
-%531 = OpCompositeExtract %v4float %516 2
-%532 = OpFOrdEqual %v4bool %530 %531
-%533 = OpAll %bool %532
-%534 = OpLogicalAnd %bool %529 %533
-%535 = OpCompositeExtract %v4float %515 3
-%536 = OpCompositeExtract %v4float %516 3
-%537 = OpFOrdEqual %v4bool %535 %536
-%538 = OpAll %bool %537
-%539 = OpLogicalAnd %bool %534 %538
-OpBranch %514
-%514 = OpLabel
-%540 = OpPhi %bool %false %485 %539 %513
-OpStore %_0_ok %540
-%543 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
-%544 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
-%545 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
-%546 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
-%542 = OpCompositeConstruct %mat4v4float %543 %544 %545 %546
-OpStore %_8_m11 %542
-%547 = OpLoad %mat4v4float %_8_m11
-%548 = OpLoad %mat4v4float %_7_m10
-%549 = OpCompositeExtract %v4float %547 0
-%550 = OpCompositeExtract %v4float %548 0
-%551 = OpFSub %v4float %549 %550
-%552 = OpCompositeExtract %v4float %547 1
-%553 = OpCompositeExtract %v4float %548 1
-%554 = OpFSub %v4float %552 %553
-%555 = OpCompositeExtract %v4float %547 2
-%556 = OpCompositeExtract %v4float %548 2
-%557 = OpFSub %v4float %555 %556
-%558 = OpCompositeExtract %v4float %547 3
-%559 = OpCompositeExtract %v4float %548 3
-%560 = OpFSub %v4float %558 %559
-%561 = OpCompositeConstruct %mat4v4float %551 %554 %557 %560
-OpStore %_8_m11 %561
-%562 = OpLoad %bool %_0_ok
-OpSelectionMerge %564 None
-OpBranchConditional %562 %563 %564
-%563 = OpLabel
-%565 = OpLoad %mat4v4float %_8_m11
-%567 = OpCompositeConstruct %v4float %float_9 %float_20 %float_20 %float_20
-%568 = OpCompositeConstruct %v4float %float_20 %float_9 %float_20 %float_20
-%569 = OpCompositeConstruct %v4float %float_20 %float_20 %float_9 %float_20
-%570 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_9
-%566 = OpCompositeConstruct %mat4v4float %567 %568 %569 %570
-%571 = OpCompositeExtract %v4float %565 0
-%572 = OpCompositeExtract %v4float %566 0
-%573 = OpFOrdEqual %v4bool %571 %572
-%574 = OpAll %bool %573
-%575 = OpCompositeExtract %v4float %565 1
-%576 = OpCompositeExtract %v4float %566 1
-%577 = OpFOrdEqual %v4bool %575 %576
-%578 = OpAll %bool %577
-%579 = OpLogicalAnd %bool %574 %578
-%580 = OpCompositeExtract %v4float %565 2
-%581 = OpCompositeExtract %v4float %566 2
-%582 = OpFOrdEqual %v4bool %580 %581
-%583 = OpAll %bool %582
-%584 = OpLogicalAnd %bool %579 %583
-%585 = OpCompositeExtract %v4float %565 3
-%586 = OpCompositeExtract %v4float %566 3
-%587 = OpFOrdEqual %v4bool %585 %586
-%588 = OpAll %bool %587
-%589 = OpLogicalAnd %bool %584 %588
-OpBranch %564
-%564 = OpLabel
-%590 = OpPhi %bool %false %514 %589 %563
-OpStore %_0_ok %590
-%591 = OpLoad %bool %_0_ok
-OpSelectionMerge %593 None
-OpBranchConditional %591 %592 %593
-%592 = OpLabel
-%594 = OpFunctionCall %bool %test_half_b
-OpBranch %593
-%593 = OpLabel
-%595 = OpPhi %bool %false %564 %594 %592
-OpSelectionMerge %600 None
-OpBranchConditional %595 %598 %599
-%598 = OpLabel
-%601 = OpAccessChain %_ptr_Uniform_v4float %11 %int_0
-%604 = OpLoad %v4float %601
-OpStore %596 %604
-OpBranch %600
-%599 = OpLabel
-%605 = OpAccessChain %_ptr_Uniform_v4float %11 %int_1
-%606 = OpLoad %v4float %605
-OpStore %596 %606
-OpBranch %600
-%600 = OpLabel
-%607 = OpLoad %v4float %596
-OpReturnValue %607
+OpBranch %486
+%486 = OpLabel
+%500 = OpPhi %bool %false %465 %499 %485
+OpStore %_0_ok %500
+%503 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
+%504 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
+%505 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
+%502 = OpCompositeConstruct %mat3v3float %503 %504 %505
+OpStore %_6_m9 %502
+%506 = OpLoad %bool %_0_ok
+OpSelectionMerge %508 None
+OpBranchConditional %506 %507 %508
+%507 = OpLabel
+%509 = OpLoad %mat3v3float %_6_m9
+%511 = OpCompositeConstruct %v3float %float_9 %float_0 %float_0
+%512 = OpCompositeConstruct %v3float %float_0 %float_9 %float_0
+%513 = OpCompositeConstruct %v3float %float_0 %float_0 %float_9
+%510 = OpCompositeConstruct %mat3v3float %511 %512 %513
+%514 = OpCompositeExtract %v3float %509 0
+%515 = OpCompositeExtract %v3float %510 0
+%516 = OpFOrdEqual %v3bool %514 %515
+%517 = OpAll %bool %516
+%518 = OpCompositeExtract %v3float %509 1
+%519 = OpCompositeExtract %v3float %510 1
+%520 = OpFOrdEqual %v3bool %518 %519
+%521 = OpAll %bool %520
+%522 = OpLogicalAnd %bool %517 %521
+%523 = OpCompositeExtract %v3float %509 2
+%524 = OpCompositeExtract %v3float %510 2
+%525 = OpFOrdEqual %v3bool %523 %524
+%526 = OpAll %bool %525
+%527 = OpLogicalAnd %bool %522 %526
+OpBranch %508
+%508 = OpLabel
+%528 = OpPhi %bool %false %486 %527 %507
+OpStore %_0_ok %528
+%531 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
+%532 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
+%533 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
+%534 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
+%530 = OpCompositeConstruct %mat4v4float %531 %532 %533 %534
+OpStore %_7_m10 %530
+%535 = OpLoad %bool %_0_ok
+OpSelectionMerge %537 None
+OpBranchConditional %535 %536 %537
+%536 = OpLabel
+%538 = OpLoad %mat4v4float %_7_m10
+%540 = OpCompositeConstruct %v4float %float_11 %float_0 %float_0 %float_0
+%541 = OpCompositeConstruct %v4float %float_0 %float_11 %float_0 %float_0
+%542 = OpCompositeConstruct %v4float %float_0 %float_0 %float_11 %float_0
+%543 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_11
+%539 = OpCompositeConstruct %mat4v4float %540 %541 %542 %543
+%544 = OpCompositeExtract %v4float %538 0
+%545 = OpCompositeExtract %v4float %539 0
+%546 = OpFOrdEqual %v4bool %544 %545
+%547 = OpAll %bool %546
+%548 = OpCompositeExtract %v4float %538 1
+%549 = OpCompositeExtract %v4float %539 1
+%550 = OpFOrdEqual %v4bool %548 %549
+%551 = OpAll %bool %550
+%552 = OpLogicalAnd %bool %547 %551
+%553 = OpCompositeExtract %v4float %538 2
+%554 = OpCompositeExtract %v4float %539 2
+%555 = OpFOrdEqual %v4bool %553 %554
+%556 = OpAll %bool %555
+%557 = OpLogicalAnd %bool %552 %556
+%558 = OpCompositeExtract %v4float %538 3
+%559 = OpCompositeExtract %v4float %539 3
+%560 = OpFOrdEqual %v4bool %558 %559
+%561 = OpAll %bool %560
+%562 = OpLogicalAnd %bool %557 %561
+OpBranch %537
+%537 = OpLabel
+%563 = OpPhi %bool %false %508 %562 %536
+OpStore %_0_ok %563
+%566 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
+%567 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
+%568 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
+%569 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_20
+%565 = OpCompositeConstruct %mat4v4float %566 %567 %568 %569
+OpStore %_8_m11 %565
+%570 = OpLoad %mat4v4float %_8_m11
+%571 = OpLoad %mat4v4float %_7_m10
+%572 = OpCompositeExtract %v4float %570 0
+%573 = OpCompositeExtract %v4float %571 0
+%574 = OpFSub %v4float %572 %573
+%575 = OpCompositeExtract %v4float %570 1
+%576 = OpCompositeExtract %v4float %571 1
+%577 = OpFSub %v4float %575 %576
+%578 = OpCompositeExtract %v4float %570 2
+%579 = OpCompositeExtract %v4float %571 2
+%580 = OpFSub %v4float %578 %579
+%581 = OpCompositeExtract %v4float %570 3
+%582 = OpCompositeExtract %v4float %571 3
+%583 = OpFSub %v4float %581 %582
+%584 = OpCompositeConstruct %mat4v4float %574 %577 %580 %583
+OpStore %_8_m11 %584
+%585 = OpLoad %bool %_0_ok
+OpSelectionMerge %587 None
+OpBranchConditional %585 %586 %587
+%586 = OpLabel
+%588 = OpLoad %mat4v4float %_8_m11
+%590 = OpCompositeConstruct %v4float %float_9 %float_20 %float_20 %float_20
+%591 = OpCompositeConstruct %v4float %float_20 %float_9 %float_20 %float_20
+%592 = OpCompositeConstruct %v4float %float_20 %float_20 %float_9 %float_20
+%593 = OpCompositeConstruct %v4float %float_20 %float_20 %float_20 %float_9
+%589 = OpCompositeConstruct %mat4v4float %590 %591 %592 %593
+%594 = OpCompositeExtract %v4float %588 0
+%595 = OpCompositeExtract %v4float %589 0
+%596 = OpFOrdEqual %v4bool %594 %595
+%597 = OpAll %bool %596
+%598 = OpCompositeExtract %v4float %588 1
+%599 = OpCompositeExtract %v4float %589 1
+%600 = OpFOrdEqual %v4bool %598 %599
+%601 = OpAll %bool %600
+%602 = OpLogicalAnd %bool %597 %601
+%603 = OpCompositeExtract %v4float %588 2
+%604 = OpCompositeExtract %v4float %589 2
+%605 = OpFOrdEqual %v4bool %603 %604
+%606 = OpAll %bool %605
+%607 = OpLogicalAnd %bool %602 %606
+%608 = OpCompositeExtract %v4float %588 3
+%609 = OpCompositeExtract %v4float %589 3
+%610 = OpFOrdEqual %v4bool %608 %609
+%611 = OpAll %bool %610
+%612 = OpLogicalAnd %bool %607 %611
+OpBranch %587
+%587 = OpLabel
+%613 = OpPhi %bool %false %537 %612 %586
+OpStore %_0_ok %613
+%614 = OpLoad %bool %_0_ok
+OpSelectionMerge %616 None
+OpBranchConditional %614 %615 %616
+%615 = OpLabel
+%617 = OpFunctionCall %bool %test_half_b
+OpBranch %616
+%616 = OpLabel
+%618 = OpPhi %bool %false %587 %617 %615
+OpSelectionMerge %620 None
+OpBranchConditional %618 %619 %620
+%619 = OpLabel
+%621 = OpFunctionCall %bool %test_comma_b
+OpBranch %620
+%620 = OpLabel
+%622 = OpPhi %bool %false %616 %621 %619
+OpSelectionMerge %627 None
+OpBranchConditional %622 %625 %626
+%625 = OpLabel
+%628 = OpAccessChain %_ptr_Uniform_v4float %12 %int_0
+%631 = OpLoad %v4float %628
+OpStore %623 %631
+OpBranch %627
+%626 = OpLabel
+%632 = OpAccessChain %_ptr_Uniform_v4float %12 %int_1
+%633 = OpLoad %v4float %632
+OpStore %623 %633
+OpBranch %627
+%627 = OpLabel
+%634 = OpLoad %v4float %623
+OpReturnValue %634
 OpFunctionEnd
diff --git a/tests/sksl/shared/Matrices.glsl b/tests/sksl/shared/Matrices.glsl
index 48e0f84..3cf9fb7 100644
--- a/tests/sksl/shared/Matrices.glsl
+++ b/tests/sksl/shared/Matrices.glsl
@@ -27,6 +27,11 @@
     ok = ok && m11 == mat4(9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0);
     return ok;
 }
+bool test_comma_b() {
+    mat2 x;
+    mat2 y;
+    return ((x = mat2(1.0, 2.0, 3.0, 4.0) , y = 0.5 * mat2(2.0, 4.0, 6.0, 8.0)) , x == y);
+}
 vec4 main() {
     bool _0_ok = true;
     mat2 _1_m1 = mat2(1.0, 2.0, 3.0, 4.0);
@@ -50,5 +55,5 @@
     mat4 _8_m11 = mat4(20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0);
     _8_m11 -= _7_m10;
     _0_ok = _0_ok && _8_m11 == mat4(9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0);
-    return _0_ok && test_half_b() ? colorGreen : colorRed;
+    return (_0_ok && test_half_b()) && test_comma_b() ? colorGreen : colorRed;
 }
diff --git a/tests/sksl/shared/Matrices.metal b/tests/sksl/shared/Matrices.metal
index a862885..5344adc 100644
--- a/tests/sksl/shared/Matrices.metal
+++ b/tests/sksl/shared/Matrices.metal
@@ -63,6 +63,11 @@
     ok = ok && m11 == float4x4(float4(9.0, 20.0, 20.0, 20.0), float4(20.0, 9.0, 20.0, 20.0), float4(20.0, 20.0, 9.0, 20.0), float4(20.0, 20.0, 20.0, 9.0));
     return ok;
 }
+bool test_comma_b() {
+    float2x2 x;
+    float2x2 y;
+    return ((x = float2x2(float2(1.0, 2.0), float2(3.0, 4.0)) , y = 0.5 * float2x2(float2(2.0, 4.0), float2(6.0, 8.0))) , x == y);
+}
 fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
     Outputs _out;
     (void)_out;
@@ -88,6 +93,6 @@
     float4x4 _8_m11 = float4x4(float4(20.0, 20.0, 20.0, 20.0), float4(20.0, 20.0, 20.0, 20.0), float4(20.0, 20.0, 20.0, 20.0), float4(20.0, 20.0, 20.0, 20.0));
     _8_m11 -= _7_m10;
     _0_ok = _0_ok && _8_m11 == float4x4(float4(9.0, 20.0, 20.0, 20.0), float4(20.0, 9.0, 20.0, 20.0), float4(20.0, 20.0, 9.0, 20.0), float4(20.0, 20.0, 20.0, 9.0));
-    _out.sk_FragColor = _0_ok && test_half_b() ? _uniforms.colorGreen : _uniforms.colorRed;
+    _out.sk_FragColor = (_0_ok && test_half_b()) && test_comma_b() ? _uniforms.colorGreen : _uniforms.colorRed;
     return _out;
 }