diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-05-01 19:51:05 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-05-01 19:51:05 +0100 |
commit | fc0ce0136231cc8c02eda623b77f710e9a0a95c1 (patch) | |
tree | 1e49210519d9ea2de044325c5747cddc126c9c0a /wrappers | |
parent | 830c0be51d2a81e660cbc03ddfe6d79631ea258b (diff) |
gltrace: Don't parse extensions twice.
Track first bound drawable separately from first bound context.
Diffstat (limited to 'wrappers')
-rw-r--r-- | wrappers/gltrace.hpp | 2 | ||||
-rw-r--r-- | wrappers/gltrace_state.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/wrappers/gltrace.hpp b/wrappers/gltrace.hpp index 375aa834..e8f6f7e4 100644 --- a/wrappers/gltrace.hpp +++ b/wrappers/gltrace.hpp @@ -96,6 +96,8 @@ public: // Whether it has been bound before bool bound = false; + // Whether it has been bound to a drawable + bool boundDrawable = false; // TODO: This will fail for buffers shared by multiple contexts. std::map <GLuint, Buffer> buffers; diff --git a/wrappers/gltrace_state.cpp b/wrappers/gltrace_state.cpp index c742e897..20d80ba9 100644 --- a/wrappers/gltrace_state.cpp +++ b/wrappers/gltrace_state.cpp @@ -144,7 +144,10 @@ void setContext(uintptr_t context_id) ctx->profile = glfeatures::getCurrentContextProfile(); ctx->extensions.getCurrentContextExtensions(ctx->profile); ctx->features.load(ctx->profile, ctx->extensions); + ctx->bound = true; + } + if (!ctx->boundDrawable) { /* * The default viewport and scissor state is set when a context is * first made current, with values matching the bound drawable. Many @@ -169,7 +172,7 @@ void setContext(uintptr_t context_id) if (viewport[2] && viewport[3] && scissor[2] && scissor[3]) { glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); - ctx->bound = true; + ctx->boundDrawable = true; } } } |