mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
Add tests derived from VK-GL-CTS
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>
This commit is contained in:
committed by
Tint LUCI CQ
parent
bd3edb564f
commit
f7e73d4ee3
@@ -0,0 +1,141 @@
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
cbuffer cbuffer_x_24 : register(b0, space0) {
|
||||
uint4 x_24[1];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cross2d_vf2_vf2_(inout float2 a, inout float2 b) {
|
||||
const float x_76 = a.x;
|
||||
const float x_78 = b.y;
|
||||
const float x_81 = b.x;
|
||||
const float x_83 = a.y;
|
||||
return ((x_76 * x_78) - (x_81 * x_83));
|
||||
}
|
||||
|
||||
int pointInTriangle_vf2_vf2_vf2_vf2_(inout float2 p, inout float2 a_1, inout float2 b_1, inout float2 c) {
|
||||
float pab = 0.0f;
|
||||
float2 param = float2(0.0f, 0.0f);
|
||||
float2 param_1 = float2(0.0f, 0.0f);
|
||||
float pbc = 0.0f;
|
||||
float2 param_2 = float2(0.0f, 0.0f);
|
||||
float2 param_3 = float2(0.0f, 0.0f);
|
||||
float pca = 0.0f;
|
||||
float2 param_4 = float2(0.0f, 0.0f);
|
||||
float2 param_5 = float2(0.0f, 0.0f);
|
||||
bool x_145 = false;
|
||||
bool x_185 = false;
|
||||
bool x_146_phi = false;
|
||||
bool x_186_phi = false;
|
||||
const float x_88 = p.x;
|
||||
const float x_90 = a_1.x;
|
||||
const float x_93 = p.y;
|
||||
const float x_95 = a_1.y;
|
||||
const float x_99 = b_1.x;
|
||||
const float x_101 = a_1.x;
|
||||
const float x_104 = b_1.y;
|
||||
const float x_106 = a_1.y;
|
||||
param = float2((x_88 - x_90), (x_93 - x_95));
|
||||
param_1 = float2((x_99 - x_101), (x_104 - x_106));
|
||||
const float x_109 = cross2d_vf2_vf2_(param, param_1);
|
||||
pab = x_109;
|
||||
const float x_111 = p.x;
|
||||
const float x_113 = b_1.x;
|
||||
const float x_116 = p.y;
|
||||
const float x_118 = b_1.y;
|
||||
const float x_122 = c.x;
|
||||
const float x_124 = b_1.x;
|
||||
const float x_127 = c.y;
|
||||
const float x_129 = b_1.y;
|
||||
param_2 = float2((x_111 - x_113), (x_116 - x_118));
|
||||
param_3 = float2((x_122 - x_124), (x_127 - x_129));
|
||||
const float x_132 = cross2d_vf2_vf2_(param_2, param_3);
|
||||
pbc = x_132;
|
||||
bool tint_tmp = (pab < 0.0f);
|
||||
if (tint_tmp) {
|
||||
tint_tmp = (pbc < 0.0f);
|
||||
}
|
||||
const bool x_137 = (tint_tmp);
|
||||
x_146_phi = x_137;
|
||||
if (!(x_137)) {
|
||||
bool tint_tmp_1 = (pab >= 0.0f);
|
||||
if (tint_tmp_1) {
|
||||
tint_tmp_1 = (pbc >= 0.0f);
|
||||
}
|
||||
x_145 = (tint_tmp_1);
|
||||
x_146_phi = x_145;
|
||||
}
|
||||
if (!(x_146_phi)) {
|
||||
return 0;
|
||||
}
|
||||
const float x_151 = p.x;
|
||||
const float x_153 = c.x;
|
||||
const float x_156 = p.y;
|
||||
const float x_158 = c.y;
|
||||
const float x_162 = a_1.x;
|
||||
const float x_164 = c.x;
|
||||
const float x_167 = a_1.y;
|
||||
const float x_169 = c.y;
|
||||
param_4 = float2((x_151 - x_153), (x_156 - x_158));
|
||||
param_5 = float2((x_162 - x_164), (x_167 - x_169));
|
||||
const float x_172 = cross2d_vf2_vf2_(param_4, param_5);
|
||||
pca = x_172;
|
||||
bool tint_tmp_2 = (pab < 0.0f);
|
||||
if (tint_tmp_2) {
|
||||
tint_tmp_2 = (pca < 0.0f);
|
||||
}
|
||||
const bool x_177 = (tint_tmp_2);
|
||||
x_186_phi = x_177;
|
||||
if (!(x_177)) {
|
||||
bool tint_tmp_3 = (pab >= 0.0f);
|
||||
if (tint_tmp_3) {
|
||||
tint_tmp_3 = (pca >= 0.0f);
|
||||
}
|
||||
x_185 = (tint_tmp_3);
|
||||
x_186_phi = x_185;
|
||||
}
|
||||
if (!(x_186_phi)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
float2 pos = float2(0.0f, 0.0f);
|
||||
float2 param_6 = float2(0.0f, 0.0f);
|
||||
float2 param_7 = float2(0.0f, 0.0f);
|
||||
float2 param_8 = float2(0.0f, 0.0f);
|
||||
float2 param_9 = float2(0.0f, 0.0f);
|
||||
const float4 x_63 = gl_FragCoord;
|
||||
const float2 x_66 = asfloat(x_24[0].xy);
|
||||
pos = (float2(x_63.x, x_63.y) / x_66);
|
||||
param_6 = pos;
|
||||
param_7 = float2(0.699999988f, 0.300000012f);
|
||||
param_8 = float2(0.5f, 0.899999976f);
|
||||
param_9 = float2(0.100000001f, 0.400000006f);
|
||||
const int x_69 = pointInTriangle_vf2_vf2_vf2_vf2_(param_6, param_7, param_8, param_9);
|
||||
if ((x_69 == 1)) {
|
||||
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
} else {
|
||||
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 gl_FragCoord_param : SV_Position;
|
||||
};
|
||||
struct tint_symbol_2 {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
||||
const float4 gl_FragCoord_param = tint_symbol.gl_FragCoord_param;
|
||||
gl_FragCoord = gl_FragCoord_param;
|
||||
main_1();
|
||||
const main_out tint_symbol_3 = {x_GLF_color};
|
||||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
Reference in New Issue
Block a user