summaryrefslogtreecommitdiffstats
path: root/src/video_core/vulkan_common
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-02-09 15:39:40 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-01-01 22:43:57 +0100
commit0f89828073a541eaa2cfd985483f839bd2f97b74 (patch)
tree3e26c71678e17ca97ec744a884f5ecb9ae2b6c5e /src/video_core/vulkan_common
parentMacroHLE: Add MultidrawIndirect HLE Macro. (diff)
downloadyuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar
yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.gz
yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.bz2
yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.lz
yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.xz
yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.zst
yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.zip
Diffstat (limited to 'src/video_core/vulkan_common')
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp5
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h1
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.cpp6
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.h24
4 files changed, 27 insertions, 9 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 477fc428b..207fae8c9 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -351,7 +351,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
.dualSrcBlend = true,
.logicOp = true,
.multiDrawIndirect = true,
- .drawIndirectFirstInstance = false,
+ .drawIndirectFirstInstance = true,
.depthClamp = true,
.depthBiasClamp = true,
.fillModeNonSolid = true,
@@ -1024,6 +1024,8 @@ void Device::CheckSuitability(bool requires_swapchain) const {
std::make_pair(features.vertexPipelineStoresAndAtomics, "vertexPipelineStoresAndAtomics"),
std::make_pair(features.imageCubeArray, "imageCubeArray"),
std::make_pair(features.independentBlend, "independentBlend"),
+ std::make_pair(features.multiDrawIndirect, "multiDrawIndirect"),
+ std::make_pair(features.drawIndirectFirstInstance, "drawIndirectFirstInstance"),
std::make_pair(features.depthClamp, "depthClamp"),
std::make_pair(features.samplerAnisotropy, "samplerAnisotropy"),
std::make_pair(features.largePoints, "largePoints"),
@@ -1117,6 +1119,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
test(khr_spirv_1_4, VK_KHR_SPIRV_1_4_EXTENSION_NAME, true);
test(khr_push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, true);
test(has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, false);
+ test(khr_draw_indirect_count, VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, true);
test(ext_depth_range_unrestricted, VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, true);
test(ext_index_type_uint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, true);
test(has_ext_primitive_topology_list_restart,
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index 6a26c4e6e..d0d7c2299 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -451,6 +451,7 @@ private:
bool nv_viewport_swizzle{}; ///< Support for VK_NV_viewport_swizzle.
bool nv_viewport_array2{}; ///< Support for VK_NV_viewport_array2.
bool nv_geometry_shader_passthrough{}; ///< Support for VK_NV_geometry_shader_passthrough.
+ bool khr_draw_indirect_count{}; ///< Support for VK_KHR_draw_indirect_count.
bool khr_uniform_buffer_standard_layout{}; ///< Support for scalar uniform buffer layouts.
bool khr_spirv_1_4{}; ///< Support for VK_KHR_spirv_1_4.
bool khr_workgroup_memory_explicit_layout{}; ///< Support for explicit workgroup layouts.
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp
index c58c4c1c4..f8f8ed9f8 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.cpp
+++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp
@@ -94,8 +94,10 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
X(vkCmdDispatch);
X(vkCmdDraw);
X(vkCmdDrawIndexed);
- X(vkCmdDrawIndirectCount);
- X(vkCmdDrawIndexedIndirectCount);
+ X(vkCmdDrawIndirect);
+ X(vkCmdDrawIndexedIndirect);
+ X(vkCmdDrawIndirectCountKHR);
+ X(vkCmdDrawIndexedIndirectCountKHR);
X(vkCmdEndQuery);
X(vkCmdEndRenderPass);
X(vkCmdEndTransformFeedbackEXT);
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h
index 9bd158dce..493a48573 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.h
+++ b/src/video_core/vulkan_common/vulkan_wrapper.h
@@ -213,8 +213,10 @@ struct DeviceDispatch : InstanceDispatch {
PFN_vkCmdDispatch vkCmdDispatch{};
PFN_vkCmdDraw vkCmdDraw{};
PFN_vkCmdDrawIndexed vkCmdDrawIndexed{};
- PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount{};
- PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount{};
+ PFN_vkCmdDrawIndirect vkCmdDrawIndirect{};
+ PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect{};
+ PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR{};
+ PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR{};
PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT{};
PFN_vkCmdEndQuery vkCmdEndQuery{};
PFN_vkCmdEndRenderPass vkCmdEndRenderPass{};
@@ -1021,17 +1023,27 @@ public:
first_instance);
}
+ void DrawIndirect(VkBuffer src_buffer, VkDeviceSize src_offset, u32 draw_count,
+ u32 stride) const noexcept {
+ dld->vkCmdDrawIndirect(handle, src_buffer, src_offset, draw_count, stride);
+ }
+
+ void DrawIndexedIndirect(VkBuffer src_buffer, VkDeviceSize src_offset, u32 draw_count,
+ u32 stride) const noexcept {
+ dld->vkCmdDrawIndexedIndirect(handle, src_buffer, src_offset, draw_count, stride);
+ }
+
void DrawIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, VkBuffer count_buffer,
VkDeviceSize count_offset, u32 draw_count, u32 stride) const noexcept {
- dld->vkCmdDrawIndirectCount(handle, src_buffer, src_offset, count_buffer, count_offset,
- draw_count, stride);
+ dld->vkCmdDrawIndirectCountKHR(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->vkCmdDrawIndexedIndirectCount(handle, src_buffer, src_offset, count_buffer,
- count_offset, draw_count, stride);
+ dld->vkCmdDrawIndexedIndirectCountKHR(handle, src_buffer, src_offset, count_buffer,
+ count_offset, draw_count, stride);
}
void ClearAttachments(Span<VkClearAttachment> attachments,