[dawn][opengl] Re-enable TextureCompressionBCSliced3D feature
The TextureCompressionBCSliced3D feature is now re-enabled if
TextureCompressionBC feature is supported; but it's disabled if it's
running on Nvidia with GLES version < 4.2.
Spec PR: https://github.com/gpuweb/gpuweb/pull/5184
Bug: 342840940
Change-Id: I3d5907c4a7435584e6d18d77c83c861628cbf018
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/239374
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Fr <beaufort.francois@gmail.com>
diff --git a/src/dawn/native/opengl/PhysicalDeviceGL.cpp b/src/dawn/native/opengl/PhysicalDeviceGL.cpp
index 6156bed..f3fed3f 100644
--- a/src/dawn/native/opengl/PhysicalDeviceGL.cpp
+++ b/src/dawn/native/opengl/PhysicalDeviceGL.cpp
@@ -229,9 +229,17 @@
mFunctions.IsGLExtensionSupported("GL_ARB_texture_compression_bptc") ||
mFunctions.IsGLExtensionSupported("GL_EXT_texture_compression_bptc");
+ bool supportsBCSliced3D = true;
+ if (mVendorId == gpu_info::kVendorID_Nvidia) {
+ supportsBCSliced3D &= mFunctions.IsAtLeastGL(4, 2);
+ }
+
if (supportsS3TC && (supportsTextureSRGB || supportsS3TCSRGB) && supportsRGTC &&
supportsBPTC) {
EnableFeature(Feature::TextureCompressionBC);
+ if (supportsBCSliced3D) {
+ EnableFeature(Feature::TextureCompressionBCSliced3D);
+ }
}
}