mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
anv: Use the common wrapper for GetPhysicalDeviceFormatProperties
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13198>
This commit is contained in:
parent
1d4d71057b
commit
35315c68a5
1 changed files with 6 additions and 14 deletions
|
|
@ -866,16 +866,18 @@ get_drm_format_modifier_properties_list(const struct anv_physical_device *physic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void anv_GetPhysicalDeviceFormatProperties(
|
void anv_GetPhysicalDeviceFormatProperties2(
|
||||||
VkPhysicalDevice physicalDevice,
|
VkPhysicalDevice physicalDevice,
|
||||||
VkFormat vk_format,
|
VkFormat vk_format,
|
||||||
VkFormatProperties* pFormatProperties)
|
VkFormatProperties2* pFormatProperties)
|
||||||
{
|
{
|
||||||
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
|
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
|
||||||
const struct intel_device_info *devinfo = &physical_device->info;
|
const struct intel_device_info *devinfo = &physical_device->info;
|
||||||
const struct anv_format *anv_format = anv_get_format(vk_format);
|
const struct anv_format *anv_format = anv_get_format(vk_format);
|
||||||
|
|
||||||
*pFormatProperties = (VkFormatProperties) {
|
assert(pFormatProperties->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
|
||||||
|
|
||||||
|
pFormatProperties->formatProperties = (VkFormatProperties) {
|
||||||
.linearTilingFeatures =
|
.linearTilingFeatures =
|
||||||
anv_get_image_format_features(devinfo, vk_format, anv_format,
|
anv_get_image_format_features(devinfo, vk_format, anv_format,
|
||||||
VK_IMAGE_TILING_LINEAR, NULL),
|
VK_IMAGE_TILING_LINEAR, NULL),
|
||||||
|
|
@ -885,22 +887,12 @@ void anv_GetPhysicalDeviceFormatProperties(
|
||||||
.bufferFeatures =
|
.bufferFeatures =
|
||||||
get_buffer_format_features(devinfo, vk_format, anv_format),
|
get_buffer_format_features(devinfo, vk_format, anv_format),
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
void anv_GetPhysicalDeviceFormatProperties2(
|
|
||||||
VkPhysicalDevice physicalDevice,
|
|
||||||
VkFormat format,
|
|
||||||
VkFormatProperties2* pFormatProperties)
|
|
||||||
{
|
|
||||||
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
|
|
||||||
anv_GetPhysicalDeviceFormatProperties(physicalDevice, format,
|
|
||||||
&pFormatProperties->formatProperties);
|
|
||||||
|
|
||||||
vk_foreach_struct(ext, pFormatProperties->pNext) {
|
vk_foreach_struct(ext, pFormatProperties->pNext) {
|
||||||
/* Use unsigned since some cases are not in the VkStructureType enum. */
|
/* Use unsigned since some cases are not in the VkStructureType enum. */
|
||||||
switch ((unsigned)ext->sType) {
|
switch ((unsigned)ext->sType) {
|
||||||
case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT:
|
case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT:
|
||||||
get_drm_format_modifier_properties_list(physical_device, format,
|
get_drm_format_modifier_properties_list(physical_device, vk_format,
|
||||||
(void *)ext);
|
(void *)ext);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue