API = cmdinfo.elem.attrib.get('name').replace('vk', dispatch_table, 1)
# Put all this together for the final down-chain call
if assignresult != '':
- self.appendSection('command', ' if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;')
+ if resulttype.text == 'VkResult':
+ self.appendSection('command', ' if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;')
+ elif resulttype.text == 'VkBool32':
+ self.appendSection('command', ' if (skip) return VK_FALSE;')
+ else:
+ raise Exception('Unknown result type ' + resulttype.text)
else:
self.appendSection('command', ' if (skip) return;')
self.appendSection('command', ' ' + assignresult + API + '(' + paramstext + ');')
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'