diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2023-03-15 15:19:42 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-03-17 21:30:48 +0000 |
commit | b6878d456f0177dcd2d80ec59a20e16ac547e4d2 (patch) | |
tree | 45082815ce43b4e7042ccc54d9405e5a7daa728b /src/gallium/auxiliary/util/u_screen.c | |
parent | f534c36ca5e1fb4aeef7be84a91a738d771b0bd4 (diff) |
st/mesa, iris: Add optional CPU-based ASTC void extent denorm flushing
Intel Gen9 GPUs have hardware ASTC support, but have a bug where they
don't handle denormalized values in void extent blocks correctly. This
isn't that hard to work around - on upload, we can detect such blocks,
and flush any denorms to zero. Because we're altering the data behind
the application's back, and applications can theoretically ask to
download the original unaltered image data, we unfortunately need to
maintain shadow copies of the data.
To make sure that we don't accidentally skip the void-extent flushing
via any fast-upload paths, and support download correctly, we plug this
into the st/mesa compressed texture format fallback paths, which store
a CPU copy of the original image data, and upload altered data.
This is unfortunately common code for what's likely to be a single
driver's issue (on a single generation), but it beats replicating an
entire framework we already have inside the driver.
Fixes dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.*
using iris on Intel Gen9 GPUs.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4167
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21943>
Diffstat (limited to 'src/gallium/auxiliary/util/u_screen.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_screen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index c0ed2f00ac9..22c20e0c638 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -537,6 +537,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, case PIPE_CAP_VALIDATE_ALL_DIRTY_STATES: case PIPE_CAP_NULL_TEXTURES: + case PIPE_CAP_ASTC_VOID_EXTENTS_NEED_DENORM_FLUSH: return 0; default: |