diff options
| author | Peter Lohrmann <peterl@valvesoftware.com> | 2015-01-09 12:34:50 -0800 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-02-04 17:58:06 -0700 |
| commit | 418bc36eb149da85000a58909d60b4de74ee02c9 (patch) | |
| tree | 9d622986b27dd4c28fb653a6004ff4799ae6b554 | |
| parent | 9e0f7707be1cd85cd785609b4384848176c18ce4 (diff) | |
| download | usermoji-418bc36eb149da85000a58909d60b4de74ee02c9.tar.xz | |
glvreplay_xgl: Add 'EnableLayers' setting to control which XGL validation layers get enabled.
* The string is a comma separated list of layer names, defaulting to "Drawstate,ObjectTracker".
* Fix the way in which the settings are assigned to the default values, as the previous approach was attempting to delete the default 'EnableLayers' value, which would have caused problems eventually.
| -rwxr-xr-x | glave-generate.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/glave-generate.py b/glave-generate.py index bcab9b52..6fa69d97 100755 --- a/glave-generate.py +++ b/glave-generate.py @@ -2109,17 +2109,25 @@ class Subcommand(object): cd_body.append(' {') cd_body.append(' XGL_DEVICE_CREATE_INFO cInfo, *ci, *pCreateInfoSaved;') cd_body.append(' // TODO what is the real list of layers to be running with??') - cd_body.append(' const XGL_CHAR * layersStr[2] = {(XGL_CHAR *) "DrawState", (XGL_CHAR *) "ObjectTracker"};') +# cd_body.append(' const XGL_CHAR * layersStr[2] = {(XGL_CHAR *) "DrawState", (XGL_CHAR *) "ObjectTracker"};') + + cd_body.append(' unsigned int numLayers = 0;') + cd_body.append(' XGL_CHAR ** layersStr = get_enableLayers_list(&numLayers);') cd_body.append(' XGL_LAYER_CREATE_INFO layerInfo;') cd_body.append(' pCreateInfoSaved = (XGL_DEVICE_CREATE_INFO *) pPacket->pCreateInfo;') cd_body.append(' ci = (XGL_DEVICE_CREATE_INFO *) pPacket->pCreateInfo;') - cd_body.append(' while (ci->pNext != NULL)') - cd_body.append(' ci = (XGL_DEVICE_CREATE_INFO *) ci->pNext;') - cd_body.append(' ci->pNext = &layerInfo;') - cd_body.append(' layerInfo.sType = XGL_STRUCTURE_TYPE_LAYER_CREATE_INFO;') - cd_body.append(' layerInfo.pNext = 0;') - cd_body.append(' layerInfo.layerCount = 2;') - cd_body.append(' layerInfo.ppActiveLayerNames = layersStr;') + + cd_body.append(' if (layersStr != NULL && numLayers > 0)') + cd_body.append(' {') + cd_body.append(' while (ci->pNext != NULL)') + cd_body.append(' ci = (XGL_DEVICE_CREATE_INFO *) ci->pNext;') + cd_body.append(' ci->pNext = &layerInfo;') + cd_body.append(' layerInfo.sType = XGL_STRUCTURE_TYPE_LAYER_CREATE_INFO;') + cd_body.append(' layerInfo.pNext = 0;') + cd_body.append(' layerInfo.layerCount = numLayers;') + cd_body.append(' layerInfo.ppActiveLayerNames = layersStr;') + cd_body.append(' }') + cd_body.append(' memcpy(&cInfo, pPacket->pCreateInfo, sizeof(XGL_DEVICE_CREATE_INFO));') cd_body.append(' cInfo.flags = pPacket->pCreateInfo->flags | XGL_DEVICE_CREATE_VALIDATION_BIT;') cd_body.append(' cInfo.maxValidationLevel = (XGL_VALIDATION_LEVEL)((g_xglReplaySettings.debugLevel <= 4) ? XGL_VALIDATION_LEVEL_0 + g_xglReplaySettings.debugLevel : XGL_VALIDATION_LEVEL_0);') @@ -2128,6 +2136,7 @@ class Subcommand(object): cd_body.append(' // restore the packet for next replay') cd_body.append(' ci->pNext = NULL;') cd_body.append(' pPacket->pCreateInfo = pCreateInfoSaved;') + cd_body.append(' release_enableLayer_list(layersStr);') cd_body.append(' if (xglDbgRegisterMsgCallback(g_fpDbgMsgCallback, NULL) != XGL_SUCCESS)') cd_body.append(' glv_LogError("Failed to register xgl callback for replayer error handling\\n");') cd_body.append(' }') |
