ac,radeonsi: report SCALED formats as unsupported by samplers and color buffers

This was never exercised and it doesn't work.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
This commit is contained in:
Marek Olšák
2022-04-24 21:20:33 -04:00
parent 65c7b5ec20
commit 88f22f188e
2 changed files with 19 additions and 0 deletions
+2
View File
@@ -188,6 +188,7 @@ class Gfx10FormatMapping(object):
num_format = 'UNORM'
else:
num_format = 'USCALED'
extra_flags.append('buffers_only')
elif chan_type == SIGNED:
if chan_pure:
num_format = 'SINT'
@@ -199,6 +200,7 @@ class Gfx10FormatMapping(object):
num_format = 'SNORM'
else:
num_format = 'SSCALED'
extra_flags.append('buffers_only')
elif chan_type == FLOAT:
num_format = 'FLOAT'
+17
View File
@@ -1598,6 +1598,16 @@ uint32_t si_translate_colorformat(enum chip_class chip_class,
if (desc->is_mixed && desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS)
return V_028C70_COLOR_INVALID;
int first_non_void = util_format_get_first_non_void_channel(format);
/* Reject SCALED formats because we don't implement them for CB. */
if (first_non_void >= 0 && first_non_void <= 3 &&
(desc->channel[first_non_void].type == UTIL_FORMAT_TYPE_UNSIGNED ||
desc->channel[first_non_void].type == UTIL_FORMAT_TYPE_SIGNED) &&
!desc->channel[first_non_void].normalized &&
!desc->channel[first_non_void].pure_integer)
return V_028C70_COLOR_INVALID;
switch (desc->nr_channels) {
case 1:
switch (desc->channel[0].size) {
@@ -1925,6 +1935,13 @@ static uint32_t si_translate_texformat(struct pipe_screen *screen, enum pipe_for
if (first_non_void < 0 || first_non_void > 3)
goto out_unknown;
/* Reject SCALED formats because we don't implement them for CB and do the same for texturing. */
if ((desc->channel[first_non_void].type == UTIL_FORMAT_TYPE_UNSIGNED ||
desc->channel[first_non_void].type == UTIL_FORMAT_TYPE_SIGNED) &&
!desc->channel[first_non_void].normalized &&
!desc->channel[first_non_void].pure_integer)
goto out_unknown;
/* uniform formats */
switch (desc->channel[first_non_void].size) {
case 4: