From: José Fonseca Date: Tue, 19 Jul 2011 15:24:09 +0000 (-0700) Subject: Sort shader objs so that state dumps are reproducible. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d9b4c14c7e154c782d66f2e9886f2bbd4c5c85f6;p=apitrace Sort shader objs so that state dumps are reproducible. --- diff --git a/glstate.cpp b/glstate.cpp index 79365ed..264e5cf 100644 --- a/glstate.cpp +++ b/glstate.cpp @@ -163,6 +163,7 @@ dumpCurrentProgram(JSONWriter &json) GLuint *shaders = new GLuint[attached_shaders]; GLsizei count = 0; glGetAttachedShaders(program, attached_shaders, &count, shaders); + std::sort(shaders, shaders + count); for (GLsizei i = 0; i < count; ++ i) { getShaderSource(shaderMap, shaders[i]); } @@ -195,6 +196,7 @@ dumpCurrentProgramObj(JSONWriter &json) GLhandleARB *shaderObjs = new GLhandleARB[attached_shaders]; GLsizei count = 0; glGetAttachedObjectsARB(programObj, attached_shaders, &count, shaderObjs); + std::sort(shaderObjs, shaderObjs + count); for (GLsizei i = 0; i < count; ++ i) { getShaderObjSource(shaderMap, shaderObjs[i]); }