From de5070ea8d0845e2d438513726fb0e19d68b895c Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Fri, 9 Aug 2019 11:26:14 +0200 Subject: [PATCH] etnaviv: add gpu_supports_texture_target(..) Currently I am seeing a handful of the following debug message: translate_texture_target:495: Unhandled texture target: 0 PIPE_BUFFER is not handled in translate_texture_target(..) which makes sense as it is used to translate from PIPE_XXX to GPU specific value during etna_create_sampler_view_state(..). To fix this problem introduce gpu_supports_texture_target(..) which just checks if the texture target is supported. Fixes: dfe048058fa ("etnaviv: support 3D and 2D array textures") Signed-off-by: Christian Gmeiner Reviewed-by: Jonathan Marek --- src/gallium/drivers/etnaviv/etnaviv_screen.c | 26 ++++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 455ccba790b..27c990bbccb 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -362,6 +362,23 @@ etna_screen_get_timestamp(struct pipe_screen *pscreen) return os_time_get_nano(); } +static bool +gpu_supports_texture_target(struct etna_screen *screen, + enum pipe_texture_target target) +{ + if (target == PIPE_TEXTURE_CUBE_ARRAY) + return false; + + /* pre-halti has no array/3D */ + if (screen->specs.halti < 0 && + (target == PIPE_TEXTURE_1D_ARRAY || + target == PIPE_TEXTURE_2D_ARRAY || + target == PIPE_TEXTURE_3D)) + return false; + + return true; +} + static bool gpu_supports_texure_format(struct etna_screen *screen, uint32_t fmt, enum pipe_format format) @@ -404,14 +421,7 @@ etna_screen_is_format_supported(struct pipe_screen *pscreen, struct etna_screen *screen = etna_screen(pscreen); unsigned allowed = 0; - if (translate_texture_target(target) == ETNA_NO_MATCH) - return false; - - /* pre-halti has no array/3D */ - if (screen->specs.halti < 0 && - (target == PIPE_TEXTURE_1D_ARRAY || - target == PIPE_TEXTURE_2D_ARRAY || - target == PIPE_TEXTURE_3D)) + if (!gpu_supports_texture_target(screen, target)) return false; if (MAX2(1, sample_count) != MAX2(1, storage_sample_count)) -- 2.30.2