Expand GetFormatEquivalentToIOSurfaceFormat

Add support for IOSurface formats for:
- RGBA16Float
- RG16Float
- R16Float
- RGB10A2Unorm

Bug: chromium:1241369
Change-Id: I8d3ed2c7575fe651406cb470383f3d4d23fb7aeb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80820
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Christopher Cameron 2022-02-16 20:38:50 +00:00 committed by Dawn LUCI CQ
parent 984ea223f2
commit be72f76c23
1 changed files with 8 additions and 0 deletions

View File

@ -159,6 +159,14 @@ namespace dawn::native::metal {
ResultOrError<wgpu::TextureFormat> GetFormatEquivalentToIOSurfaceFormat(uint32_t format) {
switch (format) {
case kCVPixelFormatType_64RGBAHalf:
return wgpu::TextureFormat::RGBA16Float;
case kCVPixelFormatType_TwoComponent16Half:
return wgpu::TextureFormat::RG16Float;
case kCVPixelFormatType_OneComponent16Half:
return wgpu::TextureFormat::R16Float;
case kCVPixelFormatType_ARGB2101010LEPacked:
return wgpu::TextureFormat::RGB10A2Unorm;
case kCVPixelFormatType_32RGBA:
return wgpu::TextureFormat::RGBA8Unorm;
case kCVPixelFormatType_32BGRA: