diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-25 05:07:34 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-25 05:07:34 +0000 |
| commit | 774506fc59bad5c93d450cdf6c21861cd70d34d2 (patch) | |
| tree | 834dd0f4b89e31a99744db37755f9fe47b52c55e /Graphics/GraphicsEngineD3D12 | |
| parent | Renamed/moved ITexture::Map() to IDeviceContext::MapTextureSubresource() (diff) | |
| download | DiligentCore-774506fc59bad5c93d450cdf6c21861cd70d34d2.tar.gz DiligentCore-774506fc59bad5c93d450cdf6c21861cd70d34d2.zip | |
Moved ITextureView::GenerateMips() to IDeviceContext::GenerateMips()
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
4 files changed, 4 insertions, 17 deletions
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<RenderDeviceD3D12Impl>(), pTexView, Ctx); + m_MipsGenerator.GenerateMips(m_pDevice.RawPtr<RenderDeviceD3D12Impl>(), ValidatedCast<TextureViewD3D12Impl>(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<DeviceContextD3D12Impl>( pContext ); - pDeviceCtxD3D12->GenerateMips(this); -} - } |
