pan/bi: Canonicalize terminate_discarded_threads

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7081>
This commit is contained in:
Alyssa Rosenzweig 2020-10-02 13:27:15 -04:00
parent a5975883b9
commit 6c1cabc288
3 changed files with 9 additions and 17 deletions

View file

@ -47,7 +47,7 @@ bi_pack_header(bi_clause *clause, bi_clause *next_1, bi_clause *next_2, bool is_
struct bifrost_header header = {
.back_to_back = clause->back_to_back,
.no_end_of_shader = (next_1 != NULL),
.elide_writes = is_fragment,
.terminate_discarded_threads = is_fragment,
.branch_cond = clause->branch_conditional || clause->back_to_back,
.datareg_writebarrier = clause->data_register_write_barrier,
.datareg = clause->data_register,

View file

@ -83,19 +83,11 @@ struct bifrost_header {
unsigned back_to_back : 1;
unsigned no_end_of_shader: 1;
unsigned unk2 : 2;
// Set to true for fragment shaders, to implement this bit of spec text
// from section 7.1.5 of the GLSL ES spec:
//
// "Stores to image and buffer variables performed by helper invocations
// have no effect on the underlying image or buffer memory."
//
// Helper invocations are threads (invocations) corresponding to pixels in
// a quad that aren't actually part of the triangle, but are included to
// make derivatives work correctly. They're usually turned on, but they
// need to be masked off for GLSL-level stores. This bit seems to be the
// only bit that's actually different between fragment shaders and other
// shaders, so this is probably what it's doing.
unsigned elide_writes : 1;
/* Terminate discarded threads, rather than continuing execution. Set
* for fragment shaders for standard GL behaviour of DISCARD. */
unsigned terminate_discarded_threads : 1;
// If backToBack is off:
// - true for conditional branches and fallthrough
// - false for unconditional branches

View file

@ -115,9 +115,6 @@ static void dump_header(FILE *fp, struct bifrost_header header, bool verbose)
fprintf(fp, "branch-uncond ");
}
if (header.elide_writes)
fprintf(fp, "we ");
if (header.suppress_inf)
fprintf(fp, "inf_suppress ");
if (header.suppress_nan)
@ -146,6 +143,9 @@ static void dump_header(FILE *fp, struct bifrost_header header, bool verbose)
if (header.unk4)
fprintf(fp, "unk4 ");
if (header.terminate_discarded_threads)
fprintf(fp, "td ");
fprintf(fp, "\n");
if (verbose) {