1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Enable VK_KHR_draw_indirect_count if available

Useful to implement a corresponding D3D11 extension.
This commit is contained in:
Philip Rebohle 2019-04-24 21:31:31 +02:00
parent 66b6b50af6
commit 13359d68d7
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 32 additions and 1 deletions

View File

@ -240,7 +240,7 @@ namespace dxvk {
Rc<DxvkDevice> DxvkAdapter::createDevice(std::string clientApi, DxvkDeviceFeatures enabledFeatures) {
DxvkDeviceExtensions devExtensions;
std::array<DxvkExt*, 19> devExtensionList = {{
std::array<DxvkExt*, 20> devExtensionList = {{
&devExtensions.amdMemoryOverallocationBehaviour,
&devExtensions.amdShaderFragmentMask,
&devExtensions.extConditionalRendering,
@ -252,6 +252,7 @@ namespace dxvk {
&devExtensions.extVertexAttributeDivisor,
&devExtensions.khrDedicatedAllocation,
&devExtensions.khrDescriptorUpdateTemplate,
&devExtensions.khrDrawIndirectCount,
&devExtensions.khrDriverProperties,
&devExtensions.khrGetMemoryRequirements2,
&devExtensions.khrImageFormatList,

View File

@ -463,6 +463,18 @@ namespace dxvk {
}
void cmdDrawIndirectCount(
VkBuffer buffer,
VkDeviceSize offset,
VkBuffer countBuffer,
VkDeviceSize countOffset,
uint32_t maxDrawCount,
uint32_t stride) {
m_vkd->vkCmdDrawIndirectCountKHR(m_execBuffer,
buffer, offset, countBuffer, countOffset, maxDrawCount, stride);
}
void cmdDrawIndexed(
uint32_t indexCount,
uint32_t instanceCount,
@ -486,6 +498,18 @@ namespace dxvk {
}
void cmdDrawIndexedIndirectCount(
VkBuffer buffer,
VkDeviceSize offset,
VkBuffer countBuffer,
VkDeviceSize countOffset,
uint32_t maxDrawCount,
uint32_t stride) {
m_vkd->vkCmdDrawIndexedIndirectCountKHR(m_execBuffer,
buffer, offset, countBuffer, countOffset, maxDrawCount, stride);
}
void cmdDrawIndirectVertexCount(
uint32_t instanceCount,
uint32_t firstInstance,

View File

@ -268,6 +268,7 @@ namespace dxvk {
DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrDedicatedAllocation = { VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrDescriptorUpdateTemplate = { VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrDrawIndirectCount = { VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrDriverProperties = { VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrGetMemoryRequirements2 = { VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrImageFormatList = { VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, DxvkExtMode::Required };

View File

@ -273,6 +273,11 @@ namespace dxvk::vk {
VULKAN_FN(vkUpdateDescriptorSetWithTemplateKHR);
VULKAN_FN(vkCmdPushDescriptorSetWithTemplateKHR);
#endif
#ifdef VK_KHR_draw_indirect_count
VULKAN_FN(vkCmdDrawIndirectCountKHR);
VULKAN_FN(vkCmdDrawIndexedIndirectCountKHR);
#endif
#ifdef VK_KHR_swapchain
VULKAN_FN(vkCreateSwapchainKHR);