1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxvk] Don't enable VK_KHR_descriptor_update_template

Core in Vulkan 1.1.
This commit is contained in:
Philip Rebohle 2020-01-16 20:47:17 +01:00 committed by Philip Rebohle
parent 4923bc20f7
commit 7150d2b7fb
6 changed files with 29 additions and 35 deletions

View File

@ -243,7 +243,7 @@ namespace dxvk {
DxvkDeviceFeatures enabledFeatures) {
DxvkDeviceExtensions devExtensions;
std::array<DxvkExt*, 21> devExtensionList = {{
std::array<DxvkExt*, 20> devExtensionList = {{
&devExtensions.amdMemoryOverallocationBehaviour,
&devExtensions.amdShaderFragmentMask,
&devExtensions.extConditionalRendering,
@ -259,7 +259,6 @@ namespace dxvk {
&devExtensions.extVertexAttributeDivisor,
&devExtensions.khrCreateRenderPass2,
&devExtensions.khrDepthStencilResolve,
&devExtensions.khrDescriptorUpdateTemplate,
&devExtensions.khrDrawIndirectCount,
&devExtensions.khrDriverProperties,
&devExtensions.khrImageFormatList,

View File

@ -221,9 +221,9 @@ namespace dxvk {
void updateDescriptorSetWithTemplate(
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplateKHR descriptorTemplate,
VkDescriptorUpdateTemplate descriptorTemplate,
const void* data) {
m_vkd->vkUpdateDescriptorSetWithTemplateKHR(m_vkd->device(),
m_vkd->vkUpdateDescriptorSetWithTemplate(m_vkd->device(),
descriptorSet, descriptorTemplate, data);
}

View File

@ -273,7 +273,6 @@ namespace dxvk {
DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrCreateRenderPass2 = { VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrDepthStencilResolve = { VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, DxvkExtMode::Optional };
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 khrImageFormatList = { VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, DxvkExtMode::Required };

View File

@ -36,8 +36,8 @@ namespace dxvk {
m_vkd->vkDestroyPipeline(m_vkd->device(), m_pipePackD32S8, nullptr);
m_vkd->vkDestroyPipeline(m_vkd->device(), m_pipePackD24S8, nullptr);
m_vkd->vkDestroyDescriptorUpdateTemplateKHR(m_vkd->device(), m_templatePack, nullptr);
m_vkd->vkDestroyDescriptorUpdateTemplateKHR(m_vkd->device(), m_templateUnpack, nullptr);
m_vkd->vkDestroyDescriptorUpdateTemplate(m_vkd->device(), m_templatePack, nullptr);
m_vkd->vkDestroyDescriptorUpdateTemplate(m_vkd->device(), m_templateUnpack, nullptr);
m_vkd->vkDestroyPipelineLayout(m_vkd->device(), m_pipeLayoutPack, nullptr);
m_vkd->vkDestroyPipelineLayout(m_vkd->device(), m_pipeLayoutUnpack, nullptr);
@ -185,54 +185,54 @@ namespace dxvk {
}
VkDescriptorUpdateTemplateKHR DxvkMetaPackObjects::createPackDescriptorUpdateTemplate() {
std::array<VkDescriptorUpdateTemplateEntryKHR, 3> bindings = {{
VkDescriptorUpdateTemplate DxvkMetaPackObjects::createPackDescriptorUpdateTemplate() {
std::array<VkDescriptorUpdateTemplateEntry, 3> bindings = {{
{ 0, 0, 1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, offsetof(DxvkMetaPackDescriptors, dstBuffer), 0 },
{ 1, 0, 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, offsetof(DxvkMetaPackDescriptors, srcDepth), 0 },
{ 2, 0, 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, offsetof(DxvkMetaPackDescriptors, srcStencil), 0 },
}};
VkDescriptorUpdateTemplateCreateInfoKHR templateInfo;
templateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR;
VkDescriptorUpdateTemplateCreateInfo templateInfo;
templateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO;
templateInfo.pNext = nullptr;
templateInfo.flags = 0;
templateInfo.descriptorUpdateEntryCount = bindings.size();
templateInfo.pDescriptorUpdateEntries = bindings.data();
templateInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR;
templateInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET;
templateInfo.descriptorSetLayout = m_dsetLayoutPack;
templateInfo.pipelineBindPoint = VK_PIPELINE_BIND_POINT_COMPUTE;
templateInfo.pipelineLayout = m_pipeLayoutPack;
templateInfo.set = 0;
VkDescriptorUpdateTemplateKHR result = VK_NULL_HANDLE;
if (m_vkd->vkCreateDescriptorUpdateTemplateKHR(m_vkd->device(),
VkDescriptorUpdateTemplate result = VK_NULL_HANDLE;
if (m_vkd->vkCreateDescriptorUpdateTemplate(m_vkd->device(),
&templateInfo, nullptr, &result) != VK_SUCCESS)
throw DxvkError("DxvkMetaPackObjects: Failed to create descriptor update template");
return result;
}
VkDescriptorUpdateTemplateKHR DxvkMetaPackObjects::createUnpackDescriptorUpdateTemplate() {
std::array<VkDescriptorUpdateTemplateEntryKHR, 3> bindings = {{
VkDescriptorUpdateTemplate DxvkMetaPackObjects::createUnpackDescriptorUpdateTemplate() {
std::array<VkDescriptorUpdateTemplateEntry, 3> bindings = {{
{ 0, 0, 1, VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, offsetof(DxvkMetaUnpackDescriptors, dstDepth), 0 },
{ 1, 0, 1, VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, offsetof(DxvkMetaUnpackDescriptors, dstStencil), 0 },
{ 2, 0, 1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, offsetof(DxvkMetaUnpackDescriptors, srcBuffer), 0 },
}};
VkDescriptorUpdateTemplateCreateInfoKHR templateInfo;
templateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR;
VkDescriptorUpdateTemplateCreateInfo templateInfo;
templateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO;
templateInfo.pNext = nullptr;
templateInfo.flags = 0;
templateInfo.descriptorUpdateEntryCount = bindings.size();
templateInfo.pDescriptorUpdateEntries = bindings.data();
templateInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR;
templateInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET;
templateInfo.descriptorSetLayout = m_dsetLayoutUnpack;
templateInfo.pipelineBindPoint = VK_PIPELINE_BIND_POINT_COMPUTE;
templateInfo.pipelineLayout = m_pipeLayoutUnpack;
templateInfo.set = 0;
VkDescriptorUpdateTemplateKHR result = VK_NULL_HANDLE;
if (m_vkd->vkCreateDescriptorUpdateTemplateKHR(m_vkd->device(),
VkDescriptorUpdateTemplate result = VK_NULL_HANDLE;
if (m_vkd->vkCreateDescriptorUpdateTemplate(m_vkd->device(),
&templateInfo, nullptr, &result) != VK_SUCCESS)
throw DxvkError("DxvkMetaPackObjects: Failed to create descriptor update template");
return result;

View File

@ -95,8 +95,8 @@ namespace dxvk {
for (uint32_t i = 0; i < bindingCount; i++)
m_bindingSlots[i] = bindingInfos[i];
std::vector<VkDescriptorSetLayoutBinding> bindings(bindingCount);
std::vector<VkDescriptorUpdateTemplateEntryKHR> tEntries(bindingCount);
std::vector<VkDescriptorSetLayoutBinding> bindings(bindingCount);
std::vector<VkDescriptorUpdateTemplateEntry> tEntries(bindingCount);
for (uint32_t i = 0; i < bindingCount; i++) {
bindings[i].binding = i;
@ -157,19 +157,19 @@ namespace dxvk {
// Create descriptor update template. If there are no active
// resource bindings, there won't be any descriptors to update.
if (bindingCount > 0) {
VkDescriptorUpdateTemplateCreateInfoKHR templateInfo;
templateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR;
VkDescriptorUpdateTemplateCreateInfo templateInfo;
templateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO;
templateInfo.pNext = nullptr;
templateInfo.flags = 0;
templateInfo.descriptorUpdateEntryCount = tEntries.size();
templateInfo.pDescriptorUpdateEntries = tEntries.data();
templateInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR;
templateInfo.templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET;
templateInfo.descriptorSetLayout = m_descriptorSetLayout;
templateInfo.pipelineBindPoint = pipelineBindPoint;
templateInfo.pipelineLayout = m_pipelineLayout;
templateInfo.set = 0;
if (m_vkd->vkCreateDescriptorUpdateTemplateKHR(
if (m_vkd->vkCreateDescriptorUpdateTemplate(
m_vkd->device(), &templateInfo, nullptr, &m_descriptorTemplate) != VK_SUCCESS) {
m_vkd->vkDestroyDescriptorSetLayout(m_vkd->device(), m_descriptorSetLayout, nullptr);
m_vkd->vkDestroyPipelineLayout(m_vkd->device(), m_pipelineLayout, nullptr);
@ -180,7 +180,7 @@ namespace dxvk {
DxvkPipelineLayout::~DxvkPipelineLayout() {
m_vkd->vkDestroyDescriptorUpdateTemplateKHR(
m_vkd->vkDestroyDescriptorUpdateTemplate(
m_vkd->device(), m_descriptorTemplate, nullptr);
m_vkd->vkDestroyPipelineLayout(

View File

@ -231,6 +231,9 @@ namespace dxvk::vk {
VULKAN_FN(vkBeginCommandBuffer);
VULKAN_FN(vkEndCommandBuffer);
VULKAN_FN(vkResetCommandBuffer);
VULKAN_FN(vkCreateDescriptorUpdateTemplate);
VULKAN_FN(vkDestroyDescriptorUpdateTemplate);
VULKAN_FN(vkUpdateDescriptorSetWithTemplate);
VULKAN_FN(vkCmdBindPipeline);
VULKAN_FN(vkCmdSetViewport);
VULKAN_FN(vkCmdSetScissor);
@ -283,13 +286,6 @@ namespace dxvk::vk {
VULKAN_FN(vkCmdEndRenderPass2KHR);
#endif
#ifdef VK_KHR_descriptor_update_template
VULKAN_FN(vkCreateDescriptorUpdateTemplateKHR);
VULKAN_FN(vkDestroyDescriptorUpdateTemplateKHR);
VULKAN_FN(vkUpdateDescriptorSetWithTemplateKHR);
VULKAN_FN(vkCmdPushDescriptorSetWithTemplateKHR);
#endif
#ifdef VK_KHR_draw_indirect_count
VULKAN_FN(vkCmdDrawIndirectCountKHR);
VULKAN_FN(vkCmdDrawIndexedIndirectCountKHR);