mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
OpenGL: Implement the backend connection and adapter.
The OpenGL backend can't gather discover default adapters because it needs getProc to do anything so we add DiscoverAdapters method to Instance that takes backend-specific options. dawn_native::opengl::CreateDevice is removed in favor of the adapter path so OpenGLBinding is modified to create an instance locally. This is only temporary until all backends support adapters, at which point a lot of *Binding code will be factored. Also contains a small fix for Result<T, E> with movable types. BUG=dawn:29 Change-Id: I4eb3d4a14a871af73e1872132aff72b45e5fe566 Reviewed-on: https://dawn-review.googlesource.com/c/3663 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
ab8eb2d6ed
commit
90e594ee8b
@@ -36,6 +36,10 @@ namespace dawn_native {
|
||||
// options (such as debug adapters, custom driver libraries, etc.)
|
||||
virtual std::vector<std::unique_ptr<AdapterBase>> DiscoverDefaultAdapters() = 0;
|
||||
|
||||
// Returns new adapters created with the backend-specific options.
|
||||
virtual ResultOrError<std::vector<std::unique_ptr<AdapterBase>>> DiscoverAdapters(
|
||||
const AdapterDiscoveryOptionsBase* options);
|
||||
|
||||
private:
|
||||
InstanceBase* mInstance = nullptr;
|
||||
BackendType mType;
|
||||
|
||||
Reference in New Issue
Block a user