mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #207] [CLOSED] d3d12: draw the console rectangle lists and quad lists (topologies 17 and 19) as triangles #259
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#259
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/207
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/9940📝 Commits (6)
49d6959d3d12: draw the console's rectangle lists (17, PSO type 19) and quad lists (19) as triangles464632fd3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capability Geometry, log cut-off quads (review fixes)1b276a9d3d12: quad lists draw as triangle-list indices (0 1 2) (0 2 3) so flat inputs use the first quad vertex, and the PSO topology type is read as raw bits7de73afd3d12: rect_list_geometry records that packed f16 attributes cannot be told apart from float outputs on the vertex side (comment only)7589af0d3d12: rectangle list geometry picks the right-angle corner per rectangle (the vertex opposite the longest screen edge) instead of assuming the first; tests for the corner at the second and third vertex and for a non-right triangle21dc388d3d12: rect list test: every pixel well inside a non-right triangle is drawn; geometry notes edges are measured in NDC📊 Changes
8 files changed (+923 additions, -11 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+12 -1)📝
runtime/CMakeLists.txt(+15 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+52 -9)➕
runtime/src/rect_list_geometry.h(+268 -0)📝
runtime/src/vulkan_backend.h(+8 -0)📝
runtime/src/vulkan_replay.h(+37 -1)➕
runtime/test/d3d12_rect_list_test.cpp(+421 -0)➕
runtime/test/replay_quad_list_test.cpp(+110 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Rebased cleanly on current main; supersedes
#7448closed during org migration.What
The console's rectangle list (
IASetPrimitiveTopology(17), PSO topology type 19) and quad list (IASetPrimitiveTopology(19)) are accepted and drawn as triangles, instead of refusing the PSO (type 19,E_INVALIDARG) or silently drawing a plain triangle list. This is a 3D-rendering and PSO blocker: a PSO of type 19 fails creation today.runtime/src/rect_list_geometry.h) written from the vertex shader's own SPIR-V outputs. It emits (v1 v2 v4) (v1 v4 v3).docs/d3d12_vulkan.md, "Console rectangle and quad lists".Why
The fourth corner is a function of what the vertex stage wrote, and the translated vertex shaders fetch vertices themselves through V# loads, so a CPU or compute expansion of vertex data would be wrong for non-linear shaders. A geometry stage after the vertex stage is exact and needs only the geometryShader feature. Facts credited to the xvalkyrie backlog V8 (GPL-3.0, commit 53af7df77c10); no code copied.
Tested
Run on this base (current main, native g++ on the build host):
replay_quad_list_test(quad list is one triangle-list indexed draw, topology, index buffer, count 64): exit 0; the layer logs "a non-indexed quad list of 3 quads draws only the first 2" as designed.runtime/srcdoes not compile (quad_indices/ quad-list topology do not exist), so it fails on main and passes with the change.rect_list_geometry.hcompiles standalone with g++ -std=c++20.NOT run on this base (be aware):
d3d12_rect_list_test(the GPU test, Windows exe through Wine) and the compile ofshims/d3d12_vulkan_device.cpp. The GPU pods are off and this host has no unpacked Windows SDK; mingw headers are too old to syntax-check the Windows code. The earlier version of this PR (#7448, older base) measured on an RTX 4090 under Wine: rectangle list 4096 of 4096 pixels on the colour plane (worst error 0); quad list 4096 of 4096 bit-exact; it failed at the PSO on main ("primitive topology type not supported: 19"). The cherry-picks onto current main applied with no conflicts and the merge with the latest main is clean, but the GPU result on this base has not been reproduced. Please rund3d12_rect_listin CI/maintainer hardware before merging.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.