OLD-10021: PSOs honour RASTERIZER_DESC2 LineRasterizationMode through VK_EXT_line_rasterization (carries #290) #1158

Closed
github-bot wants to merge 4 commits from github-bot/gh-1158 into main AGit
Owner

@⁠TimIdle on GitHub · 2026-11-24 19:22 UTC · original
TimIdle:oldpr-10021-line-raster → main · +366 −3 · 5 files · 4 commits · closed without merging

Claimed in the coordination issue as: OLD-10021 (claim)

What and why

This carries forward old-pr/10021 by @⁠tedin7 (draft #290). The four commits are cherry-picked onto main unchanged, with tedin7 kept as author.

main reads D3D12_RASTERIZER_DESC2 but drops LineRasterizationMode, so every line draws with the driver's default. With this change the layer enables VK_EXT_line_rasterization (no stippling) where the device has it and chains VkPipelineRasterizationLineStateCreateInfoEXT:

D3D12 mode Vulkan mode
ALIASED BRESENHAM
ALPHA_ANTIALIASED RECTANGULAR_SMOOTH
QUADRILATERAL_WIDE, QUADRILATERAL_NARROW RECTANGULAR (Vulkan has no narrow mode, so the two are the same here)

Bresenham and smooth lines are skipped when alpha-to-coverage is on (VUID 02766). The line mode is also part of the pipeline cache key for stream-created PSOs. The game's device comes from create_vulkan_device_standalone (d3d12_xs.cpp), which is the path that enables the extension.

Tested

Native Windows 11 10.0.26300, MSVC 19.44, RelWithDebInfo, LEONIDA_REQUIRE_VULKAN=ON, on main 42537e7 plus the four commits.

Check Result
d3d12_draw_test with the fix pass. Features on (Bresenham, smooth, rectangular all 1): aliased=52 alpha_antialiased=160(partial 108) quadrilateral_wide=52 quadrilateral_narrow=52. Features off: all four modes 52.
d3d12_draw_test with main's d3d12_vulkan_device.cpp fail: smooth lines covered 52 pixels, aliased 52 (the mode never reaches the driver)
d3d12_pso_validation_test PASS (60 layer checks, 100 host comparisons across 2 host devices)
full ctest -j 6 402 of 402 passed, gameinput disabled.

GPUs tested: NVIDIA GeForce RTX 2050 (Ampere GA107, laptop), driver 621.24, Windows 11

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule here.)

🤖 Generated with Claude Code

**@⁠TimIdle** on GitHub · 2026-11-24 19:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158) `TimIdle:oldpr-10021-line-raster` → `main` · +366 −3 · 5 files · 4 commits · closed without merging Claimed in the coordination issue as: OLD-10021 ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)) ### What and why This carries forward `old-pr/10021` by @⁠tedin7 (draft #290). The four commits are cherry-picked onto `main` unchanged, with tedin7 kept as author. `main` reads `D3D12_RASTERIZER_DESC2` but drops `LineRasterizationMode`, so every line draws with the driver's default. With this change the layer enables `VK_EXT_line_rasterization` (no stippling) where the device has it and chains `VkPipelineRasterizationLineStateCreateInfoEXT`: | D3D12 mode | Vulkan mode | |---|---| | `ALIASED` | `BRESENHAM` | | `ALPHA_ANTIALIASED` | `RECTANGULAR_SMOOTH` | | `QUADRILATERAL_WIDE`, `QUADRILATERAL_NARROW` | `RECTANGULAR` (Vulkan has no narrow mode, so the two are the same here) | Bresenham and smooth lines are skipped when alpha-to-coverage is on (VUID 02766). The line mode is also part of the pipeline cache key for stream-created PSOs. The game's device comes from `create_vulkan_device_standalone` (`d3d12_xs.cpp`), which is the path that enables the extension. ### Tested Native Windows 11 10.0.26300, MSVC 19.44, RelWithDebInfo, `LEONIDA_REQUIRE_VULKAN=ON`, on `main` `42537e7` plus the four commits. | Check | Result | |---|---| | `d3d12_draw_test` with the fix | pass. Features on (Bresenham, smooth, rectangular all 1): `aliased=52 alpha_antialiased=160(partial 108) quadrilateral_wide=52 quadrilateral_narrow=52`. Features off: all four modes 52. | | `d3d12_draw_test` with `main`'s `d3d12_vulkan_device.cpp` | fail: `smooth lines covered 52 pixels, aliased 52` (the mode never reaches the driver) | | `d3d12_pso_validation_test` | PASS (60 layer checks, 100 host comparisons across 2 host devices) | | full `ctest -j 6` | 402 of 402 passed, `gameinput` disabled. | GPUs tested: NVIDIA GeForce RTX 2050 (Ampere GA107, laptop), driver 621.24, Windows 11 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator rule here.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:40:48 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:23 UTC · original · approved these changes

