summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-11-25 05:07:34 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-11-25 05:07:34 +0000
commit774506fc59bad5c93d450cdf6c21861cd70d34d2 (patch)
tree834dd0f4b89e31a99744db37755f9fe47b52c55e /Graphics/GraphicsEngineD3D11
parentRenamed/moved ITexture::Map() to IDeviceContext::MapTextureSubresource() (diff)
downloadDiligentCore-774506fc59bad5c93d450cdf6c21861cd70d34d2.tar.gz
DiligentCore-774506fc59bad5c93d450cdf6c21861cd70d34d2.zip
Moved ITextureView::GenerateMips() to IDeviceContext::GenerateMips()
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h2
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp7
-rw-r--r--Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp13
4 files changed, 9 insertions, 15 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
index 2daacb70..206af852 100755
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h
@@ -114,6 +114,8 @@ public:
virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice)override final;
+ virtual void GenerateMips(ITextureView* pTextureView)override final;
+
virtual void FinishFrame()override final;
virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)override final;
diff --git a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h
index 4c801b07..f2e57337 100644
--- a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h
@@ -56,8 +56,6 @@ public:
return m_pD3D11View;
}
- void GenerateMips( IDeviceContext *pContext )override final;
-
protected:
/// D3D11 view
CComPtr<ID3D11View> m_pD3D11View;
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 0a933d58..03bf0795 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -1092,6 +1092,13 @@ namespace Diligent
m_pd3d11DeviceContext->Unmap(pTexD3D11->GetD3D11Texture(), Subresource);
}
+ void DeviceContextD3D11Impl::GenerateMips(ITextureView* pTextureView)
+ {
+ TDeviceContextBase::GenerateMips(pTextureView);
+ auto& TexViewD3D11 = *ValidatedCast<TextureViewD3D11Impl>(pTextureView);
+ auto* pd3d11SRV = static_cast<ID3D11ShaderResourceView*>( TexViewD3D11.GetD3D11View() );
+ m_pd3d11DeviceContext->GenerateMips(pd3d11SRV);
+ }
void DeviceContextD3D11Impl::FinishFrame()
{
diff --git a/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp
index d1bece27..dd1638ae 100644
--- a/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp
@@ -46,17 +46,4 @@ TextureViewD3D11Impl::TextureViewD3D11Impl( IReferenceCounters* pRefCounters,
IMPLEMENT_QUERY_INTERFACE( TextureViewD3D11Impl, IID_TextureViewD3D11, TTextureViewBase )
-void TextureViewD3D11Impl::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 *pd3d11Ctx = ValidatedCast<IDeviceContextD3D11>( pContext )->GetD3D11DeviceContext();
- auto *pd3d11SRV = static_cast<ID3D11ShaderResourceView*>( GetD3D11View() );
- pd3d11Ctx->GenerateMips(pd3d11SRV);
-}
-
}