Skip to content

Commit

Permalink
Make identifySamplePoints handle compare
Browse files Browse the repository at this point in the history
identifySamplePoints works by doing a binary search
filling a texture with black (0,0,0,0) and white (1,1,1,1)
texels and then sampling it. Any non-zero results means
those white pixels were sampled.

This doesn't work for comparisons like textureSampleCompare,
textureSampleCompareLevel, and textureGatherCompare because
the result of those are 0 or 1 so for example, of the comparison
is 'always' then all texels will show up as sampled.

So, instead, if the builtin being tested is a comparison
we convert the call to the corresponding non-comparsion builtin.

* textureSampleCompare -> textureSample
* textureSampleCompareLevel -> textureSampleLevel
* textureGatherCompare -> textureGather

This lets us find the sample points as best we can (it assumes
those functions sample the same texels).

Once we have the sample point we then want to look up the actual
values of the texels and print them out. To do this requires
reading the texture back from the GPU. We made the texture ourselves
so we could maybe theoretically pass the data we sent to the GPU
down to identifySamplePoints but it seems good to get the values
from the GPU itself so at least they made a round trip through the
GPU

When, if it's a comparison, we print out the result of each
comparison with that texel. Hopefully this will help us identify
why these tests don't pass on some devices.
  • Loading branch information
greggman committed Oct 11, 2024
1 parent 0f96947 commit 0da532e
Show file tree
Hide file tree
Showing 10 changed files with 352 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -254,7 +255,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -376,7 +378,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -481,7 +484,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -573,7 +577,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -660,7 +665,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -766,7 +772,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -862,7 +869,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -259,7 +260,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -356,7 +358,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -448,7 +451,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -237,7 +238,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -320,7 +322,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -416,7 +419,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -498,7 +502,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -674,7 +679,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -752,7 +758,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -828,7 +835,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -912,7 +920,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -989,7 +998,8 @@ Parameters:
sampler,
calls,
results,
stage
stage,
texture
);
t.expectOK(res);
});
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -196,7 +198,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -320,7 +324,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -404,7 +410,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -496,7 +504,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -585,7 +595,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -679,7 +691,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -770,7 +784,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -863,7 +879,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -241,7 +243,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -335,7 +339,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Expand Down Expand Up @@ -432,7 +438,9 @@ Parameters:
textureType,
sampler,
calls,
results
results,
'fragment',
texture
);
t.expectOK(res);
});
Loading

0 comments on commit 0da532e

Please sign in to comment.