layers: Enabled detailed output of void* memBarrier parameters
APIDump now interprets these void* pointers and prints the appropriate
information.
diff --git a/vk-layer-generate.py b/vk-layer-generate.py
index c011971..51f4a27 100755
--- a/vk-layer-generate.py
+++ b/vk-layer-generate.py
@@ -748,6 +748,44 @@
header_txt.append(' }')
header_txt.append('}')
header_txt.append('')
+ header_txt.append('void interpret_memBarriers(const void* const* ppMemBarriers, uint32_t memBarrierCount)')
+ header_txt.append('{')
+ header_txt.append(' if (ppMemBarriers) {')
+ header_txt.append(' string tmp_str;')
+ header_txt.append(' uint32_t i;')
+ header_txt.append(' for (i = 0; i < memBarrierCount; i++) {')
+ header_txt.append('')
+ header_txt.append(' const union worker_union {')
+ header_txt.append(' VkStructureType type;')
+ header_txt.append(' VkMemoryBarrier mem;')
+ header_txt.append(' VkBufferMemoryBarrier buf;')
+ header_txt.append(' VkImageMemoryBarrier img;')
+ header_txt.append(' } *umb = (worker_union*)(ppMemBarriers[i]);')
+ header_txt.append('')
+ header_txt.append(' switch(umb->type)')
+ header_txt.append(' {')
+ header_txt.append(' case VK_STRUCTURE_TYPE_MEMORY_BARRIER:')
+ header_txt.append(' tmp_str = vk_print_vkmemorybarrier(&umb->mem, " ");')
+ header_txt.append(' break;')
+ header_txt.append(' case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER:')
+ header_txt.append(' tmp_str = vk_print_vkbuffermemorybarrier(&umb->buf, " ");')
+ header_txt.append(' break;')
+ header_txt.append(' case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER:')
+ header_txt.append(' tmp_str = vk_print_vkimagememorybarrier(&umb->img, " ");')
+ header_txt.append(' break;')
+ header_txt.append(' default:')
+ header_txt.append(' break;')
+ header_txt.append(' }')
+ header_txt.append('')
+ header_txt.append(' if (StreamControl::writeAddress == true) {')
+ header_txt.append(' (*outputStream) << " ppMemBarriers[" << i << "] (" << &ppMemBarriers[i] << ")" << endl << tmp_str << endl;')
+ header_txt.append(' } else {')
+ header_txt.append(' (*outputStream) << " ppMemBarriers[" << i << "] (address)" << endl << " address" << endl;')
+ header_txt.append(' }')
+ header_txt.append(' }')
+ header_txt.append(' }')
+ header_txt.append('}')
+ header_txt.append('')
return "\n".join(header_txt)
def generate_init(self):
@@ -920,6 +958,10 @@
log_func += '\n%s(*outputStream) << " %s (" << %s << ")" << endl << tmp_str << endl;' % (indent, local_name, local_name)
indent = indent[4:]
log_func += '\n%s}' % (indent)
+ elif 'memBarrierCount' == sp_param_dict[sp_index]: # call helper function
+ log_func += '\n%sif (ppMemBarriers) {' % (indent)
+ log_func += '\n%s interpret_memBarriers(ppMemBarriers, memBarrierCount);' % (indent)
+ log_func += '\n%s}' % (indent)
else: # We have a count value stored to iterate over an array
print_cast = ''
print_func = ''