Game: oversized simulated-turf mesh draw exceeds device workgroup limit #2251

Open
opened 2026-11-22 12:48:32 +00:00 by erlo68 · 1 comment
Contributor

Version and system

  • Built from source from PR #2241, based on main at a2dc5385; the adaptive simulated-turf backend under test is already on main from #2093 and #2174.
  • Windows, AMD Radeon RX 7900 XT, AMD driver 26.11.2 (LLPC), Intel Core i7-14700KF, 3440x1440.
  • Built from source; graphics problem; reproducible while standing still.

What happens

At sufficiently large simulated-turf ranges, turf patches flicker in and out continuously. This is persistent rather than the brief population delay expected immediately after a live setting change. It can affect nearby patches as well as the far edge.

The adaptive private record pool is not full when this happens. The failure begins downstream, when a mesh-only indirect draw asks for more X workgroups than the physical device reports through VkPhysicalDeviceMeshShaderPropertiesEXT::maxMeshWorkGroupCount[0].

Expected: renderer-generated indirect mesh workloads remain within the device's advertised limits, or otherwise degrade safely.

Actual: the oversized indirect mesh draw is submitted and simulated turf flickers persistently.

Reproduction

  1. Load Hyrule Field at a stationary view with broad turf coverage.
  2. Use the simulated-turf controls from PR #2241, or equivalent live resource edits.
  3. A reproduced stress configuration was:
    • Fade start: 100
    • Fade endpoint: 195
    • Turf density: 100% of the area's installed value
    • Minimum blades: 24
    • Far power: 0.5
  4. Leave the camera and player still. Turf patches continue to appear and disappear.
  5. Log private-list demand/capacity and indirect mesh sizes. The oversized draw remains present after the adaptive pool has settled.

The submitted Extreme preset in PR #2241 uses endpoint 110.5 in this area and stayed below the observed boundary. Raising the endpoint toward 195 made the problem repeatable.

Measured boundary

In the reproduced frame sequence:

Measurement Value
Large private pool peak 2,248,249 / 2,795,584 records
Mesh-only indirect draw X count 70,195 workgroups
Device maxMeshWorkGroupCount[0] 65,535 workgroups
Workgroups over the reported X limit 4,660 (7.11%)

The relevant simulated-turf mesh reader consumes 32 pool records per X workgroup (workgroup_id * 32 + lane). On this device that makes the largest single-draw addressable prefix:

65,535 workgroups * 32 records = 2,097,120 records

Record 2,097,121 requires a 65,536th X workgroup and is therefore beyond this device's advertised per-dimension limit. The observed 70,195-workgroup command crosses that boundary even though the backing private pool still has room.

The pool peak and draw count were sampled from the same settled stress run but are not asserted to be the exact same counter sample; the decisive comparison is the indirect command's 70,195 X workgroups against the device limit of 65,535.

Renderer path and scope

  • gpu/vk/eden/shader_recompiler/ir_opt/sim_turf_pool_pass.h derives simulated-turf producer and reader caps from the bound storage-buffer length. This protects record memory and permits capacities above the game's original fixed lists.
  • The same storage-derived capacity can exceed what one native mesh draw can dispatch on a particular device.
  • gpu/vk/vk_draw.cpp submits the converted/native indirect arguments through vkCmdDrawMeshTasksIndirectEXT or vkCmdDrawMeshTasksIndirectCountEXT; the recorded X count is not currently bounded by maxMeshWorkGroupCount[0] on this path.
  • Because producers reserve records through parallel atomics, record order is not a stable nearest-to-farthest ordering. That is consistent with nearby patches changing as the oversized workload repeats, rather than only a fixed distant tail disappearing.

This report intentionally does not prescribe a simulated-turf-specific implementation. The general renderer requirement is that GPU-generated indirect mesh workloads larger than a device's advertised mesh-workgroup limits be handled without submitting an invalid oversized draw.

  • PR #2241 exposes wider simulated-turf controls and contains the stress-test timeline.
  • PR #2093 introduced renderer-owned adaptive simulated-turf lists.
  • PR #2174 fixed the zero-capacity transition path.

No game files, saves, generated shaders, frame dumps or caches are attached.

## Version and system - Built from source from [PR #2241](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2241), based on `main` at `a2dc5385`; the adaptive simulated-turf backend under test is already on `main` from [#2093](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2093) and [#2174](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2174). - Windows, AMD Radeon RX 7900 XT, AMD driver 26.11.2 (LLPC), Intel Core i7-14700KF, 3440x1440. - Built from source; graphics problem; reproducible while standing still. ## What happens At sufficiently large simulated-turf ranges, turf patches flicker in and out continuously. This is persistent rather than the brief population delay expected immediately after a live setting change. It can affect nearby patches as well as the far edge. The adaptive private record pool is not full when this happens. The failure begins downstream, when a mesh-only indirect draw asks for more X workgroups than the physical device reports through `VkPhysicalDeviceMeshShaderPropertiesEXT::maxMeshWorkGroupCount[0]`. Expected: renderer-generated indirect mesh workloads remain within the device's advertised limits, or otherwise degrade safely. Actual: the oversized indirect mesh draw is submitted and simulated turf flickers persistently. ## Reproduction 1. Load Hyrule Field at a stationary view with broad turf coverage. 2. Use the simulated-turf controls from PR #2241, or equivalent live resource edits. 3. A reproduced stress configuration was: - Fade start: 100 - Fade endpoint: 195 - Turf density: 100% of the area's installed value - Minimum blades: 24 - Far power: 0.5 4. Leave the camera and player still. Turf patches continue to appear and disappear. 5. Log private-list demand/capacity and indirect mesh sizes. The oversized draw remains present after the adaptive pool has settled. The submitted Extreme preset in PR #2241 uses endpoint 110.5 in this area and stayed below the observed boundary. Raising the endpoint toward 195 made the problem repeatable. ## Measured boundary In the reproduced frame sequence: | Measurement | Value | |---|---:| | Large private pool peak | 2,248,249 / 2,795,584 records | | Mesh-only indirect draw X count | 70,195 workgroups | | Device `maxMeshWorkGroupCount[0]` | 65,535 workgroups | | Workgroups over the reported X limit | 4,660 (7.11%) | The relevant simulated-turf mesh reader consumes 32 pool records per X workgroup (`workgroup_id * 32 + lane`). On this device that makes the largest single-draw addressable prefix: `65,535 workgroups * 32 records = 2,097,120 records` Record 2,097,121 requires a 65,536th X workgroup and is therefore beyond this device's advertised per-dimension limit. The observed 70,195-workgroup command crosses that boundary even though the backing private pool still has room. The pool peak and draw count were sampled from the same settled stress run but are not asserted to be the exact same counter sample; the decisive comparison is the indirect command's 70,195 X workgroups against the device limit of 65,535. ## Renderer path and scope - `gpu/vk/eden/shader_recompiler/ir_opt/sim_turf_pool_pass.h` derives simulated-turf producer and reader caps from the bound storage-buffer length. This protects record memory and permits capacities above the game's original fixed lists. - The same storage-derived capacity can exceed what one native mesh draw can dispatch on a particular device. - `gpu/vk/vk_draw.cpp` submits the converted/native indirect arguments through `vkCmdDrawMeshTasksIndirectEXT` or `vkCmdDrawMeshTasksIndirectCountEXT`; the recorded X count is not currently bounded by `maxMeshWorkGroupCount[0]` on this path. - Because producers reserve records through parallel atomics, record order is not a stable nearest-to-farthest ordering. That is consistent with nearby patches changing as the oversized workload repeats, rather than only a fixed distant tail disappearing. This report intentionally does not prescribe a simulated-turf-specific implementation. The general renderer requirement is that GPU-generated indirect mesh workloads larger than a device's advertised mesh-workgroup limits be handled without submitting an invalid oversized draw. ## Related - [PR #2241](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2241) exposes wider simulated-turf controls and contains the stress-test timeline. - [PR #2093](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2093) introduced renderer-owned adaptive simulated-turf lists. - [PR #2174](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2174) fixed the zero-capacity transition path. No game files, saves, generated shaders, frame dumps or caches are attached.
Member

Possibly related, for context:

  • PR #2241 WIP: feat(menu): add simulated-turf presets — Open PR whose stress testing uncovered this renderer limit
  • issue #1934 Game: Grass and foliage flicker around Kakariko Village and Hyrule Field on RX 6800 — Related AMD turf/foliage flicker, but different trigger and mechanism
  • issue #1477 Deck/AMD: rewrite the mesh-shader path — build-time translation of task/mesh into native pipelines — Related renderer mesh-shader dispatch/fallback work
Possibly related, for context: - PR #2241 WIP: feat(menu): add simulated-turf presets — Open PR whose stress testing uncovered this renderer limit - issue #1934 Game: Grass and foliage flicker around Kakariko Village and Hyrule Field on RX 6800 — Related AMD turf/foliage flicker, but different trigger and mechanism - issue #1477 Deck/AMD: rewrite the mesh-shader path — build-time translation of task/mesh into native pipelines — Related renderer mesh-shader dispatch/fallback work
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#2251
No description provided.