diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-02-24 13:22:43 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 11:22:43 -0800 |
| commit | edcb2f0b8216f964f10ba60d96b8070fdc1ae257 (patch) | |
| tree | b12a67a15fa4c520f8e5b60cc405264019c83538 /tools/gfx/metal/metal-device.cpp | |
| parent | 4e897189e301e44cba71906e6c5e561b7cd07a62 (diff) | |
Add implementation for 'uploadTextureData' in metal (#6443)
Close issue: #6386.
- Implement uploadTextureData in metal
- Fix a bug in 'copyTextureToBuffer' in metal
The last parameter for Metal::copyFromTexture is the
'destinationBytesPerImage', but previous implementation
fill in the destination size which is wrong in 3-D texture.
Diffstat (limited to 'tools/gfx/metal/metal-device.cpp')
| -rw-r--r-- | tools/gfx/metal/metal-device.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/gfx/metal/metal-device.cpp b/tools/gfx/metal/metal-device.cpp index 34b00d0dd..90904e0e2 100644 --- a/tools/gfx/metal/metal-device.cpp +++ b/tools/gfx/metal/metal-device.cpp @@ -331,7 +331,9 @@ Result DeviceImpl::getTextureAllocationInfo( FormatInfo formatInfo; gfxGetFormatInfo(desc.format, &formatInfo); MTL::PixelFormat pixelFormat = MetalUtil::translatePixelFormat(desc.format); - Size alignment = m_device->minimumLinearTextureAlignmentForPixelFormat(pixelFormat); + bool isCompressed = gfxIsCompressedFormat(desc.format); + Size alignment = + isCompressed ? 1 : m_device->minimumLinearTextureAlignmentForPixelFormat(pixelFormat); Size size = 0; ITextureResource::Extents extents = desc.size; extents.width = extents.width ? extents.width : 1; |
