mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #290] d3d12: honour RASTERIZER_DESC2 LineRasterizationMode with VK_EXT_line_rasterization #342
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#342
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/290
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/10021📝 Commits (4)
ebef045fix: preserve rasterizer2 line modes90e1a46fix: ALPHA_ANTIALIASED line mode uses the Vulkan RECTANGULAR_SMOOTH enumce54149fix: no Bresenham or smooth line state when alpha-to-coverage is on (VUID 02766)b9918c1test: 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 (+364 additions, -3 deletions)
View changed files
📝
runtime/shims/d3d12_com.h(+4 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+56 -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
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):What
A graphics PSO created from the pipeline-state stream now honours
D3D12_RASTERIZER_DESC2::LineRasterizationMode(it was dropped, every LINE_LIST drew with Vulkan's default line state).VK_LINE_RASTERIZATION_MODE_BRESENHAM, ALPHA_ANTIALIASED ->RECTANGULAR_SMOOTH, QUADRILATERAL_WIDE and NARROW ->RECTANGULAR. Vulkan has no narrow quadrilateral mode, so WIDE and NARROW are one mode here (noted in a comment and in the test).VK_EXT_line_rasterizationfeature, and for Bresenham/smooth it is left out when alpha-to-coverage is on (VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766).vk_test_device.h) can request the extension;d3d12_draw_testdraws a LINE_LIST per mode and counts pixels;d3d12_pso_validation_testchecks the refusals.Why
Lines are drawn by the game's debug/overlay and some world passes; with the mode ignored, ALPHA_ANTIALIASED lines came out aliased and the VUID above could fire as a validation error on a device with alpha-to-coverage PSOs. It is part of getting 3D rendering state right once a PSO is built.
Tested
Local: clang-cl 19 + xwin SDK cross build, run under Wine on lavapipe (llvmpipe, LLVM 19.1.7). No real GPU. Built on current main plus
#9809applied only in a scratch tree (main does not build right now, issue#9812); that patch is not in this PR.d3d12_pso_validation_test: PASS, 60 layer checks.d3d12_draw_test: exit 0. Line modes, features on (bresenham 1 smooth 1 rectangular 1): aliased=52 pixels (partial 0), alpha_antialiased=160 (partial 112), quadrilateral_wide=52, quadrilateral_narrow=52. Features off: all four 52 (partial 0), so no line state is chained.d3d12_draw_testexits 1 at the line-mode check. With the fix it exits 0.Not run: the whole runtime suite, real NVIDIA/AMD hardware, Windows host comparisons (Wine's D3D12 is not Microsoft's, those are skipped).
Rebased cleanly on current main; supersedes
#8716closed during org migration.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.