Skip to content

Commit 1e22f53

Browse files
committed
Fix texture view create issue in metal
In newTextureView, levelRange should represent the mipmap level range, while sliceRange should represent the texture layer range for texture array. But the implement inverse those two wrongly.
1 parent 84130b8 commit 1e22f53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/gfx/metal/metal-device.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,8 @@ Result DeviceImpl::createTextureView(
653653
MTL::PixelFormat pixelFormat = desc.format == Format::Unknown
654654
? textureImpl->m_pixelFormat
655655
: MetalUtil::translatePixelFormat(desc.format);
656-
NS::Range levelRange(sr.baseArrayLayer, sr.layerCount);
657-
NS::Range sliceRange(sr.mipLevel, sr.mipLevelCount);
656+
NS::Range sliceRange(sr.baseArrayLayer, sr.layerCount);
657+
NS::Range levelRange(sr.mipLevel, sr.mipLevelCount);
658658

659659
viewImpl->m_textureView = NS::TransferPtr(textureImpl->m_texture->newTextureView(
660660
pixelFormat,

0 commit comments

Comments
 (0)