1 /* 2 * Copyright 2017 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrMtlUtil_DEFINED 9 #define GrMtlUtil_DEFINED 10 11 #include "GrTypes.h" 12 13 #import <Metal/Metal.h> 14 15 /** 16 * Returns the Metal texture format for the given GrPixelConfig 17 */ 18 bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format); 19 20 /** 21 * Returns the GrPixelConfig for the given Metal texture format 22 */ 23 GrPixelConfig GrMTLFormatToPixelConfig(MTLPixelFormat format); 24 25 /** 26 * Returns true if the given vulkan texture format is sRGB encoded. 27 * Also provides the non-sRGB version, if there is one. 28 */ 29 bool GrMTLFormatIsSRGB(MTLPixelFormat format, MTLPixelFormat* linearFormat); 30 31 #endif 32