diff options
author | Jonathan Marek <[email protected]> | 2019-12-08 11:52:32 -0500 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-12-13 09:10:29 -0500 |
commit | 64c7cdcae51ecd315f27f15382c31350c97d632b (patch) | |
tree | c729af77b0b7a97761b457002b4d00d87849f58c /src/gallium/drivers/etnaviv/etnaviv_screen.c | |
parent | d30499a3c8c17cf3dd24d5773a69af1ed4e2493e (diff) |
etnaviv: add missing formats
Add missing texture/render formats supported by hardware.
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_screen.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_screen.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index cec94cc333d..75d3e1e6877 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -403,6 +403,13 @@ gpu_supports_texture_format(struct etna_screen *screen, uint32_t fmt, supported = screen->specs.tex_astc; } + if (util_format_is_snorm(format)) + supported = VIV_FEATURE(screen, chipMinorFeatures2, HALTI1); + + if (util_format_is_pure_integer(format) || util_format_is_float(format)) + supported = VIV_FEATURE(screen, chipMinorFeatures4, HALTI2); + + if (!supported) return false; @@ -416,7 +423,9 @@ static bool gpu_supports_render_format(struct etna_screen *screen, enum pipe_format format, unsigned sample_count) { - if (translate_pe_format(format) == ETNA_NO_MATCH) + const uint32_t fmt = translate_pe_format(format); + + if (fmt == ETNA_NO_MATCH) return false; /* Validate MSAA; number of samples must be allowed, and render target @@ -428,9 +437,26 @@ gpu_supports_render_format(struct etna_screen *screen, enum pipe_format format, return false; } + if (format == PIPE_FORMAT_R8_UNORM) + return VIV_FEATURE(screen, chipMinorFeatures5, HALTI5); + + /* figure out 8bpp RS clear to enable these formats */ + if (format == PIPE_FORMAT_R8_SINT || format == PIPE_FORMAT_R8_UINT) + return VIV_FEATURE(screen, chipMinorFeatures5, HALTI5); + if (util_format_is_srgb(format)) return VIV_FEATURE(screen, chipMinorFeatures5, HALTI3); + if (util_format_is_pure_integer(format) || util_format_is_float(format)) + return VIV_FEATURE(screen, chipMinorFeatures4, HALTI2); + + if (format == PIPE_FORMAT_R8G8_UNORM) + return VIV_FEATURE(screen, chipMinorFeatures4, HALTI2); + + /* any other extended format is HALTI0 (only R10G10B10A2?) */ + if (fmt >= PE_FORMAT_R16F) + return VIV_FEATURE(screen, chipMinorFeatures1, HALTI0); + return true; } |