mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +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:
parent
252ec9406d
commit
60145f0167
@ -241,7 +241,7 @@ namespace dxvk {
|
||||
DxvkDeviceFeatures enabledFeatures) {
|
||||
DxvkDeviceExtensions devExtensions;
|
||||
|
||||
std::array<DxvkExt*, 26> devExtensionList = {{
|
||||
std::array<DxvkExt*, 24> devExtensionList = {{
|
||||
&devExtensions.amdMemoryOverallocationBehaviour,
|
||||
&devExtensions.amdShaderFragmentMask,
|
||||
&devExtensions.extConditionalRendering,
|
||||
@ -256,12 +256,10 @@ namespace dxvk {
|
||||
&devExtensions.extTransformFeedback,
|
||||
&devExtensions.extVertexAttributeDivisor,
|
||||
&devExtensions.khrCreateRenderPass2,
|
||||
&devExtensions.khrDedicatedAllocation,
|
||||
&devExtensions.khrDepthStencilResolve,
|
||||
&devExtensions.khrDescriptorUpdateTemplate,
|
||||
&devExtensions.khrDrawIndirectCount,
|
||||
&devExtensions.khrDriverProperties,
|
||||
&devExtensions.khrGetMemoryRequirements2,
|
||||
&devExtensions.khrImageFormatList,
|
||||
&devExtensions.khrMaintenance1,
|
||||
&devExtensions.khrMaintenance2,
|
||||
|
@ -74,28 +74,28 @@ namespace dxvk {
|
||||
"\n usage: ", info.usage));
|
||||
}
|
||||
|
||||
VkMemoryDedicatedRequirementsKHR dedicatedRequirements;
|
||||
dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
|
||||
VkMemoryDedicatedRequirements dedicatedRequirements;
|
||||
dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS;
|
||||
dedicatedRequirements.pNext = VK_NULL_HANDLE;
|
||||
dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE;
|
||||
dedicatedRequirements.requiresDedicatedAllocation = VK_FALSE;
|
||||
|
||||
VkMemoryRequirements2KHR memReq;
|
||||
memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
|
||||
VkMemoryRequirements2 memReq;
|
||||
memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2;
|
||||
memReq.pNext = &dedicatedRequirements;
|
||||
|
||||
VkBufferMemoryRequirementsInfo2KHR memReqInfo;
|
||||
memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR;
|
||||
VkBufferMemoryRequirementsInfo2 memReqInfo;
|
||||
memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2;
|
||||
memReqInfo.buffer = handle.buffer;
|
||||
memReqInfo.pNext = VK_NULL_HANDLE;
|
||||
|
||||
VkMemoryDedicatedAllocateInfoKHR dedMemoryAllocInfo;
|
||||
dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR;
|
||||
VkMemoryDedicatedAllocateInfo dedMemoryAllocInfo;
|
||||
dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO;
|
||||
dedMemoryAllocInfo.pNext = VK_NULL_HANDLE;
|
||||
dedMemoryAllocInfo.buffer = handle.buffer;
|
||||
dedMemoryAllocInfo.image = VK_NULL_HANDLE;
|
||||
|
||||
vkd->vkGetBufferMemoryRequirements2KHR(
|
||||
vkd->vkGetBufferMemoryRequirements2(
|
||||
vkd->device(), &memReqInfo, &memReq);
|
||||
|
||||
// Use high memory priority for GPU-writable resources
|
||||
|
@ -272,12 +272,10 @@ namespace dxvk {
|
||||
DxvkExt extTransformFeedback = { VK_EXT_TRANSFORM_FEEDBACK_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 khrDedicatedAllocation = { VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, DxvkExtMode::Required };
|
||||
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 khrGetMemoryRequirements2 = { VK_KHR_GET_MEMORY_REQUIREMENTS_2_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 khrMaintenance2 = { VK_KHR_MAINTENANCE2_EXTENSION_NAME, DxvkExtMode::Required };
|
||||
|
@ -60,28 +60,28 @@ namespace dxvk {
|
||||
// alignment on non-linear images in order not to violate the
|
||||
// bufferImageGranularity limit, which may be greater than the
|
||||
// required resource memory alignment on some GPUs.
|
||||
VkMemoryDedicatedRequirementsKHR dedicatedRequirements;
|
||||
dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
|
||||
VkMemoryDedicatedRequirements dedicatedRequirements;
|
||||
dedicatedRequirements.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS;
|
||||
dedicatedRequirements.pNext = VK_NULL_HANDLE;
|
||||
dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE;
|
||||
dedicatedRequirements.requiresDedicatedAllocation = VK_FALSE;
|
||||
|
||||
VkMemoryRequirements2KHR memReq;
|
||||
memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
|
||||
VkMemoryRequirements2 memReq;
|
||||
memReq.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2;
|
||||
memReq.pNext = &dedicatedRequirements;
|
||||
|
||||
VkImageMemoryRequirementsInfo2KHR memReqInfo;
|
||||
memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR;
|
||||
VkImageMemoryRequirementsInfo2 memReqInfo;
|
||||
memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2;
|
||||
memReqInfo.image = m_image.image;
|
||||
memReqInfo.pNext = VK_NULL_HANDLE;
|
||||
|
||||
VkMemoryDedicatedAllocateInfoKHR dedMemoryAllocInfo;
|
||||
dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR;
|
||||
VkMemoryDedicatedAllocateInfo dedMemoryAllocInfo;
|
||||
dedMemoryAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO;
|
||||
dedMemoryAllocInfo.pNext = VK_NULL_HANDLE;
|
||||
dedMemoryAllocInfo.buffer = VK_NULL_HANDLE;
|
||||
dedMemoryAllocInfo.image = m_image.image;
|
||||
|
||||
m_vkd->vkGetImageMemoryRequirements2KHR(
|
||||
m_vkd->vkGetImageMemoryRequirements2(
|
||||
m_vkd->device(), &memReqInfo, &memReq);
|
||||
|
||||
if (info.tiling != VK_IMAGE_TILING_LINEAR) {
|
||||
|
@ -180,7 +180,7 @@ namespace dxvk {
|
||||
DxvkMemory DxvkMemoryAllocator::alloc(
|
||||
const VkMemoryRequirements* req,
|
||||
const VkMemoryDedicatedRequirements& dedAllocReq,
|
||||
const VkMemoryDedicatedAllocateInfoKHR& dedAllocInfo,
|
||||
const VkMemoryDedicatedAllocateInfo& dedAllocInfo,
|
||||
VkMemoryPropertyFlags flags,
|
||||
float priority) {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
@ -234,7 +234,7 @@ namespace dxvk {
|
||||
|
||||
DxvkMemory DxvkMemoryAllocator::tryAlloc(
|
||||
const VkMemoryRequirements* req,
|
||||
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo,
|
||||
const VkMemoryDedicatedAllocateInfo* dedAllocInfo,
|
||||
VkMemoryPropertyFlags flags,
|
||||
float priority) {
|
||||
DxvkMemory result;
|
||||
@ -259,7 +259,7 @@ namespace dxvk {
|
||||
VkDeviceSize size,
|
||||
VkDeviceSize align,
|
||||
float priority,
|
||||
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo) {
|
||||
const VkMemoryDedicatedAllocateInfo* dedAllocInfo) {
|
||||
// Prevent unnecessary external host memory fragmentation
|
||||
bool isDeviceLocal = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0;
|
||||
|
||||
@ -305,7 +305,7 @@ namespace dxvk {
|
||||
VkMemoryPropertyFlags flags,
|
||||
VkDeviceSize size,
|
||||
float priority,
|
||||
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo) {
|
||||
const VkMemoryDedicatedAllocateInfo* dedAllocInfo) {
|
||||
bool useMemoryPriority = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
|
||||
&& (m_device->features().extMemoryPriority.memoryPriority);
|
||||
|
||||
|
@ -258,7 +258,7 @@ namespace dxvk {
|
||||
DxvkMemory alloc(
|
||||
const VkMemoryRequirements* req,
|
||||
const VkMemoryDedicatedRequirements& dedAllocReq,
|
||||
const VkMemoryDedicatedAllocateInfoKHR& dedAllocInfo,
|
||||
const VkMemoryDedicatedAllocateInfo& dedAllocInfo,
|
||||
VkMemoryPropertyFlags flags,
|
||||
float priority);
|
||||
|
||||
@ -287,7 +287,7 @@ namespace dxvk {
|
||||
|
||||
DxvkMemory tryAlloc(
|
||||
const VkMemoryRequirements* req,
|
||||
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo,
|
||||
const VkMemoryDedicatedAllocateInfo* dedAllocInfo,
|
||||
VkMemoryPropertyFlags flags,
|
||||
float priority);
|
||||
|
||||
@ -297,14 +297,14 @@ namespace dxvk {
|
||||
VkDeviceSize size,
|
||||
VkDeviceSize align,
|
||||
float priority,
|
||||
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo);
|
||||
const VkMemoryDedicatedAllocateInfo* dedAllocInfo);
|
||||
|
||||
DxvkDeviceMemory tryAllocDeviceMemory(
|
||||
DxvkMemoryType* type,
|
||||
VkMemoryPropertyFlags flags,
|
||||
VkDeviceSize size,
|
||||
float priority,
|
||||
const VkMemoryDedicatedAllocateInfoKHR* dedAllocInfo);
|
||||
const VkMemoryDedicatedAllocateInfo* dedAllocInfo);
|
||||
|
||||
void free(
|
||||
const DxvkMemory& memory);
|
||||
|
@ -167,8 +167,11 @@ namespace dxvk::vk {
|
||||
VULKAN_FN(vkBindBufferMemory);
|
||||
VULKAN_FN(vkBindImageMemory);
|
||||
VULKAN_FN(vkGetBufferMemoryRequirements);
|
||||
VULKAN_FN(vkGetBufferMemoryRequirements2);
|
||||
VULKAN_FN(vkGetImageMemoryRequirements);
|
||||
VULKAN_FN(vkGetImageMemoryRequirements2);
|
||||
VULKAN_FN(vkGetImageSparseMemoryRequirements);
|
||||
VULKAN_FN(vkGetImageSparseMemoryRequirements2);
|
||||
VULKAN_FN(vkQueueBindSparse);
|
||||
VULKAN_FN(vkCreateFence);
|
||||
VULKAN_FN(vkDestroyFence);
|
||||
@ -300,11 +303,6 @@ namespace dxvk::vk {
|
||||
VULKAN_FN(vkQueuePresentKHR);
|
||||
#endif
|
||||
|
||||
#ifdef VK_KHR_get_memory_requirements2
|
||||
VULKAN_FN(vkGetBufferMemoryRequirements2KHR);
|
||||
VULKAN_FN(vkGetImageMemoryRequirements2KHR);
|
||||
#endif
|
||||
|
||||
#ifdef VK_EXT_conditional_rendering
|
||||
VULKAN_FN(vkCmdBeginConditionalRenderingEXT);
|
||||
VULKAN_FN(vkCmdEndConditionalRenderingEXT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user