upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/vulkan_present.h
diff options
context:
space:
mode:
authorerickbobd <188809599+erickbobd@users.noreply.github.com>2026-11-22 21:59:34 -0300
committererickbobd <188809599+erickbobd@users.noreply.github.com>2026-11-22 21:59:34 -0300
commit0a2b6edb90bf6594e63345087af90e843cedbb48 (patch)
treee5312c2c0e5ed15d442ff78a904e6fbc6df52571 /runtime/src/vulkan_present.h
parent03b09a086592a197db64d91655c6e65c30764d96 (diff)
vulkan_present: ask for COLOR_ATTACHMENT on the window swapchain, for overlays
The presenter only blits or copies into the swapchain images, so it asked for TRANSFER_DST (and TRANSFER_SRC with capture). Overlays that hook the swapchain draw their own frame into those images through a framebuffer: Bandicam's VK_LAYER_bandicam_helper raised 22 VUID-VkFramebufferCreateInfo- pAttachments-00877 and 22 VUID-VkImageViewCreateInfo-image-04441 in xbox_present. Every surface reports COLOR_ATTACHMENT, and the DXGI swapchain already requests it; with it the overlay's framebuffers are valid. docs/d3d12_vulkan.md no longer calls the swapchain TRANSFER_DST-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/vulkan_present.h')
-rw-r--r--runtime/src/vulkan_present.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/src/vulkan_present.h b/runtime/src/vulkan_present.h
index fc6d1699e..46e20d31d 100644
--- a/runtime/src/vulkan_present.h
+++ b/runtime/src/vulkan_present.h
@@ -885,6 +885,13 @@ private:
885 VkImageUsageFlags usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT; 885 VkImageUsageFlags usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT;
886 if (capture_) usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT; 886 if (capture_) usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
887 if ((caps.supportedUsageFlags & usage) != usage) return false; 887 if ((caps.supportedUsageFlags & usage) != usage) return false;
888 // Not used by the presenter itself (it blits or copies into the images), but overlays that hook the swapchain
889 // draw their own frame into its images through a framebuffer, which needs COLOR_ATTACHMENT: without it
890 // Bandicam's VK_LAYER_bandicam_helper builds framebuffers and image views on images that don't allow it
891 // (VUID-VkFramebufferCreateInfo-pAttachments-00877, VUID-VkImageViewCreateInfo-image-04441). The surface
892 // reports it for every swapchain (the spec requires it in supportedUsageFlags), and the DXGI swapchain
893 // (dxgi_swapchain.h) already asks for it.
894 if (caps.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
888 895
889 std::uint32_t count = 0; 896 std::uint32_t count = 0;
890 if (vkGetPhysicalDeviceSurfaceFormatsKHR_(physical_, surface_, &count, nullptr) != VK_SUCCESS || !count) 897 if (vkGetPhysicalDeviceSurfaceFormatsKHR_(physical_, surface_, &count, nullptr) != VK_SUCCESS || !count)