freedreno/a6xx: genx helper for additional template param

In a few cases we have a 2nd template param.  Add a helper for this so
adding new gens is less awkward.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38450>
This commit is contained in:
Rob Clark
2025-10-21 16:46:00 -07:00
committed by Marge Bot
parent fb6dccc64c
commit b8fd1e2f7c
3 changed files with 14 additions and 14 deletions

View File

@@ -22,6 +22,14 @@
static constexpr auto FUNC_NAME##tmpl __attribute__((used)) = \
FUNC_NAME##instantiate<__FD_GPU_GENS>();
#define FD_GENX2(FUNC_NAME, EXT_TYPE, EXT) \
template <chip... CHIPs> constexpr auto FUNC_NAME##inst##EXT() \
{ \
return std::tuple_cat(std::make_tuple(FUNC_NAME<EXT, CHIPs>)...); \
} \
static constexpr auto FUNC_NAME##tmpl##EXT __attribute__((used)) = \
FUNC_NAME##inst##EXT<__FD_GPU_GENS>();
#define FD_CALLX(info, thing) \
({ \
decltype(&thing<A6XX>) genX_thing; \

View File

@@ -359,10 +359,8 @@ fd6_build_user_consts(struct fd6_emit *emit)
return constobj.ring();
}
template struct fd_ringbuffer * fd6_build_user_consts<HAS_TESS_GS, A6XX>(struct fd6_emit *emit);
template struct fd_ringbuffer * fd6_build_user_consts<HAS_TESS_GS, A7XX>(struct fd6_emit *emit);
template struct fd_ringbuffer * fd6_build_user_consts<NO_TESS_GS, A6XX>(struct fd6_emit *emit);
template struct fd_ringbuffer * fd6_build_user_consts<NO_TESS_GS, A7XX>(struct fd6_emit *emit);
FD_GENX2(fd6_build_user_consts, fd6_pipeline_type, NO_TESS_GS);
FD_GENX2(fd6_build_user_consts, fd6_pipeline_type, HAS_TESS_GS);
template <chip CHIP>
static inline void
@@ -466,11 +464,8 @@ fd6_build_driver_params(struct fd6_emit *emit)
return dpconstobj.ring();
}
template struct fd_ringbuffer * fd6_build_driver_params<HAS_TESS_GS, A6XX>(struct fd6_emit *emit);
template struct fd_ringbuffer * fd6_build_driver_params<HAS_TESS_GS, A7XX>(struct fd6_emit *emit);
template struct fd_ringbuffer * fd6_build_driver_params<NO_TESS_GS, A6XX>(struct fd6_emit *emit);
template struct fd_ringbuffer * fd6_build_driver_params<NO_TESS_GS, A7XX>(struct fd6_emit *emit);
FD_GENX2(fd6_build_driver_params, fd6_pipeline_type, NO_TESS_GS);
FD_GENX2(fd6_build_driver_params, fd6_pipeline_type, HAS_TESS_GS);
template <chip CHIP>
void

View File

@@ -709,11 +709,8 @@ fd6_emit_3d_state(fd_cs &cs, struct fd6_emit *emit)
fd6_state_emit(&emit->state, cs);
}
template void fd6_emit_3d_state<NO_TESS_GS, A6XX>(fd_cs &cs, struct fd6_emit *emit);
template void fd6_emit_3d_state<NO_TESS_GS, A7XX>(fd_cs &cs, struct fd6_emit *emit);
template void fd6_emit_3d_state<HAS_TESS_GS, A6XX>(fd_cs &cs, struct fd6_emit *emit);
template void fd6_emit_3d_state<HAS_TESS_GS, A7XX>(fd_cs &cs, struct fd6_emit *emit);
FD_GENX2(fd6_emit_3d_state, fd6_pipeline_type, NO_TESS_GS);
FD_GENX2(fd6_emit_3d_state, fd6_pipeline_type, HAS_TESS_GS);
template <chip CHIP>
void