Implement memory oversubscription vulkan extensions

This commit is contained in:
baldurk
2022-11-02 16:49:48 +00:00
parent 30453eb8ce
commit 86807180d1
6 changed files with 73 additions and 10 deletions
+2 -2
View File
@@ -12,6 +12,7 @@ Maintainers can update this file by updating vk.xml in this folder and running `
* `VK_AMD_gcn_shader`
* `VK_AMD_gpu_shader_half_float`
* `VK_AMD_gpu_shader_int16`
* `VK_AMD_memory_overallocation_behavior`
* `VK_AMD_mixed_attachment_samples`
* `VK_AMD_negative_viewport_height`
* `VK_AMD_shader_ballot`
@@ -67,6 +68,7 @@ Maintainers can update this file by updating vk.xml in this folder and running `
* `VK_EXT_metal_surface`
* `VK_EXT_multisampled_render_to_single_sampled`
* `VK_EXT_mutable_descriptor_type`
* `VK_EXT_pageable_device_local_memory`
* `VK_EXT_pci_bus_info`
* `VK_EXT_pipeline_creation_cache_control`
* `VK_EXT_pipeline_creation_feedback`
@@ -256,7 +258,6 @@ Ray tracing extensions are now standard and will likely be supported at some poi
* `VK_EXT_multi_draw`
* `VK_EXT_non_seamless_cube_map`
* `VK_EXT_opacity_micromap`
* `VK_EXT_pageable_device_local_memory`
* `VK_EXT_physical_device_drm`
* `VK_EXT_pipeline_protected_access`
* `VK_EXT_pipeline_properties`
@@ -274,7 +275,6 @@ Ray tracing extensions are now standard and will likely be supported at some poi
### AMD
* `VK_AMD_memory_overallocation_behavior`
* `VK_AMD_pipeline_compiler_control`
* `VK_AMD_rasterization_order`
* `VK_AMD_shader_info`
+5
View File
@@ -1045,6 +1045,7 @@ DECLARE_REFLECTION_STRUCT(VkDeviceGroupSubmitInfo);
DECLARE_REFLECTION_STRUCT(VkDeviceGroupSwapchainCreateInfoKHR);
DECLARE_REFLECTION_STRUCT(VkDeviceImageMemoryRequirements);
DECLARE_REFLECTION_STRUCT(VkDeviceMemoryOpaqueCaptureAddressInfo);
DECLARE_REFLECTION_STRUCT(VkDeviceMemoryOverallocationCreateInfoAMD);
DECLARE_REFLECTION_STRUCT(VkDevicePrivateDataCreateInfo);
DECLARE_REFLECTION_STRUCT(VkDeviceQueueCreateInfo);
DECLARE_REFLECTION_STRUCT(VkDeviceQueueGlobalPriorityCreateInfoKHR);
@@ -1190,6 +1191,7 @@ DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMultisampledRenderToSingleSampledFeatu
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMultiviewFeatures);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMultiviewProperties);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevicePCIBusInfoPropertiesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevicePerformanceQueryFeaturesKHR);
DECLARE_REFLECTION_STRUCT(VkPhysicalDevicePerformanceQueryPropertiesKHR);
@@ -1434,6 +1436,7 @@ DECLARE_DESERIALISE_TYPE(VkDeviceGroupSubmitInfo);
DECLARE_DESERIALISE_TYPE(VkDeviceGroupSwapchainCreateInfoKHR);
DECLARE_DESERIALISE_TYPE(VkDeviceImageMemoryRequirements);
DECLARE_DESERIALISE_TYPE(VkDeviceMemoryOpaqueCaptureAddressInfo);
DECLARE_DESERIALISE_TYPE(VkDeviceMemoryOverallocationCreateInfoAMD);
DECLARE_DESERIALISE_TYPE(VkDevicePrivateDataCreateInfo);
DECLARE_DESERIALISE_TYPE(VkDeviceQueueCreateInfo);
DECLARE_DESERIALISE_TYPE(VkDeviceQueueGlobalPriorityCreateInfoKHR);
@@ -1575,6 +1578,7 @@ DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMultisampledRenderToSingleSampledFeatur
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMultiviewFeatures);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMultiviewProperties);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevicePCIBusInfoPropertiesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevicePerformanceQueryFeaturesKHR);
DECLARE_DESERIALISE_TYPE(VkPhysicalDevicePerformanceQueryPropertiesKHR);
@@ -1991,6 +1995,7 @@ DECLARE_REFLECTION_ENUM(VkLogicOp);
DECLARE_REFLECTION_ENUM(VkMemoryAllocateFlagBits);
DECLARE_REFLECTION_ENUM(VkMemoryHeapFlagBits);
DECLARE_REFLECTION_ENUM(VkMemoryPropertyFlagBits);
DECLARE_REFLECTION_ENUM(VkMemoryOverallocationBehaviorAMD);
DECLARE_REFLECTION_ENUM(VkObjectType);
DECLARE_REFLECTION_ENUM(VkPerformanceCounterDescriptionFlagBitsKHR);
DECLARE_REFLECTION_ENUM(VkPerformanceCounterScopeKHR);
+4 -2
View File
@@ -145,6 +145,8 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
COPY_STRUCT(VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, VkDeviceGroupSubmitInfo); \
COPY_STRUCT(VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR, \
VkDeviceGroupSwapchainCreateInfoKHR); \
COPY_STRUCT(VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD, \
VkDeviceMemoryOverallocationCreateInfoAMD); \
COPY_STRUCT(VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO, VkDevicePrivateDataCreateInfo); \
COPY_STRUCT(VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, VkDeviceQueueCreateInfo); \
COPY_STRUCT(VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR, \
@@ -334,6 +336,8 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
VkPhysicalDeviceLineRasterizationFeaturesEXT) \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT, \
VkPhysicalDeviceLineRasterizationPropertiesEXT) \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT, \
VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT); \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT, \
VkPhysicalDevicePCIBusInfoPropertiesEXT); \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR, \
@@ -767,7 +771,6 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: \
case VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT: \
case VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT: \
case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: \
case VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT: \
case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: \
case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: \
@@ -878,7 +881,6 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT: \
+42 -6
View File
@@ -542,6 +542,10 @@ SERIALISE_VK_HANDLES();
PNEXT_STRUCT(VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD, \
VkDisplayNativeHdrSurfaceCapabilitiesAMD) \
\
/* VK_AMD_memory_overallocation_behavior */ \
PNEXT_STRUCT(VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD, \
VkDeviceMemoryOverallocationCreateInfoAMD) \
\
/* VK_AMD_shader_core_properties */ \
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD, \
VkPhysicalDeviceShaderCorePropertiesAMD) \
@@ -745,6 +749,10 @@ SERIALISE_VK_HANDLES();
PNEXT_STRUCT(VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT, \
VkMutableDescriptorTypeCreateInfoEXT) \
\
/* VK_EXT_pageable_device_local_memory */ \
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT, \
VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT) \
\
/* VK_EXT_pci_bus_info */ \
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT, \
VkPhysicalDevicePCIBusInfoPropertiesEXT) \
@@ -1340,9 +1348,6 @@ SERIALISE_VK_HANDLES();
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR) \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX) \
\
/* VK_AMD_memory_overallocation_behavior */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD) \
\
/* VK_AMD_pipeline_compiler_control */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD) \
\
@@ -1460,9 +1465,6 @@ SERIALISE_VK_HANDLES();
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT) \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT) \
\
/* VK_EXT_pageable_device_local_memory */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT) \
\
/* VK_EXT_physical_device_drm */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT) \
\
@@ -9275,6 +9277,38 @@ void Deserialise(const VkMemoryPriorityAllocateInfoEXT &el)
DeserialiseNext(el.pNext);
}
template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, VkDeviceMemoryOverallocationCreateInfoAMD &el)
{
RDCASSERT(ser.IsReading() ||
el.sType == VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD);
SerialiseNext(ser, el.sType, el.pNext);
SERIALISE_MEMBER(overallocationBehavior);
}
template <>
void Deserialise(const VkDeviceMemoryOverallocationCreateInfoAMD &el)
{
DeserialiseNext(el.pNext);
}
template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT &el)
{
RDCASSERT(ser.IsReading() ||
el.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT);
SerialiseNext(ser, el.sType, el.pNext);
SERIALISE_MEMBER(pageableDeviceLocalMemory);
}
template <>
void Deserialise(const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT &el)
{
DeserialiseNext(el.pNext);
}
template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT &el)
{
@@ -10805,6 +10839,7 @@ INSTANTIATE_SERIALISE_TYPE(VkDeviceGroupSubmitInfo);
INSTANTIATE_SERIALISE_TYPE(VkDeviceGroupSwapchainCreateInfoKHR);
INSTANTIATE_SERIALISE_TYPE(VkDeviceImageMemoryRequirements);
INSTANTIATE_SERIALISE_TYPE(VkDeviceMemoryOpaqueCaptureAddressInfo);
INSTANTIATE_SERIALISE_TYPE(VkDeviceMemoryOverallocationCreateInfoAMD);
INSTANTIATE_SERIALISE_TYPE(VkDevicePrivateDataCreateInfo);
INSTANTIATE_SERIALISE_TYPE(VkDeviceQueueCreateInfo);
INSTANTIATE_SERIALISE_TYPE(VkDeviceQueueGlobalPriorityCreateInfoKHR);
@@ -10948,6 +10983,7 @@ INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMultisampledRenderToSingleSampledFeat
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMultiviewFeatures);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMultiviewProperties);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDevicePCIBusInfoPropertiesEXT);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDevicePerformanceQueryFeaturesKHR);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDevicePerformanceQueryPropertiesKHR);
+12
View File
@@ -3484,6 +3484,18 @@ rdcstr DoStringise(const VkRenderingFlagBits &el)
END_BITFIELD_STRINGISE();
}
template <>
rdcstr DoStringise(const VkMemoryOverallocationBehaviorAMD &el)
{
BEGIN_BITFIELD_STRINGISE(VkMemoryOverallocationBehaviorAMD);
{
STRINGISE_BITFIELD_BIT(VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD);
STRINGISE_BITFIELD_BIT(VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD);
STRINGISE_BITFIELD_BIT(VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD);
}
END_BITFIELD_STRINGISE();
}
template <>
rdcstr DoStringise(const VkExtent3D &el)
{
@@ -2997,6 +2997,14 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
CHECK_PHYS_EXT_FEATURE(mutableDescriptorType);
}
END_PHYS_EXT_CHECK();
BEGIN_PHYS_EXT_CHECK(
VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT);
{
CHECK_PHYS_EXT_FEATURE(pageableDeviceLocalMemory);
}
END_PHYS_EXT_CHECK();
}
if(availFeatures.depthClamp)