mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-24 07:23:35 +00:00
This adds SPIR-V assembly and WGSL tests derived from VK-GL-CTS commit 571256871c2e2f03995373e1e4a02958d8cd8cf5. The following procedure was followed: - Those .amber files in VK-GL-CTS wholly owned by Google were identified - All GLSL and SPIR-V shaders were extracted from the Amber files and converted into SPIR-V binaries - The compact-ids pass of spirv-opt was applied to each binary - Duplicate binaries were removed - spirv-opt -O was used to obtain an optimized version of each remaining binary, with duplicates discarded - Binaries that failed validation using spirv-val with target environment SPIR-V 1.3 were discarded - Those binaries that tint could not successfully convert into WGSL were put aside for further investigation - SPIR-V assembly versions of the remaining binaries are included in this CL - test-runner with -generate-expected and -generate-skip was used to generate expected .spvasm, .msl, .hlsl and .wgsl outputs for these SPIR-V assembly tests - Each successfully-generated .expected.wgsl is included in this CL again, as a WGLSL test - test-runner with -generate-expected and -generate-skip was used again, to generate expected outputs for these WGSL tests Change-Id: Ibe9baf2729cf97e0b633db9a426f53362a5de540 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58842 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
100 lines
2.0 KiB
HLSL
100 lines
2.0 KiB
HLSL
struct S {
|
|
int a;
|
|
int b;
|
|
int c;
|
|
};
|
|
|
|
cbuffer cbuffer_x_10 : register(b0, space0) {
|
|
uint4 x_10[1];
|
|
};
|
|
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
|
|
void main_1() {
|
|
int x_43 = 0;
|
|
bool x_44 = false;
|
|
S arr[2] = (S[2])0;
|
|
S param = (S)0;
|
|
int param_1 = 0;
|
|
while (true) {
|
|
int x_50 = 0;
|
|
x_50 = asint(x_10[0].x);
|
|
arr[x_50].a = 2;
|
|
const int x_53 = arr[1].a;
|
|
if ((x_53 < 1)) {
|
|
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
x_44 = true;
|
|
break;
|
|
} else {
|
|
const S x_60 = arr[1];
|
|
param = x_60;
|
|
param_1 = (2 + asint(x_50));
|
|
const int x_61 = param_1;
|
|
S x_64_1 = param;
|
|
x_64_1.a = x_61;
|
|
param = x_64_1;
|
|
if ((param.a == 2)) {
|
|
S x_71_1 = param;
|
|
x_71_1.a = 9;
|
|
param = x_71_1;
|
|
}
|
|
const int x_72 = param_1;
|
|
S x_76_1 = param;
|
|
x_76_1.b = (x_72 + 1);
|
|
param = x_76_1;
|
|
const int x_77 = param_1;
|
|
S x_81_1 = param;
|
|
x_81_1.c = (x_77 + 2);
|
|
param = x_81_1;
|
|
if ((param.b == 2)) {
|
|
S x_88_1 = param;
|
|
x_88_1.b = 7;
|
|
param = x_88_1;
|
|
}
|
|
x_43 = ((param.a + param.b) + param.c);
|
|
if ((x_43 == 12)) {
|
|
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
|
} else {
|
|
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
}
|
|
}
|
|
x_44 = true;
|
|
break;
|
|
}
|
|
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_3 = {tint_symbol_1.x_GLF_color_1};
|
|
return tint_symbol_3;
|
|
}
|
|
|
|
int func_struct_S_i1_i1_i11_i1_(inout S s, inout int x) {
|
|
const int x_103 = x;
|
|
s.a = x_103;
|
|
const int x_105 = s.a;
|
|
if ((x_105 == 2)) {
|
|
s.a = 9;
|
|
}
|
|
const int x_109 = x;
|
|
s.b = (x_109 + 1);
|
|
const int x_112 = x;
|
|
s.c = (x_112 + 2);
|
|
const int x_115 = s.b;
|
|
if ((x_115 == 2)) {
|
|
s.b = 7;
|
|
}
|
|
const int x_119 = s.a;
|
|
const int x_120 = s.b;
|
|
const int x_122 = s.c;
|
|
return ((x_119 + x_120) + x_122);
|
|
}
|