diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-02-20 18:59:49 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-20 16:59:49 -0800 |
| commit | 4d286aab2ec23c081f23846f5dfdb30b1c05728b (patch) | |
| tree | 98be13f2d72d90d69901d463a94c292d562cee67 /tools/gfx | |
| parent | 19867ffca6dca7995c799354081219c9e76f13d1 (diff) | |
Metal fix (#6413)
Partially fix #6378
* Fix invalid access mode for texture_buffer
* 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.
Diffstat (limited to 'tools/gfx')
| -rw-r--r-- | tools/gfx/metal/metal-device.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/gfx/metal/metal-device.cpp b/tools/gfx/metal/metal-device.cpp index e20d3ea3b..34b00d0dd 100644 --- a/tools/gfx/metal/metal-device.cpp +++ b/tools/gfx/metal/metal-device.cpp @@ -653,8 +653,8 @@ Result DeviceImpl::createTextureView( MTL::PixelFormat pixelFormat = desc.format == Format::Unknown ? textureImpl->m_pixelFormat : MetalUtil::translatePixelFormat(desc.format); - NS::Range levelRange(sr.baseArrayLayer, sr.layerCount); - NS::Range sliceRange(sr.mipLevel, sr.mipLevelCount); + NS::Range sliceRange(sr.baseArrayLayer, sr.layerCount); + NS::Range levelRange(sr.mipLevel, sr.mipLevelCount); viewImpl->m_textureView = NS::TransferPtr(textureImpl->m_texture->newTextureView( pixelFormat, |
