# Each function typedef in the vulkan.h header is all on one line and matches
# this regepx. We hope that won't change.
-p = re.compile('typedef ([^ ]*) *\(VKAPI \*PFN_vk([^(]*)\)(.*);')
+p = re.compile('typedef ([^ ]*) *\((?:VKAPI_PTR)? *\*PFN_vk([^(]*)\)(.*);')
entrypoints = []
print " };\n"
print "};\n"
- print "void anv_set_dispatch_gen(uint32_t gen);\n"
+ print "void anv_set_dispatch_devinfo(const struct brw_device_info *info);\n"
for type, name, args, num, h in entrypoints:
print "%s anv_%s%s;" % (type, name, args)
print "%s gen7_%s%s;" % (type, name, args)
+ print "%s gen75_%s%s;" % (type, name, args)
print "%s gen8_%s%s;" % (type, name, args)
+ print "%s gen9_%s%s;" % (type, name, args)
print "%s anv_validate_%s%s;" % (type, name, args)
exit()
print " { %5d, 0x%08x }," % (offsets[num], h)
print "};\n"
-for layer in [ "anv", "validate", "gen7", "gen8" ]:
+for layer in [ "anv", "validate", "gen7", "gen75", "gen8", "gen9" ]:
for type, name, args, num, h in entrypoints:
print "%s %s_%s%s __attribute__ ((weak));" % (type, layer, name, args)
print "\nconst struct anv_dispatch_table %s_layer = {" % layer
enable_validate = atoi(s);
}
-static uint32_t dispatch_gen;
+static const struct brw_device_info *dispatch_devinfo;
void
-anv_set_dispatch_gen(uint32_t gen)
+anv_set_dispatch_devinfo(const struct brw_device_info *devinfo)
{
- dispatch_gen = gen;
+ dispatch_devinfo = devinfo;
}
void * __attribute__ ((noinline))
if (enable_validate && validate_layer.entrypoints[index])
return validate_layer.entrypoints[index];
- switch (dispatch_gen) {
+ if (dispatch_devinfo == NULL) {
+ assert(anv_layer.entrypoints[index]);
+ return anv_layer.entrypoints[index];
+ }
+
+ switch (dispatch_devinfo->gen) {
+ case 9:
+ if (gen9_layer.entrypoints[index])
+ return gen9_layer.entrypoints[index];
+ /* fall through */
case 8:
if (gen8_layer.entrypoints[index])
return gen8_layer.entrypoints[index];
/* fall through */
case 7:
+ if (dispatch_devinfo->is_haswell && gen75_layer.entrypoints[index])
+ return gen75_layer.entrypoints[index];
+
if (gen7_layer.entrypoints[index])
return gen7_layer.entrypoints[index];
/* fall through */