diff --git a/src/amd/common/gfx10_format_table.py b/src/amd/common/gfx10_format_table.py index 9701499f8f1..9737c23280e 100644 --- a/src/amd/common/gfx10_format_table.py +++ b/src/amd/common/gfx10_format_table.py @@ -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' diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index c805e8819d7..5cc84f6edc1 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -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: