Skip to content

Commit

Permalink
Support VK_EXT_physical_device_drm
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Oct 28, 2024
1 parent 21db7b5 commit 9ff742e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion renderdoc/driver/vulkan/extension_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Maintainers can update this file by updating vk.xml in this folder and running `
* `VK_EXT_non_seamless_cube_map`
* `VK_EXT_pageable_device_local_memory`
* `VK_EXT_pci_bus_info`
* `VK_EXT_physical_device_drm`
* `VK_EXT_pipeline_creation_cache_control`
* `VK_EXT_pipeline_creation_feedback`
* `VK_EXT_post_depth_coverage`
Expand Down Expand Up @@ -292,7 +293,6 @@ Ray tracing extensions are now standard and will likely be supported at some poi
* `VK_EXT_metal_objects`
* `VK_EXT_multi_draw`
* `VK_EXT_opacity_micromap`
* `VK_EXT_physical_device_drm`
* `VK_EXT_pipeline_library_group_handles`
* `VK_EXT_pipeline_properties`
* `VK_EXT_pipeline_protected_access`
Expand Down
2 changes: 2 additions & 0 deletions renderdoc/driver/vulkan/vk_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@ DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceDescriptorIndexingFeatures)
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceDescriptorIndexingProperties)
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceDiscardRectanglePropertiesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceDriverProperties);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceDrmPropertiesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceDynamicRenderingFeatures);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceExtendedDynamicState2FeaturesEXT);
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceExtendedDynamicState3FeaturesEXT);
Expand Down Expand Up @@ -1774,6 +1775,7 @@ DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceDescriptorIndexingFeatures)
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceDescriptorIndexingProperties)
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceDiscardRectanglePropertiesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceDriverProperties);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceDrmPropertiesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceDynamicRenderingFeatures);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceExtendedDynamicState2FeaturesEXT);
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceExtendedDynamicState3FeaturesEXT);
Expand Down
4 changes: 4 additions & 0 deletions renderdoc/driver/vulkan/vk_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,10 @@ static const VkExtensionProperties supportedExtensions[] = {
VK_EXT_PCI_BUS_INFO_EXTENSION_NAME,
VK_EXT_PCI_BUS_INFO_SPEC_VERSION,
},
{
VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME,
VK_EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION,
},
{
VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME,
VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION,
Expand Down
3 changes: 2 additions & 1 deletion renderdoc/driver/vulkan/vk_next_chains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
VkPhysicalDeviceDiscardRectanglePropertiesEXT); \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, \
VkPhysicalDeviceDriverProperties); \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT, \
VkPhysicalDeviceDrmPropertiesEXT); \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, \
VkPhysicalDeviceDynamicRenderingFeatures) \
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT, \
Expand Down Expand Up @@ -997,7 +999,6 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: \
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: \
Expand Down
29 changes: 26 additions & 3 deletions renderdoc/driver/vulkan/vk_serialise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,10 @@ SERIALISE_VK_HANDLES();
PNEXT_STRUCT(VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM, \
VkSubpassFragmentDensityMapOffsetEndInfoQCOM) \
\
/* VK_EXT_physical_device_drm */ \
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT, \
VkPhysicalDeviceDrmPropertiesEXT) \
\
/* Surface creation structs. These would pull in dependencies on OS-specific includes. */ \
/* So treat them as unsupported. */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR) \
Expand Down Expand Up @@ -1648,9 +1652,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_physical_device_drm */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT) \
\
/* VK_EXT_pipeline_library_group_handles */ \
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT) \
\
Expand Down Expand Up @@ -6800,6 +6801,27 @@ void Deserialise(const VkSubpassFragmentDensityMapOffsetEndInfoQCOM &el)
delete[] el.pFragmentDensityOffsets;
}

template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, VkPhysicalDeviceDrmPropertiesEXT &el)
{
RDCASSERT(ser.IsReading() ||
el.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT);
SerialiseNext(ser, el.sType, el.pNext);

SERIALISE_MEMBER(hasPrimary);
SERIALISE_MEMBER(hasRender);
SERIALISE_MEMBER(primaryMajor);
SERIALISE_MEMBER(primaryMinor);
SERIALISE_MEMBER(renderMajor);
SERIALISE_MEMBER(renderMinor);
}

template <>
void Deserialise(const VkPhysicalDeviceDrmPropertiesEXT &el)
{
DeserialiseNext(el.pNext);
}

template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT &el)
{
Expand Down Expand Up @@ -12584,6 +12606,7 @@ INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceDescriptorIndexingFeatures)
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceDescriptorIndexingProperties)
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceDiscardRectanglePropertiesEXT);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceDriverProperties);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceDrmPropertiesEXT);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceDynamicRenderingFeatures);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceExtendedDynamicState2FeaturesEXT);
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceExtendedDynamicState3FeaturesEXT);
Expand Down

0 comments on commit 9ff742e

Please sign in to comment.