zink: allow X32 -> A32

The 32-bit per component pipe_formats are a bit different than the 8 and
16 bit formats, in that there's no UNORM or SNORM variants of them. So
let's just omit those variants.

While we're at it, update a comment that was already out-of-date anyway.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
This commit is contained in:
Erik Faye-Lund 2022-08-11 12:32:16 +02:00 committed by Marge Bot
parent e4ff42684b
commit 1961022e1a
2 changed files with 8 additions and 2 deletions

View file

@ -315,7 +315,8 @@ zink_format_is_voidable_rgba_variant(enum pipe_format format)
if(desc->block.width != 1 ||
desc->block.height != 1 ||
(desc->block.bits != 32 && desc->block.bits != 64))
(desc->block.bits != 32 && desc->block.bits != 64 &&
desc->block.bits != 128))
return false;
if (desc->nr_channels != 4)

View file

@ -1490,7 +1490,7 @@ zink_is_depth_format_supported(struct zink_screen *screen, VkFormat format)
static enum pipe_format
emulate_x8(enum pipe_format format)
{
/* convert missing X8 variants to A8 */
/* convert missing Xn variants to An */
switch (format) {
case PIPE_FORMAT_B8G8R8X8_UNORM:
return PIPE_FORMAT_B8G8R8A8_UNORM;
@ -1516,6 +1516,11 @@ emulate_x8(enum pipe_format format)
case PIPE_FORMAT_R16G16B16X16_UNORM:
return PIPE_FORMAT_R16G16B16A16_UNORM;
case PIPE_FORMAT_R32G32B32X32_FLOAT:
return PIPE_FORMAT_R32G32B32A32_FLOAT;
case PIPE_FORMAT_R32G32B32X32_SINT:
return PIPE_FORMAT_R32G32B32A32_SINT;
default:
return format;
}