diff options
| author | aslan2142 <jan.trencansky@protonmail.com> | 2026-11-25 23:37:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-25 23:37:24 +0100 |
| commit | 5fab9396763ca4d052af8abc71f29ad200e7b5ef (patch) | |
| tree | a8a751a8bc7e630bc6346d348b1405b2121de134 /runtime/src/vulkan_backend.h | |
| parent | 1bf5eeafd7041db163a6f027ba6145262f70e48a (diff) | |
| parent | 844519ab597c910797606f14ea10e0d95e99210e (diff) | |
Merge pull request #1630 from BubsMcgee/stream-output
d3d12: real SO_STATISTICS query pools (D3D-302)
Diffstat (limited to 'runtime/src/vulkan_backend.h')
| -rw-r--r-- | runtime/src/vulkan_backend.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index ecc2eef9c..68ab9b194 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h | |||
| @@ -130,7 +130,8 @@ struct VulkanDeviceFunctions { | |||
| 130 | X(vkCreatePipelineCache) X(vkDestroyPipelineCache) X(vkGetPipelineCacheData) X(vkMergePipelineCaches) \ | 130 | X(vkCreatePipelineCache) X(vkDestroyPipelineCache) X(vkGetPipelineCacheData) X(vkMergePipelineCaches) \ |
| 131 | X(vkCreateEvent) X(vkDestroyEvent) X(vkResetEvent) X(vkCmdSetEvent) X(vkCmdWaitEvents) X(vkCmdDrawMeshTasksEXT) \ | 131 | X(vkCreateEvent) X(vkDestroyEvent) X(vkResetEvent) X(vkCmdSetEvent) X(vkCmdWaitEvents) X(vkCmdDrawMeshTasksEXT) \ |
| 132 | X(vkCreateRenderPass2) X(vkDestroyRenderPass) X(vkCreateFramebuffer) X(vkDestroyFramebuffer) \ | 132 | X(vkCreateRenderPass2) X(vkDestroyRenderPass) X(vkCreateFramebuffer) X(vkDestroyFramebuffer) \ |
| 133 | X(vkCmdBeginRenderPass) X(vkCmdEndRenderPass) | 133 | X(vkCmdBeginRenderPass) X(vkCmdEndRenderPass) \ |
| 134 | X(vkCmdBeginQueryIndexedEXT) X(vkCmdEndQueryIndexedEXT) | ||
| 134 | #define LEONIDA_VK_MEMBER(name) PFN_##name name = nullptr; | 135 | #define LEONIDA_VK_MEMBER(name) PFN_##name name = nullptr; |
| 135 | LEONIDA_VK_DEVICE_FUNCTIONS(LEONIDA_VK_MEMBER) | 136 | LEONIDA_VK_DEVICE_FUNCTIONS(LEONIDA_VK_MEMBER) |
| 136 | #undef LEONIDA_VK_MEMBER | 137 | #undef LEONIDA_VK_MEMBER |
| @@ -165,6 +166,9 @@ struct VulkanDeviceFunctions { | |||
| 165 | return vkCmdBeginRendering && vkCmdEndRendering && vkCmdBindVertexBuffers2 && vkCmdSetPrimitiveTopology && | 166 | return vkCmdBeginRendering && vkCmdEndRendering && vkCmdBindVertexBuffers2 && vkCmdSetPrimitiveTopology && |
| 166 | vkCmdSetPrimitiveRestartEnable; | 167 | vkCmdSetPrimitiveRestartEnable; |
| 167 | } | 168 | } |
| 169 | // VK_EXT_transform_feedback is enabled on the device: the indexed-query entry points are loaded, so an | ||
| 170 | // SO_STATISTICS heap can be a real transform-feedback pool (D3D-302). | ||
| 171 | bool transform_feedback = false; | ||
| 168 | }; | 172 | }; |
| 169 | 173 | ||
| 170 | // Both kinds of compute resolve use the same storage buffer, descriptor set and pipeline layout. | 174 | // Both kinds of compute resolve use the same storage buffer, descriptor set and pipeline layout. |
| @@ -1090,6 +1094,8 @@ public: | |||
| 1090 | GraphicsIndirectCapabilities indirect = {}) | 1094 | GraphicsIndirectCapabilities indirect = {}) |
| 1091 | : device_(device), tracker_(separate_depth_stencil_layouts), ray_tracing_(ray_tracing) { | 1095 | : device_(device), tracker_(separate_depth_stencil_layouts), ray_tracing_(ray_tracing) { |
| 1092 | loaded_ = vk.load(get, device); | 1096 | loaded_ = vk.load(get, device); |
| 1097 | // VK_EXT_transform_feedback: enabled on the device when its indexed-query entry points resolved (D3D-302). | ||
| 1098 | vk.transform_feedback = vk.vkCmdBeginQueryIndexedEXT && vk.vkCmdEndQueryIndexedEXT; | ||
| 1093 | if (loaded_ && gpu_labels_.initialize(device, get)) { | 1099 | if (loaded_ && gpu_labels_.initialize(device, get)) { |
| 1094 | replay_.gpu_label = [this](VkCommandBuffer cb, const label::Write& write) { gpu_labels_.record(cb, write); }; | 1100 | replay_.gpu_label = [this](VkCommandBuffer cb, const label::Write& write) { gpu_labels_.record(cb, write); }; |
| 1095 | } | 1101 | } |
| @@ -1125,6 +1131,11 @@ public: | |||
| 1125 | replay_.reset_query_pool = vk.vkCmdResetQueryPool; | 1131 | replay_.reset_query_pool = vk.vkCmdResetQueryPool; |
| 1126 | replay_.begin_query = vk.vkCmdBeginQuery; | 1132 | replay_.begin_query = vk.vkCmdBeginQuery; |
| 1127 | replay_.end_query = vk.vkCmdEndQuery; | 1133 | replay_.end_query = vk.vkCmdEndQuery; |
| 1134 | // VK_EXT_transform_feedback (D3D-302), loaded when the device enabled it: indexed SO_STATISTICS queries. | ||
| 1135 | if (vk.transform_feedback) { | ||
| 1136 | replay_.begin_query_indexed = vk.vkCmdBeginQueryIndexedEXT; | ||
| 1137 | replay_.end_query_indexed = vk.vkCmdEndQueryIndexedEXT; | ||
| 1138 | } | ||
| 1128 | replay_.write_timestamp = vk.vkCmdWriteTimestamp; | 1139 | replay_.write_timestamp = vk.vkCmdWriteTimestamp; |
| 1129 | replay_.copy_query_pool_results = vk.vkCmdCopyQueryPoolResults; | 1140 | replay_.copy_query_pool_results = vk.vkCmdCopyQueryPoolResults; |
| 1130 | replay_.bind_pipeline = vk.vkCmdBindPipeline; | 1141 | replay_.bind_pipeline = vk.vkCmdBindPipeline; |