Skip to content

Fix Kawase blur offsets on WebGPU - #531

Open
snowyukitty wants to merge 1 commit into
pixijs:mainfrom
snowyukitty:fix/kawase-webgpu-blur
Open

snowyukitty wants to merge 1 commit into
pixijs:mainfrom
snowyukitty:fix/kawase-webgpu-blur

Conversation

@snowyukitty

Copy link
Copy Markdown

KawaseBlurFilter changes the same uOffset uniform for every pass. WebGPU queues those draws against one buffer, so earlier passes also use the final, smallest offset. This explains the narrower, uneven blur reported in #500 and #475.

Snapshot the offset with PixiJS's existing uniform batch for each WebGPU pass, including single-pass reuse at different input sizes. Restore the original uniform resource after the draw, including on error. This follows the approach used by the core blur filter in pixijs/pixijs#11909; kernels, shaders and WebGL behavior stay the same.

Adds regression checks to the existing screenshot workflow: per-pass snapshots and resource restoration run even without a WebGPU adapter, and rendered pixels are compared with a chain of independent single-pass filters. The checks cover qualities 1-4, clamping, anisotropic pixels and repeated frames, with a nonempty-image control. Failures propagate to the screenshot process exit code.

Validation:

  • npm run build
  • xvfb-run -a npm run dist (Electron 28; WebGL fallback in this environment)
  • Separate Chromium/SwiftShader checks used actual WebGL and WebGPU on the lockfile's PixiJS 8.0.0-rc.9 and stable 8.22.0 browser runtime. They cover pixel parity (exact on the lockfile version; at most one channel value apart on stable), a CPU single-pass oracle, shared instances, renderer switching, AdvancedBloom and DropShadow. Physical M1 hardware was not tested.

The regression fails on the audited base both at the missing snapshot and at the quality-2 pixel comparison. Each WebGPU pass now consumes one additional 128-byte slot in PixiJS's existing finite uniform batch.

The resolution/downsampling work in #517, #525 and #528 is adjacent; this change only addresses per-pass uniform lifetime.

This branch has not been deployed

No deployments
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