diff --git a/src/tint/resolver/array_accessor_test.cc b/src/tint/resolver/array_accessor_test.cc index a07f6dfd2a..f63bb1f0ae 100644 --- a/src/tint/resolver/array_accessor_test.cc +++ b/src/tint/resolver/array_accessor_test.cc @@ -102,7 +102,7 @@ TEST_F(ResolverIndexAccessorTest, Matrix_BothDimension_Dynamic) { TEST_F(ResolverIndexAccessorTest, Matrix) { GlobalVar("my_var", ty.mat2x3(), ast::StorageClass::kPrivate); - auto* acc = IndexAccessor("my_var", 2_i); + auto* acc = IndexAccessor("my_var", 1_i); WrapInFunction(acc); EXPECT_TRUE(r()->Resolve()) << r()->error(); @@ -123,7 +123,7 @@ TEST_F(ResolverIndexAccessorTest, Matrix) { TEST_F(ResolverIndexAccessorTest, Matrix_BothDimensions) { GlobalVar("my_var", ty.mat2x3(), ast::StorageClass::kPrivate); - auto* acc = IndexAccessor(IndexAccessor("my_var", 2_i), 1_i); + auto* acc = IndexAccessor(IndexAccessor("my_var", 0_i), 1_i); WrapInFunction(acc); EXPECT_TRUE(r()->Resolve()) << r()->error(); diff --git a/src/tint/resolver/materialize_test.cc b/src/tint/resolver/materialize_test.cc index 239efd59f0..af22c53852 100644 --- a/src/tint/resolver/materialize_test.cc +++ b/src/tint/resolver/materialize_test.cc @@ -954,14 +954,6 @@ constexpr Method kScalarMethods[] = { Method::kBitcastF32Arg, }; -/// Methods that support abstract-integer materialization -/// Note: Doesn't contain kWorkgroupSize or kArrayLength as they have tighter constraints on the -/// range of allowed integer values. -constexpr Method kAIntMethods[] = { - Method::kSwitch, - Method::kIndex, -}; - /// Methods that support vector materialization constexpr Method kVectorMethods[] = { Method::kLet, Method::kVar, Method::kBuiltinArg, Method::kBitcastVec3F32Arg, @@ -1039,11 +1031,36 @@ INSTANTIATE_TEST_SUITE_P( Types(AFloat(-kSubnormalF32), -kSubnormalF32), // }))); +INSTANTIATE_TEST_SUITE_P(MaterializeAInt, + MaterializeAbstractNumericToDefaultType, + testing::Combine(testing::Values(Expectation::kMaterialize), + testing::Values(Method::kWorkgroupSize, + Method::kArrayLength), + testing::ValuesIn(std::vector{ + Types(1_a, 1.0), // + Types(10_a, 10.0), // + Types(100_a, 100.0), // + Types(1000_a, 1000.0), // + Types(10000_a, 10000.0), // + Types(65535_a, 65535.0), // + }))); + +INSTANTIATE_TEST_SUITE_P(MaterializeAIntIndex, + MaterializeAbstractNumericToDefaultType, + testing::Combine(testing::Values(Expectation::kMaterialize), + testing::Values(Method::kIndex), + testing::ValuesIn(std::vector{ + Types(0_a, 0.0), // + Types(1_a, 1.0), // + Types(2_a, 2.0), // + Types(3_a, 3.0), // + }))); + INSTANTIATE_TEST_SUITE_P( - MaterializeAInt, + MaterializeAIntSwitch, MaterializeAbstractNumericToDefaultType, testing::Combine(testing::Values(Expectation::kMaterialize), - testing::ValuesIn(kAIntMethods), + testing::Values(Method::kSwitch), testing::ValuesIn(std::vector{ Types(0_a, 0.0), // Types(10_a, 10.0), // @@ -1133,7 +1150,10 @@ INSTANTIATE_TEST_SUITE_P( AIntValueCannotBeRepresented, MaterializeAbstractNumericToDefaultType, testing::Combine(testing::Values(Expectation::kValueCannotBeRepresented), - testing::ValuesIn(kAIntMethods), + testing::Values(Method::kWorkgroupSize, + Method::kArrayLength, + Method::kSwitch, + Method::kIndex), testing::ValuesIn(std::vector{ Types(0_a, static_cast(i32::kHighestValue) + 1), // Types(0_a, static_cast(i32::kLowestValue) - 1), // diff --git a/src/tint/resolver/variable_test.cc b/src/tint/resolver/variable_test.cc index 52d240ca93..884214171e 100644 --- a/src/tint/resolver/variable_test.cc +++ b/src/tint/resolver/variable_test.cc @@ -466,14 +466,14 @@ TEST_F(ResolverVariableTest, LocalLet_InheritsAccessFromOriginatingVariable) { // } // @group(0) @binding(0) var s : S; // fn f() { - // let p = &s.inner.arr[4]; + // let p = &s.inner.arr[3]; // } auto* inner = Structure("Inner", utils::Vector{Member("arr", ty.array())}); auto* buf = Structure("S", utils::Vector{Member("inner", ty.Of(inner))}); auto* storage = GlobalVar("s", ty.Of(buf), ast::StorageClass::kStorage, ast::Access::kReadWrite, Binding(0_a), Group(0_a)); - auto* expr = IndexAccessor(MemberAccessor(MemberAccessor(storage, "inner"), "arr"), 4_i); + auto* expr = IndexAccessor(MemberAccessor(MemberAccessor(storage, "inner"), "arr"), 3_i); auto* ptr = Let("p", AddressOf(expr)); WrapInFunction(ptr); diff --git a/src/tint/transform/std140_test.cc b/src/tint/transform/std140_test.cc index 4681cdf9df..57e23e6d37 100644 --- a/src/tint/transform/std140_test.cc +++ b/src/tint/transform/std140_test.cc @@ -1584,7 +1584,7 @@ fn f() { let l_a_3_a_1 : Inner = a[3].a[1]; let l_a_0_a_2_m : mat4x2 = a[0].a[2].m; let l_a_1_a_3_m_0 : vec2 = a[1].a[3].m[0]; - let l_a_2_a_0_m_1_2 : f32 = a[2].a[0].m[1][2]; + let l_a_2_a_0_m_1_0 : f32 = a[2].a[0].m[1][0]; } )"; @@ -1647,7 +1647,7 @@ fn f() { let l_a_3_a_1 : Inner = conv_Inner(a[3u].a[1u]); let l_a_0_a_2_m : mat4x2 = load_a_0_a_2_m(); let l_a_1_a_3_m_0 : vec2 = a[1u].a[3u].m_0; - let l_a_2_a_0_m_1_2 : f32 = a[2u].a[0u].m_1[2u]; + let l_a_2_a_0_m_1_0 : f32 = a[2u].a[0u].m_1[0u]; } )"; @@ -2029,7 +2029,7 @@ struct S { @group(0) @binding(0) var u : S; fn f() { - for (var i = u32(u.m[0][1]); i < u32(u.m[i][2]); i += u32(u.m[1][i])) { + for (var i = u32(u.m[0][0]); i < u32(u.m[i][1]); i += u32(u.m[1][i])) { } } )"; @@ -2050,16 +2050,16 @@ struct S_std140 { @group(0) @binding(0) var u : S_std140; -fn load_u_m_p0_2(p0 : u32) -> f32 { +fn load_u_m_p0_1(p0 : u32) -> f32 { switch(p0) { case 0u: { - return u.m_0[2u]; + return u.m_0[1u]; } case 1u: { - return u.m_1[2u]; + return u.m_1[1u]; } case 2u: { - return u.m_2[2u]; + return u.m_2[1u]; } default: { return f32(); @@ -2068,7 +2068,7 @@ fn load_u_m_p0_2(p0 : u32) -> f32 { } fn f() { - for(var i = u32(u.m_0[1u]); (i < u32(load_u_m_p0_2(u32(i)))); i += u32(u.m_1[i])) { + for(var i = u32(u.m_0[0u]); (i < u32(load_u_m_p0_1(u32(i)))); i += u32(u.m_1[i])) { } } )"; diff --git a/src/tint/writer/spirv/builder_accessor_expression_test.cc b/src/tint/writer/spirv/builder_accessor_expression_test.cc index ae755bb6cb..5c0671792b 100644 --- a/src/tint/writer/spirv/builder_accessor_expression_test.cc +++ b/src/tint/writer/spirv/builder_accessor_expression_test.cc @@ -653,11 +653,11 @@ OpReturn Validate(b); } -TEST_F(BuilderTest, Runtime_IndexAccessor_Nested_Array_f32) { - // var pos : array, 3u>; +TEST_F(BuilderTest, Runtime_IndexAccessor_Array_Vec3_f32) { + // var pos : array, 3u>; // var x = pos[1u][2u]; - auto* pos = Var("pos", ty.array(ty.vec2(), 3_u)); + auto* pos = Var("pos", ty.array(ty.vec3(), 3_a)); auto* x = Var("x", IndexAccessor(IndexAccessor(pos, 1_u), 2_u)); WrapInFunction(pos, x); @@ -668,7 +668,7 @@ TEST_F(BuilderTest, Runtime_IndexAccessor_Nested_Array_f32) { EXPECT_EQ(DumpInstructions(b.types()), R"(%2 = OpTypeVoid %1 = OpTypeFunction %2 %9 = OpTypeFloat 32 -%8 = OpTypeVector %9 2 +%8 = OpTypeVector %9 3 %10 = OpTypeInt 32 0 %11 = OpConstant %10 3 %7 = OpTypeArray %8 %11 @@ -693,11 +693,11 @@ OpReturn } TEST_F(BuilderTest, Dynamic_IndexAccessor_Nested_Array_f32) { - // var pos : array, 3u>; + // var pos : array, 3u>; // var one = 1u; // var x = pos[one][2u]; - auto* pos = Var("pos", ty.array(ty.vec2(), 3_u)); + auto* pos = Var("pos", ty.array(ty.array(), 3_u)); auto* one = Var("one", Expr(2_u)); auto* x = Var("x", IndexAccessor(IndexAccessor(pos, "one"), 2_u)); WrapInFunction(pos, one, x); @@ -709,27 +709,28 @@ TEST_F(BuilderTest, Dynamic_IndexAccessor_Nested_Array_f32) { EXPECT_EQ(DumpInstructions(b.types()), R"(%2 = OpTypeVoid %1 = OpTypeFunction %2 %9 = OpTypeFloat 32 -%8 = OpTypeVector %9 2 %10 = OpTypeInt 32 0 -%11 = OpConstant %10 3 -%7 = OpTypeArray %8 %11 +%11 = OpConstant %10 4 +%8 = OpTypeArray %9 %11 +%12 = OpConstant %10 3 +%7 = OpTypeArray %8 %12 %6 = OpTypePointer Function %7 -%12 = OpConstantNull %7 -%13 = OpConstant %10 2 -%15 = OpTypePointer Function %10 -%16 = OpConstantNull %10 -%18 = OpTypePointer Function %9 -%22 = OpConstantNull %9 +%13 = OpConstantNull %7 +%14 = OpConstant %10 2 +%16 = OpTypePointer Function %10 +%17 = OpConstantNull %10 +%19 = OpTypePointer Function %9 +%23 = OpConstantNull %9 )"); - EXPECT_EQ(DumpInstructions(b.functions()[0].variables()), R"(%5 = OpVariable %6 Function %12 -%14 = OpVariable %15 Function %16 -%21 = OpVariable %18 Function %22 + EXPECT_EQ(DumpInstructions(b.functions()[0].variables()), R"(%5 = OpVariable %6 Function %13 +%15 = OpVariable %16 Function %17 +%22 = OpVariable %19 Function %23 )"); - EXPECT_EQ(DumpInstructions(b.functions()[0].instructions()), R"(OpStore %14 %13 -%17 = OpLoad %10 %14 -%19 = OpAccessChain %18 %5 %17 %13 -%20 = OpLoad %9 %19 -OpStore %21 %20 + EXPECT_EQ(DumpInstructions(b.functions()[0].instructions()), R"(OpStore %15 %14 +%18 = OpLoad %10 %15 +%20 = OpAccessChain %19 %5 %18 %14 +%21 = OpLoad %9 %20 +OpStore %22 %21 OpReturn )"); diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm b/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm deleted file mode 100644 index 6b6223de10..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm +++ /dev/null @@ -1,185 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %_GLF_color - OpExecutionMode %main OriginUpperLeft - OpSource ESSL 320 - OpName %main "main" - OpName %m43 "m43" - OpName %buf1 "buf1" - OpMemberName %buf1 0 "_GLF_uniform_float_values" - OpName %_ "" - OpName %buf0 "buf0" - OpMemberName %buf0 0 "_GLF_uniform_int_values" - OpName %__0 "" - OpName %sums "sums" - OpName %i "i" - OpName %a "a" - OpName %_GLF_color "_GLF_color" - OpDecorate %_arr_float_uint_3 ArrayStride 16 - OpMemberDecorate %buf1 0 Offset 0 - OpDecorate %buf1 Block - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 1 - OpDecorate %_arr_int_uint_4 ArrayStride 16 - OpMemberDecorate %buf0 0 Offset 0 - OpDecorate %buf0 Block - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 0 - OpDecorate %_GLF_color Location 0 - %void = OpTypeVoid - %15 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v3float = OpTypeVector %float 3 -%mat4v3float = OpTypeMatrix %v3float 4 -%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float - %uint = OpTypeInt 32 0 - %uint_3 = OpConstant %uint 3 -%_arr_float_uint_3 = OpTypeArray %float %uint_3 - %buf1 = OpTypeStruct %_arr_float_uint_3 -%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1 - %_ = OpVariable %_ptr_Uniform_buf1 Uniform - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %int_1 = OpConstant %int 1 -%_ptr_Uniform_float = OpTypePointer Uniform %float - %float_1 = OpConstant %float 1 - %float_0 = OpConstant %float 0 - %uint_4 = OpConstant %uint 4 -%_arr_int_uint_4 = OpTypeArray %int %uint_4 - %buf0 = OpTypeStruct %_arr_int_uint_4 -%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0 - %__0 = OpVariable %_ptr_Uniform_buf0 Uniform -%_ptr_Uniform_int = OpTypePointer Uniform %int -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Function__arr_float_uint_3 = OpTypePointer Function %_arr_float_uint_3 -%_ptr_Function_int = OpTypePointer Function %int - %int_3 = OpConstant %int 3 - %bool = OpTypeBool - %int_4 = OpConstant %int 4 - %int_2 = OpConstant %int 2 - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %_GLF_color = OpVariable %_ptr_Output_v4float Output - %41 = OpConstantComposite %v3float %float_0 %float_0 %float_0 - %main = OpFunction %void None %15 - %42 = OpLabel - %m43 = OpVariable %_ptr_Function_mat4v3float Function - %sums = OpVariable %_ptr_Function__arr_float_uint_3 Function - %i = OpVariable %_ptr_Function_int Function - %a = OpVariable %_ptr_Function_int Function - %43 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1 - %44 = OpLoad %float %43 - %45 = OpCompositeConstruct %v3float %44 %float_0 %float_0 - %46 = OpCompositeConstruct %v3float %float_0 %44 %float_0 - %47 = OpCompositeConstruct %v3float %float_0 %float_0 %44 - %48 = OpCompositeConstruct %v3float %float_0 %float_0 %float_0 - %49 = OpCompositeConstruct %mat4v3float %45 %46 %47 %41 - OpStore %m43 %49 - %50 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %51 = OpLoad %int %50 - %52 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %53 = OpLoad %int %52 - %54 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 - %55 = OpLoad %float %54 - %56 = OpAccessChain %_ptr_Function_float %m43 %51 %53 - OpStore %56 %55 - %57 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 - %58 = OpLoad %float %57 - %59 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 - %60 = OpLoad %float %59 - %61 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 - %62 = OpLoad %float %61 - %63 = OpCompositeConstruct %_arr_float_uint_3 %58 %60 %62 - OpStore %sums %63 - %64 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %65 = OpLoad %int %64 - OpStore %i %65 - OpBranch %66 - %66 = OpLabel - %67 = OpPhi %int %65 %42 %68 %69 - OpLoopMerge %70 %69 None - OpBranch %71 - %71 = OpLabel - %72 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_3 - %73 = OpLoad %int %72 - %74 = OpSLessThan %bool %67 %73 - OpBranchConditional %74 %75 %70 - %75 = OpLabel - %76 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %77 = OpLoad %int %76 - %78 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %79 = OpLoad %int %78 - %80 = OpAccessChain %_ptr_Function_float %m43 %67 %79 - %81 = OpLoad %float %80 - %82 = OpAccessChain %_ptr_Function_float %sums %77 - %83 = OpLoad %float %82 - %84 = OpFAdd %float %83 %81 - %85 = OpAccessChain %_ptr_Function_float %sums %77 - OpStore %85 %84 - OpBranch %69 - %69 = OpLabel - %68 = OpIAdd %int %67 %int_1 - OpStore %i %68 - OpBranch %66 - %70 = OpLabel - %86 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1 - %87 = OpLoad %int %86 - %88 = OpIEqual %bool %87 %int_1 - OpSelectionMerge %89 None - OpBranchConditional %88 %90 %89 - %90 = OpLabel - OpStore %a %int_4 - %91 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_2 - %92 = OpLoad %int %91 - %93 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %94 = OpLoad %int %93 - %95 = OpAccessChain %_ptr_Function_float %m43 %int_4 %94 - %96 = OpLoad %float %95 - %97 = OpAccessChain %_ptr_Function_float %sums %92 - %98 = OpLoad %float %97 - %99 = OpFAdd %float %98 %96 - %100 = OpAccessChain %_ptr_Function_float %sums %92 - OpStore %100 %99 - OpBranch %89 - %89 = OpLabel - %101 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1 - %102 = OpLoad %int %101 - %103 = OpAccessChain %_ptr_Function_float %sums %102 - %104 = OpLoad %float %103 - %105 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %106 = OpLoad %int %105 - %107 = OpAccessChain %_ptr_Function_float %sums %106 - %108 = OpLoad %float %107 - %109 = OpFAdd %float %104 %108 - %110 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2 - %111 = OpLoad %float %110 - %112 = OpFOrdEqual %bool %109 %111 - OpSelectionMerge %113 None - OpBranchConditional %112 %114 %115 - %114 = OpLabel - %116 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %117 = OpLoad %int %116 - %118 = OpConvertSToF %float %117 - %119 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1 - %120 = OpLoad %int %119 - %121 = OpConvertSToF %float %120 - %122 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1 - %123 = OpLoad %int %122 - %124 = OpConvertSToF %float %123 - %125 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %126 = OpLoad %int %125 - %127 = OpConvertSToF %float %126 - %128 = OpCompositeConstruct %v4float %118 %121 %124 %127 - OpStore %_GLF_color %128 - OpBranch %113 - %115 = OpLabel - %129 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1 - %130 = OpLoad %int %129 - %131 = OpConvertSToF %float %130 - %132 = OpCompositeConstruct %v4float %131 %131 %131 %131 - OpStore %_GLF_color %132 - OpBranch %113 - %113 = OpLabel - OpReturn - OpFunctionEnd diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm.expected.fxc.hlsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm.expected.fxc.hlsl deleted file mode 100644 index abb85d570e..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm.expected.fxc.hlsl +++ /dev/null @@ -1,133 +0,0 @@ -SKIP: FAILED - -void set_scalar_float4x3(inout float4x3 mat, int col, int row, float val) { - switch (col) { - case 0: - mat[0] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[0]; - break; - case 1: - mat[1] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[1]; - break; - case 2: - mat[2] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[2]; - break; - case 3: - mat[3] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[3]; - break; - } -} - -struct strided_arr { - float el; -}; - -cbuffer cbuffer_x_6 : register(b1, space0) { - uint4 x_6[3]; -}; -cbuffer cbuffer_x_8 : register(b0, space0) { - uint4 x_8[4]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - float4x3 m43 = float4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - strided_arr sums[3] = (strided_arr[3])0; - int i = 0; - int a = 0; - int x_67_phi = 0; - const float x_44 = asfloat(x_6[1].x); - const float3 x_48 = (0.0f).xxx; - m43 = float4x3(float3(x_44, 0.0f, 0.0f), float3(0.0f, x_44, 0.0f), float3(0.0f, 0.0f, x_44), (0.0f).xxx); - const uint scalar_offset = ((16u * 0u)) / 4; - const int x_51 = asint(x_8[scalar_offset / 4][scalar_offset % 4]); - const uint scalar_offset_1 = ((16u * 0u)) / 4; - const int x_53 = asint(x_8[scalar_offset_1 / 4][scalar_offset_1 % 4]); - const uint scalar_offset_2 = ((16u * 0u)) / 4; - const float x_55 = asfloat(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]); - set_scalar_float4x3(m43, x_53, x_51, x_55); - const uint scalar_offset_3 = ((16u * 0u)) / 4; - const float x_58 = asfloat(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]); - const uint scalar_offset_4 = ((16u * 0u)) / 4; - const float x_60 = asfloat(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]); - const uint scalar_offset_5 = ((16u * 0u)) / 4; - const float x_62 = asfloat(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]); - const strided_arr tint_symbol_3 = {x_58}; - const strided_arr tint_symbol_4 = {x_60}; - const strided_arr tint_symbol_5 = {x_62}; - const strided_arr tint_symbol_6[3] = {tint_symbol_3, tint_symbol_4, tint_symbol_5}; - sums = tint_symbol_6; - const uint scalar_offset_6 = ((16u * 0u)) / 4; - const int x_65 = asint(x_8[scalar_offset_6 / 4][scalar_offset_6 % 4]); - i = x_65; - x_67_phi = x_65; - [loop] while (true) { - const int x_67 = x_67_phi; - const int x_73 = asint(x_8[3].x); - if ((x_67 < x_73)) { - } else { - break; - } - const uint scalar_offset_7 = ((16u * 0u)) / 4; - const int x_77 = asint(x_8[scalar_offset_7 / 4][scalar_offset_7 % 4]); - const uint scalar_offset_8 = ((16u * 0u)) / 4; - const int x_79 = asint(x_8[scalar_offset_8 / 4][scalar_offset_8 % 4]); - const float x_81 = m43[x_67][x_79]; - const float x_83 = sums[x_77].el; - sums[x_77].el = (x_83 + x_81); - { - const int x_68 = (x_67 + 1); - i = x_68; - x_67_phi = x_68; - } - } - const int x_87 = asint(x_8[1].x); - if ((x_87 == 1)) { - a = 4; - const int x_92 = asint(x_8[2].x); - const uint scalar_offset_9 = ((16u * 0u)) / 4; - const int x_94 = asint(x_8[scalar_offset_9 / 4][scalar_offset_9 % 4]); - const float x_96 = m43[4][x_94]; - const float x_98 = sums[x_92].el; - sums[x_92].el = (x_98 + x_96); - } - const int x_102 = asint(x_8[1].x); - const float x_104 = sums[x_102].el; - const uint scalar_offset_10 = ((16u * 0u)) / 4; - const int x_106 = asint(x_8[scalar_offset_10 / 4][scalar_offset_10 % 4]); - const float x_108 = sums[x_106].el; - const float x_111 = asfloat(x_6[2].x); - if (((x_104 + x_108) == x_111)) { - const uint scalar_offset_11 = ((16u * 0u)) / 4; - const int x_117 = asint(x_8[scalar_offset_11 / 4][scalar_offset_11 % 4]); - const int x_120 = asint(x_8[1].x); - const int x_123 = asint(x_8[1].x); - const uint scalar_offset_12 = ((16u * 0u)) / 4; - const int x_126 = asint(x_8[scalar_offset_12 / 4][scalar_offset_12 % 4]); - x_GLF_color = float4(float(x_117), float(x_120), float(x_123), float(x_126)); - } else { - const int x_130 = asint(x_8[1].x); - const float x_131 = float(x_130); - x_GLF_color = float4(x_131, x_131, x_131, x_131); - } - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_7 = {x_GLF_color}; - return tint_symbol_7; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm.expected.glsl deleted file mode 100644 index cca5043c88..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.spvasm.expected.glsl +++ /dev/null @@ -1,116 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -layout(location = 0) out vec4 x_GLF_color_1_1; -struct strided_arr { - float el; -}; - -struct strided_arr_1 { - int el; -}; - -layout(binding = 1) uniform buf1_ubo { - strided_arr x_GLF_uniform_float_values[3]; -} x_6; - -layout(binding = 0) uniform buf0_ubo { - strided_arr_1 x_GLF_uniform_int_values[4]; -} x_8; - -vec4 x_GLF_color = vec4(0.0f, 0.0f, 0.0f, 0.0f); -void main_1() { - mat4x3 m43 = mat4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - strided_arr sums[3] = strided_arr[3](strided_arr(0.0f), strided_arr(0.0f), strided_arr(0.0f)); - int i = 0; - int a = 0; - int x_67_phi = 0; - float x_44 = x_6.x_GLF_uniform_float_values[1].el; - vec3 x_48 = vec3(0.0f); - m43 = mat4x3(vec3(x_44, 0.0f, 0.0f), vec3(0.0f, x_44, 0.0f), vec3(0.0f, 0.0f, x_44), vec3(0.0f)); - int x_51 = x_8.x_GLF_uniform_int_values[0].el; - int x_53 = x_8.x_GLF_uniform_int_values[0].el; - float x_55 = x_6.x_GLF_uniform_float_values[0].el; - m43[x_51][x_53] = x_55; - float x_58 = x_6.x_GLF_uniform_float_values[0].el; - float x_60 = x_6.x_GLF_uniform_float_values[0].el; - float x_62 = x_6.x_GLF_uniform_float_values[0].el; - strided_arr tint_symbol_1 = strided_arr(x_58); - strided_arr tint_symbol_2 = strided_arr(x_60); - strided_arr tint_symbol_3 = strided_arr(x_62); - strided_arr tint_symbol_4[3] = strided_arr[3](tint_symbol_1, tint_symbol_2, tint_symbol_3); - sums = tint_symbol_4; - int x_65 = x_8.x_GLF_uniform_int_values[0].el; - i = x_65; - x_67_phi = x_65; - while (true) { - int x_67 = x_67_phi; - int x_73 = x_8.x_GLF_uniform_int_values[3].el; - if ((x_67 < x_73)) { - } else { - break; - } - int x_77 = x_8.x_GLF_uniform_int_values[0].el; - int x_79 = x_8.x_GLF_uniform_int_values[0].el; - float x_81 = m43[x_67][x_79]; - float x_83 = sums[x_77].el; - sums[x_77].el = (x_83 + x_81); - { - int x_68 = (x_67 + 1); - i = x_68; - x_67_phi = x_68; - } - } - int x_87 = x_8.x_GLF_uniform_int_values[1].el; - if ((x_87 == 1)) { - a = 4; - int x_92 = x_8.x_GLF_uniform_int_values[2].el; - int x_94 = x_8.x_GLF_uniform_int_values[0].el; - float x_96 = m43[4][x_94]; - float x_98 = sums[x_92].el; - sums[x_92].el = (x_98 + x_96); - } - int x_102 = x_8.x_GLF_uniform_int_values[1].el; - float x_104 = sums[x_102].el; - int x_106 = x_8.x_GLF_uniform_int_values[0].el; - float x_108 = sums[x_106].el; - float x_111 = x_6.x_GLF_uniform_float_values[2].el; - if (((x_104 + x_108) == x_111)) { - int x_117 = x_8.x_GLF_uniform_int_values[0].el; - int x_120 = x_8.x_GLF_uniform_int_values[1].el; - int x_123 = x_8.x_GLF_uniform_int_values[1].el; - int x_126 = x_8.x_GLF_uniform_int_values[0].el; - x_GLF_color = vec4(float(x_117), float(x_120), float(x_123), float(x_126)); - } else { - int x_130 = x_8.x_GLF_uniform_int_values[1].el; - float x_131 = float(x_130); - x_GLF_color = vec4(x_131, x_131, x_131, x_131); - } - return; -} - -struct main_out { - vec4 x_GLF_color_1; -}; - -main_out tint_symbol() { - main_1(); - main_out tint_symbol_5 = main_out(x_GLF_color); - return tint_symbol_5; -} - -void main() { - main_out inner_result = tint_symbol(); - x_GLF_color_1_1 = inner_result.x_GLF_color_1; - return; -} -Error parsing GLSL shader: -ERROR: 0:69: '[' : matrix index out of range '4' -ERROR: 0:69: '=' : cannot convert from ' temp mediump 3-component vector of float' to ' temp mediump float' -ERROR: 0:69: '' : compilation terminated -ERROR: 3 compilation errors. No code generated. - - - diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl deleted file mode 100644 index 006779f1c3..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl +++ /dev/null @@ -1,105 +0,0 @@ -struct strided_arr { - @size(16) - el : f32, -} - -type Arr = array; - -struct buf1 { - x_GLF_uniform_float_values : Arr, -} - -struct strided_arr_1 { - @size(16) - el : i32, -} - -type Arr_1 = array; - -struct buf0 { - x_GLF_uniform_int_values : Arr_1, -} - -@group(0) @binding(1) var x_6 : buf1; - -@group(0) @binding(0) var x_8 : buf0; - -var x_GLF_color : vec4; - -fn main_1() { - var m43 : mat4x3; - var sums : Arr; - var i : i32; - var a : i32; - var x_67_phi : i32; - let x_44 : f32 = x_6.x_GLF_uniform_float_values[1].el; - let x_48 : vec3 = vec3(0.0, 0.0, 0.0); - m43 = mat4x3(vec3(x_44, 0.0, 0.0), vec3(0.0, x_44, 0.0), vec3(0.0, 0.0, x_44), vec3(0.0, 0.0, 0.0)); - let x_51 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_53 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_55 : f32 = x_6.x_GLF_uniform_float_values[0].el; - m43[x_51][x_53] = x_55; - let x_58 : f32 = x_6.x_GLF_uniform_float_values[0].el; - let x_60 : f32 = x_6.x_GLF_uniform_float_values[0].el; - let x_62 : f32 = x_6.x_GLF_uniform_float_values[0].el; - sums = Arr(strided_arr(x_58), strided_arr(x_60), strided_arr(x_62)); - let x_65 : i32 = x_8.x_GLF_uniform_int_values[0].el; - i = x_65; - x_67_phi = x_65; - loop { - let x_67 : i32 = x_67_phi; - let x_73 : i32 = x_8.x_GLF_uniform_int_values[3].el; - if ((x_67 < x_73)) { - } else { - break; - } - let x_77 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_79 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_81 : f32 = m43[x_67][x_79]; - let x_83 : f32 = sums[x_77].el; - sums[x_77].el = (x_83 + x_81); - - continuing { - let x_68 : i32 = (x_67 + 1); - i = x_68; - x_67_phi = x_68; - } - } - let x_87 : i32 = x_8.x_GLF_uniform_int_values[1].el; - if ((x_87 == 1)) { - a = 4; - let x_92 : i32 = x_8.x_GLF_uniform_int_values[2].el; - let x_94 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_96 : f32 = m43[4][x_94]; - let x_98 : f32 = sums[x_92].el; - sums[x_92].el = (x_98 + x_96); - } - let x_102 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_104 : f32 = sums[x_102].el; - let x_106 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_108 : f32 = sums[x_106].el; - let x_111 : f32 = x_6.x_GLF_uniform_float_values[2].el; - if (((x_104 + x_108) == x_111)) { - let x_117 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_120 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_123 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_126 : i32 = x_8.x_GLF_uniform_int_values[0].el; - x_GLF_color = vec4(f32(x_117), f32(x_120), f32(x_123), f32(x_126)); - } else { - let x_130 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_131 : f32 = f32(x_130); - x_GLF_color = vec4(x_131, x_131, x_131, x_131); - } - return; -} - -struct main_out { - @location(0) - x_GLF_color_1 : vec4, -} - -@fragment -fn main() -> main_out { - main_1(); - return main_out(x_GLF_color); -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl.expected.fxc.hlsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl.expected.fxc.hlsl deleted file mode 100644 index abb85d570e..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl.expected.fxc.hlsl +++ /dev/null @@ -1,133 +0,0 @@ -SKIP: FAILED - -void set_scalar_float4x3(inout float4x3 mat, int col, int row, float val) { - switch (col) { - case 0: - mat[0] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[0]; - break; - case 1: - mat[1] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[1]; - break; - case 2: - mat[2] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[2]; - break; - case 3: - mat[3] = (row.xxx == int3(0, 1, 2)) ? val.xxx : mat[3]; - break; - } -} - -struct strided_arr { - float el; -}; - -cbuffer cbuffer_x_6 : register(b1, space0) { - uint4 x_6[3]; -}; -cbuffer cbuffer_x_8 : register(b0, space0) { - uint4 x_8[4]; -}; -static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f); - -void main_1() { - float4x3 m43 = float4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - strided_arr sums[3] = (strided_arr[3])0; - int i = 0; - int a = 0; - int x_67_phi = 0; - const float x_44 = asfloat(x_6[1].x); - const float3 x_48 = (0.0f).xxx; - m43 = float4x3(float3(x_44, 0.0f, 0.0f), float3(0.0f, x_44, 0.0f), float3(0.0f, 0.0f, x_44), (0.0f).xxx); - const uint scalar_offset = ((16u * 0u)) / 4; - const int x_51 = asint(x_8[scalar_offset / 4][scalar_offset % 4]); - const uint scalar_offset_1 = ((16u * 0u)) / 4; - const int x_53 = asint(x_8[scalar_offset_1 / 4][scalar_offset_1 % 4]); - const uint scalar_offset_2 = ((16u * 0u)) / 4; - const float x_55 = asfloat(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]); - set_scalar_float4x3(m43, x_53, x_51, x_55); - const uint scalar_offset_3 = ((16u * 0u)) / 4; - const float x_58 = asfloat(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]); - const uint scalar_offset_4 = ((16u * 0u)) / 4; - const float x_60 = asfloat(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]); - const uint scalar_offset_5 = ((16u * 0u)) / 4; - const float x_62 = asfloat(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]); - const strided_arr tint_symbol_3 = {x_58}; - const strided_arr tint_symbol_4 = {x_60}; - const strided_arr tint_symbol_5 = {x_62}; - const strided_arr tint_symbol_6[3] = {tint_symbol_3, tint_symbol_4, tint_symbol_5}; - sums = tint_symbol_6; - const uint scalar_offset_6 = ((16u * 0u)) / 4; - const int x_65 = asint(x_8[scalar_offset_6 / 4][scalar_offset_6 % 4]); - i = x_65; - x_67_phi = x_65; - [loop] while (true) { - const int x_67 = x_67_phi; - const int x_73 = asint(x_8[3].x); - if ((x_67 < x_73)) { - } else { - break; - } - const uint scalar_offset_7 = ((16u * 0u)) / 4; - const int x_77 = asint(x_8[scalar_offset_7 / 4][scalar_offset_7 % 4]); - const uint scalar_offset_8 = ((16u * 0u)) / 4; - const int x_79 = asint(x_8[scalar_offset_8 / 4][scalar_offset_8 % 4]); - const float x_81 = m43[x_67][x_79]; - const float x_83 = sums[x_77].el; - sums[x_77].el = (x_83 + x_81); - { - const int x_68 = (x_67 + 1); - i = x_68; - x_67_phi = x_68; - } - } - const int x_87 = asint(x_8[1].x); - if ((x_87 == 1)) { - a = 4; - const int x_92 = asint(x_8[2].x); - const uint scalar_offset_9 = ((16u * 0u)) / 4; - const int x_94 = asint(x_8[scalar_offset_9 / 4][scalar_offset_9 % 4]); - const float x_96 = m43[4][x_94]; - const float x_98 = sums[x_92].el; - sums[x_92].el = (x_98 + x_96); - } - const int x_102 = asint(x_8[1].x); - const float x_104 = sums[x_102].el; - const uint scalar_offset_10 = ((16u * 0u)) / 4; - const int x_106 = asint(x_8[scalar_offset_10 / 4][scalar_offset_10 % 4]); - const float x_108 = sums[x_106].el; - const float x_111 = asfloat(x_6[2].x); - if (((x_104 + x_108) == x_111)) { - const uint scalar_offset_11 = ((16u * 0u)) / 4; - const int x_117 = asint(x_8[scalar_offset_11 / 4][scalar_offset_11 % 4]); - const int x_120 = asint(x_8[1].x); - const int x_123 = asint(x_8[1].x); - const uint scalar_offset_12 = ((16u * 0u)) / 4; - const int x_126 = asint(x_8[scalar_offset_12 / 4][scalar_offset_12 % 4]); - x_GLF_color = float4(float(x_117), float(x_120), float(x_123), float(x_126)); - } else { - const int x_130 = asint(x_8[1].x); - const float x_131 = float(x_130); - x_GLF_color = float4(x_131, x_131, x_131, x_131); - } - return; -} - -struct main_out { - float4 x_GLF_color_1; -}; -struct tint_symbol { - float4 x_GLF_color_1 : SV_Target0; -}; - -main_out main_inner() { - main_1(); - const main_out tint_symbol_7 = {x_GLF_color}; - return tint_symbol_7; -} - -tint_symbol main() { - const main_out inner_result = main_inner(); - tint_symbol wrapper_result = (tint_symbol)0; - wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; - return wrapper_result; -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl.expected.glsl deleted file mode 100644 index cca5043c88..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-unused-access-past-matrix-elements/0-opt.wgsl.expected.glsl +++ /dev/null @@ -1,116 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -layout(location = 0) out vec4 x_GLF_color_1_1; -struct strided_arr { - float el; -}; - -struct strided_arr_1 { - int el; -}; - -layout(binding = 1) uniform buf1_ubo { - strided_arr x_GLF_uniform_float_values[3]; -} x_6; - -layout(binding = 0) uniform buf0_ubo { - strided_arr_1 x_GLF_uniform_int_values[4]; -} x_8; - -vec4 x_GLF_color = vec4(0.0f, 0.0f, 0.0f, 0.0f); -void main_1() { - mat4x3 m43 = mat4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - strided_arr sums[3] = strided_arr[3](strided_arr(0.0f), strided_arr(0.0f), strided_arr(0.0f)); - int i = 0; - int a = 0; - int x_67_phi = 0; - float x_44 = x_6.x_GLF_uniform_float_values[1].el; - vec3 x_48 = vec3(0.0f); - m43 = mat4x3(vec3(x_44, 0.0f, 0.0f), vec3(0.0f, x_44, 0.0f), vec3(0.0f, 0.0f, x_44), vec3(0.0f)); - int x_51 = x_8.x_GLF_uniform_int_values[0].el; - int x_53 = x_8.x_GLF_uniform_int_values[0].el; - float x_55 = x_6.x_GLF_uniform_float_values[0].el; - m43[x_51][x_53] = x_55; - float x_58 = x_6.x_GLF_uniform_float_values[0].el; - float x_60 = x_6.x_GLF_uniform_float_values[0].el; - float x_62 = x_6.x_GLF_uniform_float_values[0].el; - strided_arr tint_symbol_1 = strided_arr(x_58); - strided_arr tint_symbol_2 = strided_arr(x_60); - strided_arr tint_symbol_3 = strided_arr(x_62); - strided_arr tint_symbol_4[3] = strided_arr[3](tint_symbol_1, tint_symbol_2, tint_symbol_3); - sums = tint_symbol_4; - int x_65 = x_8.x_GLF_uniform_int_values[0].el; - i = x_65; - x_67_phi = x_65; - while (true) { - int x_67 = x_67_phi; - int x_73 = x_8.x_GLF_uniform_int_values[3].el; - if ((x_67 < x_73)) { - } else { - break; - } - int x_77 = x_8.x_GLF_uniform_int_values[0].el; - int x_79 = x_8.x_GLF_uniform_int_values[0].el; - float x_81 = m43[x_67][x_79]; - float x_83 = sums[x_77].el; - sums[x_77].el = (x_83 + x_81); - { - int x_68 = (x_67 + 1); - i = x_68; - x_67_phi = x_68; - } - } - int x_87 = x_8.x_GLF_uniform_int_values[1].el; - if ((x_87 == 1)) { - a = 4; - int x_92 = x_8.x_GLF_uniform_int_values[2].el; - int x_94 = x_8.x_GLF_uniform_int_values[0].el; - float x_96 = m43[4][x_94]; - float x_98 = sums[x_92].el; - sums[x_92].el = (x_98 + x_96); - } - int x_102 = x_8.x_GLF_uniform_int_values[1].el; - float x_104 = sums[x_102].el; - int x_106 = x_8.x_GLF_uniform_int_values[0].el; - float x_108 = sums[x_106].el; - float x_111 = x_6.x_GLF_uniform_float_values[2].el; - if (((x_104 + x_108) == x_111)) { - int x_117 = x_8.x_GLF_uniform_int_values[0].el; - int x_120 = x_8.x_GLF_uniform_int_values[1].el; - int x_123 = x_8.x_GLF_uniform_int_values[1].el; - int x_126 = x_8.x_GLF_uniform_int_values[0].el; - x_GLF_color = vec4(float(x_117), float(x_120), float(x_123), float(x_126)); - } else { - int x_130 = x_8.x_GLF_uniform_int_values[1].el; - float x_131 = float(x_130); - x_GLF_color = vec4(x_131, x_131, x_131, x_131); - } - return; -} - -struct main_out { - vec4 x_GLF_color_1; -}; - -main_out tint_symbol() { - main_1(); - main_out tint_symbol_5 = main_out(x_GLF_color); - return tint_symbol_5; -} - -void main() { - main_out inner_result = tint_symbol(); - x_GLF_color_1_1 = inner_result.x_GLF_color_1; - return; -} -Error parsing GLSL shader: -ERROR: 0:69: '[' : matrix index out of range '4' -ERROR: 0:69: '=' : cannot convert from ' temp mediump 3-component vector of float' to ' temp mediump float' -ERROR: 0:69: '' : compilation terminated -ERROR: 3 compilation errors. No code generated. - - - diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.spvasm b/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.spvasm deleted file mode 100644 index 97dd17734d..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.spvasm +++ /dev/null @@ -1,112 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %_GLF_color - OpExecutionMode %main OriginUpperLeft - OpSource ESSL 320 - OpName %main "main" - OpName %m32 "m32" - OpName %buf1 "buf1" - OpMemberName %buf1 0 "_GLF_uniform_float_values" - OpName %_ "" - OpName %buf0 "buf0" - OpMemberName %buf0 0 "_GLF_uniform_int_values" - OpName %__0 "" - OpName %sums "sums" - OpName %_GLF_color "_GLF_color" - OpDecorate %_arr_float_uint_2 ArrayStride 16 - OpMemberDecorate %buf1 0 Offset 0 - OpDecorate %buf1 Block - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 1 - OpDecorate %_arr_int_uint_3 ArrayStride 16 - OpMemberDecorate %buf0 0 Offset 0 - OpDecorate %buf0 Block - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 0 - OpDecorate %_GLF_color Location 0 - %void = OpTypeVoid - %13 = OpTypeFunction %void - %float = OpTypeFloat 32 - %v2float = OpTypeVector %float 2 -%mat3v2float = OpTypeMatrix %v2float 3 -%_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float - %uint = OpTypeInt 32 0 - %uint_2 = OpConstant %uint 2 -%_arr_float_uint_2 = OpTypeArray %float %uint_2 - %buf1 = OpTypeStruct %_arr_float_uint_2 -%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1 - %_ = OpVariable %_ptr_Uniform_buf1 Uniform - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 -%_ptr_Uniform_float = OpTypePointer Uniform %float - %float_0 = OpConstant %float 0 - %int_3 = OpConstant %int 3 - %uint_3 = OpConstant %uint 3 -%_arr_int_uint_3 = OpTypeArray %int %uint_3 - %buf0 = OpTypeStruct %_arr_int_uint_3 -%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0 - %__0 = OpVariable %_ptr_Uniform_buf0 Uniform -%_ptr_Uniform_int = OpTypePointer Uniform %int - %int_1 = OpConstant %int 1 - %bool = OpTypeBool -%_ptr_Function_float = OpTypePointer Function %float -%_arr_float_uint_3 = OpTypeArray %float %uint_3 -%_ptr_Function__arr_float_uint_3 = OpTypePointer Function %_arr_float_uint_3 - %int_2 = OpConstant %int 2 - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %_GLF_color = OpVariable %_ptr_Output_v4float Output - %37 = OpConstantComposite %v2float %float_0 %float_0 - %main = OpFunction %void None %13 - %38 = OpLabel - %m32 = OpVariable %_ptr_Function_mat3v2float Function - %sums = OpVariable %_ptr_Function__arr_float_uint_3 Function - %39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0 - %40 = OpLoad %float %39 - %41 = OpCompositeConstruct %v2float %40 %float_0 - %42 = OpCompositeConstruct %v2float %float_0 %40 - %43 = OpCompositeConstruct %mat3v2float %41 %42 %37 - OpStore %m32 %43 - %44 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0 - %45 = OpLoad %int %44 - %46 = OpIEqual %bool %45 %int_1 - OpSelectionMerge %47 None - OpBranchConditional %46 %48 %47 - %48 = OpLabel - %49 = OpAccessChain %_ptr_Function_float %m32 %int_3 %45 - OpStore %49 %40 - OpBranch %47 - %47 = OpLabel - %50 = OpCompositeConstruct %_arr_float_uint_3 %40 %40 %40 - OpStore %sums %50 - OpBranch %51 - %51 = OpLabel - %52 = OpPhi %int %45 %47 %53 %54 - %55 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_2 - %56 = OpLoad %int %55 - %57 = OpSLessThan %bool %52 %56 - OpLoopMerge %58 %54 None - OpBranchConditional %57 %54 %58 - %54 = OpLabel - %59 = OpAccessChain %_ptr_Function_float %m32 %52 %45 - %60 = OpLoad %float %59 - %61 = OpAccessChain %_ptr_Function_float %sums %56 - %62 = OpLoad %float %61 - %63 = OpFAdd %float %62 %60 - OpStore %61 %63 - %53 = OpIAdd %int %52 %int_1 - OpBranch %51 - %58 = OpLabel - %64 = OpAccessChain %_ptr_Function_float %sums %45 - %65 = OpLoad %float %64 - %66 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1 - %67 = OpLoad %float %66 - %68 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1 - %69 = OpLoad %int %68 - %70 = OpAccessChain %_ptr_Function_float %sums %69 - %71 = OpLoad %float %70 - %72 = OpCompositeConstruct %v4float %65 %67 %67 %71 - OpStore %_GLF_color %72 - OpReturn - OpFunctionEnd diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.spvasm.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.spvasm.expected.glsl deleted file mode 100644 index 76ec7b3fb4..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.spvasm.expected.glsl +++ /dev/null @@ -1,83 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -layout(location = 0) out vec4 x_GLF_color_1_1; -struct strided_arr { - float el; -}; - -struct strided_arr_1 { - int el; -}; - -layout(binding = 1) uniform buf1_ubo { - strided_arr x_GLF_uniform_float_values[2]; -} x_6; - -layout(binding = 0) uniform buf0_ubo { - strided_arr_1 x_GLF_uniform_int_values[3]; -} x_8; - -vec4 x_GLF_color = vec4(0.0f, 0.0f, 0.0f, 0.0f); -void main_1() { - mat3x2 m32 = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - float sums[3] = float[3](0.0f, 0.0f, 0.0f); - int x_52_phi = 0; - float x_40 = x_6.x_GLF_uniform_float_values[0].el; - m32 = mat3x2(vec2(x_40, 0.0f), vec2(0.0f, x_40), vec2(0.0f)); - int x_45 = x_8.x_GLF_uniform_int_values[0].el; - if ((x_45 == 1)) { - m32[3][x_45] = x_40; - } - float tint_symbol_1[3] = float[3](x_40, x_40, x_40); - sums = tint_symbol_1; - x_52_phi = x_45; - while (true) { - int x_53 = 0; - int x_52 = x_52_phi; - int x_56 = x_8.x_GLF_uniform_int_values[2].el; - if ((x_52 < x_56)) { - } else { - break; - } - { - float x_60 = m32[x_52][x_45]; - int x_61_save = x_56; - float x_62 = sums[x_61_save]; - sums[x_61_save] = (x_62 + x_60); - x_53 = (x_52 + 1); - x_52_phi = x_53; - } - } - float x_65 = sums[x_45]; - float x_67 = x_6.x_GLF_uniform_float_values[1].el; - int x_69 = x_8.x_GLF_uniform_int_values[1].el; - float x_71 = sums[x_69]; - x_GLF_color = vec4(x_65, x_67, x_67, x_71); - return; -} - -struct main_out { - vec4 x_GLF_color_1; -}; - -main_out tint_symbol() { - main_1(); - main_out tint_symbol_2 = main_out(x_GLF_color); - return tint_symbol_2; -} - -void main() { - main_out inner_result = tint_symbol(); - x_GLF_color_1_1 = inner_result.x_GLF_color_1; - return; -} -Error parsing GLSL shader: -ERROR: 0:30: '[' : matrix index out of range '3' -ERROR: 0:30: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.wgsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.wgsl deleted file mode 100644 index e1d29af29d..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.wgsl +++ /dev/null @@ -1,76 +0,0 @@ -struct strided_arr { - @size(16) - el : f32, -} - -type Arr = array; - -struct buf1 { - x_GLF_uniform_float_values : Arr, -} - -struct strided_arr_1 { - @size(16) - el : i32, -} - -type Arr_1 = array; - -struct buf0 { - x_GLF_uniform_int_values : Arr_1, -} - -@group(0) @binding(1) var x_6 : buf1; - -@group(0) @binding(0) var x_8 : buf0; - -var x_GLF_color : vec4; - -fn main_1() { - var m32 : mat3x2; - var sums : array; - var x_52_phi : i32; - let x_40 : f32 = x_6.x_GLF_uniform_float_values[0].el; - m32 = mat3x2(vec2(x_40, 0.0), vec2(0.0, x_40), vec2(0.0, 0.0)); - let x_45 : i32 = x_8.x_GLF_uniform_int_values[0].el; - if ((x_45 == 1)) { - m32[3][x_45] = x_40; - } - sums = array(x_40, x_40, x_40); - x_52_phi = x_45; - loop { - var x_53 : i32; - let x_52 : i32 = x_52_phi; - let x_56 : i32 = x_8.x_GLF_uniform_int_values[2].el; - if ((x_52 < x_56)) { - } else { - break; - } - - continuing { - let x_60 : f32 = m32[x_52][x_45]; - let x_61_save = x_56; - let x_62 : f32 = sums[x_61_save]; - sums[x_61_save] = (x_62 + x_60); - x_53 = (x_52 + 1); - x_52_phi = x_53; - } - } - let x_65 : f32 = sums[x_45]; - let x_67 : f32 = x_6.x_GLF_uniform_float_values[1].el; - let x_69 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_71 : f32 = sums[x_69]; - x_GLF_color = vec4(x_65, x_67, x_67, x_71); - return; -} - -struct main_out { - @location(0) - x_GLF_color_1 : vec4, -} - -@fragment -fn main() -> main_out { - main_1(); - return main_out(x_GLF_color); -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.wgsl.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.wgsl.expected.glsl deleted file mode 100644 index 76ec7b3fb4..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-write-past-matrix-elements-unused/0.wgsl.expected.glsl +++ /dev/null @@ -1,83 +0,0 @@ -SKIP: FAILED - -#version 310 es -precision mediump float; - -layout(location = 0) out vec4 x_GLF_color_1_1; -struct strided_arr { - float el; -}; - -struct strided_arr_1 { - int el; -}; - -layout(binding = 1) uniform buf1_ubo { - strided_arr x_GLF_uniform_float_values[2]; -} x_6; - -layout(binding = 0) uniform buf0_ubo { - strided_arr_1 x_GLF_uniform_int_values[3]; -} x_8; - -vec4 x_GLF_color = vec4(0.0f, 0.0f, 0.0f, 0.0f); -void main_1() { - mat3x2 m32 = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - float sums[3] = float[3](0.0f, 0.0f, 0.0f); - int x_52_phi = 0; - float x_40 = x_6.x_GLF_uniform_float_values[0].el; - m32 = mat3x2(vec2(x_40, 0.0f), vec2(0.0f, x_40), vec2(0.0f)); - int x_45 = x_8.x_GLF_uniform_int_values[0].el; - if ((x_45 == 1)) { - m32[3][x_45] = x_40; - } - float tint_symbol_1[3] = float[3](x_40, x_40, x_40); - sums = tint_symbol_1; - x_52_phi = x_45; - while (true) { - int x_53 = 0; - int x_52 = x_52_phi; - int x_56 = x_8.x_GLF_uniform_int_values[2].el; - if ((x_52 < x_56)) { - } else { - break; - } - { - float x_60 = m32[x_52][x_45]; - int x_61_save = x_56; - float x_62 = sums[x_61_save]; - sums[x_61_save] = (x_62 + x_60); - x_53 = (x_52 + 1); - x_52_phi = x_53; - } - } - float x_65 = sums[x_45]; - float x_67 = x_6.x_GLF_uniform_float_values[1].el; - int x_69 = x_8.x_GLF_uniform_int_values[1].el; - float x_71 = sums[x_69]; - x_GLF_color = vec4(x_65, x_67, x_67, x_71); - return; -} - -struct main_out { - vec4 x_GLF_color_1; -}; - -main_out tint_symbol() { - main_1(); - main_out tint_symbol_2 = main_out(x_GLF_color); - return tint_symbol_2; -} - -void main() { - main_out inner_result = tint_symbol(); - x_GLF_color_1_1 = inner_result.x_GLF_color_1; - return; -} -Error parsing GLSL shader: -ERROR: 0:30: '[' : matrix index out of range '3' -ERROR: 0:30: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - -