Reject GL devices that don't support rendering to f16 and f32
Change-Id: Ib1d81aa2e69ef33e5cbabfd851ab2e7860772f53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/175340
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/native/opengl/PhysicalDeviceGL.cpp b/src/dawn/native/opengl/PhysicalDeviceGL.cpp
index 3af5174..699ad03 100644
--- a/src/dawn/native/opengl/PhysicalDeviceGL.cpp
+++ b/src/dawn/native/opengl/PhysicalDeviceGL.cpp
@@ -144,6 +144,15 @@
MaybeError PhysicalDevice::InitializeImpl() {
if (mFunctions.GetVersion().IsES()) {
DAWN_ASSERT(GetBackendType() == wgpu::BackendType::OpenGLES);
+
+ // WebGPU requires being able to render to f16 and being able to blend f16
+ // which EXT_color_buffer_half_float provides.
+ DAWN_INVALID_IF(!mFunctions.IsGLExtensionSupported("GL_EXT_color_buffer_half_float"),
+ "GL_EXT_color_buffer_half_float is required");
+
+ // WebGPU requires being able to render to f32 but does not require being able to blend f32
+ DAWN_INVALID_IF(!mFunctions.IsGLExtensionSupported("GL_EXT_color_buffer_float"),
+ "GL_EXT_color_buffer_float is required");
} else {
DAWN_ASSERT(GetBackendType() == wgpu::BackendType::OpenGL);
}