Flutter Engine
The Flutter Engine
|
#include "src/gpu/ganesh/mtl/GrMtlUtil.h"
#import <Metal/Metal.h>
#include "include/core/SkTextureCompressionType.h"
#include "include/gpu/GrBackendSurface.h"
#include "include/private/base/SkMutex.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/ganesh/GrSurface.h"
#include "src/gpu/ganesh/mtl/GrMtlGpu.h"
#include "src/gpu/ganesh/mtl/GrMtlRenderTarget.h"
#include "src/gpu/ganesh/mtl/GrMtlTexture.h"
Go to the source code of this file.
Classes | |
class | MtlCompileResult |
Functions | |
GR_NORETAIN_BEGIN NSError * | GrCreateMtlError (NSString *description, GrMtlErrorCode errorCode) |
MTLTextureDescriptor * | GrGetMTLTextureDescriptor (id< MTLTexture > mtlTexture) |
id< MTLLibrary > | GrCompileMtlShaderLibrary (const GrMtlGpu *gpu, const std::string &msl, GrContextOptions::ShaderErrorHandler *errorHandler) |
void | GrPrecompileMtlShaderLibrary (const GrMtlGpu *gpu, const std::string &msl) |
id< MTLLibrary > | GrMtlNewLibraryWithSource (id< MTLDevice > device, NSString *mslCode, MTLCompileOptions *options, NSError **error) |
id< MTLRenderPipelineState > | GrMtlNewRenderPipelineStateWithDescriptor (id< MTLDevice > device, MTLRenderPipelineDescriptor *pipelineDescriptor, NSError **error) |
id< MTLTexture > | GrGetMTLTextureFromSurface (GrSurface *surface) |
GrMTLPixelFormat | GrGetMTLPixelFormatFromMtlTextureInfo (const GrMtlTextureInfo &info) |
GrColorFormatDesc | GrMtlFormatDesc (MTLPixelFormat mtlFormat) |
SkTextureCompressionType | GrMtlFormatToCompressionType (MTLPixelFormat format) |
int | GrMtlTextureInfoSampleCount (const GrMtlTextureInfo &info) |
int | GrMtlFormatStencilBits (MTLPixelFormat format) |
id< MTLLibrary > GrCompileMtlShaderLibrary | ( | const GrMtlGpu * | gpu, |
const std::string & | msl, | ||
GrContextOptions::ShaderErrorHandler * | errorHandler | ||
) |
Returns a compiled MTLLibrary created from MSL code
Definition at line 52 of file GrMtlUtil.mm.
GR_NORETAIN_BEGIN NSError * GrCreateMtlError | ( | NSString * | description, |
GrMtlErrorCode | errorCode | ||
) |
Definition at line 28 of file GrMtlUtil.mm.
GrMTLPixelFormat GrGetMTLPixelFormatFromMtlTextureInfo | ( | const GrMtlTextureInfo & | info | ) |
Definition at line 228 of file GrMtlUtil.mm.
MTLTextureDescriptor * GrGetMTLTextureDescriptor | ( | id< MTLTexture > | mtlTexture | ) |
Returns a MTLTextureDescriptor which describes the MTLTexture. Useful when creating a duplicate MTLTexture without the same storage allocation.
Definition at line 36 of file GrMtlUtil.mm.
Returns a MTLTexture corresponding to the GrSurface.
Definition at line 201 of file GrMtlUtil.mm.
GrColorFormatDesc GrMtlFormatDesc | ( | MTLPixelFormat | mtlFormat | ) |
Definition at line 233 of file GrMtlUtil.mm.
int GrMtlFormatStencilBits | ( | MTLPixelFormat | format | ) |
Definition at line 302 of file GrMtlUtil.mm.
SkTextureCompressionType GrMtlFormatToCompressionType | ( | MTLPixelFormat | format | ) |
Maps a MTLPixelFormat into the CompressionType enum if applicable.
Definition at line 282 of file GrMtlUtil.mm.
id< MTLLibrary > GrMtlNewLibraryWithSource | ( | id< MTLDevice > | device, |
NSString * | mslCode, | ||
MTLCompileOptions * | options, | ||
NSError ** | error | ||
) |
Replacement for newLibraryWithSource:options:error that has a timeout.
Definition at line 130 of file GrMtlUtil.mm.
id< MTLRenderPipelineState > GrMtlNewRenderPipelineStateWithDescriptor | ( | id< MTLDevice > | device, |
MTLRenderPipelineDescriptor * | pipelineDescriptor, | ||
NSError ** | error | ||
) |
Replacement for newRenderPipelineStateWithDescriptor:error that has a timeout.
Definition at line 166 of file GrMtlUtil.mm.
int GrMtlTextureInfoSampleCount | ( | const GrMtlTextureInfo & | info | ) |
Gets the sample count of a texture held by GrMtlTextureInfo or zero if the texture is nil.
Definition at line 294 of file GrMtlUtil.mm.
void GrPrecompileMtlShaderLibrary | ( | const GrMtlGpu * | gpu, |
const std::string & | msl | ||
) |
Attempts to compile an MSL shader asynchronously. We are not concerned about the result, which will be cached in the Apple shader cache.
Definition at line 94 of file GrMtlUtil.mm.