FrameCapture: Check EXT before limiting tex buffer

Only apply the limit to textureBufferOffsetAlignment when the
extension is enabled, otherwise the default alignment is zero
and the assert will fire.

This was missed previously because most of us (including the bots)
run with the following GN arg enabled:

    angle_expose_non_conformant_extensions_and_versions = true

Test: FrameCapture on Pixel 4
Bug: b/180418810
Bug: angleproject:5658
Change-Id: Iea0618f439efeb3351300ee5af54066bfe526f71
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140097
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 7932f24..67746e6 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -3835,11 +3835,15 @@
         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;
+        // Also limit texture buffer offset alignment, if enabled
+        if (mState.mExtensions.textureBufferAny())
+        {
+            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";