From f731e6737dcd0261470c9c24fd43774d3ebee274 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 30 Jul 2015 10:11:32 -0600 Subject: layers: Enabled detailed output of void* memBarrier parameters APIDump now interprets these void* pointers and prints the appropriate information. --- vk-layer-generate.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/vk-layer-generate.py b/vk-layer-generate.py index c0119711..51f4a27e 100755 --- a/vk-layer-generate.py +++ b/vk-layer-generate.py @@ -748,6 +748,44 @@ class APIDumpSubcommand(Subcommand): 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 @@ class APIDumpSubcommand(Subcommand): 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 = '' -- cgit v1.2.3