711 {
713
716
718
723
728 return false;
729 }
730
731
732 reader.readUInt();
734 if (!reader.isValid()) {
735 return false;
736 }
737
738 switch (shaderType) {
744 break;
745 }
746
755 errorHandler)) {
756 return false;
757 }
764 errorHandler)) {
765 return false;
766 }
771 break;
772 }
773
774 default: {
775 return false;
776 }
777 }
778
779 pipelineDescriptor.vertexFunction =
780 [precompiledLibs->
fVertexLibrary newFunctionWithName:
@"vertexMain"];
781 pipelineDescriptor.fragmentFunction =
783
784 {
785 TRACE_EVENT0(
"skia.shaders",
"newRenderPipelineStateWithDescriptor");
786 MTLNewRenderPipelineStateCompletionHandler completionHandler =
787 ^(id<MTLRenderPipelineState>
state, NSError*
error) {
789 SkDebugf(
"Error creating pipeline: %s\n",
790 [[
error localizedDescription]
791 cStringUsingEncoding: NSASCIIStringEncoding]);
792 }
793 };
794
795
796 [gpu->
device() newRenderPipelineStateWithDescriptor: pipelineDescriptor
797 completionHandler: completionHandler];
798 }
799
802 return true;
803}
static MTLRenderPipelineDescriptor * read_pipeline_data(SkReadBuffer *reader)
static constexpr SkFourByteTag kMSL_Tag
static constexpr SkFourByteTag kSKSL_Tag
id< MTLLibrary > GrCompileMtlShaderLibrary(const GrMtlGpu *gpu, const std::string &msl, GrContextOptions::ShaderErrorHandler *errorHandler)
static const int kGrShaderTypeCount
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
GrContextOptions::ShaderErrorHandler * getShaderErrorHandler() const
const GrShaderCaps * shaderCaps() const
GrDirectContextPriv priv()
const GrCaps * caps() const
GrDirectContext * getContext()
id< MTLDevice > device() const
const void * data() const
const uint8_t uint32_t uint32_t GError ** error
bool UnpackCachedShaders(SkReadBuffer *reader, std::string shaders[], SkSL::Program::Interface interfaces[], int numInterfaces, ShaderMetadata *meta)
SkFourByteTag GetType(SkReadBuffer *reader)
bool SkSLToMSL(const SkSL::ShaderCaps *caps, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *msl, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)
id< MTLLibrary > fFragmentLibrary
id< MTLLibrary > fVertexLibrary
#define TRACE_EVENT0(category_group, name)