Capture/Replay: Set texture buffer offset alignment

Set a texture buffer offset alignment value (256) that is divisible
by most device's actual GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT.  This is
the highest and most common recorded value on gpuinfo.org.  It is
also listed in the spec as the minimum value.

Specifically, this allows running the trace on SwiftShader.

Test: Fortnite MEC
Bug: b/180418810
Bug: angleproject:5658
Change-Id: Ied58000221465b8bdafb189a54d0418e58996ec3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123956
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
diff --git a/src/libANGLE/Constants.h b/src/libANGLE/Constants.h
index 6459465..871b269 100644
--- a/src/libANGLE/Constants.h
+++ b/src/libANGLE/Constants.h
@@ -107,6 +107,11 @@
 constexpr uint32_t kMinimumShaderUniformBlocks = 12;
 // Table 6.31 MAX_VERTEX_OUTPUT_COMPONENTS minimum value = 64
 constexpr uint32_t kMinimumVertexOutputComponents = 64;
+
+// OpenGL ES 3.2+ Minimum Values
+// Table 21.42 TEXTURE_BUFFER_OFFSET_ALIGNMENT minimum value = 256
+constexpr uint32_t kMinTextureBufferOffsetAlignment = 256;
+
 }  // namespace limits
 
 }  // namespace gl
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 9e10ea4..7932f24 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -3835,6 +3835,12 @@
         INFO() << "Setting uniform buffer offset alignment to " << uniformBufferOffsetAlignment;
         mState.mCaps.uniformBufferOffsetAlignment = uniformBufferOffsetAlignment;
 
+        // Same for texture buffer offset alignment
+        constexpr GLint textureBufferOffsetAlignment = gl::limits::kMinTextureBufferOffsetAlignment;
+        ASSERT(textureBufferOffsetAlignment % mState.mCaps.textureBufferOffsetAlignment == 0);
+        INFO() << "Setting texture buffer offset alignment to " << textureBufferOffsetAlignment;
+        mState.mCaps.textureBufferOffsetAlignment = textureBufferOffsetAlignment;
+
         INFO() << "Disabling GL_EXT_map_buffer_range and GL_OES_mapbuffer during capture, which "
                   "are not supported on some native drivers";
         mState.mExtensions.mapBufferRange = false;