Renderer/Texture: Allow to keep the texture format in TextureViewInfo
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Nz
|
||||
struct TextureViewInfo
|
||||
{
|
||||
ImageType viewType;
|
||||
PixelFormat reinterpretFormat;
|
||||
PixelFormat reinterpretFormat = PixelFormat::Undefined;
|
||||
UInt8 baseMipLevel = 0;
|
||||
UInt8 levelCount = 1;
|
||||
unsigned int baseArrayLayer = 0;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Nz
|
||||
inline TextureInfo Texture::ApplyView(TextureInfo textureInfo, const TextureViewInfo& viewInfo)
|
||||
{
|
||||
textureInfo.type = viewInfo.viewType;
|
||||
textureInfo.pixelFormat = viewInfo.reinterpretFormat;
|
||||
textureInfo.pixelFormat = (viewInfo.reinterpretFormat != PixelFormat::Undefined) ? viewInfo.reinterpretFormat : textureInfo.pixelFormat;
|
||||
textureInfo.width = GetLevelSize(textureInfo.width, viewInfo.baseMipLevel);
|
||||
textureInfo.height = GetLevelSize(textureInfo.height, viewInfo.baseMipLevel);
|
||||
textureInfo.depth = GetLevelSize(textureInfo.depth, viewInfo.baseMipLevel);
|
||||
|
||||
Reference in New Issue
Block a user