Implemented the vkGetPhysicalDeviceMultisamplePropertiesEXT according to the Vulkan Specification section [36.2. Additional Multisampling Capabilities].
v2: 1- Moved the vkGetPhysicalDeviceMultisamplePropertiesEXT from the anv_sample_locations.c to the anv_device.c (Jason Ekstrand) 2- Simplified the code that sets the grid size (Jason Ekstrand) 3- Instead of filling the whole struct, we only fill the parts we should override (sType, grid size) and we call anv_debug_ignored_stype to any pNext elements (Jason Ekstrand) --- src/intel/vulkan/anv_device.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 52ea058bdd5..0bfff7e0b30 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3557,6 +3557,31 @@ VkResult anv_GetCalibratedTimestampsEXT( return VK_SUCCESS; } +void +anv_GetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, + VkSampleCountFlagBits samples, + VkMultisamplePropertiesEXT + *pMultisampleProperties) +{ + ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice); + + VkExtent2D grid_size; + if (samples & isl_device_get_sample_counts(&physical_device->isl_dev)) { + grid_size.width = 1; + grid_size.height = 1; + } else { + grid_size.width = 0; + grid_size.height = 0; + } + + pMultisampleProperties->sType = + VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT; + pMultisampleProperties->maxSampleLocationGridSize = grid_size; + + vk_foreach_struct(ext, pMultisampleProperties->pNext) + anv_debug_ignored_stype(ext->sType); +} + /* vk_icd.h does not declare this function, so we declare it here to * suppress Wmissing-prototypes. */ -- 2.20.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev