aboutsummaryrefslogtreecommitdiff
path: root/scripts/parameter_validation_generator.py
diff options
context:
space:
mode:
authorJamie Madill <jmadill@chromium.org>2017-11-08 14:11:26 -0500
committerTobin Ehlis <tobine@google.com>2017-11-09 09:51:07 -0700
commitc284bde6b1c4a4af3ff651c70836f31deb7532a4 (patch)
treeb513df9967d13f3f70d0e9c9fbb5028265a04068 /scripts/parameter_validation_generator.py
parent931a3936ecf30348013e0e3dd14cce02eb0c0beb (diff)
downloadusermoji-c284bde6b1c4a4af3ff651c70836f31deb7532a4.tar.xz
layers: Don't confuse VkResult/VkBool32 in generators.
In some cases, the generator would return the special error for validation failed for functions that return a VkBool32. Fix this, and also some cases of initializing a VkBool32 with VkResult. Change-Id: Icc071e647f293848d62a922d492ed41dfc5a4be1
Diffstat (limited to 'scripts/parameter_validation_generator.py')
-rw-r--r--scripts/parameter_validation_generator.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/parameter_validation_generator.py b/scripts/parameter_validation_generator.py
index 01ed1bbf..9c673fc4 100644
--- a/scripts/parameter_validation_generator.py
+++ b/scripts/parameter_validation_generator.py
@@ -1200,7 +1200,13 @@ class ParameterValidationOutputGenerator(OutputGenerator):
cmdDef += '%sbool skip = false;\n' % indent
if not just_validate:
if command.result != '':
- cmdDef += indent + '%s result = VK_ERROR_VALIDATION_FAILED_EXT;\n' % command.result
+ if command.result == "VkResult":
+ cmdDef += indent + '%s result = VK_ERROR_VALIDATION_FAILED_EXT;\n' % command.result
+ elif command.result == "VkBool32":
+ cmdDef += indent + '%s result = VK_FALSE;\n' % command.result
+ else:
+ raise Exception("Unknown result type: " + command.result)
+
cmdDef += '%sstd::unique_lock<std::mutex> lock(global_lock);\n' % indent
for line in lines:
cmdDef += '\n'