mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 21:08:11 +02:00
turnip: fix drm modifier support with planar formats
We need to advertise the results of tu6_plane_count and handle VK_IMAGE_ASPECT_MEMORY_PLANE_*_BIT. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6374 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16169>
This commit is contained in:
parent
ba9c917149
commit
53d87865ca
3 changed files with 7 additions and 3 deletions
|
|
@ -329,7 +329,7 @@ tu_GetPhysicalDeviceFormatProperties2(
|
|||
if (pFormatProperties->formatProperties.linearTilingFeatures) {
|
||||
vk_outarray_append_typed(VkDrmFormatModifierPropertiesEXT, &out, mod_props) {
|
||||
mod_props->drmFormatModifier = DRM_FORMAT_MOD_LINEAR;
|
||||
mod_props->drmFormatModifierPlaneCount = 1;
|
||||
mod_props->drmFormatModifierPlaneCount = tu6_plane_count(format);
|
||||
mod_props->drmFormatModifierTilingFeatures =
|
||||
pFormatProperties->formatProperties.linearTilingFeatures;
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ tu_GetPhysicalDeviceFormatProperties2(
|
|||
ubwc_possible(format, VK_IMAGE_TYPE_2D, 0, 0, physical_device->info, VK_SAMPLE_COUNT_1_BIT)) {
|
||||
vk_outarray_append_typed(VkDrmFormatModifierPropertiesEXT, &out, mod_props) {
|
||||
mod_props->drmFormatModifier = DRM_FORMAT_MOD_QCOM_COMPRESSED;
|
||||
mod_props->drmFormatModifierPlaneCount = 1;
|
||||
mod_props->drmFormatModifierPlaneCount = tu6_plane_count(format);
|
||||
mod_props->drmFormatModifierTilingFeatures =
|
||||
pFormatProperties->formatProperties.optimalTilingFeatures;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include "tu_cs.h"
|
||||
|
||||
static uint32_t
|
||||
uint32_t
|
||||
tu6_plane_count(VkFormat format)
|
||||
{
|
||||
switch (format) {
|
||||
|
|
@ -71,10 +71,13 @@ tu6_plane_index(VkFormat format, VkImageAspectFlags aspect_mask)
|
|||
{
|
||||
switch (aspect_mask) {
|
||||
default:
|
||||
assert(aspect_mask != VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT);
|
||||
return 0;
|
||||
case VK_IMAGE_ASPECT_PLANE_1_BIT:
|
||||
case VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT:
|
||||
return 1;
|
||||
case VK_IMAGE_ASPECT_PLANE_2_BIT:
|
||||
case VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT:
|
||||
return 2;
|
||||
case VK_IMAGE_ASPECT_STENCIL_BIT:
|
||||
return format == VK_FORMAT_D32_SFLOAT_S8_UINT;
|
||||
|
|
|
|||
|
|
@ -1675,6 +1675,7 @@ tu_get_levelCount(const struct tu_image *image,
|
|||
: range->levelCount;
|
||||
}
|
||||
|
||||
uint32_t tu6_plane_count(VkFormat format);
|
||||
enum pipe_format tu6_plane_format(VkFormat format, uint32_t plane);
|
||||
|
||||
uint32_t tu6_plane_index(VkFormat format, VkImageAspectFlags aspect_mask);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue