mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 05:57:51 +00:00
test: Remove many expected files
For these tests, we only really care that we can successfully consume them and generate valid output for each backend. Having the expected files in the tree generates significant churn for any change to how we generate backend code, which makes it hard to inspect diffs. Change-Id: Ic98c248081144c0fb1791f1303eaf6d459548e3d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62720 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
568136dd10
commit
87cce20f67
@@ -1,74 +0,0 @@
|
||||
SKIP: FAILED
|
||||
|
||||
void set_float3(inout float3 vec, int idx, float val) {
|
||||
vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec;
|
||||
}
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[4];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b1, space0) {
|
||||
uint4 x_9[2];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
float3x3 m = float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
int a = 0;
|
||||
float3 arr[2] = (float3[2])0;
|
||||
float3 v = float3(0.0f, 0.0f, 0.0f);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_45 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
const float x_46 = float(x_45);
|
||||
m = float3x3(float3(x_46, 0.0f, 0.0f), float3(0.0f, x_46, 0.0f), float3(0.0f, 0.0f, x_46));
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_52 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
a = x_52;
|
||||
const int x_53 = a;
|
||||
const int x_54 = a;
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const float x_56 = asfloat(x_9[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
set_float3(m[x_53], x_54, x_56);
|
||||
const float3 x_59 = m[1];
|
||||
const float3 x_61 = m[1];
|
||||
const float3 tint_symbol_4[2] = {x_59, x_61};
|
||||
arr = tint_symbol_4;
|
||||
const float x_64 = asfloat(x_9[1].x);
|
||||
v = float3(x_64, x_64, x_64);
|
||||
const float3 x_68 = arr[a];
|
||||
v = (v + x_68);
|
||||
const float3 x_71 = v;
|
||||
const int x_73 = asint(x_6[1].x);
|
||||
const int x_76 = asint(x_6[2].x);
|
||||
const int x_79 = asint(x_6[1].x);
|
||||
if (all((x_71 == float3(float(x_73), float(x_76), float(x_79))))) {
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_88 = asint(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
const int x_91 = asint(x_6[3].x);
|
||||
const int x_94 = asint(x_6[3].x);
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_97 = asint(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
x_GLF_color = float4(float(x_88), float(x_91), float(x_94), float(x_97));
|
||||
} else {
|
||||
const int x_101 = asint(x_6[3].x);
|
||||
const float x_102 = float(x_101);
|
||||
x_GLF_color = float4(x_102, x_102, x_102, x_102);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
tint_symbol main() {
|
||||
main_1();
|
||||
const main_out tint_symbol_1 = {x_GLF_color};
|
||||
const tint_symbol tint_symbol_5 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001C5FF133840(29,14-20): error X3500: array reference cannot be used as an l-value; not natively addressable
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ tint_padded_array_element arr[4];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
|
||||
};
|
||||
struct tint_padded_array_element_1 {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad_1[12];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_padded_array_element_1 arr[2];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
float3 arr[2];
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void main_1(constant buf0& x_6, constant buf1& x_9, thread float4* const tint_symbol_4) {
|
||||
float3x3 m = float3x3(0.0f);
|
||||
int a = 0;
|
||||
tint_array_wrapper_2 arr = {};
|
||||
float3 v = 0.0f;
|
||||
int const x_45 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_46 = float(x_45);
|
||||
m = float3x3(float3(x_46, 0.0f, 0.0f), float3(0.0f, x_46, 0.0f), float3(0.0f, 0.0f, x_46));
|
||||
int const x_52 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
a = x_52;
|
||||
int const x_53 = a;
|
||||
int const x_54 = a;
|
||||
float const x_56 = x_9.x_GLF_uniform_float_values.arr[0].el;
|
||||
m[x_53][x_54] = x_56;
|
||||
float3 const x_59 = m[1];
|
||||
float3 const x_61 = m[1];
|
||||
tint_array_wrapper_2 const tint_symbol_2 = {.arr={x_59, x_61}};
|
||||
arr = tint_symbol_2;
|
||||
float const x_64 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
v = float3(x_64, x_64, x_64);
|
||||
int const x_66 = a;
|
||||
float3 const x_68 = arr.arr[x_66];
|
||||
float3 const x_69 = v;
|
||||
v = (x_69 + x_68);
|
||||
float3 const x_71 = v;
|
||||
int const x_73 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_76 = x_6.x_GLF_uniform_int_values.arr[2].el;
|
||||
int const x_79 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
if (all((x_71 == float3(float(x_73), float(x_76), float(x_79))))) {
|
||||
int const x_88 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_91 = x_6.x_GLF_uniform_int_values.arr[3].el;
|
||||
int const x_94 = x_6.x_GLF_uniform_int_values.arr[3].el;
|
||||
int const x_97 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_4) = float4(float(x_88), float(x_91), float(x_94), float(x_97));
|
||||
} else {
|
||||
int const x_101 = x_6.x_GLF_uniform_int_values.arr[3].el;
|
||||
float const x_102 = float(x_101);
|
||||
*(tint_symbol_4) = float4(x_102, x_102, x_102, x_102);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(constant buf0& x_6, constant buf1& x_9, thread float4* const tint_symbol_5) {
|
||||
main_1(x_6, x_9, tint_symbol_5);
|
||||
main_out const tint_symbol_3 = {.x_GLF_color_1=*(tint_symbol_5)};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]], constant buf1& x_9 [[buffer(1)]]) {
|
||||
thread float4 tint_symbol_6 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(x_6, x_9, &(tint_symbol_6));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 121
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_6 "x_6"
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "x_GLF_uniform_float_values"
|
||||
OpName %x_9 "x_9"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %m "m"
|
||||
OpName %a "a"
|
||||
OpName %arr "arr"
|
||||
OpName %v "v"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %x_GLF_color_1_1 Location 0
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_4 ArrayStride 16
|
||||
OpDecorate %x_6 NonWritable
|
||||
OpDecorate %x_6 DescriptorSet 0
|
||||
OpDecorate %x_6 Binding 0
|
||||
OpDecorate %buf1 Block
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_2 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 1
|
||||
OpDecorate %_arr_v3float_uint_2 ArrayStride 16
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_int_uint_4 = OpTypeArray %int %uint_4
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_4
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_6 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr_float_uint_2 = OpTypeArray %float %uint_2
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_2
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%void = OpTypeVoid
|
||||
%20 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat3v3float = OpTypeMatrix %v3float 3
|
||||
%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
|
||||
%28 = OpConstantNull %mat3v3float
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%31 = OpConstantNull %int
|
||||
%_arr_v3float_uint_2 = OpTypeArray %v3float %uint_2
|
||||
%_ptr_Function__arr_v3float_uint_2 = OpTypePointer Function %_arr_v3float_uint_2
|
||||
%35 = OpConstantNull %_arr_v3float_uint_2
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%38 = OpConstantNull %v3float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%float_0 = OpConstant %float 0
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%int_3 = OpConstant %int 3
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%110 = OpTypeFunction %main_out
|
||||
%main_1 = OpFunction %void None %20
|
||||
%23 = OpLabel
|
||||
%m = OpVariable %_ptr_Function_mat3v3float Function %28
|
||||
%a = OpVariable %_ptr_Function_int Function %31
|
||||
%arr = OpVariable %_ptr_Function__arr_v3float_uint_2 Function %35
|
||||
%v = OpVariable %_ptr_Function_v3float Function %38
|
||||
%42 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%43 = OpLoad %int %42
|
||||
%44 = OpConvertSToF %float %43
|
||||
%46 = OpCompositeConstruct %v3float %44 %float_0 %float_0
|
||||
%47 = OpCompositeConstruct %v3float %float_0 %44 %float_0
|
||||
%48 = OpCompositeConstruct %v3float %float_0 %float_0 %44
|
||||
%49 = OpCompositeConstruct %mat3v3float %46 %47 %48
|
||||
OpStore %m %49
|
||||
%50 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%51 = OpLoad %int %50
|
||||
OpStore %a %51
|
||||
%52 = OpLoad %int %a
|
||||
%53 = OpLoad %int %a
|
||||
%55 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
|
||||
%56 = OpLoad %float %55
|
||||
%58 = OpAccessChain %_ptr_Function_float %m %52 %53
|
||||
OpStore %58 %56
|
||||
%60 = OpAccessChain %_ptr_Function_v3float %m %int_1
|
||||
%61 = OpLoad %v3float %60
|
||||
%62 = OpAccessChain %_ptr_Function_v3float %m %int_1
|
||||
%63 = OpLoad %v3float %62
|
||||
%64 = OpCompositeConstruct %_arr_v3float_uint_2 %61 %63
|
||||
OpStore %arr %64
|
||||
%65 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%66 = OpLoad %float %65
|
||||
%67 = OpCompositeConstruct %v3float %66 %66 %66
|
||||
OpStore %v %67
|
||||
%68 = OpLoad %int %a
|
||||
%69 = OpAccessChain %_ptr_Function_v3float %arr %68
|
||||
%70 = OpLoad %v3float %69
|
||||
%71 = OpLoad %v3float %v
|
||||
%72 = OpFAdd %v3float %71 %70
|
||||
OpStore %v %72
|
||||
%73 = OpLoad %v3float %v
|
||||
%74 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%75 = OpLoad %int %74
|
||||
%77 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
|
||||
%78 = OpLoad %int %77
|
||||
%79 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%80 = OpLoad %int %79
|
||||
%83 = OpConvertSToF %float %75
|
||||
%84 = OpConvertSToF %float %78
|
||||
%85 = OpConvertSToF %float %80
|
||||
%86 = OpCompositeConstruct %v3float %83 %84 %85
|
||||
%87 = OpFOrdEqual %v3bool %73 %86
|
||||
%81 = OpAll %bool %87
|
||||
OpSelectionMerge %89 None
|
||||
OpBranchConditional %81 %90 %91
|
||||
%90 = OpLabel
|
||||
%92 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%93 = OpLoad %int %92
|
||||
%95 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
|
||||
%96 = OpLoad %int %95
|
||||
%97 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
|
||||
%98 = OpLoad %int %97
|
||||
%99 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%100 = OpLoad %int %99
|
||||
%101 = OpConvertSToF %float %93
|
||||
%102 = OpConvertSToF %float %96
|
||||
%103 = OpConvertSToF %float %98
|
||||
%104 = OpConvertSToF %float %100
|
||||
%105 = OpCompositeConstruct %v4float %101 %102 %103 %104
|
||||
OpStore %x_GLF_color %105
|
||||
OpBranch %89
|
||||
%91 = OpLabel
|
||||
%106 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
|
||||
%107 = OpLoad %int %106
|
||||
%108 = OpConvertSToF %float %107
|
||||
%109 = OpCompositeConstruct %v4float %108 %108 %108 %108
|
||||
OpStore %x_GLF_color %109
|
||||
OpBranch %89
|
||||
%89 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %110
|
||||
%113 = OpLabel
|
||||
%114 = OpFunctionCall %void %main_1
|
||||
%115 = OpLoad %v4float %x_GLF_color
|
||||
%116 = OpCompositeConstruct %main_out %115
|
||||
OpReturnValue %116
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %20
|
||||
%118 = OpLabel
|
||||
%119 = OpFunctionCall %main_out %main_inner
|
||||
%120 = OpCompositeExtract %v4float %119 0
|
||||
OpStore %x_GLF_color_1_1 %120
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,71 +0,0 @@
|
||||
type Arr = [[stride(16)]] array<i32, 4>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_9 : buf1;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var m : mat3x3<f32>;
|
||||
var a : i32;
|
||||
var arr : array<vec3<f32>, 2>;
|
||||
var v : vec3<f32>;
|
||||
let x_45 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_46 : f32 = f32(x_45);
|
||||
m = mat3x3<f32>(vec3<f32>(x_46, 0.0, 0.0), vec3<f32>(0.0, x_46, 0.0), vec3<f32>(0.0, 0.0, x_46));
|
||||
let x_52 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
a = x_52;
|
||||
let x_53 : i32 = a;
|
||||
let x_54 : i32 = a;
|
||||
let x_56 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
m[x_53][x_54] = x_56;
|
||||
let x_59 : vec3<f32> = m[1];
|
||||
let x_61 : vec3<f32> = m[1];
|
||||
arr = array<vec3<f32>, 2>(x_59, x_61);
|
||||
let x_64 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
v = vec3<f32>(x_64, x_64, x_64);
|
||||
let x_66 : i32 = a;
|
||||
let x_68 : vec3<f32> = arr[x_66];
|
||||
let x_69 : vec3<f32> = v;
|
||||
v = (x_69 + x_68);
|
||||
let x_71 : vec3<f32> = v;
|
||||
let x_73 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_76 : i32 = x_6.x_GLF_uniform_int_values[2];
|
||||
let x_79 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
if (all((x_71 == vec3<f32>(f32(x_73), f32(x_76), f32(x_79))))) {
|
||||
let x_88 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_91 : i32 = x_6.x_GLF_uniform_int_values[3];
|
||||
let x_94 : i32 = x_6.x_GLF_uniform_int_values[3];
|
||||
let x_97 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_88), f32(x_91), f32(x_94), f32(x_97));
|
||||
} else {
|
||||
let x_101 : i32 = x_6.x_GLF_uniform_int_values[3];
|
||||
let x_102 : f32 = f32(x_101);
|
||||
x_GLF_color = vec4<f32>(x_102, x_102, x_102, x_102);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
[[location(0)]]
|
||||
x_GLF_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main() -> main_out {
|
||||
main_1();
|
||||
return main_out(x_GLF_color);
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
SKIP: FAILED
|
||||
|
||||
void set_float3(inout float3 vec, int idx, float val) {
|
||||
vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec;
|
||||
}
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[4];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b1, space0) {
|
||||
uint4 x_9[2];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
float3x3 m = float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
int a = 0;
|
||||
float3 arr[2] = (float3[2])0;
|
||||
float3 v = float3(0.0f, 0.0f, 0.0f);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_45 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
const float x_46 = float(x_45);
|
||||
m = float3x3(float3(x_46, 0.0f, 0.0f), float3(0.0f, x_46, 0.0f), float3(0.0f, 0.0f, x_46));
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_52 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
a = x_52;
|
||||
const int x_53 = a;
|
||||
const int x_54 = a;
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const float x_56 = asfloat(x_9[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
set_float3(m[x_53], x_54, x_56);
|
||||
const float3 x_59 = m[1];
|
||||
const float3 x_61 = m[1];
|
||||
const float3 tint_symbol_4[2] = {x_59, x_61};
|
||||
arr = tint_symbol_4;
|
||||
const float x_64 = asfloat(x_9[1].x);
|
||||
v = float3(x_64, x_64, x_64);
|
||||
const float3 x_68 = arr[a];
|
||||
v = (v + x_68);
|
||||
const float3 x_71 = v;
|
||||
const int x_73 = asint(x_6[1].x);
|
||||
const int x_76 = asint(x_6[2].x);
|
||||
const int x_79 = asint(x_6[1].x);
|
||||
if (all((x_71 == float3(float(x_73), float(x_76), float(x_79))))) {
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_88 = asint(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
const int x_91 = asint(x_6[3].x);
|
||||
const int x_94 = asint(x_6[3].x);
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_97 = asint(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
x_GLF_color = float4(float(x_88), float(x_91), float(x_94), float(x_97));
|
||||
} else {
|
||||
const int x_101 = asint(x_6[3].x);
|
||||
const float x_102 = float(x_101);
|
||||
x_GLF_color = float4(x_102, x_102, x_102, x_102);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
tint_symbol main() {
|
||||
main_1();
|
||||
const main_out tint_symbol_1 = {x_GLF_color};
|
||||
const tint_symbol tint_symbol_5 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001D041DE1330(29,14-20): error X3500: array reference cannot be used as an l-value; not natively addressable
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ tint_padded_array_element arr[4];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
|
||||
};
|
||||
struct tint_padded_array_element_1 {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad_1[12];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_padded_array_element_1 arr[2];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
float3 arr[2];
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void main_1(constant buf0& x_6, constant buf1& x_9, thread float4* const tint_symbol_4) {
|
||||
float3x3 m = float3x3(0.0f);
|
||||
int a = 0;
|
||||
tint_array_wrapper_2 arr = {};
|
||||
float3 v = 0.0f;
|
||||
int const x_45 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_46 = float(x_45);
|
||||
m = float3x3(float3(x_46, 0.0f, 0.0f), float3(0.0f, x_46, 0.0f), float3(0.0f, 0.0f, x_46));
|
||||
int const x_52 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
a = x_52;
|
||||
int const x_53 = a;
|
||||
int const x_54 = a;
|
||||
float const x_56 = x_9.x_GLF_uniform_float_values.arr[0].el;
|
||||
m[x_53][x_54] = x_56;
|
||||
float3 const x_59 = m[1];
|
||||
float3 const x_61 = m[1];
|
||||
tint_array_wrapper_2 const tint_symbol_2 = {.arr={x_59, x_61}};
|
||||
arr = tint_symbol_2;
|
||||
float const x_64 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
v = float3(x_64, x_64, x_64);
|
||||
int const x_66 = a;
|
||||
float3 const x_68 = arr.arr[x_66];
|
||||
float3 const x_69 = v;
|
||||
v = (x_69 + x_68);
|
||||
float3 const x_71 = v;
|
||||
int const x_73 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_76 = x_6.x_GLF_uniform_int_values.arr[2].el;
|
||||
int const x_79 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
if (all((x_71 == float3(float(x_73), float(x_76), float(x_79))))) {
|
||||
int const x_88 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_91 = x_6.x_GLF_uniform_int_values.arr[3].el;
|
||||
int const x_94 = x_6.x_GLF_uniform_int_values.arr[3].el;
|
||||
int const x_97 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_4) = float4(float(x_88), float(x_91), float(x_94), float(x_97));
|
||||
} else {
|
||||
int const x_101 = x_6.x_GLF_uniform_int_values.arr[3].el;
|
||||
float const x_102 = float(x_101);
|
||||
*(tint_symbol_4) = float4(x_102, x_102, x_102, x_102);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(constant buf0& x_6, constant buf1& x_9, thread float4* const tint_symbol_5) {
|
||||
main_1(x_6, x_9, tint_symbol_5);
|
||||
main_out const tint_symbol_3 = {.x_GLF_color_1=*(tint_symbol_5)};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]], constant buf1& x_9 [[buffer(1)]]) {
|
||||
thread float4 tint_symbol_6 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(x_6, x_9, &(tint_symbol_6));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 121
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_6 "x_6"
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "x_GLF_uniform_float_values"
|
||||
OpName %x_9 "x_9"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %m "m"
|
||||
OpName %a "a"
|
||||
OpName %arr "arr"
|
||||
OpName %v "v"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %x_GLF_color_1_1 Location 0
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_4 ArrayStride 16
|
||||
OpDecorate %x_6 NonWritable
|
||||
OpDecorate %x_6 DescriptorSet 0
|
||||
OpDecorate %x_6 Binding 0
|
||||
OpDecorate %buf1 Block
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_2 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 1
|
||||
OpDecorate %_arr_v3float_uint_2 ArrayStride 16
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_int_uint_4 = OpTypeArray %int %uint_4
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_4
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_6 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr_float_uint_2 = OpTypeArray %float %uint_2
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_2
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%void = OpTypeVoid
|
||||
%20 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat3v3float = OpTypeMatrix %v3float 3
|
||||
%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
|
||||
%28 = OpConstantNull %mat3v3float
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%31 = OpConstantNull %int
|
||||
%_arr_v3float_uint_2 = OpTypeArray %v3float %uint_2
|
||||
%_ptr_Function__arr_v3float_uint_2 = OpTypePointer Function %_arr_v3float_uint_2
|
||||
%35 = OpConstantNull %_arr_v3float_uint_2
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%38 = OpConstantNull %v3float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%float_0 = OpConstant %float 0
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%int_3 = OpConstant %int 3
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%110 = OpTypeFunction %main_out
|
||||
%main_1 = OpFunction %void None %20
|
||||
%23 = OpLabel
|
||||
%m = OpVariable %_ptr_Function_mat3v3float Function %28
|
||||
%a = OpVariable %_ptr_Function_int Function %31
|
||||
%arr = OpVariable %_ptr_Function__arr_v3float_uint_2 Function %35
|
||||
%v = OpVariable %_ptr_Function_v3float Function %38
|
||||
%42 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%43 = OpLoad %int %42
|
||||
%44 = OpConvertSToF %float %43
|
||||
%46 = OpCompositeConstruct %v3float %44 %float_0 %float_0
|
||||
%47 = OpCompositeConstruct %v3float %float_0 %44 %float_0
|
||||
%48 = OpCompositeConstruct %v3float %float_0 %float_0 %44
|
||||
%49 = OpCompositeConstruct %mat3v3float %46 %47 %48
|
||||
OpStore %m %49
|
||||
%50 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%51 = OpLoad %int %50
|
||||
OpStore %a %51
|
||||
%52 = OpLoad %int %a
|
||||
%53 = OpLoad %int %a
|
||||
%55 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
|
||||
%56 = OpLoad %float %55
|
||||
%58 = OpAccessChain %_ptr_Function_float %m %52 %53
|
||||
OpStore %58 %56
|
||||
%60 = OpAccessChain %_ptr_Function_v3float %m %int_1
|
||||
%61 = OpLoad %v3float %60
|
||||
%62 = OpAccessChain %_ptr_Function_v3float %m %int_1
|
||||
%63 = OpLoad %v3float %62
|
||||
%64 = OpCompositeConstruct %_arr_v3float_uint_2 %61 %63
|
||||
OpStore %arr %64
|
||||
%65 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%66 = OpLoad %float %65
|
||||
%67 = OpCompositeConstruct %v3float %66 %66 %66
|
||||
OpStore %v %67
|
||||
%68 = OpLoad %int %a
|
||||
%69 = OpAccessChain %_ptr_Function_v3float %arr %68
|
||||
%70 = OpLoad %v3float %69
|
||||
%71 = OpLoad %v3float %v
|
||||
%72 = OpFAdd %v3float %71 %70
|
||||
OpStore %v %72
|
||||
%73 = OpLoad %v3float %v
|
||||
%74 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%75 = OpLoad %int %74
|
||||
%77 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
|
||||
%78 = OpLoad %int %77
|
||||
%79 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%80 = OpLoad %int %79
|
||||
%83 = OpConvertSToF %float %75
|
||||
%84 = OpConvertSToF %float %78
|
||||
%85 = OpConvertSToF %float %80
|
||||
%86 = OpCompositeConstruct %v3float %83 %84 %85
|
||||
%87 = OpFOrdEqual %v3bool %73 %86
|
||||
%81 = OpAll %bool %87
|
||||
OpSelectionMerge %89 None
|
||||
OpBranchConditional %81 %90 %91
|
||||
%90 = OpLabel
|
||||
%92 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%93 = OpLoad %int %92
|
||||
%95 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
|
||||
%96 = OpLoad %int %95
|
||||
%97 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
|
||||
%98 = OpLoad %int %97
|
||||
%99 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%100 = OpLoad %int %99
|
||||
%101 = OpConvertSToF %float %93
|
||||
%102 = OpConvertSToF %float %96
|
||||
%103 = OpConvertSToF %float %98
|
||||
%104 = OpConvertSToF %float %100
|
||||
%105 = OpCompositeConstruct %v4float %101 %102 %103 %104
|
||||
OpStore %x_GLF_color %105
|
||||
OpBranch %89
|
||||
%91 = OpLabel
|
||||
%106 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
|
||||
%107 = OpLoad %int %106
|
||||
%108 = OpConvertSToF %float %107
|
||||
%109 = OpCompositeConstruct %v4float %108 %108 %108 %108
|
||||
OpStore %x_GLF_color %109
|
||||
OpBranch %89
|
||||
%89 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %110
|
||||
%113 = OpLabel
|
||||
%114 = OpFunctionCall %void %main_1
|
||||
%115 = OpLoad %v4float %x_GLF_color
|
||||
%116 = OpCompositeConstruct %main_out %115
|
||||
OpReturnValue %116
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %20
|
||||
%118 = OpLabel
|
||||
%119 = OpFunctionCall %main_out %main_inner
|
||||
%120 = OpCompositeExtract %v4float %119 0
|
||||
OpStore %x_GLF_color_1_1 %120
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,71 +0,0 @@
|
||||
type Arr = [[stride(16)]] array<i32, 4>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_9 : buf1;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var m : mat3x3<f32>;
|
||||
var a : i32;
|
||||
var arr : array<vec3<f32>, 2>;
|
||||
var v : vec3<f32>;
|
||||
let x_45 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_46 : f32 = f32(x_45);
|
||||
m = mat3x3<f32>(vec3<f32>(x_46, 0.0, 0.0), vec3<f32>(0.0, x_46, 0.0), vec3<f32>(0.0, 0.0, x_46));
|
||||
let x_52 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
a = x_52;
|
||||
let x_53 : i32 = a;
|
||||
let x_54 : i32 = a;
|
||||
let x_56 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
m[x_53][x_54] = x_56;
|
||||
let x_59 : vec3<f32> = m[1];
|
||||
let x_61 : vec3<f32> = m[1];
|
||||
arr = array<vec3<f32>, 2>(x_59, x_61);
|
||||
let x_64 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
v = vec3<f32>(x_64, x_64, x_64);
|
||||
let x_66 : i32 = a;
|
||||
let x_68 : vec3<f32> = arr[x_66];
|
||||
let x_69 : vec3<f32> = v;
|
||||
v = (x_69 + x_68);
|
||||
let x_71 : vec3<f32> = v;
|
||||
let x_73 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_76 : i32 = x_6.x_GLF_uniform_int_values[2];
|
||||
let x_79 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
if (all((x_71 == vec3<f32>(f32(x_73), f32(x_76), f32(x_79))))) {
|
||||
let x_88 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_91 : i32 = x_6.x_GLF_uniform_int_values[3];
|
||||
let x_94 : i32 = x_6.x_GLF_uniform_int_values[3];
|
||||
let x_97 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_88), f32(x_91), f32(x_94), f32(x_97));
|
||||
} else {
|
||||
let x_101 : i32 = x_6.x_GLF_uniform_int_values[3];
|
||||
let x_102 : f32 = f32(x_101);
|
||||
x_GLF_color = vec4<f32>(x_102, x_102, x_102, x_102);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
[[location(0)]]
|
||||
x_GLF_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main() -> main_out {
|
||||
main_1();
|
||||
return main_out(x_GLF_color);
|
||||
}
|
||||
Reference in New Issue
Block a user