summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv/etnaviv_context.c
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2017-03-21 20:00:31 +0100
committerChristian Gmeiner <[email protected]>2017-04-05 19:58:22 +0200
commit7f62ffb68ad1002b6ce7727ce7202de792d53653 (patch)
treef7d70f5199ca3dfcf73974b12a2925918cc6b9fe /src/gallium/drivers/etnaviv/etnaviv_context.c
parent8d9a31ef9726192ff8e97f36bc05bb15c037ed27 (diff)
etnaviv: add support for rb swap
If we render to rb swapped format we will create a shader variant doing the involved swizzing in the pixel shader. Signed-off-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_context.c')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index d6734401029..555aa127651 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -184,6 +184,13 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
}
struct etna_shader_key key = {};
+ struct etna_surface *cbuf = etna_surface(pfb->cbufs[0]);
+
+ if (cbuf) {
+ struct etna_resource *res = etna_resource(cbuf->base.texture);
+
+ key.frag_rb_swap = !!translate_rs_format_rb_swap(res->base.format);
+ }
if (!etna_get_vs(ctx, key) || !etna_get_fs(ctx, key)) {
BUG("compiled shaders are not okay");