Reviewed and verified. Essential feature completion for \RASTERIZER_DESC2\ in D3D12/Vulkan pipeline creation (OLD-10021 / #290). Properly incorporates \LineRasterizationMode\ into the PSO cache key (\pipeline_key), maps Bresenham, smooth, and rectangular modes to \VK_EXT_line_rasterization\ via \VkPipelineRasterizationLineStateCreateInfoEXT, and preserves fallback behavior when extension features are unavailable. Verified in
untime/test/d3d12_vulkan_device_test.cpp. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#pullrequestreview-6045860695) · **approved these changes** Reviewed and verified. Essential feature completion for \RASTERIZER_DESC2\ in D3D12/Vulkan pipeline creation (OLD-10021 / #290). Properly incorporates \LineRasterizationMode\ into the PSO cache key (\pipeline_key\), maps Bresenham, smooth, and rectangular modes to \VK_EXT_line_rasterization\ via \VkPipelineRasterizationLineStateCreateInfoEXT\, and preserves fallback behavior when extension features are unavailable. Verified in \ untime/test/d3d12_vulkan_device_test.cpp\. 100% clean-room.
Author
Owner

@⁠madhyn on GitHub · 2026-11-24 19:27 UTC · original

Tested d0a33438c on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / clang-cl + xwin cross-build):

  • d3d12_draw: Passed (5.43 s)
  • d3d12_pso_validation: Passed (5.46 s)

AI-assisted: yes

**@⁠madhyn** on GitHub · 2026-11-24 19:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7142122565) Tested `d0a33438c` on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / clang-cl + xwin cross-build): - `d3d12_draw`: **Passed** (5.43 s) - `d3d12_pso_validation`: **Passed** (5.46 s) AI-assisted: yes
Author
Owner

@⁠TimIdle on GitHub · 2026-11-24 19:32 UTC · original

Thank you for the Wine run on the RTX 3060 Ti. With the native Windows run in the description, both test files now pass on two hosts.

**@⁠TimIdle** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7142235403) Thank you for the Wine run on the RTX 3060 Ti. With the native Windows run in the description, both test files now pass on two hosts.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:12 UTC · original

Recommendation: [MERGE]

Reasoning: Carries #290: PSOs honour RASTERIZER_DESC2.LineRasterizationMode through VK_EXT_line_rasterization where available (no stippling). Fixes lines always drawing with the driver default. Adds new draw and validation tests. Verified on native Windows (author) and Wine + RTX 3060 Ti (madhyn). CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 5/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7143183691) **Recommendation:** [MERGE] **Reasoning:** Carries #290: PSOs honour `RASTERIZER_DESC2.LineRasterizationMode` through `VK_EXT_line_rasterization` where available (no stippling). Fixes lines always drawing with the driver default. Adds new draw and validation tests. Verified on native Windows (author) and Wine + RTX 3060 Ti (madhyn). CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 5/10
Author
Owner

@⁠TimIdle on GitHub · 2026-11-25 00:09 UTC · original

Rebased onto main 364ab4e. The one conflict was the create_graphics signature, where #878 added back_masks. Both parameters are kept, with line_mode after back_masks. On the RTX 2050 the rebased head gives the same line counts as before (smooth 160 pixels, aliased 52), d3d12_pso_validation_test passes, and the full ctest is 316 of 316.

**@⁠TimIdle** on GitHub · 2026-11-25 00:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7148204105) Rebased onto `main` `364ab4e`. The one conflict was the `create_graphics` signature, where #878 added `back_masks`. Both parameters are kept, with `line_mode` after `back_masks`. On the RTX 2050 the rebased head gives the same line counts as before (smooth 160 pixels, aliased 52), `d3d12_pso_validation_test` passes, and the full `ctest` is 316 of 316.
Author
Owner

@⁠TimIdle on GitHub · 2026-11-25 02:02 UTC · original

Rebased onto main c266c26. The one conflict was the end of CreatePipelineState for a stream, where main now wraps the result in finish() and records mesh pipelines. The line-mode cache key is still set before the pipeline is handed out. On the RTX 2050 the line counts are unchanged (smooth 160 pixels, aliased 52), d3d12_pso_validation_test passes, and the full ctest is 361 of 361.

**@⁠TimIdle** on GitHub · 2026-11-25 02:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7150244841) Rebased onto `main` `c266c26`. The one conflict was the end of `CreatePipelineState` for a stream, where `main` now wraps the result in `finish()` and records mesh pipelines. The line-mode cache key is still set before the pipeline is handed out. On the RTX 2050 the line counts are unchanged (smooth 160 pixels, aliased 52), `d3d12_pso_validation_test` passes, and the full `ctest` is 361 of 361.
Author
Owner

@⁠TimIdle on GitHub · 2026-11-25 05:57 UTC · original

Rebased onto main 42537e7. The one conflict was in runtime/test/vk_test_device.h, where main moved the external-memory-host query higher up, so only the line-rasterization block of this PR stays at that spot. On the RTX 2050 the line counts are unchanged (smooth 160 pixels, aliased 52), d3d12_pso_validation_test passes, and the full ctest is 402 of 402.

**@⁠TimIdle** on GitHub · 2026-11-25 05:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7154296291) Rebased onto `main` `42537e7`. The one conflict was in `runtime/test/vk_test_device.h`, where `main` moved the external-memory-host query higher up, so only the line-rasterization block of this PR stays at that spot. On the RTX 2050 the line counts are unchanged (smooth 160 pixels, aliased 52), `d3d12_pso_validation_test` passes, and the full `ctest` is 402 of 402.
github-bot closed this pull request 2026-11-26 11:42:21 +00:00
Author
Owner

@⁠TimIdle on GitHub · 2026-11-26 11:41 UTC · original

Closing this one, no review yet and CI is red. Will reopen if it is still needed.

**@⁠TimIdle** on GitHub · 2026-11-26 11:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1158#issuecomment-7191040109) Closing this one, no review yet and CI is red. Will reopen if it is still needed.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.