diff options
author | Marek Olšák <[email protected]> | 2017-06-20 17:20:34 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-22 13:15:27 +0200 |
commit | c1754b69dc0687306d2ec66468109ae032ccbaf9 (patch) | |
tree | 9e911c6bcf85cca50a4c48f4c5c7a176ad0d9956 /src/gallium/drivers/radeon/r600_texture.c | |
parent | c9040dc9e75c81024f88f3f1bab821ad2bc73db3 (diff) |
radeonsi: fix DCC fast clear for luminance and alpha formats
I reproduced this bug on Polaris11 and Raven.
I can't get this bug on Fiji. The reason might be that Fiji doesn't use
2D tiling for the test due to higher 2D tiling alignment requirements.
Fixes piglit: spec@ext_framebuffer_object@fbo-fast-clear
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index d0492d68c9c..f74bbcea25d 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -2411,6 +2411,14 @@ static bool vi_get_fast_clear_parameters(enum pipe_format surface_format, bool main_value = false; bool extra_value = false; int extra_channel; + + /* This is needed to get the correct DCC clear value for luminance formats. + * 1) Get the linear format (because the next step can't handle L8_SRGB). + * 2) Convert luminance to red. (the real hw format for luminance) + */ + surface_format = util_format_linear(surface_format); + surface_format = util_format_luminance_to_red(surface_format); + const struct util_format_description *desc = util_format_description(surface_format); if (desc->block.bits == 128 && @@ -2429,7 +2437,8 @@ static bool vi_get_fast_clear_parameters(enum pipe_format surface_format, if (surface_format == PIPE_FORMAT_R11G11B10_FLOAT || surface_format == PIPE_FORMAT_B5G6R5_UNORM || - surface_format == PIPE_FORMAT_B5G6R5_SRGB) { + surface_format == PIPE_FORMAT_B5G6R5_SRGB || + util_format_is_alpha(surface_format)) { extra_channel = -1; } else if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) { if(r600_translate_colorswap(surface_format, false) <= 1) |