Remove unused Device member in D3D12 TextureView and BufferView

This commit is contained in:
Austin Eng 2017-06-30 11:55:54 -04:00 committed by Austin Eng
parent beb76d06db
commit 6774bce06e
5 changed files with 7 additions and 9 deletions

View File

@ -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();

View File

@ -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;
};

View File

@ -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() {

View File

@ -129,7 +129,7 @@ namespace d3d12 {
}
}
TextureView::TextureView(Device* device, TextureViewBuilder* builder)
TextureView::TextureView(TextureViewBuilder* builder)
: TextureViewBase(builder) {
srvDesc.Format = D3D12TextureFormat(GetTexture()->GetFormat());

View File

@ -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;
};
}
}