mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
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:
parent
a5975883b9
commit
6c1cabc288
3 changed files with 9 additions and 17 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue