Skip to content

Commit

Permalink
Fixing undefined values in boolean tests
Browse files Browse the repository at this point in the history
  • Loading branch information
venkataram-nv committed Jul 5, 2024
1 parent bd5742c commit 5264ca5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
24 changes: 13 additions & 11 deletions tests/bugs/gh-4434.slang
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ RWStructuredBuffer<uint> outputBuffer;
[numthreads(4, 1, 1)]
void computeMain(uint tid : SV_GroupIndex)
{
bool a, b, c;
c = and(a, b);

bool1 i, j, k;
bool2 l, m, n;
bool3 o, p, q;
bool4 r, s, t;
k = and(i, j);
n = and(m, l);
q = and(o, p);
t = and(r, s);
bool K = (bool)outputBuffer[tid];

bool c = and(K, K);

bool1 K1 = K;
bool2 K2 = K;
bool3 K3 = K;
bool4 K4 = K;

bool1 k = and(K, K);
bool2 n = and(K, K);
bool3 q = and(K, K);
bool4 t = and(K, K);

k = !and(k, false);
n = !and(n, false);
Expand Down
24 changes: 13 additions & 11 deletions tests/bugs/gh-4441.slang
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ RWStructuredBuffer<uint> outputBuffer;
[numthreads(4, 1, 1)]
void computeMain(uint tid : SV_GroupIndex)
{
bool a, b, c;
c = or(a, b);

bool1 i, j, k;
bool2 l, m, n;
bool3 o, p, q;
bool4 r, s, t;
k = or(i, j);
n = or(m, l);
q = or(o, p);
t = or(r, s);
bool K = (bool)outputBuffer[tid];

bool c = or(K, K);

bool1 K1 = K;
bool2 K2 = K;
bool3 K3 = K;
bool4 K4 = K;

bool1 k = or(K, K);
bool2 n = or(K, K);
bool3 q = or(K, K);
bool4 t = or(K, K);

k = or(k, true);
n = or(n, true);
Expand Down

0 comments on commit 5264ca5

Please sign in to comment.