summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-10 21:27:02 +0100
committerGitHub <noreply@github.com>2023-01-10 21:27:02 +0100
commit74404261d22ff9d22da20c2fbe8b845388e8db41 (patch)
treeafba6af50ca7aec63a3d0fbdedf8855bc6ea29e2
parentMerge pull request #9595 from liamwhite/per-game (diff)
parentvulkan_common: fix indirect draw with count (diff)
downloadyuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.tar
yuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.tar.gz
yuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.tar.bz2
yuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.tar.lz
yuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.tar.xz
yuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.tar.zst
yuzu-74404261d22ff9d22da20c2fbe8b845388e8db41.zip
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h1
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.cpp10
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.h12
3 files changed, 15 insertions, 8 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index 4cfb20bc2..0662a2d9f 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -65,6 +65,7 @@
EXTENSION(EXT, SHADER_VIEWPORT_INDEX_LAYER, shader_viewport_index_layer) \
EXTENSION(EXT, TOOLING_INFO, tooling_info) \
EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \
+ EXTENSION(KHR, DRAW_INDIRECT_COUNT, draw_indirect_count) \
EXTENSION(KHR, DRIVER_PROPERTIES, driver_properties) \
EXTENSION(KHR, EXTERNAL_MEMORY_FD, external_memory_fd) \
EXTENSION(KHR, PUSH_DESCRIPTOR, push_descriptor) \
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp
index 61be1fce1..486d4dfaf 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.cpp
+++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp
@@ -96,8 +96,8 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
X(vkCmdDrawIndexed);
X(vkCmdDrawIndirect);
X(vkCmdDrawIndexedIndirect);
- X(vkCmdDrawIndirectCountKHR);
- X(vkCmdDrawIndexedIndirectCountKHR);
+ X(vkCmdDrawIndirectCount);
+ X(vkCmdDrawIndexedIndirectCount);
X(vkCmdEndQuery);
X(vkCmdEndRenderPass);
X(vkCmdEndTransformFeedbackEXT);
@@ -221,6 +221,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
if (!dld.vkResetQueryPool) {
Proc(dld.vkResetQueryPool, dld, "vkResetQueryPoolEXT", device);
}
+
+ // Support for draw indirect with count is optional in Vulkan 1.2
+ if (!dld.vkCmdDrawIndirectCount) {
+ Proc(dld.vkCmdDrawIndirectCount, dld, "vkCmdDrawIndirectCountKHR", device);
+ Proc(dld.vkCmdDrawIndexedIndirectCount, dld, "vkCmdDrawIndexedIndirectCountKHR", device);
+ }
#undef X
}
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h
index 412779b51..e86f661cb 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.h
+++ b/src/video_core/vulkan_common/vulkan_wrapper.h
@@ -215,8 +215,8 @@ struct DeviceDispatch : InstanceDispatch {
PFN_vkCmdDrawIndexed vkCmdDrawIndexed{};
PFN_vkCmdDrawIndirect vkCmdDrawIndirect{};
PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect{};
- PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR{};
- PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR{};
+ PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount{};
+ PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount{};
PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT{};
PFN_vkCmdEndQuery vkCmdEndQuery{};
PFN_vkCmdEndRenderPass vkCmdEndRenderPass{};
@@ -1065,15 +1065,15 @@ public:
void DrawIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, VkBuffer count_buffer,
VkDeviceSize count_offset, u32 draw_count, u32 stride) const noexcept {
- dld->vkCmdDrawIndirectCountKHR(handle, src_buffer, src_offset, count_buffer, count_offset,
- draw_count, stride);
+ dld->vkCmdDrawIndirectCount(handle, src_buffer, src_offset, count_buffer, count_offset,
+ draw_count, stride);
}
void DrawIndexedIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset,
VkBuffer count_buffer, VkDeviceSize count_offset, u32 draw_count,
u32 stride) const noexcept {
- dld->vkCmdDrawIndexedIndirectCountKHR(handle, src_buffer, src_offset, count_buffer,
- count_offset, draw_count, stride);
+ dld->vkCmdDrawIndexedIndirectCount(handle, src_buffer, src_offset, count_buffer,
+ count_offset, draw_count, stride);
}
void ClearAttachments(Span<VkClearAttachment> attachments,