{"action":"opened","issue":{"url":"https://api.github.com/repos/apitrace/apitrace/issues/401","labels_url":"https://api.github.com/repos/apitrace/apitrace/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/apitrace/apitrace/issues/401/comments","events_url":"https://api.github.com/repos/apitrace/apitrace/issues/401/events","html_url":"https://github.com/apitrace/apitrace/issues/401","id":120644727,"number":401,"title":"different order of calls, in trace and retrace (multithreaded application)","user":{"login":"fred41","id":2283639,"avatar_url":"https://avatars.githubusercontent.com/u/2283639?v=3","gravatar_id":"","url":"https://api.github.com/users/fred41","html_url":"https://github.com/fred41","followers_url":"https://api.github.com/users/fred41/followers","following_url":"https://api.github.com/users/fred41/following{/other_user}","gists_url":"https://api.github.com/users/fred41/gists{/gist_id}","starred_url":"https://api.github.com/users/fred41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fred41/subscriptions","organizations_url":"https://api.github.com/users/fred41/orgs","repos_url":"https://api.github.com/users/fred41/repos","events_url":"https://api.github.com/users/fred41/events{/privacy}","received_events_url":"https://api.github.com/users/fred41/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-06T16:43:40Z","updated_at":"2015-12-06T16:43:40Z","closed_at":null,"body":"For multithreaded applications, new gl calls may arrive, complete and recorded, while previous calls (from diferent threads) are still processed (and unrecorded). \r\nTherefore the call records in file may be not sequenced correctly. \r\n\r\nThe retracer replays the calls correct (via multiple threads), but in order of records.\r\nPerhaps this may explain some strange results, while retracing multithreaded records.\r\n\r\nExample:\r\n\r\n2217 @0 glViewport(x = 0, y = 0, width = 1920, height = 1080)\r\n2218 @0 glDepthRangef(n = 0, f = 1)\r\n2219 @0 glDepthMask(flag = GL_TRUE)\r\n2221 @1 glCreateBuffers(n = 1, buffers = &6)\r\n2222 @1 glBindBuffer(target = GL_ARRAY_BUFFER, buffer = 6)\r\n2223 @1 glBufferStorage(target = GL_ARRAY_BUFFER, size = 884736, data = NULL, flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT)\r\n2224 @1 glMapBufferRange(target = GL_ARRAY_BUFFER, offset = 0, length = 884736, access = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT) = 0x7f0cc8d2f000\r\n2225 @1 glGetError() = GL_NO_ERROR\r\n2226 @1 glCreateBuffers(n = 1, buffers = &7)\r\n2227 @1 glBindBuffer(target = GL_ELEMENT_ARRAY_BUFFER, buffer = 7)\r\n2228 @1 glBindBuffer(target = GL_ELEMENT_ARRAY_BUFFER, buffer = 7)\r\n2229 @1 glBufferStorage(target = GL_ELEMENT_ARRAY_BUFFER, size = 12288, data = NULL, flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT)\r\n2230 @1 glMapBufferRange(target = GL_ELEMENT_ARRAY_BUFFER, offset = 0, length = 12288, access = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT) = 0x7f0cc8d2c000\r\n2220 @0 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT)\r\n2231 @0 glDepthMask(flag = GL_FALSE)\r\n\r\n\r\nIn this example, glClear (2220) is replayed past glMapBufferRange (2030), but was original occuring much earlier. (I can provide some traces from warthunder, a multithreaded freetoplay game.\r\n\r\nWouldn't be an option, to sort the calls by framenumbers, an wonderful improvement?\r\n"}}