diff options
author | Iago Toral Quiroga <[email protected]> | 2019-07-03 09:38:39 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-07-12 09:16:38 +0200 |
commit | e540775f0cb189ca81565815968323edc935cc74 (patch) | |
tree | eaa01f6468102fa1af9711601d75c9dd7f7899b3 /src/broadcom/compiler/vir.c | |
parent | 7c1d70891150c9960b1bb2464b53a95f4645037c (diff) |
v3d: add lowering for OpenGL logic operations
This implements support for OpenGL logic operations by emitting code to read
from the TLB if needed and blending the fragment output accordingly. It is
similar to VC4's blend lowering pass, but exclusive to logic operations, since
blending is otherwise supported in hardware.
The pass doesn't handle MSAA targets yet.
Fixes the following piglit tests:
spec/!opengl 1.0/gl-1.0-logicop/*
spec/!opengl 1.1/gl-1.1-xor
spec/!opengl 1.1/gl-1.1-xor-copypixels
It also fixes text cursor rendering in Libreoffice with the GTK+2 theme, which
is rendered via glamor using the XOR logic operation.
v2: fix checks for allowed variable location and maximum render target (Eric)
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/broadcom/compiler/vir.c')
-rw-r--r-- | src/broadcom/compiler/vir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index 4f1ee605214..c18318a6295 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -799,6 +799,8 @@ v3d_nir_lower_fs_early(struct v3d_compile *c) if (c->fs_key->int_color_rb || c->fs_key->uint_color_rb) v3d_fixup_fs_output_types(c); + NIR_PASS_V(c->s, v3d_nir_lower_logic_ops, c); + /* If the shader has no non-TLB side effects, we can promote it to * enabling early_fragment_tests even if the user didn't. */ |