v3d: add lowering for OpenGL logic operations

Graphics / Mesa 3D Graphics Library / Mesa - Iago Toral Quiroga [igalia.com] - 12 July 2019 07:16 EDT

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)

e540775f0cb v3d: add lowering for OpenGL logic operations
src/broadcom/compiler/meson.build | 1 +
src/broadcom/compiler/v3d_compiler.h | 1 +
src/broadcom/compiler/v3d_nir_lower_logic_ops.c | 275 ++++++++++++++++++++++++
src/broadcom/compiler/vir.c | 2 +
4 files changed, 279 insertions(+)

Upstream: cgit.freedesktop.org

  • Share