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>
This commit is contained in:
Stephen White
2020-11-24 20:57:23 +00:00
committed by Commit Bot service account
parent 90bac683b4
commit 70102b7190
15 changed files with 113 additions and 40 deletions

View File

@@ -40,7 +40,7 @@ namespace dawn_native {
#endif // defined(DAWN_ENABLE_BACKEND_NULL)
#if defined(DAWN_ENABLE_BACKEND_OPENGL)
namespace opengl {
BackendConnection* Connect(InstanceBase* instance);
BackendConnection* Connect(InstanceBase* instance, wgpu::BackendType backendType);
}
#endif // defined(DAWN_ENABLE_BACKEND_OPENGL)
#if defined(DAWN_ENABLE_BACKEND_VULKAN)
@@ -147,7 +147,8 @@ namespace dawn_native {
# endif // defined(DAWN_ENABLE_SWIFTSHADER)
#endif // defined(DAWN_ENABLE_BACKEND_VULKAN)
#if defined(DAWN_ENABLE_BACKEND_OPENGL)
Register(opengl::Connect(this), wgpu::BackendType::OpenGL);
Register(opengl::Connect(this, wgpu::BackendType::OpenGL), wgpu::BackendType::OpenGL);
Register(opengl::Connect(this, wgpu::BackendType::OpenGLES), wgpu::BackendType::OpenGLES);
#endif // defined(DAWN_ENABLE_BACKEND_OPENGL)
#if defined(DAWN_ENABLE_BACKEND_NULL)
Register(null::Connect(this), wgpu::BackendType::Null);