Remove unnecessary DeviceBase::GetDevice
BUG=
Change-Id: Iac73c9ffb4900961a0b47bf26dac049518021af2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8165
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/Device.cpp b/src/dawn_native/Device.cpp
index 207a398..720c386 100644
--- a/src/dawn_native/Device.cpp
+++ b/src/dawn_native/Device.cpp
@@ -96,10 +96,6 @@
return mAdapter;
}
- DeviceBase* DeviceBase::GetDevice() {
- return this;
- }
-
FenceSignalTracker* DeviceBase::GetFenceSignalTracker() const {
return mFenceSignalTracker.get();
}
diff --git a/src/dawn_native/Device.h b/src/dawn_native/Device.h
index e980b32..f613382 100644
--- a/src/dawn_native/Device.h
+++ b/src/dawn_native/Device.h
@@ -54,9 +54,6 @@
AdapterBase* GetAdapter() const;
- // Used by autogenerated code, returns itself
- DeviceBase* GetDevice();
-
FenceSignalTracker* GetFenceSignalTracker() const;
virtual CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder) = 0;
diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp
index 8097169..fa4a69a 100644
--- a/src/dawn_native/d3d12/DeviceD3D12.cpp
+++ b/src/dawn_native/d3d12/DeviceD3D12.cpp
@@ -83,24 +83,20 @@
programDesc.NumArgumentDescs = 1;
programDesc.pArgumentDescs = &argumentDesc;
- ToBackend(GetDevice())
- ->GetD3D12Device()
- ->CreateCommandSignature(&programDesc, NULL, IID_PPV_ARGS(&mDispatchIndirectSignature));
+ GetD3D12Device()->CreateCommandSignature(&programDesc, NULL,
+ IID_PPV_ARGS(&mDispatchIndirectSignature));
argumentDesc.Type = D3D12_INDIRECT_ARGUMENT_TYPE_DRAW;
programDesc.ByteStride = 4 * sizeof(uint32_t);
- ToBackend(GetDevice())
- ->GetD3D12Device()
- ->CreateCommandSignature(&programDesc, NULL, IID_PPV_ARGS(&mDrawIndirectSignature));
+ GetD3D12Device()->CreateCommandSignature(&programDesc, NULL,
+ IID_PPV_ARGS(&mDrawIndirectSignature));
argumentDesc.Type = D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED;
programDesc.ByteStride = 5 * sizeof(uint32_t);
- ToBackend(GetDevice())
- ->GetD3D12Device()
- ->CreateCommandSignature(&programDesc, NULL,
- IID_PPV_ARGS(&mDrawIndexedIndirectSignature));
+ GetD3D12Device()->CreateCommandSignature(&programDesc, NULL,
+ IID_PPV_ARGS(&mDrawIndexedIndirectSignature));
return {};
}
diff --git a/src/dawn_native/null/DeviceNull.cpp b/src/dawn_native/null/DeviceNull.cpp
index bc4c8de..954a26d 100644
--- a/src/dawn_native/null/DeviceNull.cpp
+++ b/src/dawn_native/null/DeviceNull.cpp
@@ -158,7 +158,7 @@
operation->destinationOffset = destinationOffset;
operation->size = size;
- ToBackend(GetDevice())->AddPendingOperation(std::move(operation));
+ AddPendingOperation(std::move(operation));
return {};
}