dawn_native: Factor getting procs into a single function.

Now the backends only expose the creation of devices. Getting the procs
is moved to DawnNative that will over time more backend-agnostic APIs.
This commit is contained in:
Corentin Wallez
2018-08-02 22:27:57 +02:00
committed by Corentin Wallez
parent f9f44ae289
commit dcb71a131c
23 changed files with 98 additions and 84 deletions

View File

@@ -17,6 +17,7 @@
#include "common/Assert.h"
#include "common/Constants.h"
#include "common/Math.h"
#include "dawn_native/DawnNative.h"
#include "dawn_wire/Wire.h"
#include "utils/BackendBinding.h"
#include "utils/DawnHelpers.h"
@@ -136,9 +137,8 @@ void DawnTest::SetUp() {
mBinding->SetWindow(testWindow);
dawnDevice backendDevice;
dawnProcTable backendProcs;
mBinding->GetProcAndDevice(&backendProcs, &backendDevice);
dawnDevice backendDevice = mBinding->CreateDevice();
dawnProcTable backendProcs = dawn_native::GetProcs();
// Choose whether to use the backend procs and devices directly, or set up the wire.
dawnDevice cDevice = nullptr;

View File

@@ -15,6 +15,8 @@
#include "tests/unittests/validation/ValidationTest.h"
#include "dawn/dawn.h"
#include "dawn_native/DawnNative.h"
#include "dawn_native/NullBackend.h"
namespace dawn_native {
namespace null {
@@ -23,9 +25,8 @@ namespace dawn_native {
}
ValidationTest::ValidationTest() {
dawnProcTable procs;
dawnDevice cDevice;
dawn_native::null::Init(&procs, &cDevice);
dawnProcTable procs = dawn_native::GetProcs();
dawnDevice cDevice = dawn_native::null::CreateDevice();
dawnSetProcs(&procs);
device = dawn::Device::Acquire(cDevice);