Table of Contents

Mobile (Android / Adreno)


Most mobile devices with a Vulkan-capable GPU work with BRG Instanced Renderer out of the box. However, Qualcomm Adreno GPUs (Samsung Galaxy phones, Meta Quest 2/3, most Android devices) have a driver bug that causes every BRG instance to collapse onto instance 0 — rendering only the first instance correctly and stacking the rest on top of it.

To work around this, BRG Instanced Renderer ships with a one-click Mobile Indirect Fix patcher.

When to Apply the Patch

Apply the patch if any of the following are true:

  • You are targeting Android with the Universal Render Pipeline.
  • You are targeting Meta Quest 2, Quest 3, or any other Qualcomm Adreno-based headset with URP.
  • You see all your BRG instances collapsed onto a single point in a player build on a mobile device.

If you ship exclusively to PC, console, or iOS, you do not need the patch.

What the Patch Does

The patcher:

  1. Embeds SRP Core (com.unity.render-pipelines.core) into your project — copies the package from the registry cache into Packages/ so the shader source can be modified.
  2. Edits ShaderLibrary/UnityDOTSInstancing.hlsl — adds an Adreno-specific code path inside SetupDOTSVisibleInstancingData that resolves the visible instance index at unity_InstanceID directly on Vulkan / GLES3 / GLCore, instead of the packed-offset path that the Adreno driver mis-handles.
  3. Adds an ADRENO_DRIVER_WORKAROUND versioned define to the BRGInstancedRenderer asmdef, gated to URP 17.0.0+, so internal call sites that depend on the patched shader compile correctly.

Apply

Tools > BRG Instanced Renderer > URP > Mobile Indirect Fix > Apply

On first run the patcher will offer to embed SRP Core for you. Confirm the dialog, wait for the Package Manager to finish, then the shader patch is applied automatically.

Important

Force a clean shader rebuild before your first player build after applying the patch. Either delete the entire Library/ folder, or delete Library/ShaderCache and then run Assets > Reimport All. Edits to the included .hlsl don't reliably trigger a shader recompile — and player builds will otherwise embed the stale, un-patched variant cache, producing the same Adreno-collapse bug you were trying to fix.

Check Status

Tools > BRG Instanced Renderer > URP > Mobile Indirect Fix > Check Status

Logs a one-line summary to the console:

[BRG Adreno Patcher] PATCHED | Embedded: True | ADRENO_DRIVER_WORKAROUND in asmdef: True | Core version: 17.x.x | Shader present: True | Path: Packages/com.unity.render-pipelines.core

Revert

Tools > BRG Instanced Renderer > URP > Mobile Indirect Fix > Revert

Restores the stock UnityDOTSInstancing.hlsl and removes the asmdef define. The embedded SRP Core package stays embedded — remove it via Package Manager if you want to go back to the registry version.

After SRP Upgrades

The embedded SRP Core package does not auto-update. After any URP / SRP upgrade you must:

  1. Open Window > Package Manager, remove the embedded SRP Core, and let Unity resolve the new version from the registry.
  2. Run Apply again to embed the new SRP Core version and re-patch the shader.
  3. Delete Library/ShaderCache before your next build.

Caveats

  • The patcher only works against SRP Core versions whose SetupDOTSVisibleInstancingData function still matches the original anchor text. If Unity rewrites that function in a future release the patcher will warn and refuse to apply — let us know on Discord and we'll ship an updated anchor.
  • The patcher is URP-only. The version-define gate (com.unity.render-pipelines.universal >= 17.0.0) keeps the ADRENO_DRIVER_WORKAROUND define from being added to projects that don't have URP installed.

Help Us Get This Fixed Upstream

Unity has confirmed the bug — track and vote on it here: Visible instance buffer returns 0 for every instance when using BatchDrawCommandIndirect on Adreno devices with Vulkan API.

The more votes the issue gets, the higher it climbs in Unity's prioritization queue. Once Unity ships a fix in URP/SRP Core, this patcher will no longer be required and you'll be able to revert it cleanly.