From 774506fc59bad5c93d450cdf6c21861cd70d34d2 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 24 Nov 2018 21:07:34 -0800 Subject: Moved ITextureView::GenerateMips() to IDeviceContext::GenerateMips() --- .../GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h | 2 -- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 5 +++-- Graphics/GraphicsEngineD3D12/src/TextureViewD3D12Impl.cpp | 12 ------------ 4 files changed, 4 insertions(+), 17 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h index 893545c9..0af2b72a 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h @@ -158,7 +158,7 @@ public: Uint32 DstSubResIndex, const Box& DstBox); - void GenerateMips(class TextureViewD3D12Impl *pTexView); + virtual void GenerateMips(ITextureView *pTexView)override final; D3D12DynamicAllocation AllocateDynamicSpace(size_t NumBytes, size_t Alignment); diff --git a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h index 444c32c6..9da7fbdf 100644 --- a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h @@ -51,8 +51,6 @@ public: virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override; - void GenerateMips( IDeviceContext *pContext )override; - virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle()override{return m_Descriptor.GetCpuHandle();} protected: diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 8bb084f9..629ed589 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -1284,10 +1284,11 @@ namespace Diligent } - void DeviceContextD3D12Impl::GenerateMips(TextureViewD3D12Impl* pTexView) + void DeviceContextD3D12Impl::GenerateMips(ITextureView* pTexView) { + TDeviceContextBase::GenerateMips(pTexView); auto& Ctx = GetCmdContext(); - m_MipsGenerator.GenerateMips(m_pDevice.RawPtr(), pTexView, Ctx); + m_MipsGenerator.GenerateMips(m_pDevice.RawPtr(), ValidatedCast(pTexView), Ctx); ++m_State.NumCommands; } diff --git a/Graphics/GraphicsEngineD3D12/src/TextureViewD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/TextureViewD3D12Impl.cpp index aa11f98d..b467a415 100644 --- a/Graphics/GraphicsEngineD3D12/src/TextureViewD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/TextureViewD3D12Impl.cpp @@ -46,16 +46,4 @@ TextureViewD3D12Impl::TextureViewD3D12Impl( IReferenceCounters* pRefCount IMPLEMENT_QUERY_INTERFACE( TextureViewD3D12Impl, IID_TextureViewD3D12, TTextureViewBase ) -void TextureViewD3D12Impl::GenerateMips( IDeviceContext *pContext ) -{ - VERIFY( m_Desc.ViewType == TEXTURE_VIEW_SHADER_RESOURCE, "GenerateMips() is allowed for shader resource views only, ", GetTexViewTypeLiteralName(m_Desc.ViewType), " is not allowed." ); - if( m_Desc.ViewType != TEXTURE_VIEW_SHADER_RESOURCE ) - { - LOG_ERROR("GenerateMips() is allowed for shader resource views only, ", GetTexViewTypeLiteralName(m_Desc.ViewType), " is not allowed."); - return; - } - auto *pDeviceCtxD3D12 = ValidatedCast( pContext ); - pDeviceCtxD3D12->GenerateMips(this); -} - } -- cgit v1.2.3