mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
tint->dawn: Shuffle source tree in preperation of merging repos
docs/ -> docs/tint/ fuzzers/ -> src/tint/fuzzers/ samples/ -> src/tint/cmd/ src/ -> src/tint/ test/ -> test/tint/ BUG=tint:1418,tint:1433 Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
38f1e9c75c
commit
dbc13af287
34
test/tint/buffer/uniform/dynamic_index/read.wgsl
Normal file
34
test/tint/buffer/uniform/dynamic_index/read.wgsl
Normal file
@@ -0,0 +1,34 @@
|
||||
struct Inner {
|
||||
a : vec3<i32>;
|
||||
b : i32;
|
||||
c : vec3<u32>;
|
||||
d : u32;
|
||||
e : vec3<f32>;
|
||||
f : f32;
|
||||
g : vec2<i32>;
|
||||
h : vec2<i32>;
|
||||
i : mat2x3<f32>;
|
||||
@align(16) j : mat3x2<f32>;
|
||||
@align(16) k : array<vec4<i32>, 4>;
|
||||
};
|
||||
|
||||
struct S {
|
||||
arr : array<Inner, 8>;
|
||||
};
|
||||
|
||||
@binding(0) @group(0) var<uniform> s : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(@builtin(local_invocation_index) idx : u32) {
|
||||
let a = s.arr[idx].a;
|
||||
let b = s.arr[idx].b;
|
||||
let c = s.arr[idx].c;
|
||||
let d = s.arr[idx].d;
|
||||
let e = s.arr[idx].e;
|
||||
let f = s.arr[idx].f;
|
||||
let g = s.arr[idx].g;
|
||||
let h = s.arr[idx].h;
|
||||
let i = s.arr[idx].i;
|
||||
let j = s.arr[idx].j;
|
||||
let k = s.arr[idx].k;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#version 310 es
|
||||
|
||||
struct Inner {
|
||||
ivec3 a;
|
||||
int b;
|
||||
uvec3 c;
|
||||
uint d;
|
||||
vec3 e;
|
||||
float f;
|
||||
ivec2 g;
|
||||
ivec2 h;
|
||||
mat2x3 i;
|
||||
mat3x2 j;
|
||||
ivec4 k[4];
|
||||
};
|
||||
|
||||
struct S {
|
||||
Inner arr[8];
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform S_1 {
|
||||
Inner arr[8];
|
||||
} s;
|
||||
|
||||
void tint_symbol(uint idx) {
|
||||
ivec3 a = s.arr[idx].a;
|
||||
int b = s.arr[idx].b;
|
||||
uvec3 c = s.arr[idx].c;
|
||||
uint d = s.arr[idx].d;
|
||||
vec3 e = s.arr[idx].e;
|
||||
float f = s.arr[idx].f;
|
||||
ivec2 g = s.arr[idx].g;
|
||||
ivec2 h = s.arr[idx].h;
|
||||
mat2x3 i = s.arr[idx].i;
|
||||
mat3x2 j = s.arr[idx].j;
|
||||
ivec4 k[4] = s.arr[idx].k;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
cbuffer cbuffer_s : register(b0, space0) {
|
||||
uint4 s[96];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uint idx : SV_GroupIndex;
|
||||
};
|
||||
|
||||
float2x3 tint_symbol_9(uint4 buffer[96], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz));
|
||||
}
|
||||
|
||||
float3x2 tint_symbol_10(uint4 buffer[96], uint offset) {
|
||||
const uint scalar_offset_2 = ((offset + 0u)) / 4;
|
||||
uint4 ubo_load = buffer[scalar_offset_2 / 4];
|
||||
const uint scalar_offset_3 = ((offset + 8u)) / 4;
|
||||
uint4 ubo_load_1 = buffer[scalar_offset_3 / 4];
|
||||
const uint scalar_offset_4 = ((offset + 16u)) / 4;
|
||||
uint4 ubo_load_2 = buffer[scalar_offset_4 / 4];
|
||||
return float3x2(asfloat(((scalar_offset_2 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_4 & 2) ? ubo_load_2.zw : ubo_load_2.xy)));
|
||||
}
|
||||
|
||||
typedef int4 tint_symbol_12_ret[4];
|
||||
tint_symbol_12_ret tint_symbol_12(uint4 buffer[96], uint offset) {
|
||||
int4 arr_1[4] = (int4[4])0;
|
||||
{
|
||||
[loop] for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
const uint scalar_offset_5 = ((offset + (i_1 * 16u))) / 4;
|
||||
arr_1[i_1] = asint(buffer[scalar_offset_5 / 4]);
|
||||
}
|
||||
}
|
||||
return arr_1;
|
||||
}
|
||||
|
||||
void main_inner(uint idx) {
|
||||
const uint scalar_offset_6 = ((192u * idx)) / 4;
|
||||
const int3 a = asint(s[scalar_offset_6 / 4].xyz);
|
||||
const uint scalar_offset_7 = (((192u * idx) + 12u)) / 4;
|
||||
const int b = asint(s[scalar_offset_7 / 4][scalar_offset_7 % 4]);
|
||||
const uint scalar_offset_8 = (((192u * idx) + 16u)) / 4;
|
||||
const uint3 c = s[scalar_offset_8 / 4].xyz;
|
||||
const uint scalar_offset_9 = (((192u * idx) + 28u)) / 4;
|
||||
const uint d = s[scalar_offset_9 / 4][scalar_offset_9 % 4];
|
||||
const uint scalar_offset_10 = (((192u * idx) + 32u)) / 4;
|
||||
const float3 e = asfloat(s[scalar_offset_10 / 4].xyz);
|
||||
const uint scalar_offset_11 = (((192u * idx) + 44u)) / 4;
|
||||
const float f = asfloat(s[scalar_offset_11 / 4][scalar_offset_11 % 4]);
|
||||
const uint scalar_offset_12 = (((192u * idx) + 48u)) / 4;
|
||||
uint4 ubo_load_3 = s[scalar_offset_12 / 4];
|
||||
const int2 g = asint(((scalar_offset_12 & 2) ? ubo_load_3.zw : ubo_load_3.xy));
|
||||
const uint scalar_offset_13 = (((192u * idx) + 56u)) / 4;
|
||||
uint4 ubo_load_4 = s[scalar_offset_13 / 4];
|
||||
const int2 h = asint(((scalar_offset_13 & 2) ? ubo_load_4.zw : ubo_load_4.xy));
|
||||
const float2x3 i = tint_symbol_9(s, ((192u * idx) + 64u));
|
||||
const float3x2 j = tint_symbol_10(s, ((192u * idx) + 96u));
|
||||
const int4 k[4] = tint_symbol_12(s, ((192u * idx) + 128u));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(tint_symbol_1 tint_symbol) {
|
||||
main_inner(tint_symbol.idx);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
}
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
};
|
||||
|
||||
struct Inner {
|
||||
/* 0x0000 */ packed_int3 a;
|
||||
/* 0x000c */ int b;
|
||||
/* 0x0010 */ packed_uint3 c;
|
||||
/* 0x001c */ uint d;
|
||||
/* 0x0020 */ packed_float3 e;
|
||||
/* 0x002c */ float f;
|
||||
/* 0x0030 */ int2 g;
|
||||
/* 0x0038 */ int2 h;
|
||||
/* 0x0040 */ float2x3 i;
|
||||
/* 0x0060 */ float3x2 j;
|
||||
/* 0x0078 */ int8_t tint_pad[8];
|
||||
/* 0x0080 */ tint_array_wrapper k;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ Inner arr[8];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper_1 arr;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx, const constant S* const tint_symbol_1) {
|
||||
int3 const a = (*(tint_symbol_1)).arr.arr[idx].a;
|
||||
int const b = (*(tint_symbol_1)).arr.arr[idx].b;
|
||||
uint3 const c = (*(tint_symbol_1)).arr.arr[idx].c;
|
||||
uint const d = (*(tint_symbol_1)).arr.arr[idx].d;
|
||||
float3 const e = (*(tint_symbol_1)).arr.arr[idx].e;
|
||||
float const f = (*(tint_symbol_1)).arr.arr[idx].f;
|
||||
int2 const g = (*(tint_symbol_1)).arr.arr[idx].g;
|
||||
int2 const h = (*(tint_symbol_1)).arr.arr[idx].h;
|
||||
float2x3 const i = (*(tint_symbol_1)).arr.arr[idx].i;
|
||||
float3x2 const j = (*(tint_symbol_1)).arr.arr[idx].j;
|
||||
tint_array_wrapper const k = (*(tint_symbol_1)).arr.arr[idx].k;
|
||||
}
|
||||
|
||||
kernel void tint_symbol(const constant S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
|
||||
tint_symbol_inner(idx, tint_symbol_2);
|
||||
return;
|
||||
}
|
||||
|
||||
127
test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.spvasm
Normal file
127
test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,127 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 73
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %idx_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %idx_1 "idx_1"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "arr"
|
||||
OpName %Inner "Inner"
|
||||
OpMemberName %Inner 0 "a"
|
||||
OpMemberName %Inner 1 "b"
|
||||
OpMemberName %Inner 2 "c"
|
||||
OpMemberName %Inner 3 "d"
|
||||
OpMemberName %Inner 4 "e"
|
||||
OpMemberName %Inner 5 "f"
|
||||
OpMemberName %Inner 6 "g"
|
||||
OpMemberName %Inner 7 "h"
|
||||
OpMemberName %Inner 8 "i"
|
||||
OpMemberName %Inner 9 "j"
|
||||
OpMemberName %Inner 10 "k"
|
||||
OpName %s "s"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %idx "idx"
|
||||
OpName %main "main"
|
||||
OpDecorate %idx_1 BuiltIn LocalInvocationIndex
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %Inner 0 Offset 0
|
||||
OpMemberDecorate %Inner 1 Offset 12
|
||||
OpMemberDecorate %Inner 2 Offset 16
|
||||
OpMemberDecorate %Inner 3 Offset 28
|
||||
OpMemberDecorate %Inner 4 Offset 32
|
||||
OpMemberDecorate %Inner 5 Offset 44
|
||||
OpMemberDecorate %Inner 6 Offset 48
|
||||
OpMemberDecorate %Inner 7 Offset 56
|
||||
OpMemberDecorate %Inner 8 Offset 64
|
||||
OpMemberDecorate %Inner 8 ColMajor
|
||||
OpMemberDecorate %Inner 8 MatrixStride 16
|
||||
OpMemberDecorate %Inner 9 Offset 96
|
||||
OpMemberDecorate %Inner 9 ColMajor
|
||||
OpMemberDecorate %Inner 9 MatrixStride 8
|
||||
OpMemberDecorate %Inner 10 Offset 128
|
||||
OpDecorate %_arr_v4int_uint_4 ArrayStride 16
|
||||
OpDecorate %_arr_Inner_uint_8 ArrayStride 192
|
||||
OpDecorate %s NonWritable
|
||||
OpDecorate %s Binding 0
|
||||
OpDecorate %s DescriptorSet 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%idx_1 = OpVariable %_ptr_Input_uint Input
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%v2int = OpTypeVector %int 2
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
%v2float = OpTypeVector %float 2
|
||||
%mat3v2float = OpTypeMatrix %v2float 3
|
||||
%v4int = OpTypeVector %int 4
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_v4int_uint_4 = OpTypeArray %v4int %uint_4
|
||||
%Inner = OpTypeStruct %v3int %int %v3uint %uint %v3float %float %v2int %v2int %mat2v3float %mat3v2float %_arr_v4int_uint_4
|
||||
%uint_8 = OpConstant %uint 8
|
||||
%_arr_Inner_uint_8 = OpTypeArray %Inner %uint_8
|
||||
%S = OpTypeStruct %_arr_Inner_uint_8
|
||||
%_ptr_Uniform_S = OpTypePointer Uniform %S
|
||||
%s = OpVariable %_ptr_Uniform_S Uniform
|
||||
%void = OpTypeVoid
|
||||
%22 = OpTypeFunction %void %uint
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_v3int = OpTypePointer Uniform %v3int
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
|
||||
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%uint_6 = OpConstant %uint 6
|
||||
%_ptr_Uniform_v2int = OpTypePointer Uniform %v2int
|
||||
%uint_7 = OpConstant %uint 7
|
||||
%_ptr_Uniform_mat2v3float = OpTypePointer Uniform %mat2v3float
|
||||
%uint_9 = OpConstant %uint 9
|
||||
%_ptr_Uniform_mat3v2float = OpTypePointer Uniform %mat3v2float
|
||||
%uint_10 = OpConstant %uint 10
|
||||
%_ptr_Uniform__arr_v4int_uint_4 = OpTypePointer Uniform %_arr_v4int_uint_4
|
||||
%68 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %22
|
||||
%idx = OpFunctionParameter %uint
|
||||
%26 = OpLabel
|
||||
%29 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0 %idx %uint_0
|
||||
%30 = OpLoad %v3int %29
|
||||
%33 = OpAccessChain %_ptr_Uniform_int %s %uint_0 %idx %uint_1
|
||||
%34 = OpLoad %int %33
|
||||
%37 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_0 %idx %uint_2
|
||||
%38 = OpLoad %v3uint %37
|
||||
%41 = OpAccessChain %_ptr_Uniform_uint %s %uint_0 %idx %uint_3
|
||||
%42 = OpLoad %uint %41
|
||||
%44 = OpAccessChain %_ptr_Uniform_v3float %s %uint_0 %idx %uint_4
|
||||
%45 = OpLoad %v3float %44
|
||||
%48 = OpAccessChain %_ptr_Uniform_float %s %uint_0 %idx %uint_5
|
||||
%49 = OpLoad %float %48
|
||||
%52 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %idx %uint_6
|
||||
%53 = OpLoad %v2int %52
|
||||
%55 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %idx %uint_7
|
||||
%56 = OpLoad %v2int %55
|
||||
%58 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_0 %idx %uint_8
|
||||
%59 = OpLoad %mat2v3float %58
|
||||
%62 = OpAccessChain %_ptr_Uniform_mat3v2float %s %uint_0 %idx %uint_9
|
||||
%63 = OpLoad %mat3v2float %62
|
||||
%66 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %s %uint_0 %idx %uint_10
|
||||
%67 = OpLoad %_arr_v4int_uint_4 %66
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %68
|
||||
%70 = OpLabel
|
||||
%72 = OpLoad %uint %idx_1
|
||||
%71 = OpFunctionCall %void %main_inner %72
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,36 @@
|
||||
struct Inner {
|
||||
a : vec3<i32>;
|
||||
b : i32;
|
||||
c : vec3<u32>;
|
||||
d : u32;
|
||||
e : vec3<f32>;
|
||||
f : f32;
|
||||
g : vec2<i32>;
|
||||
h : vec2<i32>;
|
||||
i : mat2x3<f32>;
|
||||
@align(16)
|
||||
j : mat3x2<f32>;
|
||||
@align(16)
|
||||
k : array<vec4<i32>, 4>;
|
||||
}
|
||||
|
||||
struct S {
|
||||
arr : array<Inner, 8>;
|
||||
}
|
||||
|
||||
@binding(0) @group(0) var<uniform> s : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(@builtin(local_invocation_index) idx : u32) {
|
||||
let a = s.arr[idx].a;
|
||||
let b = s.arr[idx].b;
|
||||
let c = s.arr[idx].c;
|
||||
let d = s.arr[idx].d;
|
||||
let e = s.arr[idx].e;
|
||||
let f = s.arr[idx].f;
|
||||
let g = s.arr[idx].g;
|
||||
let h = s.arr[idx].h;
|
||||
let i = s.arr[idx].i;
|
||||
let j = s.arr[idx].j;
|
||||
let k = s.arr[idx].k;
|
||||
}
|
||||
36
test/tint/buffer/uniform/static_index/read.wgsl
Normal file
36
test/tint/buffer/uniform/static_index/read.wgsl
Normal file
@@ -0,0 +1,36 @@
|
||||
struct Inner {
|
||||
@size(16) x : i32;
|
||||
};
|
||||
|
||||
struct S {
|
||||
a : vec3<i32>;
|
||||
b : i32;
|
||||
c : vec3<u32>;
|
||||
d : u32;
|
||||
e : vec3<f32>;
|
||||
f : f32;
|
||||
g : vec2<i32>;
|
||||
h : vec2<i32>;
|
||||
i : mat2x3<f32>;
|
||||
j : mat3x2<f32>;
|
||||
@align(16) k : Inner;
|
||||
@align(16) l : array<Inner, 4>;
|
||||
};
|
||||
|
||||
@binding(0) @group(0) var<uniform> s : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let a = s.a;
|
||||
let b = s.b;
|
||||
let c = s.c;
|
||||
let d = s.d;
|
||||
let e = s.e;
|
||||
let f = s.f;
|
||||
let g = s.g;
|
||||
let h = s.h;
|
||||
let i = s.i;
|
||||
let j = s.j;
|
||||
let k = s.k;
|
||||
let l = s.l;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#version 310 es
|
||||
|
||||
struct Inner {
|
||||
int x;
|
||||
};
|
||||
|
||||
struct S {
|
||||
ivec3 a;
|
||||
int b;
|
||||
uvec3 c;
|
||||
uint d;
|
||||
vec3 e;
|
||||
float f;
|
||||
ivec2 g;
|
||||
ivec2 h;
|
||||
mat2x3 i;
|
||||
mat3x2 j;
|
||||
Inner k;
|
||||
Inner l[4];
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform S_1 {
|
||||
ivec3 a;
|
||||
int b;
|
||||
uvec3 c;
|
||||
uint d;
|
||||
vec3 e;
|
||||
float f;
|
||||
ivec2 g;
|
||||
ivec2 h;
|
||||
mat2x3 i;
|
||||
mat3x2 j;
|
||||
Inner k;
|
||||
Inner l[4];
|
||||
} s;
|
||||
|
||||
void tint_symbol() {
|
||||
ivec3 a = s.a;
|
||||
int b = s.b;
|
||||
uvec3 c = s.c;
|
||||
uint d = s.d;
|
||||
vec3 e = s.e;
|
||||
float f = s.f;
|
||||
ivec2 g = s.g;
|
||||
ivec2 h = s.h;
|
||||
mat2x3 i = s.i;
|
||||
mat3x2 j = s.j;
|
||||
Inner k = s.k;
|
||||
Inner l[4] = s.l;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
struct Inner {
|
||||
int x;
|
||||
};
|
||||
|
||||
cbuffer cbuffer_s : register(b0, space0) {
|
||||
uint4 s[13];
|
||||
};
|
||||
|
||||
float2x3 tint_symbol_7(uint4 buffer[13], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz));
|
||||
}
|
||||
|
||||
float3x2 tint_symbol_8(uint4 buffer[13], uint offset) {
|
||||
const uint scalar_offset_2 = ((offset + 0u)) / 4;
|
||||
uint4 ubo_load = buffer[scalar_offset_2 / 4];
|
||||
const uint scalar_offset_3 = ((offset + 8u)) / 4;
|
||||
uint4 ubo_load_1 = buffer[scalar_offset_3 / 4];
|
||||
const uint scalar_offset_4 = ((offset + 16u)) / 4;
|
||||
uint4 ubo_load_2 = buffer[scalar_offset_4 / 4];
|
||||
return float3x2(asfloat(((scalar_offset_2 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_4 & 2) ? ubo_load_2.zw : ubo_load_2.xy)));
|
||||
}
|
||||
|
||||
Inner tint_symbol_10(uint4 buffer[13], uint offset) {
|
||||
const uint scalar_offset_5 = ((offset + 0u)) / 4;
|
||||
const Inner tint_symbol_12 = {asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])};
|
||||
return tint_symbol_12;
|
||||
}
|
||||
|
||||
typedef Inner tint_symbol_11_ret[4];
|
||||
tint_symbol_11_ret tint_symbol_11(uint4 buffer[13], uint offset) {
|
||||
Inner arr[4] = (Inner[4])0;
|
||||
{
|
||||
[loop] for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
|
||||
arr[i_1] = tint_symbol_10(buffer, (offset + (i_1 * 16u)));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const int3 a = asint(s[0].xyz);
|
||||
const int b = asint(s[0].w);
|
||||
const uint3 c = s[1].xyz;
|
||||
const uint d = s[1].w;
|
||||
const float3 e = asfloat(s[2].xyz);
|
||||
const float f = asfloat(s[2].w);
|
||||
const int2 g = asint(s[3].xy);
|
||||
const int2 h = asint(s[3].zw);
|
||||
const float2x3 i = tint_symbol_7(s, 64u);
|
||||
const float3x2 j = tint_symbol_8(s, 96u);
|
||||
const Inner k = tint_symbol_10(s, 128u);
|
||||
const Inner l[4] = tint_symbol_11(s, 144u);
|
||||
return;
|
||||
}
|
||||
55
test/tint/buffer/uniform/static_index/read.wgsl.expected.msl
Normal file
55
test/tint/buffer/uniform/static_index/read.wgsl.expected.msl
Normal file
@@ -0,0 +1,55 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
}
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct Inner {
|
||||
/* 0x0000 */ int x;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ Inner arr[4];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ packed_int3 a;
|
||||
/* 0x000c */ int b;
|
||||
/* 0x0010 */ packed_uint3 c;
|
||||
/* 0x001c */ uint d;
|
||||
/* 0x0020 */ packed_float3 e;
|
||||
/* 0x002c */ float f;
|
||||
/* 0x0030 */ int2 g;
|
||||
/* 0x0038 */ int2 h;
|
||||
/* 0x0040 */ float2x3 i;
|
||||
/* 0x0060 */ float3x2 j;
|
||||
/* 0x0078 */ int8_t tint_pad_1[8];
|
||||
/* 0x0080 */ Inner k;
|
||||
/* 0x0090 */ tint_array_wrapper l;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) {
|
||||
int3 const a = (*(tint_symbol_1)).a;
|
||||
int const b = (*(tint_symbol_1)).b;
|
||||
uint3 const c = (*(tint_symbol_1)).c;
|
||||
uint const d = (*(tint_symbol_1)).d;
|
||||
float3 const e = (*(tint_symbol_1)).e;
|
||||
float const f = (*(tint_symbol_1)).f;
|
||||
int2 const g = (*(tint_symbol_1)).g;
|
||||
int2 const h = (*(tint_symbol_1)).h;
|
||||
float2x3 const i = (*(tint_symbol_1)).i;
|
||||
float3x2 const j = (*(tint_symbol_1)).j;
|
||||
Inner const k = (*(tint_symbol_1)).k;
|
||||
tint_array_wrapper const l = (*(tint_symbol_1)).l;
|
||||
return;
|
||||
}
|
||||
|
||||
116
test/tint/buffer/uniform/static_index/read.wgsl.expected.spvasm
Normal file
116
test/tint/buffer/uniform/static_index/read.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,116 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 67
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpMemberName %S 1 "b"
|
||||
OpMemberName %S 2 "c"
|
||||
OpMemberName %S 3 "d"
|
||||
OpMemberName %S 4 "e"
|
||||
OpMemberName %S 5 "f"
|
||||
OpMemberName %S 6 "g"
|
||||
OpMemberName %S 7 "h"
|
||||
OpMemberName %S 8 "i"
|
||||
OpMemberName %S 9 "j"
|
||||
OpMemberName %S 10 "k"
|
||||
OpName %Inner "Inner"
|
||||
OpMemberName %Inner 0 "x"
|
||||
OpMemberName %S 11 "l"
|
||||
OpName %s "s"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %S 1 Offset 12
|
||||
OpMemberDecorate %S 2 Offset 16
|
||||
OpMemberDecorate %S 3 Offset 28
|
||||
OpMemberDecorate %S 4 Offset 32
|
||||
OpMemberDecorate %S 5 Offset 44
|
||||
OpMemberDecorate %S 6 Offset 48
|
||||
OpMemberDecorate %S 7 Offset 56
|
||||
OpMemberDecorate %S 8 Offset 64
|
||||
OpMemberDecorate %S 8 ColMajor
|
||||
OpMemberDecorate %S 8 MatrixStride 16
|
||||
OpMemberDecorate %S 9 Offset 96
|
||||
OpMemberDecorate %S 9 ColMajor
|
||||
OpMemberDecorate %S 9 MatrixStride 8
|
||||
OpMemberDecorate %S 10 Offset 128
|
||||
OpMemberDecorate %Inner 0 Offset 0
|
||||
OpMemberDecorate %S 11 Offset 144
|
||||
OpDecorate %_arr_Inner_uint_4 ArrayStride 16
|
||||
OpDecorate %s NonWritable
|
||||
OpDecorate %s Binding 0
|
||||
OpDecorate %s DescriptorSet 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%v2int = OpTypeVector %int 2
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
%v2float = OpTypeVector %float 2
|
||||
%mat3v2float = OpTypeMatrix %v2float 3
|
||||
%Inner = OpTypeStruct %int
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_Inner_uint_4 = OpTypeArray %Inner %uint_4
|
||||
%S = OpTypeStruct %v3int %int %v3uint %uint %v3float %float %v2int %v2int %mat2v3float %mat3v2float %Inner %_arr_Inner_uint_4
|
||||
%_ptr_Uniform_S = OpTypePointer Uniform %S
|
||||
%s = OpVariable %_ptr_Uniform_S Uniform
|
||||
%void = OpTypeVoid
|
||||
%17 = OpTypeFunction %void
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_v3int = OpTypePointer Uniform %v3int
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
|
||||
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%uint_6 = OpConstant %uint 6
|
||||
%_ptr_Uniform_v2int = OpTypePointer Uniform %v2int
|
||||
%uint_7 = OpConstant %uint 7
|
||||
%uint_8 = OpConstant %uint 8
|
||||
%_ptr_Uniform_mat2v3float = OpTypePointer Uniform %mat2v3float
|
||||
%uint_9 = OpConstant %uint 9
|
||||
%_ptr_Uniform_mat3v2float = OpTypePointer Uniform %mat3v2float
|
||||
%uint_10 = OpConstant %uint 10
|
||||
%_ptr_Uniform_Inner = OpTypePointer Uniform %Inner
|
||||
%uint_11 = OpConstant %uint 11
|
||||
%_ptr_Uniform__arr_Inner_uint_4 = OpTypePointer Uniform %_arr_Inner_uint_4
|
||||
%main = OpFunction %void None %17
|
||||
%20 = OpLabel
|
||||
%23 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0
|
||||
%24 = OpLoad %v3int %23
|
||||
%27 = OpAccessChain %_ptr_Uniform_int %s %uint_1
|
||||
%28 = OpLoad %int %27
|
||||
%31 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_2
|
||||
%32 = OpLoad %v3uint %31
|
||||
%35 = OpAccessChain %_ptr_Uniform_uint %s %uint_3
|
||||
%36 = OpLoad %uint %35
|
||||
%38 = OpAccessChain %_ptr_Uniform_v3float %s %uint_4
|
||||
%39 = OpLoad %v3float %38
|
||||
%42 = OpAccessChain %_ptr_Uniform_float %s %uint_5
|
||||
%43 = OpLoad %float %42
|
||||
%46 = OpAccessChain %_ptr_Uniform_v2int %s %uint_6
|
||||
%47 = OpLoad %v2int %46
|
||||
%49 = OpAccessChain %_ptr_Uniform_v2int %s %uint_7
|
||||
%50 = OpLoad %v2int %49
|
||||
%53 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_8
|
||||
%54 = OpLoad %mat2v3float %53
|
||||
%57 = OpAccessChain %_ptr_Uniform_mat3v2float %s %uint_9
|
||||
%58 = OpLoad %mat3v2float %57
|
||||
%61 = OpAccessChain %_ptr_Uniform_Inner %s %uint_10
|
||||
%62 = OpLoad %Inner %61
|
||||
%65 = OpAccessChain %_ptr_Uniform__arr_Inner_uint_4 %s %uint_11
|
||||
%66 = OpLoad %_arr_Inner_uint_4 %65
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,39 @@
|
||||
struct Inner {
|
||||
@size(16)
|
||||
x : i32;
|
||||
}
|
||||
|
||||
struct S {
|
||||
a : vec3<i32>;
|
||||
b : i32;
|
||||
c : vec3<u32>;
|
||||
d : u32;
|
||||
e : vec3<f32>;
|
||||
f : f32;
|
||||
g : vec2<i32>;
|
||||
h : vec2<i32>;
|
||||
i : mat2x3<f32>;
|
||||
j : mat3x2<f32>;
|
||||
@align(16)
|
||||
k : Inner;
|
||||
@align(16)
|
||||
l : array<Inner, 4>;
|
||||
}
|
||||
|
||||
@binding(0) @group(0) var<uniform> s : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let a = s.a;
|
||||
let b = s.b;
|
||||
let c = s.c;
|
||||
let d = s.d;
|
||||
let e = s.e;
|
||||
let f = s.f;
|
||||
let g = s.g;
|
||||
let h = s.h;
|
||||
let i = s.i;
|
||||
let j = s.j;
|
||||
let k = s.k;
|
||||
let l = s.l;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/array.wgsl
Normal file
7
test/tint/buffer/uniform/types/array.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : array<vec4<f32>, 4>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/array.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/array.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
vec4 inner[4];
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
vec4 inner[4];
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
vec4 x[4] = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
21
test/tint/buffer/uniform/types/array.wgsl.expected.hlsl
Normal file
21
test/tint/buffer/uniform/types/array.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,21 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[4];
|
||||
};
|
||||
|
||||
typedef float4 tint_symbol_ret[4];
|
||||
tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) {
|
||||
float4 arr[4] = (float4[4])0;
|
||||
{
|
||||
[loop] for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
const uint scalar_offset = ((offset + (i * 16u))) / 4;
|
||||
arr[i] = asfloat(buffer[scalar_offset / 4]);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float4 x[4] = tint_symbol(u, 0u);
|
||||
return;
|
||||
}
|
||||
12
test/tint/buffer/uniform/types/array.wgsl.expected.msl
Normal file
12
test/tint/buffer/uniform/types/array.wgsl.expected.msl
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ float4 arr[4];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_array_wrapper* tint_symbol_1 [[buffer(0)]]) {
|
||||
tint_array_wrapper const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
37
test/tint/buffer/uniform/types/array.wgsl.expected.spvasm
Normal file
37
test/tint/buffer/uniform/types/array.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,37 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 17
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %_arr_v4float_uint_4 ArrayStride 16
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4
|
||||
%u_block = OpTypeStruct %_arr_v4float_uint_4
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform__arr_v4float_uint_4 = OpTypePointer Uniform %_arr_v4float_uint_4
|
||||
%main = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_Uniform__arr_v4float_uint_4 %u %uint_0
|
||||
%16 = OpLoad %_arr_v4float_uint_4 %15
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/array.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/array.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : array<vec4<f32>, 4>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/f32.wgsl
Normal file
7
test/tint/buffer/uniform/types/f32.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : f32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/f32.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/f32.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
float inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
float inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
float x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
9
test/tint/buffer/uniform/types/f32.wgsl.expected.hlsl
Normal file
9
test/tint/buffer/uniform/types/f32.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,9 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float x = asfloat(u[0].x);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/f32.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/f32.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant float* tint_symbol_1 [[buffer(0)]]) {
|
||||
float const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
33
test/tint/buffer/uniform/types/f32.wgsl.expected.spvasm
Normal file
33
test/tint/buffer/uniform/types/f32.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 14
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%u_block = OpTypeStruct %float
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%5 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%main = OpFunction %void None %5
|
||||
%8 = OpLabel
|
||||
%12 = OpAccessChain %_ptr_Uniform_float %u %uint_0
|
||||
%13 = OpLoad %float %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/f32.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/f32.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : f32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/i32.wgsl
Normal file
7
test/tint/buffer/uniform/types/i32.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : i32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/i32.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/i32.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
int inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
int inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
int x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
9
test/tint/buffer/uniform/types/i32.wgsl.expected.hlsl
Normal file
9
test/tint/buffer/uniform/types/i32.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,9 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const int x = asint(u[0].x);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/i32.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/i32.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant int* tint_symbol_1 [[buffer(0)]]) {
|
||||
int const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
33
test/tint/buffer/uniform/types/i32.wgsl.expected.spvasm
Normal file
33
test/tint/buffer/uniform/types/i32.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 14
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%u_block = OpTypeStruct %int
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%5 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%main = OpFunction %void None %5
|
||||
%8 = OpLabel
|
||||
%12 = OpAccessChain %_ptr_Uniform_int %u %uint_0
|
||||
%13 = OpLoad %int %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/i32.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/i32.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : i32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/mat2x2.wgsl
Normal file
7
test/tint/buffer/uniform/types/mat2x2.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : mat2x2<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
mat2 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
mat2 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
mat2 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
17
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.hlsl
Normal file
17
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,17 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
float2x2 tint_symbol(uint4 buffer[1], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
uint4 ubo_load = buffer[scalar_offset / 4];
|
||||
const uint scalar_offset_1 = ((offset + 8u)) / 4;
|
||||
uint4 ubo_load_1 = buffer[scalar_offset_1 / 4];
|
||||
return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float2x2 x = tint_symbol(u, 0u);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant float2x2* tint_symbol_1 [[buffer(0)]]) {
|
||||
float2x2 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
37
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.spvasm
Normal file
37
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,37 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpMemberDecorate %u_block 0 ColMajor
|
||||
OpMemberDecorate %u_block 0 MatrixStride 8
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%mat2v2float = OpTypeMatrix %v2float 2
|
||||
%u_block = OpTypeStruct %mat2v2float
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_mat2v2float = OpTypePointer Uniform %mat2v2float
|
||||
%main = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
%14 = OpAccessChain %_ptr_Uniform_mat2v2float %u %uint_0
|
||||
%15 = OpLoad %mat2v2float %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/mat2x2.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : mat2x2<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/mat2x3.wgsl
Normal file
7
test/tint/buffer/uniform/types/mat2x3.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : mat2x3<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
mat2x3 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
mat2x3 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
mat2x3 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
15
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.hlsl
Normal file
15
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,15 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[2];
|
||||
};
|
||||
|
||||
float2x3 tint_symbol(uint4 buffer[2], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float2x3 x = tint_symbol(u, 0u);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant float2x3* tint_symbol_1 [[buffer(0)]]) {
|
||||
float2x3 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
37
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.spvasm
Normal file
37
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,37 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpMemberDecorate %u_block 0 ColMajor
|
||||
OpMemberDecorate %u_block 0 MatrixStride 16
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
%u_block = OpTypeStruct %mat2v3float
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_mat2v3float = OpTypePointer Uniform %mat2v3float
|
||||
%main = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
%14 = OpAccessChain %_ptr_Uniform_mat2v3float %u %uint_0
|
||||
%15 = OpLoad %mat2v3float %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/mat2x3.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : mat2x3<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/mat3x2.wgsl
Normal file
7
test/tint/buffer/uniform/types/mat3x2.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : mat3x2<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
mat3x2 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
mat3x2 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
mat3x2 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.hlsl
Normal file
19
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,19 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[2];
|
||||
};
|
||||
|
||||
float3x2 tint_symbol(uint4 buffer[2], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
uint4 ubo_load = buffer[scalar_offset / 4];
|
||||
const uint scalar_offset_1 = ((offset + 8u)) / 4;
|
||||
uint4 ubo_load_1 = buffer[scalar_offset_1 / 4];
|
||||
const uint scalar_offset_2 = ((offset + 16u)) / 4;
|
||||
uint4 ubo_load_2 = buffer[scalar_offset_2 / 4];
|
||||
return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float3x2 x = tint_symbol(u, 0u);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant float3x2* tint_symbol_1 [[buffer(0)]]) {
|
||||
float3x2 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
37
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.spvasm
Normal file
37
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,37 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpMemberDecorate %u_block 0 ColMajor
|
||||
OpMemberDecorate %u_block 0 MatrixStride 8
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%mat3v2float = OpTypeMatrix %v2float 3
|
||||
%u_block = OpTypeStruct %mat3v2float
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_mat3v2float = OpTypePointer Uniform %mat3v2float
|
||||
%main = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
%14 = OpAccessChain %_ptr_Uniform_mat3v2float %u %uint_0
|
||||
%15 = OpLoad %mat3v2float %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/mat3x2.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : mat3x2<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/mat4x4.wgsl
Normal file
7
test/tint/buffer/uniform/types/mat4x4.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : mat4x4<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
mat4 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
mat4 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
mat4 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
17
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.hlsl
Normal file
17
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,17 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[4];
|
||||
};
|
||||
|
||||
float4x4 tint_symbol(uint4 buffer[4], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const uint scalar_offset_1 = ((offset + 16u)) / 4;
|
||||
const uint scalar_offset_2 = ((offset + 32u)) / 4;
|
||||
const uint scalar_offset_3 = ((offset + 48u)) / 4;
|
||||
return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4]));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float4x4 x = tint_symbol(u, 0u);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant float4x4* tint_symbol_1 [[buffer(0)]]) {
|
||||
float4x4 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
37
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.spvasm
Normal file
37
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,37 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 16
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpMemberDecorate %u_block 0 ColMajor
|
||||
OpMemberDecorate %u_block 0 MatrixStride 16
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%mat4v4float = OpTypeMatrix %v4float 4
|
||||
%u_block = OpTypeStruct %mat4v4float
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
|
||||
%main = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
%14 = OpAccessChain %_ptr_Uniform_mat4v4float %u %uint_0
|
||||
%15 = OpLoad %mat4v4float %14
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/mat4x4.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : mat4x4<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
14
test/tint/buffer/uniform/types/struct.wgsl
Normal file
14
test/tint/buffer/uniform/types/struct.wgsl
Normal file
@@ -0,0 +1,14 @@
|
||||
struct Inner {
|
||||
f : f32;
|
||||
};
|
||||
struct S {
|
||||
inner : Inner;
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
32
test/tint/buffer/uniform/types/struct.wgsl.expected.glsl
Normal file
32
test/tint/buffer/uniform/types/struct.wgsl.expected.glsl
Normal file
@@ -0,0 +1,32 @@
|
||||
SKIP: FAILED
|
||||
|
||||
#version 310 es
|
||||
|
||||
struct Inner {
|
||||
float f;
|
||||
};
|
||||
|
||||
struct S {
|
||||
Inner inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform S_1 {
|
||||
Inner inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
S x = u;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
Error parsing GLSL shader:
|
||||
ERROR: 0:16: '=' : cannot convert from 'layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform structure{ global highp float f} inner}' to ' temp structure{ global structure{ global highp float f} inner}'
|
||||
ERROR: 0:16: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
|
||||
|
||||
27
test/tint/buffer/uniform/types/struct.wgsl.expected.hlsl
Normal file
27
test/tint/buffer/uniform/types/struct.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,27 @@
|
||||
struct Inner {
|
||||
float f;
|
||||
};
|
||||
struct S {
|
||||
Inner inner;
|
||||
};
|
||||
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
Inner tint_symbol_1(uint4 buffer[1], uint offset) {
|
||||
const uint scalar_offset = ((offset + 0u)) / 4;
|
||||
const Inner tint_symbol_3 = {asfloat(buffer[scalar_offset / 4][scalar_offset % 4])};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
S tint_symbol(uint4 buffer[1], uint offset) {
|
||||
const S tint_symbol_4 = {tint_symbol_1(buffer, (offset + 0u))};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const S x = tint_symbol(u, 0u);
|
||||
return;
|
||||
}
|
||||
16
test/tint/buffer/uniform/types/struct.wgsl.expected.msl
Normal file
16
test/tint/buffer/uniform/types/struct.wgsl.expected.msl
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct Inner {
|
||||
/* 0x0000 */ float f;
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ Inner inner;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) {
|
||||
S const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
33
test/tint/buffer/uniform/types/struct.wgsl.expected.spvasm
Normal file
33
test/tint/buffer/uniform/types/struct.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 11
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "inner"
|
||||
OpName %Inner "Inner"
|
||||
OpMemberName %Inner 0 "f"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %Inner 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%Inner = OpTypeStruct %float
|
||||
%S = OpTypeStruct %Inner
|
||||
%_ptr_Uniform_S = OpTypePointer Uniform %S
|
||||
%u = OpVariable %_ptr_Uniform_S Uniform
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpLoad %S %u
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
14
test/tint/buffer/uniform/types/struct.wgsl.expected.wgsl
Normal file
14
test/tint/buffer/uniform/types/struct.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,14 @@
|
||||
struct Inner {
|
||||
f : f32;
|
||||
}
|
||||
|
||||
struct S {
|
||||
inner : Inner;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> u : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/u32.wgsl
Normal file
7
test/tint/buffer/uniform/types/u32.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : u32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/u32.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/u32.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
uint inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
uint inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
uint x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
9
test/tint/buffer/uniform/types/u32.wgsl.expected.hlsl
Normal file
9
test/tint/buffer/uniform/types/u32.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,9 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const uint x = u[0].x;
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/u32.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/u32.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant uint* tint_symbol_1 [[buffer(0)]]) {
|
||||
uint const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
32
test/tint/buffer/uniform/types/u32.wgsl.expected.spvasm
Normal file
32
test/tint/buffer/uniform/types/u32.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 13
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%u_block = OpTypeStruct %uint
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%5 = OpTypeFunction %void
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
|
||||
%main = OpFunction %void None %5
|
||||
%8 = OpLabel
|
||||
%11 = OpAccessChain %_ptr_Uniform_uint %u %uint_0
|
||||
%12 = OpLoad %uint %11
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/u32.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/u32.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : u32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/vec2.wgsl
Normal file
7
test/tint/buffer/uniform/types/vec2.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : vec2<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/vec2.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/vec2.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
ivec2 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
ivec2 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
ivec2 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
9
test/tint/buffer/uniform/types/vec2.wgsl.expected.hlsl
Normal file
9
test/tint/buffer/uniform/types/vec2.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,9 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const int2 x = asint(u[0].xy);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/vec2.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/vec2.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant int2* tint_symbol_1 [[buffer(0)]]) {
|
||||
int2 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
34
test/tint/buffer/uniform/types/vec2.wgsl.expected.spvasm
Normal file
34
test/tint/buffer/uniform/types/vec2.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,34 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 15
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v2int = OpTypeVector %int 2
|
||||
%u_block = OpTypeStruct %v2int
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_v2int = OpTypePointer Uniform %v2int
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%13 = OpAccessChain %_ptr_Uniform_v2int %u %uint_0
|
||||
%14 = OpLoad %v2int %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/vec2.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/vec2.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : vec2<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/vec3.wgsl
Normal file
7
test/tint/buffer/uniform/types/vec3.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : vec3<u32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/vec3.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/vec3.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
uvec3 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
uvec3 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
uvec3 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
9
test/tint/buffer/uniform/types/vec3.wgsl.expected.hlsl
Normal file
9
test/tint/buffer/uniform/types/vec3.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,9 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const uint3 x = u[0].xyz;
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/vec3.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/vec3.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant uint3* tint_symbol_1 [[buffer(0)]]) {
|
||||
uint3 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
33
test/tint/buffer/uniform/types/vec3.wgsl.expected.spvasm
Normal file
33
test/tint/buffer/uniform/types/vec3.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 14
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%u_block = OpTypeStruct %v3uint
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%12 = OpAccessChain %_ptr_Uniform_v3uint %u %uint_0
|
||||
%13 = OpLoad %v3uint %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/vec3.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/vec3.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : vec3<u32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
7
test/tint/buffer/uniform/types/vec4.wgsl
Normal file
7
test/tint/buffer/uniform/types/vec4.wgsl
Normal file
@@ -0,0 +1,7 @@
|
||||
@group(0) @binding(0)
|
||||
var<uniform> u : vec4<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
19
test/tint/buffer/uniform/types/vec4.wgsl.expected.glsl
Normal file
19
test/tint/buffer/uniform/types/vec4.wgsl.expected.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 310 es
|
||||
|
||||
struct u_block {
|
||||
vec4 inner;
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform u_block_1 {
|
||||
vec4 inner;
|
||||
} u;
|
||||
|
||||
void tint_symbol() {
|
||||
vec4 x = u.inner;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
9
test/tint/buffer/uniform/types/vec4.wgsl.expected.hlsl
Normal file
9
test/tint/buffer/uniform/types/vec4.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,9 @@
|
||||
cbuffer cbuffer_u : register(b0, space0) {
|
||||
uint4 u[1];
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const float4 x = asfloat(u[0]);
|
||||
return;
|
||||
}
|
||||
8
test/tint/buffer/uniform/types/vec4.wgsl.expected.msl
Normal file
8
test/tint/buffer/uniform/types/vec4.wgsl.expected.msl
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol(const constant float4* tint_symbol_1 [[buffer(0)]]) {
|
||||
float4 const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
34
test/tint/buffer/uniform/types/vec4.wgsl.expected.spvasm
Normal file
34
test/tint/buffer/uniform/types/vec4.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,34 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 15
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %main "main"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
OpDecorate %u NonWritable
|
||||
OpDecorate %u DescriptorSet 0
|
||||
OpDecorate %u Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%u_block = OpTypeStruct %v4float
|
||||
%_ptr_Uniform_u_block = OpTypePointer Uniform %u_block
|
||||
%u = OpVariable %_ptr_Uniform_u_block Uniform
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%13 = OpAccessChain %_ptr_Uniform_v4float %u %uint_0
|
||||
%14 = OpLoad %v4float %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
6
test/tint/buffer/uniform/types/vec4.wgsl.expected.wgsl
Normal file
6
test/tint/buffer/uniform/types/vec4.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<uniform> u : vec4<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let x = u;
|
||||
}
|
||||
Reference in New Issue
Block a user