Renderer/Texture: Allow to keep the texture format in TextureViewInfo

This commit is contained in:
SirLynix
2023-11-26 21:29:49 +01:00
parent 00935efbe0
commit 962a2e71c7
4 changed files with 5 additions and 5 deletions

View File

@@ -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();

View File

@@ -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()));