radeonsi: add support for PIPE_FORMAT_{X1,A1}R5G5B5_UNORM
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 3 Oct 2017 13:02:22 +0000 (15:02 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 12 Oct 2017 06:42:55 +0000 (08:42 +0200)
Fixes dEQP-EGL.functional.image.modify.tex_rgb5_a1_tex_subimage_rgba8

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 4bfd5272db0859398775858be02670079ab31478..ae45e1a6b26b85c7c6566033d15e42e117ab2c78 100644 (file)
@@ -1506,6 +1506,8 @@ static uint32_t si_translate_colorformat(enum pipe_format format)
                        }
                } else if (HAS_SIZE(5,5,5,1)) {
                        return V_028C70_COLOR_1_5_5_5;
+               } else if (HAS_SIZE(1,5,5,5)) {
+                       return V_028C70_COLOR_5_5_5_1;
                } else if (HAS_SIZE(10,10,10,2)) {
                        return V_028C70_COLOR_2_10_10_10;
                }
@@ -1764,6 +1766,12 @@ static uint32_t si_translate_texformat(struct pipe_screen *screen,
                            desc->channel[3].size == 1) {
                                return V_008F14_IMG_DATA_FORMAT_1_5_5_5;
                        }
+                       if (desc->channel[0].size == 1 &&
+                           desc->channel[1].size == 5 &&
+                           desc->channel[2].size == 5 &&
+                           desc->channel[3].size == 5) {
+                               return V_008F14_IMG_DATA_FORMAT_5_5_5_1;
+                       }
                        if (desc->channel[0].size == 10 &&
                            desc->channel[1].size == 10 &&
                            desc->channel[2].size == 10 &&