mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
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#387
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/333
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/10068📝 Commits (2)
6d0afc8dxgi: support sampling swap-chain back buffersc6b8d70dxgi: an _SRGB shader-resource view samples an 8-bit UNORM back buffer📊 Changes
8 files changed (+526 additions, -83 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+7 -4)📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+86 -39)📝
runtime/shims/dxgi_com.cpp(+27 -11)📝
runtime/shims/dxgi_swapchain.h(+56 -26)📝
runtime/src/vulkan_backend.h(+28 -3)📝
runtime/src/vulkan_replay.h(+2 -0)➕
runtime/test/dxgi_backbuffer_srv_test.cpp(+313 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue as: Michael-M51's sRGB back-buffer SRV finding (finding here)
Depends on:
#9783(stacked: this branch is#9783's6d0afc8ccplus one commit,c6b8d70f7; only that commit is new here). Draft while#9783is a draft.What and why
D3D12 lets an application view a DXGI back buffer in
R8G8B8A8_UNORMorB8G8R8A8_UNORMthrough its_SRGBformat, so a later pass reads the frame as linear colour.@Michael-M51measured it on WARP: 64/64 gamma-decoded texels before and after Present, no debug-layer errors. With#9783, the layer accepts only a default view or a view in the buffer's own format. An_SRGBview leaves the descriptor empty, because the offscreen back buffers are plain Vulkan images, and Vulkan can only view those in their own format.dxgi_swapchain.h: the offscreen back buffers of those two formats are created withVK_IMAGE_CREATE_MUTABLE_FORMAT_BITand aVkImageFormatListCreateInfothat names the UNORM/sRGB pair. The binding records the sRGB partner (ResourceBinding::srgb_view_format).d3d12_vulkan_device.cpp:CreateShaderResourceViewon a back buffer also accepts a view whose format is that partner.vulkan_view_formatalready maps the T# to the_SRGBVulkan view of the UNORM image. Any other view format is still refused, now with alog_onceinstead of silently.R10G10B10A2_UNORM,R16G16B16A16_FLOAT) have no sRGB pair and are unchanged.Tested
Windows 11 Pro 26300, NVIDIA GeForce RTX 3060, driver 610.88, Vulkan validation on, MSVC 14.44 RelWithDebInfo. Built on this branch with
#9809merged locally, only so thatmain's runtime compiles; that merge is not in the diff.dxgi_backbuffer_srvgains two cases: an_SRGBview after Present, and an_SRGBview of the resized back buffer kept after the swap chain is released. Each clears the bytese1 c6 80 7fthrough a UNORM RTV and expectsc0 90 37 7f. Each decoded channel is within 0.05 of a whole step on the D3D12 sRGB curve, sopackUnorm4x8gives exact bytes.0/64(00000000) in both sRGB cases. The five#9783cases still pass.AI-assisted: yes (Claude Code)
Checklist
#9783's hand-written shader and synthetic colours.docs/design.md, with how it was confirmed. (not applicable: runtime change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.