mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
asahi: Fix disk cache disable with AGX_MESA_DEBUG
We go to initialize the disk cache before we've compiled any shaders so agx_compiler_debug is 0 at this point. Don't try to read it, instead go through sa safe getter that will do the right thing. Fixes:5e9538c12e("agx: isolate compiler debug flags") Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22891> (cherry picked from commite9b471d1b3)
This commit is contained in:
parent
f3fb0dd9a5
commit
057c71bc42
5 changed files with 12 additions and 4 deletions
|
|
@ -1165,7 +1165,7 @@
|
|||
"description": "asahi: Fix disk cache disable with AGX_MESA_DEBUG",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5e9538c12e0f564af888e2d2c1804e960b9492ca"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ DEBUG_GET_ONCE_FLAGS_OPTION(agx_compiler_debug, "AGX_MESA_DEBUG",
|
|||
|
||||
int agx_compiler_debug = 0;
|
||||
|
||||
uint64_t
|
||||
agx_get_compiler_debug(void)
|
||||
{
|
||||
return debug_get_option_agx_compiler_debug();
|
||||
}
|
||||
|
||||
#define DBG(fmt, ...) \
|
||||
do { \
|
||||
if (agx_compiler_debug & AGX_DBG_MSGS) \
|
||||
|
|
@ -2360,7 +2366,7 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
|
|||
struct util_dynarray *binary,
|
||||
struct agx_shader_info *out)
|
||||
{
|
||||
agx_compiler_debug = debug_get_option_agx_compiler_debug();
|
||||
agx_compiler_debug = agx_get_compiler_debug();
|
||||
|
||||
memset(out, 0, sizeof *out);
|
||||
|
||||
|
|
|
|||
|
|
@ -809,6 +809,8 @@ struct agx_occupancy {
|
|||
|
||||
struct agx_occupancy agx_occupancy_for_register_count(unsigned halfregs);
|
||||
|
||||
extern int agx_compiler_debug;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern C */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ enum agx_compiler_dbg {
|
|||
};
|
||||
/* clang-format on */
|
||||
|
||||
extern int agx_compiler_debug;
|
||||
uint64_t agx_get_compiler_debug(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern C */
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ void
|
|||
agx_disk_cache_init(struct agx_screen *screen)
|
||||
{
|
||||
#ifdef ENABLE_SHADER_CACHE
|
||||
if (agx_compiler_debug || screen->dev.debug)
|
||||
if (agx_get_compiler_debug() || screen->dev.debug)
|
||||
return;
|
||||
|
||||
const char *renderer = screen->pscreen.get_name(&screen->pscreen);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue