summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
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/GraphicsEngineVulkan
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/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h5
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp12
4 files changed, 7 insertions, 18 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
index 2f743864..49dba0ae 100644
--- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
@@ -180,10 +180,7 @@ public:
Uint32 Slice,
const Box& DstBox);
- void GenerateMips(class TextureViewVkImpl& TexView)
- {
- m_GenerateMipsHelper->GenerateMips(TexView, *this, *m_GenerateMipsSRB);
- }
+ virtual void GenerateMips(ITextureView* pTexView)override final;
Uint32 GetContextId()const{return m_ContextId;}
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
index 467a2241..9402538e 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
@@ -52,8 +52,6 @@ public:
virtual void QueryInterface( const Diligent::INTERFACE_ID& IID, IObject** ppInterface )override;
- void GenerateMips( IDeviceContext* pContext )override;
-
VkImageView GetVulkanImageView()const override final{return m_ImageView;}
protected:
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 6b2f4e48..da532719 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -1502,6 +1502,12 @@ namespace Diligent
Slice);
}
+ void DeviceContextVkImpl::GenerateMips(ITextureView* pTexView)
+ {
+ TDeviceContextBase::GenerateMips(pTexView);
+ m_GenerateMipsHelper->GenerateMips(*ValidatedCast<TextureViewVkImpl>(pTexView), *this, *m_GenerateMipsSRB);
+ }
+
void DeviceContextVkImpl::CopyBufferToTexture(VkBuffer vkBuffer,
Uint32 BufferOffset,
Uint32 BufferRowStrideInTexels,
diff --git a/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp
index 3ec73fe1..0f441953 100644
--- a/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/TextureViewVkImpl.cpp
@@ -49,16 +49,4 @@ TextureViewVkImpl::~TextureViewVkImpl()
IMPLEMENT_QUERY_INTERFACE( TextureViewVkImpl, IID_TextureViewVk, TTextureViewBase )
-void TextureViewVkImpl::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* pDeviceCtxVk = ValidatedCast<DeviceContextVkImpl>( pContext );
- pDeviceCtxVk->GenerateMips(*this);
-}
-
}