aboutsummaryrefslogtreecommitdiff
path: root/scripts/dispatch_table_helper_generator.py
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-05-04 15:10:59 -0600
committerMark Young <marky@lunarg.com>2017-05-05 13:26:08 -0600
commitbc4a9e58c724cbe907cd098ea2110c5296e2f48e (patch)
tree3edc222cc85c93c70983a482494ca33bf7617945 /scripts/dispatch_table_helper_generator.py
parentecc775f1a76773cbea037ee3a8003e32968b719b (diff)
downloadusermoji-bc4a9e58c724cbe907cd098ea2110c5296e2f48e.tar.xz
loader: gh1693 - GPDA override not used
In some situations, the loader wouldn't directly use the GetInstanceProcAddr or GetDeviceProcAddr function overrides directly. Instead, the loader would call vkGetInstanceProcAddr with an argument of "vkGetInstanceProcAddr" and vkGetDeviceProcAddr with an argument of "vkGetDeviceProcAddr". This short-cuts that. NOTE: Layers still need to support these queries because if another layer is above you, it may call "vkGetInstanceProcAddr" with to get "vkGetDeviceProcAddr". Change-Id: I810945f45121d42d23b69d0b3334d6bad3a8ed2f
Diffstat (limited to 'scripts/dispatch_table_helper_generator.py')
-rw-r--r--scripts/dispatch_table_helper_generator.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/dispatch_table_helper_generator.py b/scripts/dispatch_table_helper_generator.py
index 971eba7c..fd0ab313 100644
--- a/scripts/dispatch_table_helper_generator.py
+++ b/scripts/dispatch_table_helper_generator.py
@@ -190,7 +190,16 @@ class DispatchTableHelperOutputGenerator(OutputGenerator):
if item[1] is not None:
table += '#ifdef %s\n' % item[1]
- table += ' table->%s = (PFN_%s) gpa(%s, "%s");\n' % (base_name, item[0], table_type, item[0])
+
+ # If we're looking for the proc we are passing in, just point the table to it. This fixes the issue where
+ # a layer overrides the function name for the loader.
+ if (table_type == 'device' and base_name == 'GetDeviceProcAddr'):
+ table += ' table->GetDeviceProcAddr = gpa;\n'
+ elif (table_type != 'device' and base_name == 'GetInstanceProcAddr'):
+ table += ' table->GetInstanceProcAddr = gpa;\n'
+ else:
+ table += ' table->%s = (PFN_%s) gpa(%s, "%s");\n' % (base_name, item[0], table_type, item[0])
+
if item[1] is not None:
table += '#endif // %s\n' % item[1]
table += '}'