}
}
+#ifdef _MSC_VER
+void vk_entrypoint_stub(void)
+{
+ unreachable(!"Entrypoint not implemented");
+}
+#endif
+
<%def name="dispatch_table_from_entrypoints(type)">
void vk_${type}_dispatch_table_from_entrypoints(
struct vk_${type}_dispatch_table *dispatch_table,
memset(dispatch_table, 0, sizeof(*dispatch_table));
for (unsigned i = 0; i < ARRAY_SIZE(${type}_compaction_table); i++) {
#ifdef _MSC_VER
- const uintptr_t zero = 0;
- if (entry[i] == NULL || memcmp(entry[i], &zero, sizeof(zero)) == 0)
+ assert(entry[i] != NULL);
+ if (entry[i] == vk_entrypoint_stub)
#else
if (entry[i] == NULL)
#endif
} else {
for (unsigned i = 0; i < ARRAY_SIZE(${type}_compaction_table); i++) {
unsigned disp_index = ${type}_compaction_table[i];
+#ifdef _MSC_VER
+ assert(entry[i] != NULL);
+ if (disp[disp_index] == NULL && entry[i] != vk_entrypoint_stub)
+#else
if (disp[disp_index] == NULL)
+#endif
disp[disp_index] = entry[i];
}
}
% endif
% for p in prefixes:
#ifdef _MSC_VER
- ${e.return_type} (*${p}_${e.name}_Null)(${e.decl_params()}) = 0;
#ifdef _M_IX86
% for args_size in [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 60, 104]:
- #pragma comment(linker, "/alternatename:_${p}_${e.name}@${args_size}=_${p}_${e.name}_Null")
+ #pragma comment(linker, "/alternatename:_${p}_${e.name}@${args_size}=_vk_entrypoint_stub")
% endfor
#else
- #pragma comment(linker, "/alternatename:${p}_${e.name}=${p}_${e.name}_Null")
+ #pragma comment(linker, "/alternatename:${p}_${e.name}=vk_entrypoint_stub")
#endif
#else
VKAPI_ATTR ${e.return_type} VKAPI_CALL ${p}_${e.name}(${e.decl_params()}) __attribute__ ((weak));