freedreno/a6xx: Set tfetch correctly for compressed formats
authorKristian H. Kristensen <hoegsberg@google.com>
Tue, 5 May 2020 07:18:35 +0000 (00:18 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Thu, 7 May 2020 00:11:34 +0000 (17:11 -0700)
The fetchsize is just the blocksize for compressed formats, which gets
rid of the ASTC special cases add handles ETC1/2 as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4868>

src/gallium/drivers/freedreno/a6xx/fd6_format.c

index 1780fbcc9415d0b7e887387bcdb9bfdc91e5bd7b..fbb1fb960a8a225ff20d8f0c47a598bb12bcde67 100644 (file)
@@ -378,10 +378,7 @@ fd6_pipe2fetchsize(enum pipe_format format)
        if (format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT)
                format = PIPE_FORMAT_Z32_FLOAT;
 
-       if (util_format_description(format)->layout == UTIL_FORMAT_LAYOUT_ASTC)
-               return TFETCH6_16_BYTE;
-
-       switch (util_format_get_blocksizebits(format) / util_format_get_blockwidth(format)) {
+       switch (util_format_get_blocksizebits(format)) {
        case 8:   return TFETCH6_1_BYTE;
        case 16:  return TFETCH6_2_BYTE;
        case 32:  return TFETCH6_4_BYTE;