mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 18:00:10 +01:00
panvk: check against texfeat_bit
This is the same as the previous commit, but for PanVK instead.
Fixes: 213e895da0 ("panvk: Allow compressed formats")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31419>
This commit is contained in:
parent
6f1b5f3eea
commit
b8bfbbdf66
1 changed files with 6 additions and 6 deletions
|
|
@ -931,7 +931,8 @@ panvk_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator)
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
format_is_supported(struct panvk_physical_device *physical_device,
|
format_is_supported(struct panvk_physical_device *physical_device,
|
||||||
const struct panfrost_format fmt)
|
const struct panfrost_format fmt,
|
||||||
|
enum pipe_format pfmt)
|
||||||
{
|
{
|
||||||
/* If the format ID is zero, it's not supported. */
|
/* If the format ID is zero, it's not supported. */
|
||||||
if (!fmt.hw)
|
if (!fmt.hw)
|
||||||
|
|
@ -939,14 +940,13 @@ format_is_supported(struct panvk_physical_device *physical_device,
|
||||||
|
|
||||||
/* Compressed formats (ID < 32) are optional. We need to check against
|
/* Compressed formats (ID < 32) are optional. We need to check against
|
||||||
* the supported formats reported by the GPU. */
|
* the supported formats reported by the GPU. */
|
||||||
unsigned idx = MALI_EXTRACT_INDEX(fmt.hw);
|
if (util_format_is_compressed(pfmt)) {
|
||||||
if (MALI_EXTRACT_TYPE(idx) == MALI_FORMAT_COMPRESSED) {
|
|
||||||
uint32_t supported_compr_fmts =
|
uint32_t supported_compr_fmts =
|
||||||
panfrost_query_compressed_formats(&physical_device->kmod.props);
|
panfrost_query_compressed_formats(&physical_device->kmod.props);
|
||||||
|
|
||||||
assert(idx < 32);
|
assert(fmt.texfeat_bit < 32);
|
||||||
|
|
||||||
if (!(BITFIELD_BIT(idx) & supported_compr_fmts))
|
if (!(BITFIELD_BIT(fmt.texfeat_bit) & supported_compr_fmts))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -977,7 +977,7 @@ get_format_properties(struct panvk_physical_device *physical_device,
|
||||||
|
|
||||||
const struct panfrost_format fmt = physical_device->formats.all[pfmt];
|
const struct panfrost_format fmt = physical_device->formats.all[pfmt];
|
||||||
|
|
||||||
if (!format_is_supported(physical_device, fmt))
|
if (!format_is_supported(physical_device, fmt, pfmt))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
/* 3byte formats are not supported by the buffer <-> image copy helpers. */
|
/* 3byte formats are not supported by the buffer <-> image copy helpers. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue