mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
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#1157
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/1123
Author: @TimIdle
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:oldpr-10061-index-view📝 Commits (9)
b332c6dfix: index buffer view SizeInBytes bounds the index fetch; reads outside the view are 0f86e681fix: a draw that crosses the index view's end reads index 0 past it, from a staged copy369b326fix: scratch buffers allow index-buffer use for the staged index copyb86163afix: bound null index views to zero page0ee8064test: the null index view test releases its buffers before the device proxy reference checkce7ade9test: replay_index_view_test covers the index view bounds in prepare_draw without a GPU26f1f58test: the first arena allocation follows the zero page and the quad index table21c7bc8fix: an indexed quad list keeps main's expansion pass instead of a staged index copyb403c27fix: the device asks scratch for index-buffer use, and the draw test follows main's quad index table📊 Changes
5 files changed (+313 additions, -11 deletions)
View changed files
📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+4 -1)📝
runtime/src/vulkan_replay.h(+65 -6)📝
runtime/test/d3d12_draw_test.cpp(+89 -4)➕
runtime/test/replay_index_view_test.cpp(+148 -0)📄 Description
Claimed in the coordination issue as: OLD-10061 (claim)
What and why
This carries forward
old-pr/10061by @tedin7 (draft #326). The six commits are rebased ontomainwith tedin7 kept as author. Three commits of mine follow. One moves the arena address the draw test expects, sincemainnow puts the quad index table after the zero page. One leaves indexed quad lists tomain's expansion pass. One asks for the index-buffer use throughmain's new scratchextra_usageinstead of invulkan_scratch.h.In D3D12, an index fetch outside the index buffer view reads 0.
vkCmdBindIndexBufferbinds to the end of the buffer instead, so the replay read real index data past the view and lit the wrong pixels.vkCmdBeginRendering. The device asks its scratch buffers forVK_BUFFER_USAGE_INDEX_BUFFER_BITfor this, on every GPU.main's expansion pass (prepare_quad_indices), which already reads only the view and zero-fills the rest. An index buffer found throughtitle_memoryis bounded the same way as one found throughbuffer_at.@Sigtryggur-Mani-Gudmundsson checked the series on Linux (RTX 4070 Ti, synchronization validation) in #326 and noted that the Windows D3D12 entry point was untested. This PR adds that run.
Tested
Native Windows 11 10.0.26300, MSVC 19.44, RelWithDebInfo,
LEONIDA_REQUIRE_VULKAN=ON, onmain42537e7plus the nine commits.d3d12_draw_testwith the fixd3d12_draw_testwithmain'svulkan_replay.handvulkan_scratch.h(run on955d9be, before the rebase)line 1171: view_out_red == 0replay_index_view_test(no GPU)main's headers, since it checks the newPreparedDrawfields)replay_index_view_testwith the quad-list branch taken outquad straddle: the buffer and view size go to the expansion pass, no stagingctest -j 6gameinputandgameinput_scriptdisabled.Not covered:
ExecuteIndirectwithDRAW_INDEXEDbinds no index buffer in the replay, so these bounds never reach indirect indexed draws. #499 works on that path.A huge index count past a small view asks scratch for
count * index sizebytes. If that allocation fails, the list is refused. I did not hit this. It is a limit, not a measured failure.GPUs tested: NVIDIA GeForce RTX 2050 (Ampere GA107, laptop), driver 621.24, Windows 11
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator rule here.)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.