summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wrappers/gltrace.hpp2
-rw-r--r--wrappers/gltrace_state.cpp5
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;
}
}
}