From: Carl Worth Date: Wed, 29 Aug 2012 21:38:39 +0000 (-0700) Subject: trim: Avoid trimming textures when referenced by a framebuffer object X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=25e918f484586620d3e718d92aa4d338a1e3c9bd trim: Avoid trimming textures when referenced by a framebuffer object We aren't yet tracking FBOs as their own resource, but we do need to notice when any texture is referenced by an FBO so that we don't omit it while trimming. So, notice any textrure referenced by glFramebufferTexture2D and make the render state depend on this texture. --- diff --git a/cli/trace_analyzer.cpp b/cli/trace_analyzer.cpp index afca802..9a4553e 100644 --- a/cli/trace_analyzer.cpp +++ b/cli/trace_analyzer.cpp @@ -319,6 +319,20 @@ TraceAnalyzer::recordSideEffects(trace::Call *call) return; } + /* FIXME: When we start tracking framebuffer objects as their own + * resources, we will want to link the FBO to the given texture + * resource, (and to this call). For now, just link render state + * to the texture, and force this call to be required. */ + if (strcmp(name, "glFramebufferTexture2D") == 0) { + GLuint texture; + + texture = call->arg(3).toUInt(); + + linkf("render-state", "texture-", texture); + + required.insert(call->no); + } + if (strcmp(name, "glBindTexture") == 0) { GLenum target; GLuint texture;