tint/test-runner: Split expectations for FXC and DXC

Change tint's `--fxc` flag to take the path of the FXC compiler DLL.
Have tint attempt to validate with both FXC and DXC if `--validate` is
passed.

Fix the 'dirsWithNoPassExpectations' logic which looks like it got
broken with the tint -> dawn merge. It also incorrectly applied
filepath.FromSlash() on windows.

Change-Id: I0f46aa5c21bc48a2abc48402c41f846aff4a8633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96800
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton
2022-07-22 17:43:27 +00:00
committed by Dawn LUCI CQ
parent 0778d9a48f
commit 7d34de88f1
5122 changed files with 73624 additions and 206 deletions

View File

@@ -0,0 +1,32 @@
void set_int4(inout int4 vec, int idx, int val) {
vec = (idx.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : vec;
}
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
struct S {
int4 a[4];
};
static int counter = 0;
int foo() {
counter = (counter + 1);
return counter;
}
int bar() {
counter = (counter + 2);
return counter;
}
void main() {
S x = (S)0;
const int tint_symbol_2 = foo();
const int tint_symbol_save = tint_symbol_2;
const int tint_symbol_1 = bar();
set_int4(x.a[tint_symbol_save], tint_symbol_1, (x.a[tint_symbol_save][tint_symbol_1] + 5));
}

View File

@@ -0,0 +1,18 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int a = 0;
static float b = 0.0f;
void foo(int maybe_zero) {
a = (a / 1);
a = (a % 1);
a = (a / (maybe_zero == 0 ? 1 : maybe_zero));
a = (a % (maybe_zero == 0 ? 1 : maybe_zero));
b = (b / 0.0f);
b = (b % 0.0f);
b = (b / float(maybe_zero));
b = (b % float(maybe_zero));
}

View File

@@ -0,0 +1,44 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
static uint i = 0u;
int idx1() {
i = (i + 1u);
return 1;
}
int idx2() {
i = (i + 2u);
return 1;
}
int idx3() {
i = (i + 3u);
return 1;
}
void foo() {
float a[4] = (float[4])0;
const int tint_symbol_2 = idx1();
const int tint_symbol_save = tint_symbol_2;
{
a[tint_symbol_save] = (a[tint_symbol_save] * 2.0f);
[loop] while (true) {
const int tint_symbol_3 = idx2();
if (!((a[tint_symbol_3] < 10.0f))) {
break;
}
{
}
{
const int tint_symbol_4 = idx3();
const int tint_symbol_1_save = tint_symbol_4;
a[tint_symbol_1_save] = (a[tint_symbol_1_save] + 1.0f);
}
}
}
}

View File

@@ -0,0 +1,13 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
void foo() {
int a = 0;
float4 b = float4(0.0f, 0.0f, 0.0f, 0.0f);
float2x2 c = float2x2(0.0f, 0.0f, 0.0f, 0.0f);
a = (a / 2);
b = mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), b);
c = (c * 2.0f);
}

View File

@@ -0,0 +1,21 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) {
buffer.Store4((offset + 0u), asuint(value[0u]));
buffer.Store4((offset + 16u), asuint(value[1u]));
buffer.Store4((offset + 32u), asuint(value[2u]));
buffer.Store4((offset + 48u), asuint(value[3u]));
}
float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) {
return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u))));
}
void foo() {
tint_symbol(v, 0u, (tint_symbol_2(v, 0u) - float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)));
}

View File

@@ -0,0 +1,21 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) {
buffer.Store4((offset + 0u), asuint(value[0u]));
buffer.Store4((offset + 16u), asuint(value[1u]));
buffer.Store4((offset + 32u), asuint(value[2u]));
buffer.Store4((offset + 48u), asuint(value[3u]));
}
float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) {
return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u))));
}
void foo() {
tint_symbol(v, 0u, (tint_symbol_2(v, 0u) + float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)));
}

View File

@@ -0,0 +1,21 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) {
buffer.Store4((offset + 0u), asuint(value[0u]));
buffer.Store4((offset + 16u), asuint(value[1u]));
buffer.Store4((offset + 32u), asuint(value[2u]));
buffer.Store4((offset + 48u), asuint(value[3u]));
}
float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) {
return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u))));
}
void foo() {
tint_symbol(v, 0u, (tint_symbol_2(v, 0u) * 2.0f));
}

View File

@@ -0,0 +1,21 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) {
buffer.Store4((offset + 0u), asuint(value[0u]));
buffer.Store4((offset + 16u), asuint(value[1u]));
buffer.Store4((offset + 32u), asuint(value[2u]));
buffer.Store4((offset + 48u), asuint(value[3u]));
}
float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) {
return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u))));
}
void foo() {
tint_symbol(v, 0u, mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), tint_symbol_2(v, 0u)));
}

View File

@@ -0,0 +1,14 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int a = 0;
static float4 b = float4(0.0f, 0.0f, 0.0f, 0.0f);
static float2x2 c = float2x2(0.0f, 0.0f, 0.0f, 0.0f);
void foo() {
a = (a / 2);
b = mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), b);
c = (c * 2.0f);
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) & 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) / 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) - 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) % 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) | 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) + 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) * 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store(0u, asuint((asint(v.Load(0u)) ^ 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) & (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asfloat(v.Load4(0u)) / 2.0f)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) / (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asfloat(v.Load4(0u)) - 2.0f)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) - (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) % 2)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) % (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) | (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asfloat(v.Load4(0u)) + 2.0f)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) + (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint(mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), asfloat(v.Load4(0u)))));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asfloat(v.Load4(0u)) * 2.0f)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) * (2).xxxx)));
}

View File

@@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
RWByteAddressBuffer v : register(u0, space0);
void foo() {
v.Store4(0u, asuint((asint(v.Load4(0u)) ^ (2).xxxx)));
}

View File

@@ -0,0 +1,14 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
groupshared int a;
groupshared float4 b;
groupshared float2x2 c;
void foo() {
a = (a / 2);
b = mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), b);
c = (c * 2.0f);
}