Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make identifySamplePoints handle compare #3996

Merged
merged 1 commit into from
Oct 15, 2024

Commits on Oct 15, 2024

  1. Make identifySamplePoints handle compare

    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.
    greggman committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c53cadc View commit details
    Browse the repository at this point in the history