summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-04 20:00:44 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-04 20:00:44 +0000
commit00238732a3be3f1ce24674e0709147bc67e0d42c (patch)
tree5a379f3dd70e7213daa17280f06e7d65b0181eb5 /Graphics/GraphicsEngineVulkan
parentEnabled geometryShader and tessellationShader features by default (diff)
downloadDiligentCore-00238732a3be3f1ce24674e0709147bc67e0d42c.tar.gz
DiligentCore-00238732a3be3f1ce24674e0709147bc67e0d42c.zip
Fixed few issues with 3D texture views in GL and VK
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
index 1695d7eb..253e1300 100644
--- a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp
@@ -604,11 +604,15 @@ VulkanUtilities::ImageViewWrapper TextureVkImpl::CreateImageView(TextureViewDesc
else
{
ImageViewCI.viewType = VK_IMAGE_VIEW_TYPE_3D;
- if (ViewDesc.FirstDepthSlice != 0 || ViewDesc.NumDepthSlices != m_Desc.Depth)
+ Uint32 MipDepth = std::max(m_Desc.Depth >> ViewDesc.MostDetailedMip, 1U);
+ if (ViewDesc.FirstDepthSlice != 0 || ViewDesc.NumDepthSlices != MipDepth)
{
- LOG_ERROR_MESSAGE("3D texture views in Vulkan must address all depth slices.");
+ LOG_ERROR("3D texture view '", (ViewDesc.Name ? ViewDesc.Name : ""), "' (most detailed mip: ", ViewDesc.MostDetailedMip,
+ "; mip levels: ", ViewDesc.NumMipLevels, "; first slice: ", ViewDesc.FirstDepthSlice,
+ "; num depth slices: ", ViewDesc.NumDepthSlices, ") of texture '", m_Desc.Name, "' does not references"
+ " all depth slices (", MipDepth, ") in the mip level. 3D texture views in Vulkan must address all depth slices." );
ViewDesc.FirstDepthSlice = 0;
- ViewDesc.NumDepthSlices = m_Desc.Depth;
+ ViewDesc.NumDepthSlices = MipDepth;
}
}
break;