Skip to content

fix(android): work around A850v2 compute texture-size corruption - #11

Open
misakayuuki wants to merge 2 commits into
Droid-Deck:mainfrom
misakayuuki:fix/a850-lsfg-compute-texture-size
Open

misakayuuki wants to merge 2 commits into
Droid-Deck:mainfrom
misakayuuki:fix/a850-lsfg-compute-texture-size

Conversation

@misakayuuki

Copy link
Copy Markdown

On Adreno 850v2 (0x44051431), DroidDeck with DD-Turnip v0.3.4 produced normal original frames alternating with black or top-left-fragmented LSFG-generated frames. A compute diagnostic isolated incorrect, workgroup-dependent textureSize(..., 0) results: integer-coordinate copies and sampling with known dimensions worked, while sampling normalized by the queried dimensions failed. The corresponding imageSize query returned the correct 1562 x 720 dimensions.

This adds an Android-only recipe patch that lowers this specific query to the existing bindless image-size/RESINFO path. It is restricted to that chip ID, compute shaders, non-array 2D textures, two 32-bit result components, a lowered bindless texture handle, and constant LOD zero. Descriptor validity and non-uniform access flags are preserved. RESINFO can use the dimensions encoded for the view's base mip here, but does not perform GETSIZE's LOD minification, so nonzero/dynamic LOD queries are deliberately excluded.

The patch is registered in patches/series.json and documented in the README. A small original GLSL diagnostic and manual instructions record the isolation procedure, evidence, and coverage limits. The underlying reason GETSIZE returns incorrect values is still unconfirmed; this is a targeted workaround.

Validation

  • Built the official v0.3.4 Android source/patch set plus this workaround with NDK r26d. Mesa: e2ab6687d5ad700cc2b856af684aa014f9dae943.
  • Tested on Xiaomi M154FF / SM8975, Adreno 850v2, Android 17, DroidDeck 0.6.0. Both query paths returned the correct dimensions after the fix.
  • Restored original LSFG FP16 shaders and actual 2x frame generation: the previous black corruption was absent from a subsequent 32-frame capture, and the device user confirmed normal rendering.
  • Verified that the submitted patch applies to the release Android source and reproduces the device-tested implementation, with only an explanatory comment added.
  • All 13 repository unit tests pass. The submitted diagnostic compiles with glslangValidator -V and passes spirv-val.
  • Checked that the recipe includes the patch exactly once for Android and excludes it for Linux.

Vulkan CTS, Linux, other GPUs, null descriptors, and nonzero view base mips have not been tested on hardware. CI still needs to check the complete patch series against current Mesa main. A separate adaptive-60-FPS application setting improved perceived latency; it is not included or claimed as a driver performance improvement.

@maxjivi05

Copy link
Copy Markdown
Contributor

Thanks for the careful isolation work. Two things stop this from going in as it is:

  1. The merge of main left patches/series.json invalid (the new entry has no closing }, and no opening { before the nir/0001 entry) and put the new README paragraph in the middle of the patch table, together with the fdl/0001 row that was dropped in Drop the A8XX buffer descriptor patch now in Mesa main #16. Check has not run on this head, and scripts/apply_patches.py cannot read the series like this.
  2. The cause is still open. GETSIZE returning workgroup-dependent values on one chip looks like the same class of problem as the category-4 repeat issue on the A845 / A850, and the same GPU runs the Linux target too. If you can, please check whether the wrong sizes go away with IR3_SHADER_DEBUG=nouboopt-style narrowing (in particular with repeat groups off for cat5), and whether the Linux build shows it. A fix at that level would cover every query instead of one shape of textureSize.

If the cause cannot be narrowed further, a quirk flag in the device table rather than a chip id in tu_shader.cc would be the form to merge, for both targets.

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.

2 participants