From ca7e62d4211c712810959a22b52437b18abd5b25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 18 May 2015 08:52:22 -0700 Subject: [PATCH] vk: Add a logger wrapper for the generated entrypoint --- src/vulkan/vk_gen.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/vulkan/vk_gen.py b/src/vulkan/vk_gen.py index b82c90f73aa..b97b50d4d00 100644 --- a/src/vulkan/vk_gen.py +++ b/src/vulkan/vk_gen.py @@ -189,6 +189,20 @@ for type, name, args, num, h in entrypoints: print "static void *resolve_%s(void) { return resolve_entrypoint(%d); }" % (name, num) print "%s vk%s%s\n __attribute__ ((ifunc (\"resolve_%s\"), visibility (\"default\")));\n" % (type, name, args, name) + +logger = """%s __attribute__ ((weak)) anv_validate_%s%s +{ + fprintf(stderr, "%%s\\n", strings + %d); + void *args = __builtin_apply_args(); + void *result = __builtin_apply((void *) anv_%s, args, 100); + __builtin_return(result); +} +""" + +for type, name, args, num, h in entrypoints: + print logger % (type, name, args, offsets[num], name) + + # Now generate the hash table used for entry point look up. This is a # uint16_t table of entry point indices. We use 0xffff to indicate an entry # in the hash table is empty. -- 2.30.2