Renderer/Texture: Allow to keep the texture format in TextureViewInfo
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Nz
|
||||
{
|
||||
if (m_texture.Create(*m_parentTexture->m_texture.GetDevice()))
|
||||
{
|
||||
auto format = DescribeTextureFormat(viewInfo.reinterpretFormat);
|
||||
auto format = DescribeTextureFormat(m_textureInfo.pixelFormat);
|
||||
|
||||
context.ClearErrorStack();
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace Nz
|
||||
|
||||
m_viewInfo = viewInfo;
|
||||
m_subresourceRange = {
|
||||
ToVulkan(PixelFormatInfo::GetContent(viewInfo.reinterpretFormat)),
|
||||
ToVulkan(PixelFormatInfo::GetContent(m_textureViewInfo.pixelFormat)),
|
||||
viewInfo.baseMipLevel,
|
||||
viewInfo.levelCount,
|
||||
viewInfo.baseArrayLayer,
|
||||
@@ -290,7 +290,7 @@ namespace Nz
|
||||
break;
|
||||
}
|
||||
|
||||
InitViewForFormat(viewInfo.reinterpretFormat, createInfoView);
|
||||
InitViewForFormat(m_textureViewInfo.pixelFormat, createInfoView);
|
||||
|
||||
if (!m_imageView.Create(m_device, createInfoView))
|
||||
throw std::runtime_error("Failed to create image view: " + TranslateVulkanError(m_imageView.GetLastErrorCode()));
|
||||
|
||||
Reference in New Issue
Block a user