tint: const eval of transpose builtin

Bug: tint:1581
Change-Id: Ia614647bc4a3d24a53d45981ddcdb1c84ea84608
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111600
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Antonio Maiorano 2022-11-23 23:12:56 +00:00 committed by Dawn LUCI CQ
parent dd3fb05af7
commit 9ba5f9e2c6
214 changed files with 5439 additions and 460 deletions

View File

@ -546,7 +546,7 @@ fn refract<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
@const fn tan<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
@const fn tanh<T: fa_f32_f16>(T) -> T
@const fn tanh<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
fn transpose<M: num, N: num, T: f32_f16>(mat<M, N, T>) -> mat<N, M, T>
@const fn transpose<M: num, N: num, T: fa_f32_f16>(mat<M, N, T>) -> mat<N, M, T>
@const fn trunc<T: fa_f32_f16>(@test_value(1.5) T) -> T
@const fn trunc<N: num, T: fa_f32_f16>(@test_value(1.5) vec<N, T>) -> vec<N, T>
@const fn unpack2x16float(u32) -> vec2<f32>

View File

@ -3031,6 +3031,26 @@ ConstEval::Result ConstEval::tanh(const sem::Type* ty,
return TransformElements(builder, ty, transform, args[0]);
}
ConstEval::Result ConstEval::transpose(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source&) {
auto* m = args[0];
auto* mat_ty = m->Type()->As<sem::Matrix>();
auto me = [&](size_t r, size_t c) { return m->Index(c)->Index(r); };
auto* result_mat_ty = ty->As<sem::Matrix>();
// Produce column vectors from each row
utils::Vector<const sem::Constant*, 4> result_mat;
for (size_t r = 0; r < mat_ty->rows(); ++r) {
utils::Vector<const sem::Constant*, 4> new_col_vec;
for (size_t c = 0; c < mat_ty->columns(); ++c) {
new_col_vec.Push(me(r, c));
}
result_mat.Push(CreateComposite(builder, result_mat_ty->ColumnType(), new_col_vec));
}
return CreateComposite(builder, ty, result_mat);
}
ConstEval::Result ConstEval::trunc(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source) {

View File

@ -863,6 +863,15 @@ class ConstEval {
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// transpose builtin
/// @param ty the expression type
/// @param args the input arguments
/// @param source the source location
/// @return the result value, or null if the value cannot be calculated
Result transpose(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source& source);
/// trunc builtin
/// @param ty the expression type
/// @param args the input arguments

View File

@ -2092,6 +2092,72 @@ INSTANTIATE_TEST_SUITE_P( //
TanhCases<f32>(),
TanhCases<f16>()))));
template <typename T>
std::vector<Case> TransposeCases() {
return {
// 2x2
C({Mat({T(1), T(2)}, //
{T(3), T(4)})}, //
Mat({T(1), T(3)}, //
{T(2), T(4)})),
// 3x3
C({Mat({T(1), T(2), T(3)}, //
{T(4), T(5), T(6)}, //
{T(7), T(8), T(9)})}, //
Mat({T(1), T(4), T(7)}, //
{T(2), T(5), T(8)}, //
{T(3), T(6), T(9)})),
// 4x4
C({Mat({T(1), T(2), T(3), T(4)}, //
{T(5), T(6), T(7), T(8)}, //
{T(9), T(10), T(11), T(12)}, //
{T(13), T(14), T(15), T(16)})}, //
Mat({T(1), T(5), T(9), T(13)}, //
{T(2), T(6), T(10), T(14)}, //
{T(3), T(7), T(11), T(15)}, //
{T(4), T(8), T(12), T(16)})),
// 4x2
C({Mat({T(1), T(2), T(3), T(4)}, //
{T(5), T(6), T(7), T(8)})}, //
Mat({T(1), T(5)}, //
{T(2), T(6)}, //
{T(3), T(7)}, //
{T(4), T(8)})),
// 2x4
C({Mat({T(1), T(2)}, //
{T(3), T(4)}, //
{T(5), T(6)}, //
{T(7), T(8)})}, //
Mat({T(1), T(3), T(5), T(7)}, //
{T(2), T(4), T(6), T(8)})),
// 3x2
C({Mat({T(1), T(2), T(3)}, //
{T(4), T(5), T(6)})}, //
Mat({T(1), T(4)}, //
{T(2), T(5)}, //
{T(3), T(6)})),
// 2x3
C({Mat({T(1), T(2)}, //
{T(3), T(4)}, //
{T(5), T(6)})}, //
Mat({T(1), T(3), T(5)}, //
{T(2), T(4), T(6)})),
};
}
INSTANTIATE_TEST_SUITE_P( //
Transpose,
ResolverConstEvalBuiltinTest,
testing::Combine(testing::Values(sem::BuiltinType::kTranspose),
testing::ValuesIn(Concat(TransposeCases<AFloat>(), //
TransposeCases<f32>(),
TransposeCases<f16>()))));
template <typename T>
std::vector<Case> TruncCases() {
std::vector<Case> cases = {C({T(0)}, T(0)), //

View File

@ -306,7 +306,17 @@ using Types = std::variant< //
Value<builder::mat3x2<AInt>>,
Value<builder::mat3x2<AFloat>>,
Value<builder::mat3x2<f32>>,
Value<builder::mat3x2<f16>>
Value<builder::mat3x2<f16>>,
Value<builder::mat2x4<AInt>>,
Value<builder::mat2x4<AFloat>>,
Value<builder::mat2x4<f32>>,
Value<builder::mat2x4<f16>>,
Value<builder::mat4x2<AInt>>,
Value<builder::mat4x2<AFloat>>,
Value<builder::mat4x2<f32>>,
Value<builder::mat4x2<f16>>
//
>;

View File

@ -13734,12 +13734,12 @@ constexpr OverloadInfo kOverloads[] = {
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 2,
/* template types */ &kTemplateTypes[26],
/* template types */ &kTemplateTypes[23],
/* template numbers */ &kTemplateNumbers[3],
/* parameters */ &kParameters[908],
/* return matcher indices */ &kMatcherIndices[18],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
/* const eval */ &ConstEval::transpose,
},
{
/* [452] */
@ -14518,7 +14518,7 @@ constexpr IntrinsicInfo kBuiltins[] = {
},
{
/* [78] */
/* fn transpose<M : num, N : num, T : f32_f16>(mat<M, N, T>) -> mat<N, M, T> */
/* fn transpose<M : num, N : num, T : fa_f32_f16>(mat<M, N, T>) -> mat<N, M, T> */
/* num overloads */ 1,
/* overloads */ &kOverloads[451],
},

View File

@ -150,6 +150,12 @@ using mat2x3 = mat<2, 3, T>;
template <typename T>
using mat3x2 = mat<3, 2, T>;
template <typename T>
using mat2x4 = mat<2, 4, T>;
template <typename T>
using mat4x2 = mat<4, 2, T>;
template <typename T>
using mat3x3 = mat<3, 3, T>;

View File

@ -1,5 +1,5 @@
void transpose_06794e() {
matrix<float16_t, 3, 3> res = transpose(matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx));
matrix<float16_t, 3, 3> res = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void transpose_06794e() {
f16mat3 res = transpose(f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void transpose_06794e() {
f16mat3 res = transpose(f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void transpose_06794e() {
f16mat3 res = transpose(f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_06794e() {
half3x3 res = transpose(half3x3(half3(1.0h), half3(1.0h), half3(1.0h)));
half3x3 res = half3x3(half3(1.0h), half3(1.0h), half3(1.0h));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability Float16
@ -38,38 +38,37 @@
%v3half = OpTypeVector %half 3
%mat3v3half = OpTypeMatrix %v3half 3
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%19 = OpConstantComposite %mat3v3half %18 %18 %18
%17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%18 = OpConstantComposite %mat3v3half %17 %17 %17
%_ptr_Function_mat3v3half = OpTypePointer Function %mat3v3half
%22 = OpConstantNull %mat3v3half
%23 = OpTypeFunction %v4float
%21 = OpConstantNull %mat3v3half
%22 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%transpose_06794e = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v3half Function %22
%13 = OpTranspose %mat3v3half %19
OpStore %res %13
%res = OpVariable %_ptr_Function_mat3v3half Function %21
OpStore %res %18
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %transpose_06794e
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %transpose_06794e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_06794e
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_06794e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %transpose_06794e
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_06794e
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void transpose_2585cd() {
float3x4 res = transpose(float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx));
float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void transpose_2585cd() {
float3x4 res = transpose(float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx));
float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void transpose_2585cd() {
mat3x4 res = transpose(mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f)));
mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void transpose_2585cd() {
mat3x4 res = transpose(mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f)));
mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void transpose_2585cd() {
mat3x4 res = transpose(mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f)));
mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_2585cd() {
float3x4 res = transpose(float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f)));
float3x4 res = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -31,40 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%mat3v4float = OpTypeMatrix %v4float 3
%v3float = OpTypeVector %float 3
%mat4v3float = OpTypeMatrix %v3float 4
%float_1 = OpConstant %float 1
%18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%19 = OpConstantComposite %mat4v3float %18 %18 %18 %18
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%16 = OpConstantComposite %mat3v4float %15 %15 %15
%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
%22 = OpConstantNull %mat3v4float
%23 = OpTypeFunction %v4float
%19 = OpConstantNull %mat3v4float
%20 = OpTypeFunction %v4float
%transpose_2585cd = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v4float Function %22
%13 = OpTranspose %mat3v4float %19
OpStore %res %13
%res = OpVariable %_ptr_Function_mat3v4float Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %transpose_2585cd
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %transpose_2585cd
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %transpose_2585cd
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_2585cd
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_2585cd
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void transpose_31d679() {
float2x2 res = transpose(float2x2((1.0f).xx, (1.0f).xx));
float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void transpose_31d679() {
float2x2 res = transpose(float2x2((1.0f).xx, (1.0f).xx));
float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void transpose_31d679() {
mat2 res = transpose(mat2(vec2(1.0f), vec2(1.0f)));
mat2 res = mat2(vec2(1.0f), vec2(1.0f));
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void transpose_31d679() {
mat2 res = transpose(mat2(vec2(1.0f), vec2(1.0f)));
mat2 res = mat2(vec2(1.0f), vec2(1.0f));
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void transpose_31d679() {
mat2 res = transpose(mat2(vec2(1.0f), vec2(1.0f)));
mat2 res = mat2(vec2(1.0f), vec2(1.0f));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_31d679() {
float2x2 res = transpose(float2x2(float2(1.0f), float2(1.0f)));
float2x2 res = float2x2(float2(1.0f), float2(1.0f));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -33,37 +33,36 @@
%v2float = OpTypeVector %float 2
%mat2v2float = OpTypeMatrix %v2float 2
%float_1 = OpConstant %float 1
%17 = OpConstantComposite %v2float %float_1 %float_1
%18 = OpConstantComposite %mat2v2float %17 %17
%16 = OpConstantComposite %v2float %float_1 %float_1
%17 = OpConstantComposite %mat2v2float %16 %16
%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
%21 = OpConstantNull %mat2v2float
%22 = OpTypeFunction %v4float
%20 = OpConstantNull %mat2v2float
%21 = OpTypeFunction %v4float
%transpose_31d679 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat2v2float Function %21
%13 = OpTranspose %mat2v2float %18
OpStore %res %13
%res = OpVariable %_ptr_Function_mat2v2float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %transpose_31d679
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_31d679
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %transpose_31d679
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_31d679
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %transpose_31d679
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_31d679
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void transpose_31e37e() {
float2x4 res = transpose(float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx));
float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void transpose_31e37e() {
float2x4 res = transpose(float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx));
float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void transpose_31e37e() {
mat2x4 res = transpose(mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f)));
mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void transpose_31e37e() {
mat2x4 res = transpose(mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f)));
mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void transpose_31e37e() {
mat2x4 res = transpose(mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f)));
mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_31e37e() {
float2x4 res = transpose(float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f)));
float2x4 res = float2x4(float4(1.0f), float4(1.0f));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -31,40 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%mat2v4float = OpTypeMatrix %v4float 2
%v2float = OpTypeVector %float 2
%mat4v2float = OpTypeMatrix %v2float 4
%float_1 = OpConstant %float 1
%18 = OpConstantComposite %v2float %float_1 %float_1
%19 = OpConstantComposite %mat4v2float %18 %18 %18 %18
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%16 = OpConstantComposite %mat2v4float %15 %15
%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
%22 = OpConstantNull %mat2v4float
%23 = OpTypeFunction %v4float
%19 = OpConstantNull %mat2v4float
%20 = OpTypeFunction %v4float
%transpose_31e37e = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat2v4float Function %22
%13 = OpTranspose %mat2v4float %19
OpStore %res %13
%res = OpVariable %_ptr_Function_mat2v4float Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %transpose_31e37e
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %transpose_31e37e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %transpose_31e37e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_31e37e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_31e37e
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<3, 4, fa>) -> mat<4, 3, fa>
fn transpose_32dd64() {
var res = transpose(mat3x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_32dd64();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_32dd64();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_32dd64();
}

View File

@ -0,0 +1,30 @@
void transpose_32dd64() {
float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_32dd64();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_32dd64();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_32dd64();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_32dd64() {
float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_32dd64();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_32dd64();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_32dd64();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_32dd64() {
mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
}
vec4 vertex_main() {
transpose_32dd64();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_32dd64() {
mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
}
void fragment_main() {
transpose_32dd64();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_32dd64() {
mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
}
void compute_main() {
transpose_32dd64();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_32dd64() {
float4x3 res = float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_32dd64();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_32dd64();
return;
}
kernel void compute_main() {
transpose_32dd64();
return;
}

View File

@ -0,0 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_32dd64 "transpose_32dd64"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%mat4v3float = OpTypeMatrix %v3float 4
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%17 = OpConstantComposite %mat4v3float %16 %16 %16 %16
%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
%20 = OpConstantNull %mat4v3float
%21 = OpTypeFunction %v4float
%transpose_32dd64 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat4v3float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_32dd64
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_32dd64
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_32dd64
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn transpose_32dd64() {
var res = transpose(mat3x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_32dd64();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_32dd64();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_32dd64();
}

View File

@ -1,5 +1,5 @@
void transpose_4ce359() {
float4x2 res = transpose(float2x4((1.0f).xxxx, (1.0f).xxxx));
float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void transpose_4ce359() {
float4x2 res = transpose(float2x4((1.0f).xxxx, (1.0f).xxxx));
float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void transpose_4ce359() {
mat4x2 res = transpose(mat2x4(vec4(1.0f), vec4(1.0f)));
mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void transpose_4ce359() {
mat4x2 res = transpose(mat2x4(vec4(1.0f), vec4(1.0f)));
mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void transpose_4ce359() {
mat4x2 res = transpose(mat2x4(vec4(1.0f), vec4(1.0f)));
mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_4ce359() {
float4x2 res = transpose(float2x4(float4(1.0f), float4(1.0f)));
float4x2 res = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -32,39 +32,37 @@
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%mat4v2float = OpTypeMatrix %v2float 4
%mat2v4float = OpTypeMatrix %v4float 2
%float_1 = OpConstant %float 1
%18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%19 = OpConstantComposite %mat2v4float %18 %18
%16 = OpConstantComposite %v2float %float_1 %float_1
%17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
%22 = OpConstantNull %mat4v2float
%23 = OpTypeFunction %v4float
%20 = OpConstantNull %mat4v2float
%21 = OpTypeFunction %v4float
%transpose_4ce359 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat4v2float Function %22
%13 = OpTranspose %mat4v2float %19
OpStore %res %13
%res = OpVariable %_ptr_Function_mat4v2float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %transpose_4ce359
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_4ce359
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_4ce359
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_4ce359
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_4ce359
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_4ce359
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void transpose_4dc9a1() {
float3x2 res = transpose(float2x3((1.0f).xxx, (1.0f).xxx));
float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {

View File

@ -1,5 +1,5 @@
void transpose_4dc9a1() {
float3x2 res = transpose(float2x3((1.0f).xxx, (1.0f).xxx));
float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
#version 310 es
void transpose_4dc9a1() {
mat3x2 res = transpose(mat2x3(vec3(1.0f), vec3(1.0f)));
mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
vec4 vertex_main() {
@ -21,7 +21,7 @@ void main() {
precision mediump float;
void transpose_4dc9a1() {
mat3x2 res = transpose(mat2x3(vec3(1.0f), vec3(1.0f)));
mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void fragment_main() {
@ -35,7 +35,7 @@ void main() {
#version 310 es
void transpose_4dc9a1() {
mat3x2 res = transpose(mat2x3(vec3(1.0f), vec3(1.0f)));
mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_4dc9a1() {
float3x2 res = transpose(float2x3(float3(1.0f), float3(1.0f)));
float3x2 res = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@ -32,40 +32,37 @@
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%mat3v2float = OpTypeMatrix %v2float 3
%v3float = OpTypeVector %float 3
%mat2v3float = OpTypeMatrix %v3float 2
%float_1 = OpConstant %float 1
%19 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%20 = OpConstantComposite %mat2v3float %19 %19
%16 = OpConstantComposite %v2float %float_1 %float_1
%17 = OpConstantComposite %mat3v2float %16 %16 %16
%_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
%23 = OpConstantNull %mat3v2float
%24 = OpTypeFunction %v4float
%20 = OpConstantNull %mat3v2float
%21 = OpTypeFunction %v4float
%transpose_4dc9a1 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v2float Function %23
%13 = OpTranspose %mat3v2float %20
OpStore %res %13
%res = OpVariable %_ptr_Function_mat3v2float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %24
%26 = OpLabel
%27 = OpFunctionCall %void %transpose_4dc9a1
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_4dc9a1
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %30
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_4dc9a1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_4dc9a1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %transpose_4dc9a1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<4, 2, fa>) -> mat<2, 4, fa>
fn transpose_553e90() {
var res = transpose(mat4x2(1., 1., 1., 1., 1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_553e90();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_553e90();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_553e90();
}

View File

@ -0,0 +1,30 @@
void transpose_553e90() {
float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_553e90();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_553e90();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_553e90();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_553e90() {
float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_553e90();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_553e90();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_553e90();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_553e90() {
mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
}
vec4 vertex_main() {
transpose_553e90();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_553e90() {
mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
}
void fragment_main() {
transpose_553e90();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_553e90() {
mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
}
void compute_main() {
transpose_553e90();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_553e90() {
float2x4 res = float2x4(float4(1.0f), float4(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_553e90();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_553e90();
return;
}
kernel void compute_main() {
transpose_553e90();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_553e90 "transpose_553e90"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%mat2v4float = OpTypeMatrix %v4float 2
%float_1 = OpConstant %float 1
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%16 = OpConstantComposite %mat2v4float %15 %15
%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
%19 = OpConstantNull %mat2v4float
%20 = OpTypeFunction %v4float
%transpose_553e90 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat2v4float Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %transpose_553e90
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %transpose_553e90
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_553e90
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn transpose_553e90() {
var res = transpose(mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_553e90();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_553e90();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_553e90();
}

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<4, 3, fa>) -> mat<3, 4, fa>
fn transpose_5c133c() {
var res = transpose(mat4x3(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_5c133c();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_5c133c();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_5c133c();
}

View File

@ -0,0 +1,30 @@
void transpose_5c133c() {
float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_5c133c();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_5c133c();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_5c133c();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_5c133c() {
float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_5c133c();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_5c133c();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_5c133c();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_5c133c() {
mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
}
vec4 vertex_main() {
transpose_5c133c();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_5c133c() {
mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
}
void fragment_main() {
transpose_5c133c();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_5c133c() {
mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
}
void compute_main() {
transpose_5c133c();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_5c133c() {
float3x4 res = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_5c133c();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_5c133c();
return;
}
kernel void compute_main() {
transpose_5c133c();
return;
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_5c133c "transpose_5c133c"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%mat3v4float = OpTypeMatrix %v4float 3
%float_1 = OpConstant %float 1
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%16 = OpConstantComposite %mat3v4float %15 %15 %15
%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
%19 = OpConstantNull %mat3v4float
%20 = OpTypeFunction %v4float
%transpose_5c133c = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v4float Function %19
OpStore %res %16
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %transpose_5c133c
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%25 = OpLabel
%26 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %transpose_5c133c
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_5c133c
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn transpose_5c133c() {
var res = transpose(mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_5c133c();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_5c133c();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_5c133c();
}

View File

@ -1,5 +1,5 @@
void transpose_5edd96() {
matrix<float16_t, 2, 4> res = transpose(matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx));
matrix<float16_t, 2, 4> res = matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void transpose_5edd96() {
f16mat2x4 res = transpose(f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void transpose_5edd96() {
f16mat2x4 res = transpose(f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void transpose_5edd96() {
f16mat2x4 res = transpose(f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf)));
f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_5edd96() {
half2x4 res = transpose(half4x2(half2(1.0h), half2(1.0h), half2(1.0h), half2(1.0h)));
half2x4 res = half2x4(half4(1.0h), half4(1.0h));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 39
; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability Float16
@ -37,41 +37,38 @@
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
%mat2v4half = OpTypeMatrix %v4half 2
%v2half = OpTypeVector %half 2
%mat4v2half = OpTypeMatrix %v2half 4
%half_0x1p_0 = OpConstant %half 0x1p+0
%20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%21 = OpConstantComposite %mat4v2half %20 %20 %20 %20
%17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%18 = OpConstantComposite %mat2v4half %17 %17
%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
%24 = OpConstantNull %mat2v4half
%25 = OpTypeFunction %v4float
%21 = OpConstantNull %mat2v4half
%22 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%transpose_5edd96 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat2v4half Function %24
%13 = OpTranspose %mat2v4half %21
OpStore %res %13
%res = OpVariable %_ptr_Function_mat2v4half Function %21
OpStore %res %18
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %25
%27 = OpLabel
%28 = OpFunctionCall %void %transpose_5edd96
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %transpose_5edd96
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %31
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_5edd96
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_5edd96
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%37 = OpLabel
%38 = OpFunctionCall %void %transpose_5edd96
OpReturn
OpFunctionEnd

View File

@ -1,5 +1,5 @@
void transpose_5f36bf() {
matrix<float16_t, 3, 4> res = transpose(matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx));
matrix<float16_t, 3, 4> res = matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void transpose_5f36bf() {
f16mat3x4 res = transpose(f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void transpose_5f36bf() {
f16mat3x4 res = transpose(f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void transpose_5f36bf() {
f16mat3x4 res = transpose(f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf)));
f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_5f36bf() {
half3x4 res = transpose(half4x3(half3(1.0h), half3(1.0h), half3(1.0h), half3(1.0h)));
half3x4 res = half3x4(half4(1.0h), half4(1.0h), half4(1.0h));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 39
; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability Float16
@ -37,41 +37,38 @@
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
%mat3v4half = OpTypeMatrix %v4half 3
%v3half = OpTypeVector %half 3
%mat4v3half = OpTypeMatrix %v3half 4
%half_0x1p_0 = OpConstant %half 0x1p+0
%20 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%21 = OpConstantComposite %mat4v3half %20 %20 %20 %20
%17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%18 = OpConstantComposite %mat3v4half %17 %17 %17
%_ptr_Function_mat3v4half = OpTypePointer Function %mat3v4half
%24 = OpConstantNull %mat3v4half
%25 = OpTypeFunction %v4float
%21 = OpConstantNull %mat3v4half
%22 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%transpose_5f36bf = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v4half Function %24
%13 = OpTranspose %mat3v4half %21
OpStore %res %13
%res = OpVariable %_ptr_Function_mat3v4half Function %21
OpStore %res %18
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %25
%27 = OpLabel
%28 = OpFunctionCall %void %transpose_5f36bf
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %transpose_5f36bf
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %31
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_5f36bf
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_5f36bf
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%37 = OpLabel
%38 = OpFunctionCall %void %transpose_5f36bf
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<3, 3, fa>) -> mat<3, 3, fa>
fn transpose_66fce8() {
var res = transpose(mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_66fce8();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_66fce8();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_66fce8();
}

View File

@ -0,0 +1,30 @@
void transpose_66fce8() {
float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_66fce8();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_66fce8();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_66fce8();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_66fce8() {
float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_66fce8();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_66fce8();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_66fce8();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_66fce8() {
mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
}
vec4 vertex_main() {
transpose_66fce8();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_66fce8() {
mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
}
void fragment_main() {
transpose_66fce8();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_66fce8() {
mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
}
void compute_main() {
transpose_66fce8();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_66fce8() {
float3x3 res = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_66fce8();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_66fce8();
return;
}
kernel void compute_main() {
transpose_66fce8();
return;
}

View File

@ -0,0 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_66fce8 "transpose_66fce8"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%17 = OpConstantComposite %mat3v3float %16 %16 %16
%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
%20 = OpConstantNull %mat3v3float
%21 = OpTypeFunction %v4float
%transpose_66fce8 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v3float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_66fce8
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_66fce8
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_66fce8
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn transpose_66fce8() {
var res = transpose(mat3x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_66fce8();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_66fce8();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_66fce8();
}

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<2, 3, fa>) -> mat<3, 2, fa>
fn transpose_70ca11() {
var res = transpose(mat2x3(1., 1., 1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_70ca11();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_70ca11();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_70ca11();
}

View File

@ -0,0 +1,30 @@
void transpose_70ca11() {
float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_70ca11();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_70ca11();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_70ca11();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_70ca11() {
float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_70ca11();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_70ca11();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_70ca11();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_70ca11() {
mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
vec4 vertex_main() {
transpose_70ca11();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_70ca11() {
mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void fragment_main() {
transpose_70ca11();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_70ca11() {
mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void compute_main() {
transpose_70ca11();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_70ca11() {
float3x2 res = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_70ca11();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_70ca11();
return;
}
kernel void compute_main() {
transpose_70ca11();
return;
}

View File

@ -0,0 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_70ca11 "transpose_70ca11"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%mat3v2float = OpTypeMatrix %v2float 3
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v2float %float_1 %float_1
%17 = OpConstantComposite %mat3v2float %16 %16 %16
%_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
%20 = OpConstantNull %mat3v2float
%21 = OpTypeFunction %v4float
%transpose_70ca11 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat3v2float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_70ca11
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_70ca11
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_70ca11
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn transpose_70ca11() {
var res = transpose(mat2x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_70ca11();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_70ca11();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_70ca11();
}

View File

@ -1,5 +1,5 @@
void transpose_7be8b2() {
matrix<float16_t, 2, 2> res = transpose(matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx));
matrix<float16_t, 2, 2> res = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void transpose_7be8b2() {
f16mat2 res = transpose(f16mat2(f16vec2(1.0hf), f16vec2(1.0hf)));
f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void transpose_7be8b2() {
f16mat2 res = transpose(f16mat2(f16vec2(1.0hf), f16vec2(1.0hf)));
f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void transpose_7be8b2() {
f16mat2 res = transpose(f16mat2(f16vec2(1.0hf), f16vec2(1.0hf)));
f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_7be8b2() {
half2x2 res = transpose(half2x2(half2(1.0h), half2(1.0h)));
half2x2 res = half2x2(half2(1.0h), half2(1.0h));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability Float16
@ -38,38 +38,37 @@
%v2half = OpTypeVector %half 2
%mat2v2half = OpTypeMatrix %v2half 2
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%19 = OpConstantComposite %mat2v2half %18 %18
%17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
%18 = OpConstantComposite %mat2v2half %17 %17
%_ptr_Function_mat2v2half = OpTypePointer Function %mat2v2half
%22 = OpConstantNull %mat2v2half
%23 = OpTypeFunction %v4float
%21 = OpConstantNull %mat2v2half
%22 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%transpose_7be8b2 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat2v2half Function %22
%13 = OpTranspose %mat2v2half %19
OpStore %res %13
%res = OpVariable %_ptr_Function_mat2v2half Function %21
OpStore %res %18
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %transpose_7be8b2
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %transpose_7be8b2
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_7be8b2
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_7be8b2
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %transpose_7be8b2
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_7be8b2
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<2, 2, fa>) -> mat<2, 2, fa>
fn transpose_7eb2c5() {
var res = transpose(mat2x2(1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_7eb2c5();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_7eb2c5();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_7eb2c5();
}

View File

@ -0,0 +1,30 @@
void transpose_7eb2c5() {
float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_7eb2c5();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_7eb2c5();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_7eb2c5();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_7eb2c5() {
float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_7eb2c5();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_7eb2c5();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_7eb2c5();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_7eb2c5() {
mat2 res = mat2(vec2(1.0f), vec2(1.0f));
}
vec4 vertex_main() {
transpose_7eb2c5();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_7eb2c5() {
mat2 res = mat2(vec2(1.0f), vec2(1.0f));
}
void fragment_main() {
transpose_7eb2c5();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_7eb2c5() {
mat2 res = mat2(vec2(1.0f), vec2(1.0f));
}
void compute_main() {
transpose_7eb2c5();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_7eb2c5() {
float2x2 res = float2x2(float2(1.0f), float2(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_7eb2c5();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_7eb2c5();
return;
}
kernel void compute_main() {
transpose_7eb2c5();
return;
}

View File

@ -0,0 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_7eb2c5 "transpose_7eb2c5"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%mat2v2float = OpTypeMatrix %v2float 2
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v2float %float_1 %float_1
%17 = OpConstantComposite %mat2v2float %16 %16
%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
%20 = OpConstantNull %mat2v2float
%21 = OpTypeFunction %v4float
%transpose_7eb2c5 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat2v2float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_7eb2c5
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_7eb2c5
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_7eb2c5
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,19 @@
fn transpose_7eb2c5() {
var res = transpose(mat2x2(1.0, 1.0, 1.0, 1.0));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_7eb2c5();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_7eb2c5();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_7eb2c5();
}

View File

@ -1,5 +1,5 @@
void transpose_844869() {
matrix<float16_t, 4, 4> res = transpose(matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx));
matrix<float16_t, 4, 4> res = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
}
struct tint_symbol {

View File

@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void transpose_844869() {
f16mat4 res = transpose(f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
}
vec4 vertex_main() {
@ -23,7 +23,7 @@ void main() {
precision mediump float;
void transpose_844869() {
f16mat4 res = transpose(f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
}
void fragment_main() {
@ -38,7 +38,7 @@ void main() {
#extension GL_AMD_gpu_shader_half_float : require
void transpose_844869() {
f16mat4 res = transpose(f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf)));
f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
}
void compute_main() {

View File

@ -2,7 +2,7 @@
using namespace metal;
void transpose_844869() {
half4x4 res = transpose(half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h)));
half4x4 res = half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h));
}
struct tint_symbol {

View File

@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability Float16
@ -38,38 +38,37 @@
%v4half = OpTypeVector %half 4
%mat4v4half = OpTypeMatrix %v4half 4
%half_0x1p_0 = OpConstant %half 0x1p+0
%18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%19 = OpConstantComposite %mat4v4half %18 %18 %18 %18
%17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
%18 = OpConstantComposite %mat4v4half %17 %17 %17 %17
%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
%22 = OpConstantNull %mat4v4half
%23 = OpTypeFunction %v4float
%21 = OpConstantNull %mat4v4half
%22 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%transpose_844869 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat4v4half Function %22
%13 = OpTranspose %mat4v4half %19
OpStore %res %13
%res = OpVariable %_ptr_Function_mat4v4half Function %21
OpStore %res %18
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %transpose_844869
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %transpose_844869
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_844869
%31 = OpLabel
%32 = OpFunctionCall %void %transpose_844869
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %transpose_844869
%34 = OpLabel
%35 = OpFunctionCall %void %transpose_844869
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,43 @@
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
////////////////////////////////////////////////////////////////////////////////
// File generated by tools/src/cmd/gen
// using the template:
// test/tint/builtins/gen/gen.wgsl.tmpl
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// fn transpose(mat<2, 4, fa>) -> mat<4, 2, fa>
fn transpose_84a763() {
var res = transpose(mat2x4(1., 1., 1., 1., 1., 1., 1., 1.));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
transpose_84a763();
return vec4<f32>();
}
@fragment
fn fragment_main() {
transpose_84a763();
}
@compute @workgroup_size(1)
fn compute_main() {
transpose_84a763();
}

View File

@ -0,0 +1,30 @@
void transpose_84a763() {
float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_84a763();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_84a763();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_84a763();
return;
}

View File

@ -0,0 +1,30 @@
void transpose_84a763() {
float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
}
struct tint_symbol {
float4 value : SV_Position;
};
float4 vertex_main_inner() {
transpose_84a763();
return (0.0f).xxxx;
}
tint_symbol vertex_main() {
const float4 inner_result = vertex_main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.value = inner_result;
return wrapper_result;
}
void fragment_main() {
transpose_84a763();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
transpose_84a763();
return;
}

View File

@ -0,0 +1,49 @@
#version 310 es
void transpose_84a763() {
mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
vec4 vertex_main() {
transpose_84a763();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
void transpose_84a763() {
mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void fragment_main() {
transpose_84a763();
}
void main() {
fragment_main();
return;
}
#version 310 es
void transpose_84a763() {
mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
}
void compute_main() {
transpose_84a763();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}

View File

@ -0,0 +1,33 @@
#include <metal_stdlib>
using namespace metal;
void transpose_84a763() {
float4x2 res = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner() {
transpose_84a763();
return float4(0.0f);
}
vertex tint_symbol vertex_main() {
float4 const inner_result = vertex_main_inner();
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main() {
transpose_84a763();
return;
}
kernel void compute_main() {
transpose_84a763();
return;
}

View File

@ -0,0 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %transpose_84a763 "transpose_84a763"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %5
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%mat4v2float = OpTypeMatrix %v2float 4
%float_1 = OpConstant %float 1
%16 = OpConstantComposite %v2float %float_1 %float_1
%17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
%20 = OpConstantNull %mat4v2float
%21 = OpTypeFunction %v4float
%transpose_84a763 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_mat4v2float Function %20
OpStore %res %17
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %transpose_84a763
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
%26 = OpLabel
%27 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %27
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %transpose_84a763
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %transpose_84a763
OpReturn
OpFunctionEnd

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