aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-11-14 15:20:06 +0100
committerMarek Olšák <[email protected]>2019-07-03 15:51:12 -0400
commit3163db3ba4e9991254bc5c5a590186138b879b93 (patch)
tree84e7dc1d6ce18c32806a16330da623364d7e5729 /src/gallium/drivers/radeonsi/si_state.c
parent0ffa2292b36346ed4255cb93a1e9544101cb616e (diff)
radeonsi/gfx10: implement si_is_format_supported
Acked-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c17
1 files changed, 17 insertions, 0 deletions
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)