From 3163db3ba4e9991254bc5c5a590186138b879b93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 14 Nov 2017 15:20:06 +0100 Subject: [PATCH] radeonsi/gfx10: implement si_is_format_supported Acked-by: Bas Nieuwenhuizen --- src/gallium/drivers/radeonsi/si_state.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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) -- 2.30.2