diff options
author | Christian Gmeiner <[email protected]> | 2019-06-14 08:22:07 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2019-11-25 20:12:52 +0100 |
commit | 92d5e3c692483a6c90f5738b6cfabb6d11a7ef78 (patch) | |
tree | 5baaafefb88622068ee2ae32bc3d2e7d50cca97f /src/gallium | |
parent | 396818fd9d2e24ab0e05eed609310dd74fa52d53 (diff) |
etnaviv: add support for extended pe formats
Use the extended format if an such a format was passed.
v1 -> v2:
- set FORMAT_MASK bit when using ext PE format as suggested
by Wladimir J. van der Laan
Signed-off-by: Christian Gmeiner <[email protected]>
Reviewed-by: Jonathan Marek <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_state.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index e913fe7783c..5c8448315f0 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -141,12 +141,18 @@ etna_set_framebuffer_state(struct pipe_context *pctx, struct etna_surface *cbuf = etna_surface(fb->cbufs[0]); struct etna_resource *res = etna_resource(cbuf->base.texture); bool color_supertiled = (res->layout & ETNA_LAYOUT_BIT_SUPER) != 0; + uint32_t fmt = translate_pe_format(cbuf->base.format); assert(res->layout & ETNA_LAYOUT_BIT_TILE); /* Cannot render to linear surfaces */ etna_update_render_resource(pctx, etna_resource(cbuf->prsc)); - cs->PE_COLOR_FORMAT = - VIVS_PE_COLOR_FORMAT_FORMAT(translate_pe_format(cbuf->base.format)) | + if (fmt >= PE_FORMAT_R16F) + cs->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_FORMAT_EXT(fmt) | + VIVS_PE_COLOR_FORMAT_FORMAT_MASK; + else + cs->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_FORMAT(fmt); + + cs->PE_COLOR_FORMAT |= VIVS_PE_COLOR_FORMAT_COMPONENTS__MASK | VIVS_PE_COLOR_FORMAT_OVERWRITE | COND(color_supertiled, VIVS_PE_COLOR_FORMAT_SUPER_TILED) | |