diff --git a/src/tint/lang/wgsl/resolver/compatibility_mode_test.cc b/src/tint/lang/wgsl/resolver/compatibility_mode_test.cc
index 0223370..16793d3 100644
--- a/src/tint/lang/wgsl/resolver/compatibility_mode_test.cc
+++ b/src/tint/lang/wgsl/resolver/compatibility_mode_test.cc
@@ -27,6 +27,8 @@
 
 #include <string>
 #include "src/tint/lang/core/number.h"
+#include "src/tint/lang/core/type/storage_texture.h"
+#include "src/tint/lang/core/type/texture_dimension.h"
 #include "src/tint/lang/wgsl/ast/expression.h"
 #include "src/tint/lang/wgsl/ast/type.h"
 #include "src/tint/lang/wgsl/common/validation_mode.h"
@@ -52,6 +54,47 @@
     }
 };
 
+template <typename T>
+class ResolverCompatibilityModeTestWithParam : public TestHelper, public testing::TestWithParam<T> {
+  protected:
+    ResolverCompatibilityModeTestWithParam() {
+        resolver_ = std::make_unique<Resolver>(this, wgsl::AllowedFeatures::Everything(),
+                                               wgsl::ValidationMode::kCompat);
+    }
+};
+
+using ResolverCompatibilityModeTest_StorageTexture = ResolverCompatibilityModeTestWithParam<
+    std::tuple<core::type::TextureDimension, core::TexelFormat>>;
+
+TEST_P(ResolverCompatibilityModeTest_StorageTexture, RGStorageTextures) {
+    // @group(2) @binding(1) var tex: texture_storage_xxx<formatxxx, read_write>
+    auto dim = std::get<0>(GetParam());
+    auto fmt = std::get<1>(GetParam());
+    auto t = ty.storage_texture(Source{{12, 34}}, dim, fmt, core::Access::kReadWrite);
+    GlobalVar("tex", t,
+              Vector{
+                  Group(2_a),
+                  Binding(1_a),
+              });
+
+    StringStream err;
+    err << "12:34 error: format " << fmt
+        << " is not supported as a storage texture in compatibility mode";
+
+    EXPECT_FALSE(r()->Resolve());
+    EXPECT_EQ(r()->error(), err.str());
+}
+
+INSTANTIATE_TEST_SUITE_P(ResolverCompatibilityModeTest,
+                         ResolverCompatibilityModeTest_StorageTexture,
+                         testing::Combine(testing::Values(core::type::TextureDimension::k1d,
+                                                          core::type::TextureDimension::k2d,
+                                                          core::type::TextureDimension::k2dArray,
+                                                          core::type::TextureDimension::k3d),
+                                          testing::Values(core::TexelFormat::kRg32Float,
+                                                          core::TexelFormat::kRg32Sint,
+                                                          core::TexelFormat::kRg32Uint)));
+
 TEST_F(ResolverCompatibilityModeTest, SampleMask_Parameter) {
     // @fragment
     // fn main(@builtin(sample_mask) mask : u32) {
diff --git a/src/tint/lang/wgsl/resolver/validator.cc b/src/tint/lang/wgsl/resolver/validator.cc
index d6bb9d9..d68f698 100644
--- a/src/tint/lang/wgsl/resolver/validator.cc
+++ b/src/tint/lang/wgsl/resolver/validator.cc
@@ -142,6 +142,17 @@
     }
 }
 
+bool IsInvalidStorageTextureTexelFormatInCompatibilityMode(core::TexelFormat format) {
+    switch (format) {
+        case core::TexelFormat::kRg32Float:
+        case core::TexelFormat::kRg32Sint:
+        case core::TexelFormat::kRg32Uint:
+            return true;
+        default:
+            return false;
+    }
+}
+
 template <typename CALLBACK>
 void TraverseCallChain(const sem::Function* from, const sem::Function* to, CALLBACK&& callback) {
     for (auto* f : from->TransitivelyCalledFunctions()) {
@@ -417,9 +428,17 @@
 
     if (!IsValidStorageTextureTexelFormat(t->texel_format())) {
         AddError(source) << "image format must be one of the texel formats specified for storage "
-                            "textues in https://gpuweb.github.io/gpuweb/wgsl/#texel-formats";
+                            "textures in https://gpuweb.github.io/gpuweb/wgsl/#texel-formats";
         return false;
     }
+
+    if (mode_ == wgsl::ValidationMode::kCompat &&
+        IsInvalidStorageTextureTexelFormatInCompatibilityMode(t->texel_format())) {
+        AddError(source) << "format " << t->texel_format()
+                         << " is not supported as a storage texture in compatibility mode";
+        return false;
+    }
+
     return true;
 }
 
