summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2019-05-26 21:06:51 +0200
committerChristian Gmeiner <[email protected]>2019-05-27 20:55:11 +0200
commit37af75f88c8c1daf67f3d4747613040a6dd9caf8 (patch)
treef588180145d1c98ad0cc7efc54ad819304f20f53 /src
parentaf0de6b91c0b2e26e57bd235cbdc7296992502d9 (diff)
etnaviv: rs: choose clear format based on block size
Fixes following piglit and does not introduce any regressions. spec@ext_packed_depth_stencil@fbo-depth-gl_depth24_stencil8-blit Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_rs.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c
index a9d3872ad41..f51a81e5177 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_rs.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c
@@ -254,7 +254,19 @@ etna_rs_gen_clear_surface(struct etna_context *ctx, struct etna_surface *surf,
uint32_t clear_value)
{
struct etna_resource *dst = etna_resource(surf->base.texture);
- uint32_t format = translate_rs_format(surf->base.format);
+ uint32_t format;
+
+ switch (util_format_get_blocksizebits(surf->base.format)) {
+ case 16:
+ format = RS_FORMAT_A4R4G4B4;
+ break;
+ case 32:
+ format = RS_FORMAT_A8R8G8B8;
+ break;
+ default:
+ format = ETNA_NO_MATCH;
+ break;
+ }
if (format == ETNA_NO_MATCH) {
BUG("etna_rs_gen_clear_surface: Unhandled clear fmt %s", util_format_name(surf->base.format));