Skip to content

ssao: Hi-Z mip per march step without a private array - #190

Open
proggeramlug wants to merge 1 commit into
mainfrom
perf/ssao-no-private-array
Open

proggeramlug wants to merge 1 commit into
mainfrom
perf/ssao-no-private-array

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

The GTAO march read each step's Hi-Z mip from var<private> mip_per_step: array<i32, 8>, indexed by the step counter. A runtime-indexed private array becomes function memory in SPIR-V, which Adreno keeps in scratch memory (the same issue as #184). Each step now computes its mip directly, clamp(floor(log2(step_pixels * s)), 0, HIZ_MAX_MIP), giving the same values as the precomputed table.

On a Pixel 4a (Adreno 618) the SSAO pass goes from 8 to 7 ms at 0.5 render scale. cargo test --lib passes.

The per-pixel mip_per_step array was indexed by the step counter: a
runtime-indexed private array is function memory in SPIR-V, which Adreno
keeps in scratch memory. Each step computes its mip (floor(log2) of the
pixels it covers) instead; same values. Pixel 4a: SSAO 8 -> 7 ms.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d3a85e1f-26d5-4068-ac4a-e04991f97796
Commits

Reviewing files that changed from the base of the PR and between bcae9c2 and a20f619.

Files selected for processing: 1

  • native/shared/src/renderer/shaders/ao.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant