Fix incomplete buffer uploads for task and mesh shaders #206

Merged
klimovich008 merged 3 commits from codex/cbuf-table-extent into main 2026-11-07 23:46:13 +00:00
klimovich008 commented 2026-11-07 15:43:59 +00:00 (Migrated from github.com)

What this fixes

Task and mesh global-memory lookups can read descriptor metadata beyond the bound constant-bank range. On RX 9070 XT, reached shaders bound C0 through 0x6a0, while their generated pointer table ends at 0x8b0.

Why merge

  • Include the generated descriptor address/size reads in the existing uniform-range calculation.
  • Account for each descriptor's bank and array count; keep larger existing ranges.
  • Non-global shaders, defaults and environment-variable fallbacks stay unchanged. Existing bank and uniform-buffer limits still apply.

Change

  • gpu/vk/vk_draw.cpp: extend used through storage descriptors when global fallbacks are present, before allocating and filling the bank.

  • nx2/test_cbuf_table_extent.py: cover task/mesh ranges, descriptor arrays, other banks, larger ranges and non-global controls.

Tested

  • python nx2/test_cbuf_table_extent.py --cxx clang++: 13 cases using the actual range expressions.
  • Fails on the old code, passes now. All 13 cases pass on the refreshed branch.
  • RX 9070 XT, Windows 11: a 250-second Kokiri Forest run completed a GPU capture with no validation errors.

Not covered

  • This refresh has source-only checks; GPU results above are from the earlier integration. Tested on AMD only. Missing foliage remains; complete rendering correctness is not claimed.
## What this fixes Task and mesh global-memory lookups can read descriptor metadata beyond the bound constant-bank range. On RX 9070 XT, reached shaders bound C0 through `0x6a0`, while their generated pointer table ends at `0x8b0`. ## Why merge - Include the generated descriptor address/size reads in the existing uniform-range calculation. - Account for each descriptor's bank and array count; keep larger existing ranges. - Non-global shaders, defaults and environment-variable fallbacks stay unchanged. Existing bank and uniform-buffer limits still apply. ## Change - `gpu/vk/vk_draw.cpp`: extend `used` through storage descriptors when global fallbacks are present, before allocating and filling the bank. - `nx2/test_cbuf_table_extent.py`: cover task/mesh ranges, descriptor arrays, other banks, larger ranges and non-global controls. ## Tested - `python nx2/test_cbuf_table_extent.py --cxx clang++`: 13 cases using the actual range expressions. - Fails on the old code, passes now. All 13 cases pass on the refreshed branch. - RX 9070 XT, Windows 11: a 250-second Kokiri Forest run completed a GPU capture with no validation errors. ## Not covered - This refresh has source-only checks; GPU results above are from the earlier integration. Tested on AMD only. Missing foliage remains; complete rendering correctness is not claimed.
Commenting is not possible because the repository is archived.
No description provided.