aboutsummaryrefslogtreecommitdiff
path: root/scripts/unique_objects_generator.py
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-06-07 16:04:50 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-06-09 13:22:15 -0600
commit4f70011dcb9c0b8982a6d559785ea1f825d8abf4 (patch)
treec2cb45f7536b6e600a5d9cba3c0e0f6d8fda7b57 /scripts/unique_objects_generator.py
parent53d3e07430db6b64ca5460e5660cd0cbed6325a5 (diff)
downloadusermoji-4f70011dcb9c0b8982a6d559785ea1f825d8abf4.tar.xz
layers: Unique objects GPA handling updates
Change-Id: Id14c4b5ecb96eed9091ee13aceeb1701adb1f511
Diffstat (limited to 'scripts/unique_objects_generator.py')
-rw-r--r--scripts/unique_objects_generator.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/unique_objects_generator.py b/scripts/unique_objects_generator.py
index 8ad30530..7effe03f 100644
--- a/scripts/unique_objects_generator.py
+++ b/scripts/unique_objects_generator.py
@@ -258,8 +258,8 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
self.newline()
# Record intercepted procedures
- write('// intercepts', file=self.outFile)
- write('struct { const char* name; PFN_vkVoidFunction pFunc;} procmap[] = {', file=self.outFile)
+ write('// Map of all APIs to be intercepted by this layer', file=self.outFile)
+ write('static const std::unordered_map<std::string, void*> name_to_funcptr_map = {', file=self.outFile)
write('\n'.join(self.intercepts), file=self.outFile)
write('};\n', file=self.outFile)
self.newline()
@@ -850,7 +850,7 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
self.appendSection('command', '')
self.appendSection('command', '// Declare only')
self.appendSection('command', decls[0])
- self.intercepts += [ ' {"%s", reinterpret_cast<PFN_vkVoidFunction>(%s)},' % (cmdname,cmdname[2:]) ]
+ self.intercepts += [ ' {"%s", (void *)%s},' % (cmdname,cmdname[2:]) ]
continue
# Generate NDO wrapping/unwrapping code for all parameters
(api_decls, api_pre, api_post) = self.generate_wrapping_code(cmdinfo.elem)
@@ -863,7 +863,7 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
self.appendSection('command', '#ifdef '+ feature_extra_protect)
self.intercepts += [ '#ifdef %s' % feature_extra_protect ]
# Add intercept to procmap
- self.intercepts += [ ' {"%s", reinterpret_cast<PFN_vkVoidFunction>(%s)},' % (cmdname,cmdname[2:]) ]
+ self.intercepts += [ ' {"%s", (void*)%s},' % (cmdname,cmdname[2:]) ]
decls = self.makeCDecls(cmdinfo.elem)
self.appendSection('command', '')
self.appendSection('command', decls[0][:-1])