Skip to content

fix(webgpu): Android rendered nothing (texture view aspect, render bundle encoder) - #214

Merged
triniwiz merged 3 commits into
masterfrom
fix/webgpu-android-rendering
Nov 13, 2026
Merged

triniwiz merged 3 commits into
masterfrom
fix/webgpu-android-rendering

Conversation

@triniwiz

Copy link
Copy Markdown
Member

WebGPU on Android drew nothing: every PixiJS 3D example stayed blank, while WebGL rendered the same scenes. Every frame failed validation, which invalidated the command encoder, so Queue::submit never sent any work.

Fixes

  • createView drops aspect. The aspect was parsed but never copied into the subresource range, so every view had aspect all. Binding a depth-stencil texture for sampling then fails (Bound texture views can not have both depth and stencil aspects enabled). This C++ is shared with iOS, so iOS is likely affected too.
  • createRenderBundleEncoder ignores sampleCount, depthReadOnly and stencilReadOnly. sampleCount was always 1, so a bundle recorded for an MSAA pass rejected its pipelines (Incompatible sample count).
  • Render bundles skip the Android bgra fallback. createTexture and the pipelines swap bgra8unorm for rgba8unorm on Android, but bundles kept bgra8unorm and no longer matched their pass (Incompatible color attachments).

Testing

  • Where: Android emulator (x86_64, API 36, host Vulkan through gfxstream) on Linux, running the @pixi/3d examples app on WebGPU.
  • Before: every example was blank, with validation errors on every frame.
  • After: 11 examples, covering PBR, iridescence, transmission, light types, shadows, planar mirror, skinned animation, crowd, instancing, particles and bloom, all render with zero validation errors. The three files are identical to the build that was tested.
  • Not tested: iOS, and Android on a physical device.

Known issue, not addressed here

Once, while instancing_batching was running, the main thread blocked in canvas_native_webgpu_context_get_current_texture for over 5 s and triggered an ANR. A second run didn't reproduce it. It may just be the emulator's GPU being slow; it hasn't been investigated.

The aspect was parsed but never copied into the subresource range, so every
view was created with aspect 'all'. Binding a depth-stencil texture through
such a view fails validation, which invalidated the command encoder, so on
Android nothing was ever submitted and the canvas stayed blank.
…y flags

sampleCount was always 1 and depthReadOnly/stencilReadOnly always false, so a
bundle recorded for an MSAA pass rejected its pipelines.
createTexture and the pipelines swap bgra8unorm for rgba8unorm on Android, but
render bundles kept bgra8unorm and no longer matched the pass they ran in.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fea5be0-c9f3-4afb-986f-8ef94303fa86

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@triniwiz
triniwiz merged commit 710ab5d into master Nov 13, 2026
17 of 25 checks passed
@triniwiz
triniwiz deleted the fix/webgpu-android-rendering branch November 13, 2026 09:20
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