mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1097] [CLOSED] d3d12: check field offsets within structured buffer SRV records (SHADER-BUFFER-BOUNDS) #1131
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1131
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1097
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:split/shader-buffer-bounds📝 Commits (1)
8fc4abbd3d12: check field offsets within structured buffer SRV records (SHADER-BUFFER-BOUNDS)📊 Changes
4 files changed (+23 additions, -10 deletions)
View changed files
📝
docs/buffer_bounds.md(+3 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+2 -1)📝
runtime/test/d3d12_compute_test.cpp(+14 -6)📝
runtime/test/glsl/cs_user_data.comp(+4 -3)📄 Description
Claimed in the coordination issue as: SHADER-BUFFER-BOUNDS (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #220 validates SRV descriptions, #513 changes CBV stride, and #1068 widens translator address arithmetic. This change selects the descriptor bounds mode for structured buffer SRVs.
What and why
A structured buffer SRV used the typed view's index-only bounds mode. A four-byte field starting at the end of an indexed record could therefore read the next record. Select mode 0 for structured SRVs, matching the structured UAV encoding. Raw views keep byte bounds. Typed views keep record-index bounds.
The synthetic GPU fixture reads the same field offset through a structured view and a typed view. With 16-byte records, offset 16 must read zero for the structured view. The typed control reads the next value for each valid index.
Tested
Cross-built with clang-cl 23 and the xwin SDK. Ran under CachyOS Linux 7.3, Proton Experimental (Wine 11), Ryzen 5 5600X, 16 GB RAM, RTX 4070 12 GB and NVIDIA 620.73.
The fixture skipped its native D3D12 CachedPSO comparison under Wine. Native Windows, AMD, Intel and a game boot were not tested.
GPUs tested: NVIDIA GeForce RTX 4070.
AI-assisted: yes
Checklist
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.