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

[dxvk] Don't enable VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2

Core in Vulkan 1.1.
This commit is contained in:
Philip Rebohle 2020-01-16 20:10:37 +01:00 committed by Philip Rebohle
parent 252ec9406d
commit 60145f0167
7 changed files with 30 additions and 36 deletions

View File

@ -241,7 +241,7 @@ namespace dxvk {
DxvkDeviceFeatures enabledFeatures) { DxvkDeviceFeatures enabledFeatures) {
DxvkDeviceExtensions devExtensions; DxvkDeviceExtensions devExtensions;
std::array<DxvkExt*, 26> devExtensionList = {{ std::array<DxvkExt*, 24> devExtensionList = {{
&devExtensions.amdMemoryOverallocationBehaviour, &devExtensions.amdMemoryOverallocationBehaviour,
&devExtensions.amdShaderFragmentMask, &devExtensions.amdShaderFragmentMask,
&devExtensions.extConditionalRendering, &devExtensions.extConditionalRendering,
@ -256,12 +256,10 @@ namespace dxvk {
&devExtensions.extTransformFeedback, &devExtensions.extTransformFeedback,
&devExtensions.extVertexAttributeDivisor, &devExtensions.extVertexAttributeDivisor,
&devExtensions.khrCreateRenderPass2, &devExtensions.khrCreateRenderPass2,
&devExtensions.khrDedicatedAllocation,
&devExtensions.khrDepthStencilResolve, &devExtensions.khrDepthStencilResolve,
&devExtensions.khrDescriptorUpdateTemplate, &devExtensions.khrDescriptorUpdateTemplate,
&devExtensions.khrDrawIndirectCount, &devExtensions.khrDrawIndirectCount,
&devExtensions.khrDriverProperties, &devExtensions.khrDriverProperties,
&devExtensions.khrGetMemoryRequirements2,
&devExtensions.khrImageFormatList, &devExtensions.khrImageFormatList,
&devExtensions.khrMaintenance1, &devExtensions.khrMaintenance1,
&devExtensions.khrMaintenance2, &devExtensions.khrMaintenance2,

View File

@ -74,28 +74,28 @@ namespace dxvk {
"\n usage: ", info.usage)); "\n usage: ", info.usage));
} }
VkMemoryDedicatedRequirementsKHR dedicatedRequirements; VkMemoryDedicatedRequirements dedicatedRequirements;
dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR; dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS;
dedicatedRequirements.pNext = VK_NULL_HANDLE; dedicatedRequirements.pNext = VK_NULL_HANDLE;
dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE; dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE;
dedicatedRequirements.requiresDedicatedAllocation = VK_FALSE; dedicatedRequirements.requiresDedicatedAllocation = VK_FALSE;
VkMemoryRequirements2KHR memReq; VkMemoryRequirements2 memReq;
memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR; memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2;
memReq.pNext = &dedicatedRequirements; memReq.pNext = &dedicatedRequirements;
VkBufferMemoryRequirementsInfo2KHR memReqInfo; VkBufferMemoryRequirementsInfo2 memReqInfo;
memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR; memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2;
memReqInfo.buffer = handle.buffer; memReqInfo.buffer = handle.buffer;
memReqInfo.pNext = VK_NULL_HANDLE; memReqInfo.pNext = VK_NULL_HANDLE;
VkMemoryDedicatedAllocateInfoKHR dedMemoryAllocInfo; VkMemoryDedicatedAllocateInfo dedMemoryAllocInfo;
dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR; dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO;
dedMemoryAllocInfo.pNext = VK_NULL_HANDLE; dedMemoryAllocInfo.pNext = VK_NULL_HANDLE;
dedMemoryAllocInfo.buffer = handle.buffer; dedMemoryAllocInfo.buffer = handle.buffer;
dedMemoryAllocInfo.image = VK_NULL_HANDLE; dedMemoryAllocInfo.image = VK_NULL_HANDLE;
vkd->vkGetBufferMemoryRequirements2KHR( vkd->vkGetBufferMemoryRequirements2(
vkd->device(), &memReqInfo, &memReq); vkd->device(), &memReqInfo, &memReq);
// Use high memory priority for GPU-writable resources // Use high memory priority for GPU-writable resources

View File

@ -272,12 +272,10 @@ namespace dxvk {
DxvkExt extTransformFeedback = { VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extTransformFeedback = { VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrCreateRenderPass2 = { VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrCreateRenderPass2 = { VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrDedicatedAllocation = { VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrDepthStencilResolve = { VK_KHR_DEPTH_STENCIL_RESOLVE_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 khrDescriptorUpdateTemplate = { VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrDrawIndirectCount = { VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrDrawIndirectCount = { VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, DxvkExtMode::Optional };
DxvkExt khrDriverProperties = { VK_KHR_DRIVER_PROPERTIES_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 }; DxvkExt khrImageFormatList = { VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrMaintenance1 = { VK_KHR_MAINTENANCE1_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt khrMaintenance1 = { VK_KHR_MAINTENANCE1_EXTENSION_NAME, DxvkExtMode::Required };
DxvkExt khrMaintenance2 = { VK_KHR_MAINTENANCE2_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt khrMaintenance2 = { VK_KHR_MAINTENANCE2_EXTENSION_NAME, DxvkExtMode::Required };

View File

@ -60,28 +60,28 @@ namespace dxvk {
// alignment on non-linear images in order not to violate the // alignment on non-linear images in order not to violate the
// bufferImageGranularity limit, which may be greater than the // bufferImageGranularity limit, which may be greater than the
// required resource memory alignment on some GPUs. // required resource memory alignment on some GPUs.
VkMemoryDedicatedRequirementsKHR dedicatedRequirements; VkMemoryDedicatedRequirements dedicatedRequirements;
dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR; dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS;
dedicatedRequirements.pNext = VK_NULL_HANDLE; dedicatedRequirements.pNext = VK_NULL_HANDLE;
dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE; dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE;
dedicatedRequirements.requiresDedicatedAllocation = VK_FALSE; dedicatedRequirements.requiresDedicatedAllocation = VK_FALSE;
VkMemoryRequirements2KHR memReq; VkMemoryRequirements2 memReq;
memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR; memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2;
memReq.pNext = &dedicatedRequirements; memReq.pNext = &dedicatedRequirements;
VkImageMemoryRequirementsInfo2KHR memReqInfo; VkImageMemoryRequirementsInfo2 memReqInfo;
memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR; memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2;
memReqInfo.image = m_image.image; memReqInfo.image = m_image.image;
memReqInfo.pNext = VK_NULL_HANDLE; memReqInfo.pNext = VK_NULL_HANDLE;
VkMemoryDedicatedAllocateInfoKHR dedMemoryAllocInfo; VkMemoryDedicatedAllocateInfo dedMemoryAllocInfo;
dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR; dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO;
dedMemoryAllocInfo.pNext = VK_NULL_HANDLE; dedMemoryAllocInfo.pNext = VK_NULL_HANDLE;
dedMemoryAllocInfo.buffer = VK_NULL_HANDLE; dedMemoryAllocInfo.buffer = VK_NULL_HANDLE;
dedMemoryAllocInfo.image = m_image.image; dedMemoryAllocInfo.image = m_image.image;
m_vkd->vkGetImageMemoryRequirements2KHR( m_vkd->vkGetImageMemoryRequirements2(
m_vkd->device(), &memReqInfo, &memReq); m_vkd->device(), &memReqInfo, &memReq);
if (info.tiling != VK_IMAGE_TILING_LINEAR) { if (info.tiling != VK_IMAGE_TILING_LINEAR) {

View File

@ -180,7 +180,7 @@ namespace dxvk {
DxvkMemory DxvkMemoryAllocator::alloc( DxvkMemory DxvkMemoryAllocator::alloc(
const VkMemoryRequirements* req, const VkMemoryRequirements* req,
const VkMemoryDedicatedRequirements& dedAllocReq, const VkMemoryDedicatedRequirements& dedAllocReq,
const VkMemoryDedicatedAllocateInfoKHR& dedAllocInfo, const VkMemoryDedicatedAllocateInfo& dedAllocInfo,
VkMemoryPropertyFlags flags, VkMemoryPropertyFlags flags,
float priority) { float priority) {
std::lock_guard<std::mutex> lock(m_mutex); std::lock_guard<std::mutex> lock(m_mutex);
@ -234,7 +234,7 @@ namespace dxvk {
DxvkMemory DxvkMemoryAllocator::tryAlloc( DxvkMemory DxvkMemoryAllocator::tryAlloc(
const VkMemoryRequirements* req, const VkMemoryRequirements* req,
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo, const VkMemoryDedicatedAllocateInfo* dedAllocInfo,
VkMemoryPropertyFlags flags, VkMemoryPropertyFlags flags,
float priority) { float priority) {
DxvkMemory result; DxvkMemory result;
@ -259,7 +259,7 @@ namespace dxvk {
VkDeviceSize size, VkDeviceSize size,
VkDeviceSize align, VkDeviceSize align,
float priority, float priority,
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo) { const VkMemoryDedicatedAllocateInfo* dedAllocInfo) {
// Prevent unnecessary external host memory fragmentation // Prevent unnecessary external host memory fragmentation
bool isDeviceLocal = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0; bool isDeviceLocal = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0;
@ -305,7 +305,7 @@ namespace dxvk {
VkMemoryPropertyFlags flags, VkMemoryPropertyFlags flags,
VkDeviceSize size, VkDeviceSize size,
float priority, float priority,
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo) { const VkMemoryDedicatedAllocateInfo* dedAllocInfo) {
bool useMemoryPriority = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) bool useMemoryPriority = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
&& (m_device->features().extMemoryPriority.memoryPriority); && (m_device->features().extMemoryPriority.memoryPriority);

View File

@ -258,7 +258,7 @@ namespace dxvk {
DxvkMemory alloc( DxvkMemory alloc(
const VkMemoryRequirements* req, const VkMemoryRequirements* req,
const VkMemoryDedicatedRequirements& dedAllocReq, const VkMemoryDedicatedRequirements& dedAllocReq,
const VkMemoryDedicatedAllocateInfoKHR& dedAllocInfo, const VkMemoryDedicatedAllocateInfo& dedAllocInfo,
VkMemoryPropertyFlags flags, VkMemoryPropertyFlags flags,
float priority); float priority);
@ -287,7 +287,7 @@ namespace dxvk {
DxvkMemory tryAlloc( DxvkMemory tryAlloc(
const VkMemoryRequirements* req, const VkMemoryRequirements* req,
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo, const VkMemoryDedicatedAllocateInfo* dedAllocInfo,
VkMemoryPropertyFlags flags, VkMemoryPropertyFlags flags,
float priority); float priority);
@ -297,14 +297,14 @@ namespace dxvk {
VkDeviceSize size, VkDeviceSize size,
VkDeviceSize align, VkDeviceSize align,
float priority, float priority,
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo); const VkMemoryDedicatedAllocateInfo* dedAllocInfo);
DxvkDeviceMemory tryAllocDeviceMemory( DxvkDeviceMemory tryAllocDeviceMemory(
DxvkMemoryType* type, DxvkMemoryType* type,
VkMemoryPropertyFlags flags, VkMemoryPropertyFlags flags,
VkDeviceSize size, VkDeviceSize size,
float priority, float priority,
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo); const VkMemoryDedicatedAllocateInfo* dedAllocInfo);
void free( void free(
const DxvkMemory& memory); const DxvkMemory& memory);

View File

@ -167,8 +167,11 @@ namespace dxvk::vk {
VULKAN_FN(vkBindBufferMemory); VULKAN_FN(vkBindBufferMemory);
VULKAN_FN(vkBindImageMemory); VULKAN_FN(vkBindImageMemory);
VULKAN_FN(vkGetBufferMemoryRequirements); VULKAN_FN(vkGetBufferMemoryRequirements);
VULKAN_FN(vkGetBufferMemoryRequirements2);
VULKAN_FN(vkGetImageMemoryRequirements); VULKAN_FN(vkGetImageMemoryRequirements);
VULKAN_FN(vkGetImageMemoryRequirements2);
VULKAN_FN(vkGetImageSparseMemoryRequirements); VULKAN_FN(vkGetImageSparseMemoryRequirements);
VULKAN_FN(vkGetImageSparseMemoryRequirements2);
VULKAN_FN(vkQueueBindSparse); VULKAN_FN(vkQueueBindSparse);
VULKAN_FN(vkCreateFence); VULKAN_FN(vkCreateFence);
VULKAN_FN(vkDestroyFence); VULKAN_FN(vkDestroyFence);
@ -300,11 +303,6 @@ namespace dxvk::vk {
VULKAN_FN(vkQueuePresentKHR); VULKAN_FN(vkQueuePresentKHR);
#endif #endif
#ifdef VK_KHR_get_memory_requirements2
VULKAN_FN(vkGetBufferMemoryRequirements2KHR);
VULKAN_FN(vkGetImageMemoryRequirements2KHR);
#endif
#ifdef VK_EXT_conditional_rendering #ifdef VK_EXT_conditional_rendering
VULKAN_FN(vkCmdBeginConditionalRenderingEXT); VULKAN_FN(vkCmdBeginConditionalRenderingEXT);
VULKAN_FN(vkCmdEndConditionalRenderingEXT); VULKAN_FN(vkCmdEndConditionalRenderingEXT);