agx: Add AGX_MESA_DEBUG=noopt option
To disable the optimizer. Trying to root cause a Neverball bug, this gives one less thing to worry. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17198>
This commit is contained in:
@@ -39,6 +39,7 @@ static const struct debug_named_value agx_debug_options[] = {
|
|||||||
{"verbose", AGX_DBG_VERBOSE, "Disassemble verbosely"},
|
{"verbose", AGX_DBG_VERBOSE, "Disassemble verbosely"},
|
||||||
{"internal", AGX_DBG_INTERNAL, "Dump even internal shaders"},
|
{"internal", AGX_DBG_INTERNAL, "Dump even internal shaders"},
|
||||||
{"novalidate",AGX_DBG_NOVALIDATE,"Skip IR validation in debug builds"},
|
{"novalidate",AGX_DBG_NOVALIDATE,"Skip IR validation in debug builds"},
|
||||||
|
{"noopt", AGX_DBG_NOOPT, "Disable backend optimizations"},
|
||||||
DEBUG_NAMED_VALUE_END
|
DEBUG_NAMED_VALUE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1743,12 +1744,14 @@ agx_compile_shader_nir(nir_shader *nir,
|
|||||||
if (agx_debug & AGX_DBG_SHADERS && !skip_internal)
|
if (agx_debug & AGX_DBG_SHADERS && !skip_internal)
|
||||||
agx_print_shader(ctx, stdout);
|
agx_print_shader(ctx, stdout);
|
||||||
|
|
||||||
agx_optimizer(ctx);
|
if (likely(!(agx_debug & AGX_DBG_NOOPT))) {
|
||||||
agx_dce(ctx);
|
agx_optimizer(ctx);
|
||||||
agx_validate(ctx, "Optimization");
|
agx_dce(ctx);
|
||||||
|
agx_validate(ctx, "Optimization");
|
||||||
|
|
||||||
if (agx_debug & AGX_DBG_SHADERS && !skip_internal)
|
if (agx_debug & AGX_DBG_SHADERS && !skip_internal)
|
||||||
agx_print_shader(ctx, stdout);
|
agx_print_shader(ctx, stdout);
|
||||||
|
}
|
||||||
|
|
||||||
agx_ra(ctx);
|
agx_ra(ctx);
|
||||||
|
|
||||||
|
@@ -45,6 +45,7 @@ enum agx_dbg {
|
|||||||
AGX_DBG_VERBOSE = BITFIELD_BIT(3),
|
AGX_DBG_VERBOSE = BITFIELD_BIT(3),
|
||||||
AGX_DBG_INTERNAL = BITFIELD_BIT(4),
|
AGX_DBG_INTERNAL = BITFIELD_BIT(4),
|
||||||
AGX_DBG_NOVALIDATE = BITFIELD_BIT(5),
|
AGX_DBG_NOVALIDATE = BITFIELD_BIT(5),
|
||||||
|
AGX_DBG_NOOPT = BITFIELD_BIT(6),
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int agx_debug;
|
extern int agx_debug;
|
||||||
|
Reference in New Issue
Block a user