bool framebufferObjectActive;
bool insideBeginEnd;
GLuint activeProgram;
+ GLenum activeTextureUnit;
/* Rendering often has no side effects, but it can in some cases,
* (such as when transform feedback is active, or when rendering
return;
}
+ if (strcmp(name, "glActiveTexture") == 0) {
+ activeTextureUnit = static_cast<GLenum>(call->arg(0).toSInt());
+ return;
+ }
+
if (strcmp(name, "glBindTexture") == 0) {
GLenum target;
GLuint texture;
target = static_cast<GLenum>(call->arg(0).toSInt());
texture = call->arg(1).toUInt();
- ss_target << "texture-target-" << target;
+ ss_target << "texture-unit-" << activeTextureUnit << "-target-" << target;
ss_texture << "texture-" << texture;
resources.erase(ss_target.str());
GLenum target = static_cast<GLenum>(call->arg(0).toSInt());
- ss_target << "texture-target-" << target;
+ ss_target << "texture-unit-" << activeTextureUnit << "-target-" << target;
ss_texture << "texture-" << texture_map[target];
/* The texture resource depends on this call and any calls
cap == GL_TEXTURE_3D ||
cap == GL_TEXTURE_CUBE_MAP)
{
- linkf("render-state", "texture-target-", cap);
+ std::stringstream ss;
+
+ ss << "texture-unit-" << activeTextureUnit << "-target-" << cap;
+
+ link("render-state", ss.str());
}
provide("state", call->no);
cap == GL_TEXTURE_3D ||
cap == GL_TEXTURE_CUBE_MAP)
{
- unlinkf("render-state", "texture-target-", cap);
+ std::stringstream ss;
+
+ ss << "texture-unit-" << activeTextureUnit << "-target-" << cap;
+
+ unlink("render-state", ss.str());
}
provide("state", call->no);
public:
TraceAnalyzer(): transformFeedbackActive(false),
framebufferObjectActive(false),
- insideBeginEnd(false)
+ insideBeginEnd(false),
+ activeTextureUnit(GL_TEXTURE0)
{}
~TraceAnalyzer() {}