diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-02-03 13:39:05 -0700 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-02-04 17:58:11 -0700 |
| commit | 417a2cfac9d5b0cc12e28cbf1dc2bc2d94b4fbd5 (patch) | |
| tree | 773d60d7e9addbebf0b2c559c7c2caf84060bc8c | |
| parent | 99409a8be2b9386833dda1804b9bafd9d6cb0966 (diff) | |
| download | usermoji-417a2cfac9d5b0cc12e28cbf1dc2bc2d94b4fbd5.tar.xz | |
glave: Fix EnumerateLayers replay to handle if layer libs differ from tracing
Was not handling the case where the layer libraries enumerated at replay time
were greater than those enumerated at trace time.
| -rwxr-xr-x | glave-generate.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/glave-generate.py b/glave-generate.py index e909566a..d02da635 100755 --- a/glave-generate.py +++ b/glave-generate.py @@ -2967,6 +2967,11 @@ class Subcommand(object): rbody.append(' }') elif proto.name in do_while_dict: rbody.append(' do {') + elif proto.name == 'EnumerateLayers': + rbody.append(' char **bufptr = GLV_NEW_ARRAY(char *, pPacket->maxLayerCount);') + rbody.append(' char **ptrLayers = (pPacket->pOutLayers == NULL) ? bufptr : (char **) pPacket->pOutLayers;') + rbody.append(' for (unsigned int i = 0; i < pPacket->maxLayerCount; i++)') + rbody.append(' bufptr[i] = GLV_NEW_ARRAY(char, pPacket->maxStringSize);') rr_string = ' ' if ret_value: rr_string = ' replayResult = ' @@ -3003,6 +3008,8 @@ class Subcommand(object): rr_string = ', '.join(rr_list) # this is a sneaky shortcut to use generic create code below to add_to_map create_func = True + elif proto.name == 'EnumerateLayers': + rr_string = rr_string.replace('pPacket->pOutLayers', 'ptrLayers') rbody.append(rr_string) if 'DestroyDevice' in proto.name: rbody.append(' if (replayResult == XGL_SUCCESS)') @@ -3041,6 +3048,9 @@ class Subcommand(object): elif proto.name in do_while_dict: rbody[-1] = ' %s' % rbody[-1] rbody.append(' } while (%s);' % do_while_dict[proto.name]) + elif proto.name == 'EnumerateLayers': + rbody.append(' for (unsigned int i = 0; i < pPacket->maxLayerCount; i++)') + rbody.append(' GLV_DELETE(bufptr[i]);') if ret_value: rbody.append(' CHECK_RETURN_VALUE(xgl%s);' % proto.name) if 'MsgCallback' in proto.name: |
