Add preliminary OpenGL ES and EGL support to Dawn.
This is enough to get all of the sample apps running on a conformant ES 3.1 implementation, such as ANGLE/Vk or NVidia's OpenGL ES Linux driver.
Implements a new opengl::AdapterDiscoveryOptionsES subclass to specify its creation at adapter discovery time.
Adds a "-b opengles" command-line flag to the code samples.
Asserts on a call to glShaderStorageBlockBinding() on ES.
Works around missing indexed draw buffers support by asserting when a non-0 color attachment is specified.
Works around missing glClearTexSubImage() by asserting. :/
These will likely require front-end validation.
BUG=dawn:580
Change-Id: I4a4240ca695a22388c55073fd2aee0323cd4afc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31000
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp
index cab6cb0..2522d20 100644
--- a/examples/SampleUtils.cpp
+++ b/examples/SampleUtils.cpp
@@ -213,12 +213,17 @@
backendType = wgpu::BackendType::OpenGL;
continue;
}
+ if (i < argc && std::string("opengles") == argv[i]) {
+ backendType = wgpu::BackendType::OpenGLES;
+ continue;
+ }
if (i < argc && std::string("vulkan") == argv[i]) {
backendType = wgpu::BackendType::Vulkan;
continue;
}
fprintf(stderr,
- "--backend expects a backend name (opengl, metal, d3d12, null, vulkan)\n");
+ "--backend expects a backend name (opengl, opengles, metal, d3d12, null, "
+ "vulkan)\n");
return false;
}
if (std::string("-c") == argv[i] || std::string("--command-buffer") == argv[i]) {