From 6774bce06ef16ac548bf4bc9881c20daa4c4978b Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Fri, 30 Jun 2017 11:55:54 -0400 Subject: [PATCH] Remove unused Device member in D3D12 TextureView and BufferView --- src/backend/d3d12/BufferD3D12.cpp | 4 ++-- src/backend/d3d12/BufferD3D12.h | 3 +-- src/backend/d3d12/D3D12Backend.cpp | 4 ++-- src/backend/d3d12/TextureD3D12.cpp | 2 +- src/backend/d3d12/TextureD3D12.h | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/backend/d3d12/BufferD3D12.cpp b/src/backend/d3d12/BufferD3D12.cpp index 1836660233..f45cbd6f07 100644 --- a/src/backend/d3d12/BufferD3D12.cpp +++ b/src/backend/d3d12/BufferD3D12.cpp @@ -119,8 +119,8 @@ namespace d3d12 { } - BufferView::BufferView(Device* device, BufferViewBuilder* builder) - : BufferViewBase(builder), device(device) { + BufferView::BufferView(BufferViewBuilder* builder) + : BufferViewBase(builder) { cbvDesc.BufferLocation = ToBackend(GetBuffer())->GetVA() + GetOffset(); cbvDesc.SizeInBytes = GetD3D12Size(); diff --git a/src/backend/d3d12/BufferD3D12.h b/src/backend/d3d12/BufferD3D12.h index 7c106986d0..9963d3dcf4 100644 --- a/src/backend/d3d12/BufferD3D12.h +++ b/src/backend/d3d12/BufferD3D12.h @@ -48,14 +48,13 @@ namespace d3d12 { class BufferView : public BufferViewBase { public: - BufferView(Device* device, BufferViewBuilder* builder); + BufferView(BufferViewBuilder* builder); uint32_t GetD3D12Size() const; const D3D12_CONSTANT_BUFFER_VIEW_DESC& GetCBVDescriptor() const; const D3D12_UNORDERED_ACCESS_VIEW_DESC& GetUAVDescriptor() const; private: - Device* device; D3D12_CONSTANT_BUFFER_VIEW_DESC cbvDesc; D3D12_UNORDERED_ACCESS_VIEW_DESC uavDesc; }; diff --git a/src/backend/d3d12/D3D12Backend.cpp b/src/backend/d3d12/D3D12Backend.cpp index e770e7b89d..8cacd98cad 100644 --- a/src/backend/d3d12/D3D12Backend.cpp +++ b/src/backend/d3d12/D3D12Backend.cpp @@ -205,7 +205,7 @@ namespace d3d12 { return new Buffer(this, builder); } BufferViewBase* Device::CreateBufferView(BufferViewBuilder* builder) { - return new BufferView(this, builder); + return new BufferView(builder); } CommandBufferBase* Device::CreateCommandBuffer(CommandBufferBuilder* builder) { return new CommandBuffer(this, builder); @@ -241,7 +241,7 @@ namespace d3d12 { return new Texture(this, builder); } TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) { - return new TextureView(this, builder); + return new TextureView(builder); } void Device::Reference() { diff --git a/src/backend/d3d12/TextureD3D12.cpp b/src/backend/d3d12/TextureD3D12.cpp index 3aaf2c0687..cb06a05f7c 100644 --- a/src/backend/d3d12/TextureD3D12.cpp +++ b/src/backend/d3d12/TextureD3D12.cpp @@ -129,7 +129,7 @@ namespace d3d12 { } } - TextureView::TextureView(Device* device, TextureViewBuilder* builder) + TextureView::TextureView(TextureViewBuilder* builder) : TextureViewBase(builder) { srvDesc.Format = D3D12TextureFormat(GetTexture()->GetFormat()); diff --git a/src/backend/d3d12/TextureD3D12.h b/src/backend/d3d12/TextureD3D12.h index 110a353d2f..aa85c9ba6b 100644 --- a/src/backend/d3d12/TextureD3D12.h +++ b/src/backend/d3d12/TextureD3D12.h @@ -42,14 +42,13 @@ namespace d3d12 { class TextureView : public TextureViewBase { public: - TextureView(Device* device, TextureViewBuilder* builder); + TextureView(TextureViewBuilder* builder); const D3D12_SHADER_RESOURCE_VIEW_DESC& GetSRVDescriptor() const; private: D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc; }; - } }