tu_entrypoints = custom_target(
'tu_entrypoints',
input : [vk_entrypoints_gen, vk_api_xml],
- output : ['tu_entrypoints.h', 'tu_entrypoints.c'],
+ output : ['tu_entrypoints.h', 'tu_entrypoints.cc'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'tu',
+ '--include', 'adreno_common.xml.h',
+ '--tmpl-prefix', 'tu', '--tmpl-param', 'chip CHIP',
+ '--tmpl-variants', '<A6XX>', '<A7XX>',
],
depend_files : vk_entrypoints_gen_depend_files,
)
#define TU_FROM_HANDLE(__tu_type, __name, __handle) \
VK_FROM_HANDLE(__tu_type, __name, __handle)
+#define ACT_0(ACTION)
+#define ACT_1(ACTION, X) ACTION(X)
+#define ACT_2(ACTION, X, ...) ACTION(X) ACT_1(ACTION, __VA_ARGS__)
+#define ACT_3(ACTION, X, ...) ACTION(X) ACT_2(ACTION, __VA_ARGS__)
+#define ACT_4(ACTION, X, ...) ACTION(X) ACT_3(ACTION, __VA_ARGS__)
+#define ACT_5(ACTION, X, ...) ACTION(X) ACT_4(ACTION, __VA_ARGS__)
+#define ACT_6(ACTION, X, ...) ACTION(X) ACT_5(ACTION, __VA_ARGS__)
+
+#define GET_ACT_MACRO(_0, _1, _2, _3, _4, _5, _6, NAME, ...) NAME
+
+/* Do the action for the each vararg. It could be macro, function call, etc. */
+#define ACTION_FOR_EACH(action, ...) \
+ GET_ACT_MACRO(_0, __VA_ARGS__, ACT_6, ACT_5, ACT_4, ACT_3, ACT_2, ACT_1, ACT_0) \
+ (action, __VA_ARGS__)
+
+#define TU_GPU_GENS A6XX, A7XX
+#define TU_GENX(entrypoint) \
+ ACTION_FOR_EACH(entrypoint ## _GENS, TU_GPU_GENS)
+
/* vk object types */
struct tu_buffer;
struct tu_buffer_view;
struct vk_device_dispatch_table dispatch_table;
vk_device_dispatch_table_from_entrypoints(
&dispatch_table, &tu_device_entrypoints, true);
+
+ switch (fd_dev_gen(&physical_device->dev_id)) {
+ case 6:
+ vk_device_dispatch_table_from_entrypoints(
+ &dispatch_table, &tu_device_entrypoints_a6xx, false);
+ break;
+ case 7:
+ vk_device_dispatch_table_from_entrypoints(
+ &dispatch_table, &tu_device_entrypoints_a7xx, false);
+ }
+
vk_device_dispatch_table_from_entrypoints(
&dispatch_table, &wsi_device_entrypoints, false);