Capture/Replay: Add textures to resource tracking This CL: - Shifts resource reset tracking to be stored in an array of structs indexed by type. This helps curb the complexity of adding more resource types. - Moves buffer and program tracking to the new layout. - Adds textures to the resource tracker, using new layout. Note that only aspects common to all ResourceIDTypes have been moved to the new layout. Unique pieces of data, like buffer mapping state and GLSync handling, remain in resource tracker alone. Since texture setup is quite involved, this CL takes the approach of having each call applied to two call chains at the same time; SetupReplay calls and ResetReplay calls. ResetReplay ends up with a sequence similar to buffers: ... const GLuint deleteTextures[] = { gTextureMap[1], gTextureMap[2], ... gTextureMap[n]}; glDeleteTextures(<count>, deleteTextures); ... glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(1, 0); glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(2, 0); glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(3, 0); ... glBindTexture(GL_TEXTURE_2D, gTextureMap[1]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9729); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, 33071); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 33071); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 33071); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, 519); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexImage2D(GL_TEXTURE_2D, 0, 6406, 512, 512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte *>(&gBinaryData[183263280])); glBindTexture(GL_TEXTURE_2D, gTextureMap[2]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9987); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, 519); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 6); glTexStorage2D(GL_TEXTURE_2D, 7, GL_COMPRESSED_SRGB8_ETC2, 64, 64); ... Test: PUBG Mobile MEC Bug: b/180418573 Bug: angleproject:6087 Change-Id: I9f8e151c12aec5b2b7af376b8e0ff644ff9c61c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3016114 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>