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

Stencil test #58

Merged
merged 4 commits into from
Aug 3, 2024
Merged

Stencil test #58

merged 4 commits into from
Aug 3, 2024

Commits on Jul 31, 2024

  1. Implement stencil buffer

    The stencil functionality is not directly implemented by the GX API, so
    we have to emulate it by using an additional TEV stage to mask out the
    pixels we don't want to draw and perform some drawing operations on an
    offscreen EFB in order to build the stencil buffer in the first place.
    mardy committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    3d8c736 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0f287b View commit details
    Browse the repository at this point in the history
  3. efb: enable color updates when restoring EFB

    We should not rely on the fact that the _ogx_efb_restore_texobj()
    function will only e called when color updates are enabled -- or, at the
    very least, if we accept this requirement we should document it. It's
    more robust if we always enable color updates within the function and
    set the dirty bit, as we do for all other GX settings that we modify.
    mardy committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    d6c9b61 View commit details
    Browse the repository at this point in the history
  4. stencil: update stencil buffer before main drawing

    Draw to the stencil buffer before drawing the graphic primitive,
    otherwise the stencil drawing operations which perform a Z-buffer test
    (the `zpass` and `zfail` ones set with glStencilOp) will be affected by
    it.
    When moving the stencil drawing operations before the main drawing,
    special care must be taken to avoid using the updated stencil buffer
    already when drawing the current primitive (which should be drawn using
    the old stencil buffer). We use the `draw_count` variable to achieve
    this.
    mardy committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    5e33248 View commit details
    Browse the repository at this point in the history