pan/bi: Add nosched debug option
Forces a trivial schedule to replicate the old behaviour (for debugging or benchmarking). Actually the new scheduler is still used, just highly constrained; the net result should still do what's expected. 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/8354>
This commit is contained in:
parent
ced55f0bcc
commit
4f4bb72745
|
@ -761,6 +761,12 @@ bi_take_instr(bi_context *ctx, struct bi_worklist st,
|
||||||
struct bi_tuple_state *tuple,
|
struct bi_tuple_state *tuple,
|
||||||
bool fma)
|
bool fma)
|
||||||
{
|
{
|
||||||
|
#ifndef NDEBUG
|
||||||
|
/* Don't pair instructions if debugging */
|
||||||
|
if ((bifrost_debug & BIFROST_DBG_NOSCHED) && tuple->add)
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (tuple->add && tuple->add->op == BI_OPCODE_CUBEFACE)
|
if (tuple->add && tuple->add->op == BI_OPCODE_CUBEFACE)
|
||||||
return bi_lower_cubeface(ctx, clause, tuple);
|
return bi_lower_cubeface(ctx, clause, tuple);
|
||||||
|
|
||||||
|
@ -1229,6 +1235,12 @@ bi_schedule_clause(bi_context *ctx, bi_block *block, struct bi_worklist st)
|
||||||
if (!bi_space_for_more_constants(&clause_state))
|
if (!bi_space_for_more_constants(&clause_state))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
/* Don't schedule more than 1 tuple if debugging */
|
||||||
|
if (bifrost_debug & BIFROST_DBG_NOSCHED)
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Link through the register state */
|
/* Link through the register state */
|
||||||
STATIC_ASSERT(sizeof(prev_reads) == sizeof(tuple_state.reg.reads));
|
STATIC_ASSERT(sizeof(prev_reads) == sizeof(tuple_state.reg.reads));
|
||||||
memcpy(prev_reads, tuple_state.reg.reads, sizeof(prev_reads));
|
memcpy(prev_reads, tuple_state.reg.reads, sizeof(prev_reads));
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#define BIFROST_DBG_SHADERDB 0x0004
|
#define BIFROST_DBG_SHADERDB 0x0004
|
||||||
#define BIFROST_DBG_VERBOSE 0x0008
|
#define BIFROST_DBG_VERBOSE 0x0008
|
||||||
#define BIFROST_DBG_INTERNAL 0x0010
|
#define BIFROST_DBG_INTERNAL 0x0010
|
||||||
|
#define BIFROST_DBG_NOSCHED 0x0020
|
||||||
|
|
||||||
extern int bifrost_debug;
|
extern int bifrost_debug;
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ static const struct debug_named_value bifrost_debug_options[] = {
|
||||||
{"shaderdb", BIFROST_DBG_SHADERDB, "Print statistics"},
|
{"shaderdb", BIFROST_DBG_SHADERDB, "Print statistics"},
|
||||||
{"verbose", BIFROST_DBG_VERBOSE, "Disassemble verbosely"},
|
{"verbose", BIFROST_DBG_VERBOSE, "Disassemble verbosely"},
|
||||||
{"internal", BIFROST_DBG_INTERNAL, "Dump even internal shaders"},
|
{"internal", BIFROST_DBG_INTERNAL, "Dump even internal shaders"},
|
||||||
|
{"nosched", BIFROST_DBG_NOSCHED, "Force trivial scheduling"},
|
||||||
DEBUG_NAMED_VALUE_END
|
DEBUG_NAMED_VALUE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue