glave: For color array params, correctly size trace buffer based on array type and...
authorTobin Ehlis <tobin@lunarg.com>
Wed, 25 Feb 2015 18:30:27 +0000 (11:30 -0700)
committerTobin Ehlis <tobin@lunarg.com>
Wed, 25 Feb 2015 18:31:35 +0000 (11:31 -0700)
glave-generate.py

index 7742d55..9d5b2f6 100755 (executable)
@@ -386,7 +386,8 @@ class Subcommand(object):
                         buff_ptr_indices.append(proto.params.index(p))
                     else:
                         if 'color' == p.name:
-                            packet_update_txt += '    memcpy((void*)pPacket->color, color, 4 * sizeof(uint32_t));\n'
+                            array_str = p.ty[p.ty.find('[')+1:p.ty.find(']')]
+                            packet_update_txt += '    memcpy((void*)pPacket->color, color, %s * sizeof(%s));\n' % (array_str, p.ty.strip('*').replace('const ', '').replace('[%s]' % array_str, ''))
                         else:
                             packet_update_txt += '    pPacket->%s = %s;\n' % (p.name, p.name)
                     if 'Count' in p.name and proto.params[-1].name != p.name and p.name not in ['queryCount', 'vertexCount', 'indexCount', 'startCounter'] and proto.name not in ['CmdLoadAtomicCounters', 'CmdSaveAtomicCounters']: