diff --git a/src/freedreno/common/freedreno_common.h b/src/freedreno/common/freedreno_common.h index 12e236d309a..fb6101add83 100644 --- a/src/freedreno/common/freedreno_common.h +++ b/src/freedreno/common/freedreno_common.h @@ -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 constexpr auto FUNC_NAME##inst##EXT() \ + { \ + return std::tuple_cat(std::make_tuple(FUNC_NAME)...); \ + } \ + static constexpr auto FUNC_NAME##tmpl##EXT __attribute__((used)) = \ + FUNC_NAME##inst##EXT<__FD_GPU_GENS>(); + #define FD_CALLX(info, thing) \ ({ \ decltype(&thing) genX_thing; \ diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_const.cc b/src/gallium/drivers/freedreno/a6xx/fd6_const.cc index 44f4aea6c5e..7a061c0159c 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_const.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_const.cc @@ -359,10 +359,8 @@ fd6_build_user_consts(struct fd6_emit *emit) return constobj.ring(); } -template struct fd_ringbuffer * fd6_build_user_consts(struct fd6_emit *emit); -template struct fd_ringbuffer * fd6_build_user_consts(struct fd6_emit *emit); -template struct fd_ringbuffer * fd6_build_user_consts(struct fd6_emit *emit); -template struct fd_ringbuffer * fd6_build_user_consts(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 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(struct fd6_emit *emit); -template struct fd_ringbuffer * fd6_build_driver_params(struct fd6_emit *emit); -template struct fd_ringbuffer * fd6_build_driver_params(struct fd6_emit *emit); -template struct fd_ringbuffer * fd6_build_driver_params(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 void diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.cc b/src/gallium/drivers/freedreno/a6xx/fd6_emit.cc index 3c09ea0ad46..3fab7e950c4 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.cc @@ -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(fd_cs &cs, struct fd6_emit *emit); -template void fd6_emit_3d_state(fd_cs &cs, struct fd6_emit *emit); -template void fd6_emit_3d_state(fd_cs &cs, struct fd6_emit *emit); -template void fd6_emit_3d_state(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 void