[PR #1158] [CLOSED] OLD-10021: PSOs honour RASTERIZER_DESC2 LineRasterizationMode through VK_EXT_line_rasterization (carries #290) #1191

Closed
opened 2026-11-26 20:20:24 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1158
Author: @TimIdle
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: oldpr-10021-line-raster


📝 Commits (4)

  • 7e74611 fix: preserve rasterizer2 line modes
  • 2915652 fix: ALPHA_ANTIALIASED line mode uses the Vulkan RECTANGULAR_SMOOTH enum
  • 44d1ffe fix: no Bresenham or smooth line state when alpha-to-coverage is on (VUID 02766)
  • bd770c1 test: draw LINE_LIST per D3D12_LINE_RASTERIZATION_MODE and check the pixels; note that wide and narrow are one Vulkan mode

📊 Changes

5 files changed (+366 additions, -3 deletions)

View changed files

📝 runtime/shims/d3d12_com.h (+4 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+58 -3)
📝 runtime/test/d3d12_draw_test.cpp (+237 -0)
📝 runtime/test/d3d12_pso_validation_test.cpp (+45 -0)
📝 runtime/test/vk_test_device.h (+22 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1158 **Author:** [@TimIdle](https://github.com/TimIdle) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `oldpr-10021-line-raster` --- ### 📝 Commits (4) - [`7e74611`](https://github.com/ubiquitarianism/leonida/commit/7e746115fee243270a98f31428d68f48fed82d03) fix: preserve rasterizer2 line modes - [`2915652`](https://github.com/ubiquitarianism/leonida/commit/29156522921e4f2f9165133d5cc62df2e0617c10) fix: ALPHA_ANTIALIASED line mode uses the Vulkan RECTANGULAR_SMOOTH enum - [`44d1ffe`](https://github.com/ubiquitarianism/leonida/commit/44d1ffe6745b2d251d23f9a1979cb2999301fcca) fix: no Bresenham or smooth line state when alpha-to-coverage is on (VUID 02766) - [`bd770c1`](https://github.com/ubiquitarianism/leonida/commit/bd770c122cd0d14b7757d9276579fec1128ada79) test: draw LINE_LIST per D3D12_LINE_RASTERIZATION_MODE and check the pixels; note that wide and narrow are one Vulkan mode ### 📊 Changes **5 files changed** (+366 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_com.h` (+4 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+58 -3) 📝 `runtime/test/d3d12_draw_test.cpp` (+237 -0) 📝 `runtime/test/d3d12_pso_validation_test.cpp` (+45 -0) 📝 `runtime/test/vk_test_device.h` (+22 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-10021 ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141757749)) ### 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:24 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1191
No description provided.