924 {
925 struct UnpackedKeyData {
926
927 uint32_t fRenderStepID = 0;
928 UniquePaintParamsID fPaintParamsID;
929
930
932 uint32_t fColorSampleCount = 1;
933
935 uint32_t fDSSampleCount = 1;
936
937 Swizzle fWriteSwizzle;
938 } keyData;
939
942
943 const uint32_t* rawKeyData =
key.data();
944
945 keyData.fRenderStepID = rawKeyData[0];
946 keyData.fPaintParamsID = rawKeyData[1] ? UniquePaintParamsID(rawKeyData[1])
947 : UniquePaintParamsID::InvalidID();
948
949 keyData.fDSFormat =
static_cast<MtlPixelFormat>((rawKeyData[2] >> 16) & 0xFFFF);
950 keyData.fDSSampleCount = rawKeyData[2] & 0xFFFF;
951
952 keyData.fColorFormat =
static_cast<MtlPixelFormat>((rawKeyData[3] >> 16) & 0xFFFF);
953 keyData.fColorSampleCount = rawKeyData[3] & 0xFFFF;
954
956
957
958 SkASSERT(keyData.fColorSampleCount == keyData.fDSSampleCount);
959
960 MTLPixelFormat dsFormat = (MTLPixelFormat) keyData.fDSFormat;
964 }
967 }
968
969 MtlTextureInfo mtlInfo(keyData.fColorSampleCount,
971 keyData.fColorFormat,
972 MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget,
973 MTLStorageModePrivate,
974 false);
975 TextureInfo
info(mtlInfo);
976
981 dsFlags,
982 { .0f, .0f, .0f, .0f },
983 keyData.fColorSampleCount > 1,
984 keyData.fWriteSwizzle);
985
986
987 const RenderStep* renderStep = rendererProvider->lookup(keyData.fRenderStepID);
988
989 UniquePaintParamsID paintID = renderStep->performsShading() ? keyData.fPaintParamsID
991
992 *pipelineDesc = GraphicsPipelineDesc(renderStep, paintID);
993
994 return true;
995}
static Swizzle Make(uint16_t key)
static UniquePaintParamsID InvalidID()
unsigned int MtlPixelFormat
static const int kGraphicsPipelineKeyData32Count
static const skgpu::UniqueKey::Domain kGraphicsPipelineDomain
bool MtlFormatIsStencil(MTLPixelFormat format)
bool MtlFormatIsDepth(MTLPixelFormat format)
static RenderPassDesc Make(const Caps *caps, const TextureInfo &targetInfo, LoadOp loadOp, StoreOp storeOp, SkEnumBitMask< DepthStencilFlags > depthStencilFlags, const std::array< float, 4 > &clearColor, bool requiresMSAA, Swizzle writeSwizzle)