shader: keep alignment displacement in single-SSBO ranges #447

Merged
monsterlag merged 4 commits from fix/global-ssbo-range into main 2026-11-08 16:49:22 +00:00
monsterlag commented 2026-11-08 02:46:03 +00:00 (Migrated from github.com)

Problem and change

The single-SSBO helper computes its logical end from the aligned descriptor base, losing the alignment displacement. With guest base 0x1004, size 2 and alignment 16, it incorrectly ends the range at 0x1002 and rejects the requested halfword.

Use the original guest base plus size, preserving the aligned lower bound, 64-bit arithmetic, descriptor-length cap and table path. Normally merge honest-eta (a598b9f) and retain its new narrow-store CAS implementation and mesh fixes. The existing translator-source stamp invalidates translated-program caches when this emitter changes.

Validation

  • Clang 23.1.5/GNU focused build passes all 19 real-IR cases: all 11 upstream load/store/mesh/profile cases plus the eight existing SSBO-range scenarios. The range checks trace and evaluate the called helper's actual emitted branch, including signed/unsigned hits, misses, alignment, descriptor caps and high address bits.
  • All 19 emitted modules pass spirv-val --target-env vulkan1.3 --uniform-buffer-standard-layout. The layout option is needed by the single-SSBO fixture profiles' uniform blocks.
  • Rebuilding with only the upstream faulty end operand makes the actual fixture fail its original-address dependency assertion. Restoring the fix passes all cases and validations again.
  • The production emitter differs from the pinned release by one operand; upstream store/mesh fixture bodies and cases remain intact. The earlier 13-module proof remains unchanged.

Scope

This validates the lowering contract and generated SPIR-V, without executing a shader, driver or game. It does not establish rendering symptoms, odd-address behavior or device feature enablement. Hosted checks for the refreshed head are pending.

## Problem and change The single-SSBO helper computes its logical end from the aligned descriptor base, losing the alignment displacement. With guest base `0x1004`, size 2 and alignment 16, it incorrectly ends the range at `0x1002` and rejects the requested halfword. Use the original guest base plus size, preserving the aligned lower bound, 64-bit arithmetic, descriptor-length cap and table path. Normally merge `honest-eta` (`a598b9f`) and retain its new narrow-store CAS implementation and mesh fixes. The existing translator-source stamp invalidates translated-program caches when this emitter changes. ## Validation - Clang 23.1.5/GNU focused build passes all 19 real-IR cases: all 11 upstream load/store/mesh/profile cases plus the eight existing SSBO-range scenarios. The range checks trace and evaluate the called helper's actual emitted branch, including signed/unsigned hits, misses, alignment, descriptor caps and high address bits. - All 19 emitted modules pass `spirv-val --target-env vulkan1.3 --uniform-buffer-standard-layout`. The layout option is needed by the single-SSBO fixture profiles' uniform blocks. - Rebuilding with only the upstream faulty end operand makes the actual fixture fail its original-address dependency assertion. Restoring the fix passes all cases and validations again. - The production emitter differs from the pinned release by one operand; upstream store/mesh fixture bodies and cases remain intact. The earlier 13-module proof remains unchanged. ## Scope This validates the lowering contract and generated SPIR-V, without executing a shader, driver or game. It does not establish rendering symptoms, odd-address behavior or device feature enablement. Hosted checks for the refreshed head are pending.
Commenting is not possible because the repository is archived.
No description provided.