panfrost: Dynamically set discard branch targets
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 17 Feb 2019 23:24:39 +0000 (23:24 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 21 Feb 2019 07:08:59 +0000 (07:08 +0000)
commit779e140b1aeeb4592c6e8c573d344ba3dcbd6872
tree1d39faa8c3be47595b5c3ef4d491ab484fa3d40a
parent5abb7b559e9c81b354a4417b910032e70d075f7b
panfrost: Dynamically set discard branch targets

discard and discard_if are both implemented with the branching pipeline
on Midgard; essentially, we branch to the end of the fragment shader in
a special "discard" mode, setting the condition as necessary.
Previously, we hardcoded the form of this instruction, which worked for
very simple shaders but was incorrect for anything remotely interesting.
This patch instead emits logical branches in the IR, which are flattened
to real discard ops the same way other branches are, allowing targets to
be computed correctly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/midgard/midgard_compile.c