]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace_main.cpp
Create glretrace specific context.
[apitrace] / retrace / glretrace_main.cpp
index cbfc67f84dcb32b3ddcf6584b6c407e9def34d17..ca7f9b7b6874654751ee894b62a533dbcc8d98c5 100644 (file)
@@ -54,7 +54,6 @@ static bool supportsOcclusion = true;
 
 static bool firstFrame = true;
 static std::list<CallQuery> callQueries;
-static std::map<glws::Context*, GLuint> activePrograms;
 
 
 void
@@ -160,22 +159,6 @@ flushQueries() {
     callQueries.clear();
 }
 
-void setActiveProgram(GLuint program)
-{
-    activePrograms[glretrace::currentContext] = program;
-}
-
-static GLuint
-getActiveProgram()
-{
-    std::map<glws::Context*, GLuint>::iterator it;
-    it = activePrograms.find(glretrace::currentContext);
-    if (it == activePrograms.end())
-        return 0;
-
-    return it->second;
-}
-
 void
 beginProfile(trace::Call &call) {
     if (firstFrame) {
@@ -213,7 +196,7 @@ beginProfile(trace::Call &call) {
     CallQuery query;
     query.call = call.no;
     query.sig = call.sig;
-    query.program = getActiveProgram();
+    query.program = glretrace::currentContext ? glretrace::currentContext->activeProgram : 0;
 
     glGenQueries(3, query.ids);