Commit b8ca4309 by Cody Northrop Committed by Commit Bot

CaptureReplay: Emit unused resources

In the final frame of Manhattan, resources are cleaned up, even if they are non-existent. This is allowed by the GLES spec. Compilation of the replay would fail, for instance: error: use of undeclared identifier 'gRenderbufferMap'; did you mean 'gFramebufferMap'? const GLuint glDeleteRenderbuffers_renderbuffersPacked_0[] = { gRenderbufferMap[0] }; ^~~~~~~~~~~~~~~~ This is because we are only declaring resources if they are used. Instead, go ahead and emit the resources, then circle back when filtering is implemented, allow that to optimize the replay. Bug: angleproject:4091 Bug: angleproject:4223 Change-Id: Ib48da0d9c3f4f2eca268646e7717a12126b1d85c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2066455Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent ce4918f1
...@@ -807,9 +807,7 @@ void WriteCppReplayIndexFiles(const std::string &outDir, ...@@ -807,9 +807,7 @@ void WriteCppReplayIndexFiles(const std::string &outDir,
} }
for (ResourceIDType resourceType : AllEnums<ResourceIDType>()) for (ResourceIDType resourceType : AllEnums<ResourceIDType>())
{ {
if (!hasResourceType[resourceType]) // TODO: Only emit resources needed by the frames (anglebug.com/4223)
continue;
const char *name = GetResourceIDTypeName(resourceType); const char *name = GetResourceIDTypeName(resourceType);
header << "extern ResourceMap g" << name << "Map;\n"; header << "extern ResourceMap g" << name << "Map;\n";
source << "ResourceMap g" << name << "Map;\n"; source << "ResourceMap g" << name << "Map;\n";
...@@ -875,8 +873,7 @@ void WriteCppReplayIndexFiles(const std::string &outDir, ...@@ -875,8 +873,7 @@ void WriteCppReplayIndexFiles(const std::string &outDir,
for (ResourceIDType resourceType : AllEnums<ResourceIDType>()) for (ResourceIDType resourceType : AllEnums<ResourceIDType>())
{ {
if (!hasResourceType[resourceType]) // TODO: Only emit resources needed by the frames (anglebug.com/4223)
continue;
const char *name = GetResourceIDTypeName(resourceType); const char *name = GetResourceIDTypeName(resourceType);
header << "void Update" << name << "ID(GLuint id, GLsizei readBufferOffset);\n"; header << "void Update" << name << "ID(GLuint id, GLsizei readBufferOffset);\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment