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

Fix texture sampling calculations for CPU pipeline #479

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Commits on Mar 3, 2024

  1. test: make touching-color test more robust against GPU imprecision

    Previously, the `color-touching-tests.sb2` test "touches a color that
    doesn't actually exist right now" would use a sprite with ghost 50,
    blended against another sprite, to create the color that "doesn't
    actually exist" when the query sprite is skipped. Unfortunately the
    blend result was near a bit-boundary and, depending on the specific
    hardware used, that test could fail on the GPU. When the renderer uses
    the CPU path this test works fine, though, so the existing problem went
    unnoticed.
    
    To fix the problem I changed the project to use ghost 30 instead, which
    results in a color that is less near a bit boundary and is therefore
    less likely to fail on specific hardware.
    
    As an example of what was happening: the `touching color` block was
    checking for `RGB(127,101,216)` with a mask of `RGB(0xF8,0xF8,0xF0)`. On
    the CPU it would find `RGB(120,99,215)`, which is in range, but on some
    GPUs the closest color it could find was `RGB(119,98,215)` which
    mismatches on all four of the least significant bits -- one of which is
    enabled in the mask.
    Christopher Willis-Ford authored and adroitwhiz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    6cadd0b View commit details
    Browse the repository at this point in the history
  2. fix: adjust CPU isTouchingColor to match GPU results

    Fix direction for Y iteration on CPU path
    
    For some reason the JavaScript engine insists on running the code
    instead of doing what the comment says. I guess they should match.
    
    Fix (x,y) => point[] conversion comments
    Christopher Willis-Ford authored and adroitwhiz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    35c9b7a View commit details
    Browse the repository at this point in the history
  3. fix: iterate drawables in the same order on CPU & GPU

    Christopher Willis-Ford authored and adroitwhiz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    73864f3 View commit details
    Browse the repository at this point in the history
  4. test: add touching-color test to verify stencil use

    Christopher Willis-Ford authored and adroitwhiz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    9514d3b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1dec5a7 View commit details
    Browse the repository at this point in the history
  6. test: add collision test

    adroitwhiz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    f1918b4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b0ef5e9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    be15f20 View commit details
    Browse the repository at this point in the history
  9. fix: fix cpu-render.html coordinate space

    This should ensure that CPU/GPU diffs are actually useful,
    and not improperly shifted.
    adroitwhiz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    0554ed7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    37a0fa0 View commit details
    Browse the repository at this point in the history