upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorRain156 <77776581+Rain156@users.noreply.github.com>2026-11-24 20:40:44 +0800
committerRain156 <77776581+Rain156@users.noreply.github.com>2026-11-24 20:49:20 +0800
commitc55ecc9cbf4e7cde8b80b032b827e5943d451a9e (patch)
tree79ae52e0e666437e46d2dcf8d8f51bd6b762349c /runtime/src
parentb10e0e9d5a24c90bfc1a6d2370fcfcf641f3fbc7 (diff)
d3d12: expand rectangle draws through triangle-family pipelines
Select the geometry-stage variant when the input assembler requests an Xbox rectangle and cache it alongside the attachment-format variants. Keep a shared snapshot of the linked vertex program for that draw. Exercise alternating rectangle and triangle draws through the same PSO and compare the complete target after each switch.
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/vulkan_replay.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/src/vulkan_replay.h b/runtime/src/vulkan_replay.h
index 889bb71f7..f7702f128 100644
--- a/runtime/src/vulkan_replay.h
+++ b/runtime/src/vulkan_replay.h
@@ -773,7 +773,10 @@ struct GraphicsPipeline {
773 // unbound (D3D12 allows it; dynamic rendering needs the formats to agree). Bit i: colour slot i, bit 8: depth 773 // unbound (D3D12 allows it; dynamic rendering needs the formats to agree). Bit i: colour slot i, bit 8: depth
774 // and stencil. Null when it cannot be built. 774 // and stencil. Null when it cannot be built.
775 static constexpr std::uint32_t unbound_depth = 1u << 8; 775 static constexpr std::uint32_t unbound_depth = 1u << 8;
776 std::function<VkPipeline(std::uint32_t unbound)> variant; 776 static constexpr std::uint32_t rectangle_stage = 1u << 9;
777 // IA topology requiring a fourth-corner geometry stage. Zero when the PSO already contains the stage.
778 std::uint32_t rectangle_variant_topology = 0;
779 std::function<VkPipeline(std::uint32_t flags)> variant;
777 std::uint32_t samples = 1; // rasterizationSamples; every bound attachment must have this count 780 std::uint32_t samples = 1; // rasterizationSamples; every bound attachment must have this count
778}; 781};
779 782
@@ -2160,6 +2163,8 @@ ReplayResult prepare_draw(const Draw& draw, Resolve&& resolve, const ReplayFunct
2160 // Slots the pipeline has a format for but the draw leaves unbound take a variant whose format there is 2163 // Slots the pipeline has a format for but the draw leaves unbound take a variant whose format there is
2161 // VK_FORMAT_UNDEFINED: D3D12 discards those writes, Vulkan wants the formats to match the attachments. 2164 // VK_FORMAT_UNDEFINED: D3D12 discards those writes, Vulkan wants the formats to match the attachments.
2162 std::uint32_t unbound = 0; 2165 std::uint32_t unbound = 0;
2166 if (pipeline->rectangle_variant_topology && draw.topology == pipeline->rectangle_variant_topology)
2167 unbound |= GraphicsPipeline::rectangle_stage;
2163 for (std::size_t slot = 0; slot < p.colors.size(); ++slot) 2168 for (std::size_t slot = 0; slot < p.colors.size(); ++slot)
2164 if (pipeline->color_formats[slot] != VK_FORMAT_UNDEFINED && !p.colors[slot].id) unbound |= 1u << slot; 2169 if (pipeline->color_formats[slot] != VK_FORMAT_UNDEFINED && !p.colors[slot].id) unbound |= 1u << slot;
2165 if (pipeline->depth_format != VK_FORMAT_UNDEFINED && !p.depth.id) unbound |= GraphicsPipeline::unbound_depth; 2170 if (pipeline->depth_format != VK_FORMAT_UNDEFINED && !p.depth.id) unbound |= GraphicsPipeline::unbound_depth;