agx: expose agx_link_libagx

for deduplication.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179>
This commit is contained in:
Alyssa Rosenzweig
2024-04-27 11:28:04 -04:00
committed by Marge Bot
parent 5a3ac73747
commit 840394c169
2 changed files with 5 additions and 4 deletions
+4 -4
View File
@@ -3199,8 +3199,8 @@ agx_compile_function_nir(nir_shader *nir, nir_function_impl *impl,
return offset;
}
static void
link_libagx(nir_shader *nir, const nir_shader *libagx)
void
agx_link_libagx(nir_shader *nir, const nir_shader *libagx)
{
nir_link_shader_functions(nir, libagx);
NIR_PASS(_, nir, nir_inline_functions);
@@ -3242,7 +3242,7 @@ agx_preprocess_nir(nir_shader *nir, const nir_shader *libagx)
/* Clean up deref gunk after lowering I/O */
NIR_PASS(_, nir, nir_opt_dce);
link_libagx(nir, libagx);
agx_link_libagx(nir, libagx);
/* Runs before we lower away idiv, to work at all. But runs after lowering
* textures, since the cube map array lowering generates division by 6.
@@ -3322,7 +3322,7 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
NIR_PASS(_, nir, nir_lower_vars_to_ssa);
if (needs_libagx) {
link_libagx(nir, key->libagx);
agx_link_libagx(nir, key->libagx);
NIR_PASS(_, nir, nir_opt_deref);
NIR_PASS(_, nir, nir_lower_vars_to_ssa);
+1
View File
@@ -224,6 +224,7 @@ struct agx_shader_key {
struct agx_interp_info agx_gather_interp_info(nir_shader *nir);
uint64_t agx_gather_texcoords(nir_shader *nir);
void agx_link_libagx(nir_shader *nir, const nir_shader *libagx);
void agx_preprocess_nir(nir_shader *nir, const nir_shader *libagx);
bool agx_nir_lower_discard_zs_emit(nir_shader *s);
bool agx_nir_lower_sample_mask(nir_shader *s);