[PR #2271] Preserve fractional viewport coverage in attachmentless draws #2274

Open
opened 2026-11-26 21:20:38 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2271
Author: @Bonchaloo
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: fix/attachmentless-fractional-area


📝 Commits (1)

  • 39434d4 Round fractional viewport edges outward for attachmentless rendering

📊 Changes

2 files changed (+25 additions, -6 deletions)

View changed files

📝 runtime/src/vulkan_replay.h (+6 -5)
📝 runtime/test/d3d12_state_map_test.cpp (+19 -1)

📄 Description

Claimed in #1608 as RT-ATTACHMENTLESS-FRACTIONAL-AREA.

Fix

With no color or depth attachment, Vulkan replay derives the render area from the viewports. Converting their right and bottom edges directly to integers could clip a row or column that contains covered samples. Round the maximum right and bottom edges outward after considering all viewports.

Tests

  • The replay regression fails on the parent commit for a viewport ending at (3.75, 2.75). With this change the recorded render area is 4×3. A second viewport extending to y = 5.75 produces 4×6, and the integer 8×8 control retains its extent.
  • Five focused CTests passed: state map, bounded index view, quad-list replay, and both pipeline compile replay modes. The changed files passed the no-game-data check.
  • GPU tested: Apple M5 Max, Apple Metal driver, macOS 27.3. A separate synthetic attachmentless Metal draw with the same fractional viewport wrote six pixel positions with a 3×2 render area and twelve with a 4×3 area. The regression test captures the Vulkan command; the Metal probe measures raster coverage.

Full native runtime CTest suite on Apple M5 Max with MoltenVK 1.4.2: 105 passed, 0 failed, 3 skipped (shader_library_corpus, vk_device_markers, vk_sync_validation).

AI-assisted: yes.


🔄 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/2271 **Author:** [@Bonchaloo](https://github.com/Bonchaloo) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/attachmentless-fractional-area` --- ### 📝 Commits (1) - [`39434d4`](https://github.com/ubiquitarianism/leonida/commit/39434d43930a89688989c6bef111e02c9e7c3e9d) Round fractional viewport edges outward for attachmentless rendering ### 📊 Changes **2 files changed** (+25 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/vulkan_replay.h` (+6 -5) 📝 `runtime/test/d3d12_state_map_test.cpp` (+19 -1) </details> ### 📄 Description Claimed in [#1608 as RT-ATTACHMENTLESS-FRACTIONAL-AREA](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191340976). ### Fix With no color or depth attachment, Vulkan replay derives the render area from the viewports. Converting their right and bottom edges directly to integers could clip a row or column that contains covered samples. Round the maximum right and bottom edges outward after considering all viewports. ### Tests - The replay regression fails on the parent commit for a viewport ending at (3.75, 2.75). With this change the recorded render area is 4×3. A second viewport extending to y = 5.75 produces 4×6, and the integer 8×8 control retains its extent. - Five focused CTests passed: state map, bounded index view, quad-list replay, and both pipeline compile replay modes. The changed files passed the no-game-data check. - GPU tested: Apple M5 Max, Apple Metal driver, macOS 27.3. A separate synthetic attachmentless Metal draw with the same fractional viewport wrote six pixel positions with a 3×2 render area and twelve with a 4×3 area. The regression test captures the Vulkan command; the Metal probe measures raster coverage. Full native runtime CTest suite on Apple M5 Max with MoltenVK 1.4.2: 105 passed, 0 failed, 3 skipped (shader_library_corpus, vk_device_markers, vk_sync_validation). AI-assisted: yes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2274
No description provided.