From: Nicolai Hähnle Date: Tue, 14 Nov 2017 14:20:06 +0000 (+0100) Subject: radeonsi/gfx10: implement si_is_format_supported X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3163db3ba4e9991254bc5c5a590186138b879b93;p=mesa.git radeonsi/gfx10: implement si_is_format_supported Acked-by: Bas Nieuwenhuizen --- diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index ca1671e021c..a82f8dc6a89 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2008,6 +2008,15 @@ static unsigned si_tex_dim(struct si_screen *sscreen, struct si_texture *tex, static bool si_is_sampler_format_supported(struct pipe_screen *screen, enum pipe_format format) { + struct si_screen *sscreen = (struct si_screen *)screen; + + if (sscreen->info.chip_class >= GFX10) { + const struct gfx10_format *fmt = &gfx10_format_table[format]; + if (!fmt->img_format || fmt->buffers_only) + return false; + return true; + } + const struct util_format_description *desc = util_format_description(format); if (!desc) return false; @@ -2136,6 +2145,7 @@ static unsigned si_is_vertex_format_supported(struct pipe_screen *screen, enum pipe_format format, unsigned usage) { + struct si_screen *sscreen = (struct si_screen *)screen; const struct util_format_description *desc; int first_non_void; unsigned data_format; @@ -2165,6 +2175,13 @@ static unsigned si_is_vertex_format_supported(struct pipe_screen *screen, } } + if (sscreen->info.chip_class >= GFX10) { + const struct gfx10_format *fmt = &gfx10_format_table[format]; + if (!fmt->img_format || fmt->img_format >= 128) + return 0; + return usage; + } + first_non_void = util_format_get_first_non_void_channel(format); data_format = si_translate_buffer_dataformat(screen, desc, first_non_void); if (data_format == V_008F0C_BUF_DATA_FORMAT_INVALID)