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
@@ -54,6 +54,11 @@ namespace dawn_native {
|
||||
return reinterpret_cast<dawnDevice>(mImpl->CreateDevice());
|
||||
}
|
||||
|
||||
// AdapterDiscoverOptionsBase
|
||||
|
||||
AdapterDiscoveryOptionsBase::AdapterDiscoveryOptionsBase(BackendType type) : backendType(type) {
|
||||
}
|
||||
|
||||
// Instance
|
||||
|
||||
Instance::Instance() : mImpl(new InstanceBase()) {
|
||||
@@ -68,6 +73,10 @@ namespace dawn_native {
|
||||
mImpl->DiscoverDefaultAdapters();
|
||||
}
|
||||
|
||||
bool Instance::DiscoverAdapters(const AdapterDiscoveryOptionsBase* options) {
|
||||
return mImpl->DiscoverAdapters(options);
|
||||
}
|
||||
|
||||
std::vector<Adapter> Instance::GetAdapters() const {
|
||||
// Adapters are owned by mImpl so it is safe to return non RAII pointers to them
|
||||
std::vector<Adapter> adapters;
|
||||
|
||||
Reference in New Issue
Block a user