fix(shaders): avoid unused swizzle helper on older Adreno - #115
Open
mrrobot97 wants to merge 1 commit into
Open
Conversation
Some older Adreno GLSL compilers silently miscompile non-atomic path shaders when they contain the unused unsigned shifts in swizzle_image_buffer_idx. Restrict the helper to storage-buffer PLS and clockwise-atomic variants. This preserves its WebGPU use and the previous atomic shader behavior while keeping it out of unrelated path shaders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
swizzle_image_buffer_idxonly for storage-buffer PLS andclockwise-atomic shader variants.
pre-existing clockwise-atomic path.
Problem
After the storage-buffer PLS work in
365421d6,swizzle_image_buffer_idxbecame part of every path shader, even when itwas unused. On an Android 8.1 device with an Adreno 616, the older GLSL
compiler silently miscompiles those non-atomic path shaders: vector paths
disappear while image meshes continue to render. This affects the Rive GPU
renderer; the Android Canvas renderer remains complete because it does not
use these GLSL path shaders.
I bisected the regression:
runtime-v0.1.118: renders correctlyruntime-v0.1.119: first broken release365421d6177757772a911f176241af8ea6d5e64eThe helper is required by
PLS_IMPL_STORAGE_BUFFER. Clockwise-atomicvariants also contained the previous swizzle helper before that commit.
Guarding it to those two configurations restores the previous shader
contents for all other path variants.
Reproduction
A small
.rivfile can expose the problem when its artboard containsseveral visible filled or stroked vector paths. Mixing those paths with an
image mesh makes the failure especially easy to identify: on the affected
device's Rive renderer, the image mesh continues to render while some or all
vector paths disappear. A state machine is not required; a static artboard
is sufficient as long as the shapes are visible.
Test environment and observed behavior:
RendererType.Rivereproduces the missing-path resultRendererType.Canvasrenders the same artboard completelyValidation
runtime-v0.1.119on the affected device: the unguardedRive renderer fails, while this guard restores all vector paths and
matches the Canvas control.
runtime-v0.1.169/ Rive Android 11.7.2.main.Automated coverage for the visual failure is not practical because it is
a silent miscompile in the proprietary device driver.