45#include <initializer_list>
51#if defined(SK_BUILD_FOR_IOS)
52#include <TargetConditionals.h>
60 fPackFlipYSupport =
false;
61 fTextureUsageSupport =
false;
62 fImagingSupport =
false;
63 fVertexArrayObjectSupport =
false;
64 fDebugSupport =
false;
65 fES2CompatibilitySupport =
false;
66 fDrawRangeElementsSupport =
false;
67 fBaseVertexBaseInstanceSupport =
false;
68 fIsCoreProfile =
false;
69 fBindFragDataLocationSupport =
false;
70 fRectangleTextureSupport =
false;
71 fBindUniformLocationSupport =
false;
72 fMipmapLevelControlSupport =
false;
73 fMipmapLodControlSupport =
false;
74 fDoManualMipmapping =
false;
75 fClearToBoundaryValuesIsBroken =
false;
76 fClearTextureSupport =
false;
77 fDrawArraysBaseVertexIsBroken =
false;
78 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO =
false;
79 fUseDrawInsteadOfAllRenderTargetWrites =
false;
80 fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines =
false;
81 fDontSetBaseOrMaxLevelForExternalTextures =
false;
82 fNeverDisableColorWrites =
false;
83 fMustSetAnyTexParameterToEnableMipmapping =
false;
84 fAllowBGRA8CopyTexSubImage =
false;
85 fAllowSRGBCopyTexSubImage =
false;
86 fDisallowDynamicMSAA =
false;
87 fMustResetBlendFuncBetweenDualSourceAndDisable =
false;
88 fBindTexture0WhenChangingTextureFBOMultisampleCount =
false;
89 fRebindColorAttachmentAfterCheckFramebufferStatus =
false;
90 fFlushBeforeWritePixels =
false;
91 fDisableScalingCopyAsDraws =
false;
92 fPadRG88TransferAlignment =
false;
93 fProgramBinarySupport =
false;
94 fProgramParameterSupport =
false;
95 fSamplerObjectSupport =
false;
96 fUseSamplerObjects =
false;
97 fTextureSwizzleSupport =
false;
98 fTiledRenderingSupport =
false;
99 fFenceSyncSupport =
false;
100 fFBFetchRequiresEnablePerSample =
false;
101 fSRGBWriteControl =
false;
102 fSkipErrorChecks =
false;
106 this->init(contextOptions, ctxInfo, glInterface);
125#if defined(GR_TEST_UTILS)
128 this->setDeviceName(
reinterpret_cast<const char*
>(deviceName));
134 fMaxFragmentUniformVectors =
max / 4;
142 &fMaxFragmentUniformVectors);
146 fMaxFragmentUniformVectors = std::min(fMaxFragmentUniformVectors, 32);
153 fPackFlipYSupport =
false;
160 ctxInfo.
hasExtension(
"GL_ANGLE_pack_reverse_row_order");
206 }
else if (ctxInfo.
hasExtension(
"GL_EXT_discard_framebuffer")) {
240 fDebugSupport =
true;
244 fDebugSupport =
false;
248 fES2CompatibilitySupport = ctxInfo.
hasExtension(
"GL_ARB_ES2_compatibility");
251 fES2CompatibilitySupport =
true;
253 fES2CompatibilitySupport =
true;
257 fClientCanDisableMultisample =
true;
259 fClientCanDisableMultisample = ctxInfo.
hasExtension(
"GL_EXT_multisample_compatibility");
261 fClientCanDisableMultisample =
false;
284 fBindFragDataLocationSupport =
true;
288 fBindFragDataLocationSupport =
true;
291 fBindFragDataLocationSupport =
false;
294 fBindUniformLocationSupport = ctxInfo.
hasExtension(
"GL_CHROMIUM_bind_uniform_location");
299 fRectangleTextureSupport =
true;
302 fRectangleTextureSupport = ctxInfo.
hasExtension(
"GL_ARB_texture_rectangle") ||
305 fRectangleTextureSupport =
false;
328 fTextureSwizzleSupport =
true;
332 fTextureSwizzleSupport =
true;
335 fTextureSwizzleSupport =
false;
339 fMipmapLevelControlSupport =
true;
340 fMipmapLodControlSupport =
true;
343 fMipmapLevelControlSupport =
true;
344 fMipmapLodControlSupport =
true;
347 fMipmapLevelControlSupport =
false;
348 fMipmapLodControlSupport =
false;
365 fClearTextureSupport = ctxInfo.
hasExtension(
"GL_EXT_clear_texture");
367 fClearTextureSupport =
false;
370#if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
381 fSRGBWriteControl = ctxInfo.
hasExtension(
"GL_EXT_sRGB_write_control");
387 fSkipErrorChecks =
true;
394 if (!ctxInfo.
hasExtension(
"GL_EXT_protected_textures")) {
408 this->initGLSL(ctxInfo, gli);
458 if (ctxInfo.
hasExtension(
"GL_NV_conservative_raster")) {
479 static const uint8_t kMaxSaneSamplers = 32;
504 this->initFSAASupport(contextOptions, ctxInfo, gli);
505 this->initStencilSupport(ctxInfo);
513 fBlitFramebufferFlags = 0;
521 }
else if (ctxInfo.
hasExtension(
"GL_CHROMIUM_framebuffer_multisample") ||
533 this->initBlendEqationSupport(ctxInfo);
619 ctxInfo.
hasExtension(
"GL_ARB_texture_filter_anisotropic") ||
620 ctxInfo.
hasExtension(
"GL_EXT_texture_filter_anisotropic");
669#ifdef SK_BUILD_FOR_WIN
712 if (fBaseVertexBaseInstanceSupport) {
721 if (ctxInfo.
hasExtension(
"GL_ANGLE_base_vertex_base_instance")) {
722 fBaseVertexBaseInstanceSupport =
true;
728 fBaseVertexBaseInstanceSupport = ctxInfo.
hasExtension(
"GL_EXT_base_instance");
739 "WEBGL_draw_instanced_base_vertex_base_instance");
740 if (fBaseVertexBaseInstanceSupport && ctxInfo.
hasExtension(
741 "GL_WEBGL_multi_draw_instanced_base_vertex_base_instance")) {
752 fBaseVertexBaseInstanceSupport =
false;
778 fFenceSyncSupport =
true;
803 fProgramBinarySupport =
808 if (fProgramBinarySupport) {
814 reinterpret_cast<GrGLint*
>(fProgramBinaryFormats.
data()));
816 fProgramBinarySupport =
false;
820 fSamplerObjectSupport =
828 fUseSamplerObjects = fSamplerObjectSupport;
831 fTiledRenderingSupport = ctxInfo.
hasExtension(
"GL_QCOM_tiled_rendering");
838#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
847 FormatWorkarounds formatWorkarounds;
850 this->applyDriverCorrectnessWorkarounds(ctxInfo, contextOptions, gli,
shaderCaps,
855 this->initFormatTable(ctxInfo, gli, formatWorkarounds);
864 bool isCoreProfile) {
866 switch (generation) {
868 return "#version 110\n";
870 return "#version 130\n";
872 return "#version 140\n";
875 return "#version 150\n";
877 return "#version 150 compatibility\n";
881 return "#version 330\n";
883 return "#version 330 compatibility\n";
887 return "#version 400\n";
889 return "#version 400 compatibility\n";
893 return "#version 420\n";
895 return "#version 420 compatibility\n";
901 switch (generation) {
903 return "#version 100\n";
905 return "#version 300 es\n";
907 return "#version 310 es\n";
909 return "#version 320 es\n";
914 return "<no version>";
930 if (range[0] < 127 || range[1] < 127 || bits < 23) {
950 if (ctxInfo.
hasExtension(
"GL_EXT_shader_framebuffer_fetch")) {
955 fFBFetchRequiresEnablePerSample =
false;
956 }
else if (ctxInfo.
hasExtension(
"GL_NV_shader_framebuffer_fetch")) {
962 fFBFetchRequiresEnablePerSample =
false;
963 }
else if (ctxInfo.
hasExtension(
"GL_ARM_shader_framebuffer_fetch")) {
969 fFBFetchRequiresEnablePerSample =
true;
973 if (ctxInfo.
hasExtension(
"GL_EXT_shader_framebuffer_fetch")) {
978 fFBFetchRequiresEnablePerSample =
false;
1009 if (ctxInfo.
hasExtension(
"GL_NV_shader_noperspective_interpolation") &&
1013 "GL_NV_shader_noperspective_interpolation";
1022 }
else if (ctxInfo.
hasExtension(
"GL_OES_sample_variables")) {
1042 if (ctxInfo.
hasExtension(
"GL_OES_EGL_image_external")) {
1046 }
else if (ctxInfo.
hasExtension(
"GL_OES_EGL_image_external_essl3") ||
1047 ctxInfo.
hasExtension(
"OES_EGL_image_external_essl3")) {
1104 }
else if (ctxInfo.
hasExtension(
"GL_EXT_framebuffer_multisample") &&
1111 if (ctxInfo.
hasExtension(
"GL_EXT_multisampled_render_to_texture")) {
1114 }
else if (ctxInfo.
hasExtension(
"GL_IMG_multisampled_render_to_texture")) {
1119 }
else if (ctxInfo.
hasExtension(
"GL_CHROMIUM_framebuffer_multisample")) {
1121 }
else if (ctxInfo.
hasExtension(
"GL_ANGLE_framebuffer_multisample")) {
1123 }
else if (ctxInfo.
hasExtension(
"GL_APPLE_framebuffer_multisample")) {
1136void GrGLCaps::initBlendEqationSupport(
const GrGLContextInfo& ctxInfo) {
1139 bool layoutQualifierSupport =
false;
1142 layoutQualifierSupport =
true;
1147 if (ctxInfo.
hasExtension(
"GL_NV_blend_equation_advanced_coherent")) {
1150 }
else if (ctxInfo.
hasExtension(
"GL_KHR_blend_equation_advanced_coherent") &&
1151 layoutQualifierSupport) {
1154 }
else if (ctxInfo.
hasExtension(
"GL_NV_blend_equation_advanced")) {
1157 }
else if (ctxInfo.
hasExtension(
"GL_KHR_blend_equation_advanced") && layoutQualifierSupport) {
1173 bool supportsPackedDS =
1183 if (supportsPackedDS) {
1203#ifdef SK_ENABLE_DUMP_GPU
1207 switch (multiDrawType) {
1223 for (
int i = 0; i < fStencilFormats.
size(); ++i) {
1232 auto msfboStr = [&] {
1233 switch (fMSFBOType) {
1243 auto invalidateFBTypeStr = [&] {
1244 switch (fInvalidateFBType) {
1252 auto invalidateBufferTypeStr = [&] {
1253 switch (fInvalidateBufferType) {
1261 auto mapBufferTypeStr = [&] {
1262 switch (fMapBufferType) {
1271 writer->
appendBool(
"Core Profile", fIsCoreProfile);
1273 writer->
appendCString(
"Invalidate FB Type", invalidateFBTypeStr());
1274 writer->
appendCString(
"Invalidate Buffer Type", invalidateBufferTypeStr());
1275 writer->
appendCString(
"Map Buffer Type", mapBufferTypeStr());
1276 writer->
appendCString(
"Multi Draw Type", multi_draw_type_name(fMultiDrawType));
1277 writer->
appendS32(
"Max FS Uniform Vectors", fMaxFragmentUniformVectors);
1278 writer->
appendBool(
"Pack Flip Y support", fPackFlipYSupport);
1280 writer->
appendBool(
"Texture Usage support", fTextureUsageSupport);
1281 writer->
appendBool(
"GL_ARB_imaging support", fImagingSupport);
1282 writer->
appendBool(
"Vertex array object support", fVertexArrayObjectSupport);
1283 writer->
appendBool(
"Debug support", fDebugSupport);
1284 writer->
appendBool(
"ES2 compatibility support", fES2CompatibilitySupport);
1285 writer->
appendBool(
"drawRangeElements support", fDrawRangeElementsSupport);
1286 writer->
appendBool(
"Base (vertex base) instance support", fBaseVertexBaseInstanceSupport);
1287 writer->
appendBool(
"Bind uniform location support", fBindUniformLocationSupport);
1288 writer->
appendBool(
"Rectangle texture support", fRectangleTextureSupport);
1289 writer->
appendBool(
"Mipmap LOD control support", fMipmapLodControlSupport);
1290 writer->
appendBool(
"Mipmap level control support", fMipmapLevelControlSupport);
1291 writer->
appendBool(
"Clear texture support", fClearTextureSupport);
1292 writer->
appendBool(
"Program binary support", fProgramBinarySupport);
1293 writer->
appendBool(
"Program parameters support", fProgramParameterSupport);
1294 writer->
appendBool(
"Sampler object support", fSamplerObjectSupport);
1295 writer->
appendBool(
"Using sampler objects", fUseSamplerObjects);
1296 writer->
appendBool(
"Texture swizzle support", fTextureSwizzleSupport);
1297 writer->
appendBool(
"Tiled rendering support", fTiledRenderingSupport);
1298 writer->
appendBool(
"Fence sync support", fFenceSyncSupport);
1299 writer->
appendBool(
"FB fetch requires enable per sample", fFBFetchRequiresEnablePerSample);
1300 writer->
appendBool(
"sRGB Write Control", fSRGBWriteControl);
1302 writer->
appendBool(
"Intermediate texture for partial updates of unorm textures ever bound to FBOs",
1303 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO);
1304 writer->
appendBool(
"Intermediate texture for all updates of textures bound to FBOs",
1305 fUseDrawInsteadOfAllRenderTargetWrites);
1306 writer->
appendBool(
"Max instances per draw without crashing (or zero)",
1307 fMaxInstancesPerDrawWithoutCrashing);
1314 writer->
appendHexU32(
"f_type", (uint32_t)fFormatTable[i].fFormatType);
1315 writer->
appendHexU32(
"c_internal", fFormatTable[i].fCompressedInternalFormat);
1316 writer->
appendHexU32(
"i_for_teximage", fFormatTable[i].fInternalFormatForTexImageOrStorage);
1317 writer->
appendHexU32(
"i_for_renderbuffer", fFormatTable[i].fInternalFormatForRenderbuffer);
1318 writer->
appendHexU32(
"default_ex_format", fFormatTable[i].fDefaultExternalFormat);
1319 writer->
appendHexU32(
"default_ex_type", fFormatTable[i].fDefaultExternalType);
1320 writer->
appendHexU32(
"default_color_type", (uint32_t)fFormatTable[i].fDefaultColorType);
1323 for (
int j = 0; j < fFormatTable[i].fColorTypeInfoCount; ++j) {
1324 const auto& ctInfo = fFormatTable[i].fColorTypeInfos[j];
1326 writer->
appendHexU32(
"colorType", (uint32_t)ctInfo.fColorType);
1330 for (
int k = 0; k < ctInfo.fExternalIOFormatCount; ++k) {
1331 const auto& ioInfo = ctInfo.fExternalIOFormats[k];
1333 writer->
appendHexU32(
"colorType", (uint32_t)ioInfo.fColorType);
1335 writer->
appendHexU32(
"ex_teximage", ioInfo.fExternalTexImageFormat);
1336 writer->
appendHexU32(
"ex_read", ioInfo.fExternalReadFormat);
1355 const auto&
info = this->getFormatInfo(surfaceFormat);
1356 *externalType =
info.fDefaultExternalType;
1357 *externalFormat =
info.fDefaultExternalFormat;
1364 const auto&
info = this->getFormatInfo(
format);
1365 *externalType =
info.fDefaultExternalType;
1366 *externalFormat =
info.fDefaultExternalFormat;
1375 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType,
1376 kTexImage_ExternalFormatUsage, externalFormat, externalType);
1382 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType,
1383 kReadPixels_ExternalFormatUsage, externalFormat, externalType);
1389 SkASSERT(externalFormat && externalType);
1390 *externalFormat = this->getFormatInfo(surfaceFormat).externalFormat(
1391 surfaceColorType, memoryColorType,
usage);
1392 *externalType = this->getFormatInfo(surfaceFormat).externalType(
1393 surfaceColorType, memoryColorType);
1398 this->getFormatInfo(
format).fStencilFormatIndex =
1399 index < 0 ? FormatInfo::kUnsupported_StencilFormatIndex : index;
1405 fColorTypeToFormatTable[idx] =
format;
1409 const FormatWorkarounds& formatWorkarounds) {
1415 uint32_t nonMSAARenderFlags = FormatInfo::kFBOColorAttachment_Flag;
1416 uint32_t msaaRenderFlags = nonMSAARenderFlags;
1418 msaaRenderFlags |= FormatInfo::kFBOColorAttachmentWithMSAA_Flag;
1421 bool texStorageSupported =
false;
1434 texStorageSupported =
false;
1437 if (formatWorkarounds.fDisableTexStorage) {
1438 texStorageSupported =
false;
1443 bool texImageSupportsSizedInternalFormat =
1447 uint32_t fpRenderFlags = (
GR_IS_GR_GL(standard)) ? msaaRenderFlags : nonMSAARenderFlags;
1464 info.fFormatType = FormatType::kNormalizedFixedPoint;
1469 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1471 info.fFlags |= msaaRenderFlags;
1475 info.fFlags |= msaaRenderFlags;
1478 info.fFlags |= msaaRenderFlags;
1481 if (texStorageSupported) {
1482 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1485 info.fInternalFormatForTexImageOrStorage =
1489 bool supportsBGRAColorType =
GR_IS_GR_GL(standard) &&
1491 info.fColorTypeInfoCount = supportsBGRAColorType ? 3 : 2;
1492 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1496 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1498 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1502 ctInfo.fExternalIOFormatCount = 2;
1503 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1504 ctInfo.fExternalIOFormatCount);
1508 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1511 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
1516 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1519 ioFormat.fExternalTexImageFormat = 0;
1520 ioFormat.fExternalReadFormat =
1521 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
1523 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1528 if (supportsBGRAColorType) {
1529 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1531 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1535 ctInfo.fExternalIOFormatCount = 2;
1536 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1537 ctInfo.fExternalIOFormatCount);
1541 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1544 ioFormat.fExternalTexImageFormat =
GR_GL_BGRA;
1545 ioFormat.fExternalReadFormat =
1546 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
1548 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1553 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1556 ioFormat.fExternalTexImageFormat = 0;
1563 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1565 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1569 ctInfo.fExternalIOFormatCount = 1;
1570 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1571 ctInfo.fExternalIOFormatCount);
1575 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1578 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
1587 info.fFormatType = FormatType::kNormalizedFixedPoint;
1592 bool r8Support =
false;
1600 if (formatWorkarounds.fDisallowR8ForPowerVRSGX54x) {
1605 info.fFlags |= FormatInfo::kTexturable_Flag
1606 | FormatInfo::kTransfers_Flag
1610 if (texStorageSupported) {
1611 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1614 info.fInternalFormatForTexImageOrStorage =
1619 info.fColorTypeInfoCount = 3;
1620 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1624 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1626 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1630 ctInfo.fExternalIOFormatCount = 2;
1631 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1632 ctInfo.fExternalIOFormatCount);
1636 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1639 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
1640 ioFormat.fExternalReadFormat =
GR_GL_RED;
1642 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1647 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1650 ioFormat.fExternalTexImageFormat = 0;
1657 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1659 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1665 ctInfo.fExternalIOFormatCount = 2;
1666 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1667 ctInfo.fExternalIOFormatCount);
1671 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1674 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
1675 ioFormat.fExternalReadFormat =
GR_GL_RED;
1677 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1682 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1685 ioFormat.fExternalTexImageFormat = 0;
1692 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1694 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1699 ctInfo.fExternalIOFormatCount = 2;
1700 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1701 ctInfo.fExternalIOFormatCount);
1705 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1708 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
1709 ioFormat.fExternalReadFormat =
GR_GL_RED;
1711 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1716 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1719 ioFormat.fExternalTexImageFormat = 0;
1728 bool alpha8IsValidForGL =
GR_IS_GR_GL(standard) &&
1734 info.fFormatType = FormatType::kNormalizedFixedPoint;
1738 bool alpha8SizedEnumSupported =
1739 alpha8IsValidForGL ||
1740 (alpha8IsValidForGLES && ctxInfo.
hasExtension(
"GL_EXT_texture_storage"));
1741 bool alpha8TexStorageSupported = alpha8SizedEnumSupported && texStorageSupported;
1743 bool alpha8IsRenderable =
false;
1744 if (alpha8IsValidForGL) {
1754 if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
1755 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1757 if (alpha8IsRenderable && alpha8IsValidForGL) {
1759 SkASSERT(alpha8SizedEnumSupported);
1760 info.fFlags |= msaaRenderFlags;
1762 if (alpha8TexStorageSupported) {
1763 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1768 if (!
GR_IS_GR_GL_ES(standard) && texImageSupportsSizedInternalFormat &&
1769 alpha8SizedEnumSupported) {
1776 if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
1777 info.fColorTypeInfoCount = 1;
1778 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1782 if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
1783 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1785 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag |
1786 ColorTypeInfo::kRenderable_Flag;
1793 ctInfo.fExternalIOFormatCount = 2;
1794 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1795 ctInfo.fExternalIOFormatCount);
1799 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1805 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1810 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1813 ioFormat.fExternalTexImageFormat = 0;
1822 bool lum8Supported =
false;
1823 bool lum8SizedFormatSupported =
false;
1825 lum8Supported =
true;
1826 lum8SizedFormatSupported =
true;
1828 lum8Supported =
true;
1833 lum8SizedFormatSupported =
1834 texStorageSupported && ctxInfo.
hasExtension(
"GL_EXT_texture_storage");
1836 lum8Supported =
true;
1842 info.fFormatType = FormatType::kNormalizedFixedPoint;
1848 if (lum8Supported) {
1849 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1851 if (texStorageSupported && lum8SizedFormatSupported) {
1852 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1854 }
else if (texImageSupportsSizedInternalFormat && lum8SizedFormatSupported) {
1868 if (lum8Supported) {
1869 info.fColorTypeInfoCount = 1;
1870 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1874 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1876 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1883 ctInfo.fExternalIOFormatCount = 2;
1884 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1885 ctInfo.fExternalIOFormatCount);
1889 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1893 ioFormat.fExternalReadFormat = 0;
1898 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1901 ioFormat.fExternalTexImageFormat = 0;
1911 info.fFormatType = FormatType::kNormalizedFixedPoint;
1916 if (lum8Supported) {
1917 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1919 if (texStorageSupported && lum8SizedFormatSupported) {
1920 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1922 }
else if (texImageSupportsSizedInternalFormat && lum8SizedFormatSupported) {
1929 if (lum8Supported) {
1930 info.fColorTypeInfoCount = 1;
1931 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1935 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1937 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1945 ctInfo.fExternalIOFormatCount = 2;
1946 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1947 ctInfo.fExternalIOFormatCount);
1951 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1955 ioFormat.fExternalReadFormat = 0;
1960 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1963 ioFormat.fExternalTexImageFormat = 0;
1972 info.fFormatType = FormatType::kNormalizedFixedPoint;
1981 if (ctxInfo.
hasExtension(
"GL_EXT_texture_format_BGRA8888")) {
1999 bool supportsBGRATexStorage =
false;
2002 if (ctxInfo.
hasExtension(
"GL_EXT_texture_format_BGRA8888")) {
2013 info.fFlags = FormatInfo::kTexturable_Flag
2014 | FormatInfo::kTransfers_Flag;
2036 info.fFlags |= msaaRenderFlags;
2045 info.fFlags |= nonMSAARenderFlags;
2051 !formatWorkarounds.fDisableBGRATextureStorageForIntelWindowsES) {
2052 supportsBGRATexStorage =
true;
2054 }
else if (ctxInfo.
hasExtension(
"GL_APPLE_texture_format_BGRA8888")) {
2066 info.fFlags = FormatInfo::kTexturable_Flag
2067 | FormatInfo::kTransfers_Flag
2072 supportsBGRATexStorage =
true;
2076 if (texStorageSupported && supportsBGRATexStorage) {
2077 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2080 info.fInternalFormatForTexImageOrStorage = bgraTexImageFormat;
2083 if (
SkToBool(
info.fFlags & FormatInfo::kTexturable_Flag)) {
2084 info.fColorTypeInfoCount = 2;
2085 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2089 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2091 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2095 ctInfo.fExternalIOFormatCount = 2;
2096 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2097 ctInfo.fExternalIOFormatCount);
2101 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2104 ioFormat.fExternalTexImageFormat =
GR_GL_BGRA;
2105 ioFormat.fExternalReadFormat = 0;
2106 ioFormat.fExternalReadFormat =
2107 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
2109 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2114 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2117 ioFormat.fExternalTexImageFormat = 0;
2124 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2126 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
2130 ctInfo.fExternalIOFormatCount = 1;
2131 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2132 ctInfo.fExternalIOFormatCount);
2136 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2139 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2149 info.fFormatType = FormatType::kNormalizedFixedPoint;
2156 info.fFlags = FormatInfo::kTexturable_Flag
2157 | FormatInfo::kTransfers_Flag
2161 info.fFlags = FormatInfo::kTexturable_Flag
2162 | FormatInfo::kTransfers_Flag
2165 info.fFlags = FormatInfo::kTexturable_Flag
2166 | FormatInfo::kTransfers_Flag
2177 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2180 info.fInternalFormatForTexImageOrStorage =
2184 if (
SkToBool(
info.fFlags &FormatInfo::kTexturable_Flag)) {
2185 info.fColorTypeInfoCount = 1;
2186 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2190 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2192 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2196 ctInfo.fExternalIOFormatCount = 2;
2197 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2198 ctInfo.fExternalIOFormatCount);
2202 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2205 ioFormat.fExternalTexImageFormat =
GR_GL_RGB;
2206 ioFormat.fExternalReadFormat =
GR_GL_RGB;
2208 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2213 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2216 ioFormat.fExternalTexImageFormat = 0;
2226 info.fFormatType = FormatType::kFloat;
2229 info.fDefaultExternalType = halfFloatType;
2231 bool rgba16FTextureSupport =
false;
2232 bool rgba16FRenderTargetSupport =
false;
2236 rgba16FTextureSupport =
true;
2237 rgba16FRenderTargetSupport =
true;
2238 }
else if (ctxInfo.
hasExtension(
"GL_ARB_texture_float")) {
2239 rgba16FTextureSupport =
true;
2243 rgba16FTextureSupport =
true;
2244 rgba16FRenderTargetSupport =
2246 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
2248 }
else if (ctxInfo.
hasExtension(
"GL_OES_texture_half_float") &&
2249 ctxInfo.
hasExtension(
"GL_OES_texture_half_float_linear")) {
2250 rgba16FTextureSupport =
true;
2251 rgba16FRenderTargetSupport = ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float");
2255 rgba16FTextureSupport =
true;
2256 rgba16FRenderTargetSupport =
2257 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
2261 }
else if ((ctxInfo.
hasExtension(
"GL_OES_texture_half_float") ||
2263 (ctxInfo.
hasExtension(
"GL_OES_texture_half_float_linear") ||
2264 ctxInfo.
hasExtension(
"OES_texture_half_float_linear"))) {
2265 rgba16FTextureSupport =
true;
2267 rgba16FRenderTargetSupport =
2268 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
2273 if (rgba16FTextureSupport) {
2274 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2275 if (rgba16FRenderTargetSupport) {
2276 info.fFlags |= fpRenderFlags;
2279 if (texStorageSupported && !formatWorkarounds.fDisableRGBA16FTexStorageForCrBug1008003) {
2280 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2283 info.fInternalFormatForTexImageOrStorage =
2287 if (rgba16FTextureSupport) {
2288 uint32_t
flags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2290 info.fColorTypeInfoCount = 2;
2291 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2295 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2297 ctInfo.fFlags =
flags;
2301 ctInfo.fExternalIOFormatCount = 2;
2302 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2303 ctInfo.fExternalIOFormatCount);
2307 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2309 ioFormat.fExternalType = halfFloatType;
2310 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2313 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2318 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2321 ioFormat.fExternalTexImageFormat = 0;
2328 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2330 ctInfo.fFlags =
flags;
2334 ctInfo.fExternalIOFormatCount = 2;
2335 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2336 ctInfo.fExternalIOFormatCount);
2340 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2342 ioFormat.fExternalType = halfFloatType;
2343 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2346 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2351 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2354 ioFormat.fExternalTexImageFormat = 0;
2364 info.fFormatType = FormatType::kFloat;
2367 info.fDefaultExternalType = halfFloatType;
2369 bool r16FTextureSupport =
false;
2370 bool r16FRenderTargetSupport =
false;
2374 r16FTextureSupport =
true;
2375 r16FRenderTargetSupport =
true;
2384 r16FTextureSupport =
true;
2387 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float");
2391 r16FTextureSupport =
true;
2392 r16FRenderTargetSupport = ctxInfo.
hasExtension(
"GL_EXT_color_buffer_float") ||
2397 if (r16FTextureSupport) {
2398 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2399 if (r16FRenderTargetSupport) {
2400 info.fFlags |= fpRenderFlags;
2403 if (texStorageSupported) {
2404 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2407 info.fInternalFormatForTexImageOrStorage =
2411 if (r16FTextureSupport) {
2413 info.fColorTypeInfoCount = 1;
2414 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2417 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2419 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2425 ctInfo.fExternalIOFormatCount = 2;
2426 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2427 ctInfo.fExternalIOFormatCount);
2431 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2433 ioFormat.fExternalType = halfFloatType;
2434 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
2435 ioFormat.fExternalReadFormat =
GR_GL_RED;
2437 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2442 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2445 ioFormat.fExternalTexImageFormat = 0;
2456 bool lum16FSupported =
false;
2457 bool lum16FSizedFormatSupported =
false;
2458 GrGLenum lumHalfFloatType = halfFloatType;
2460 if (!fIsCoreProfile && ctxInfo.
hasExtension(
"GL_ARB_texture_float")) {
2461 lum16FSupported =
true;
2462 lum16FSizedFormatSupported =
true;
2465 if (ctxInfo.
hasExtension(
"GL_OES_texture_half_float_linear") &&
2467 lum16FSupported =
true;
2474 lum16FSizedFormatSupported = ctxInfo.
hasExtension(
"GL_EXT_texture_storage");
2478 if (formatWorkarounds.fDisableLuminance16F) {
2479 lum16FSupported =
false;
2483 info.fFormatType = FormatType::kFloat;
2486 info.fDefaultExternalType = lumHalfFloatType;
2489 if (lum16FSupported) {
2490 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2492 if (texStorageSupported && lum16FSizedFormatSupported) {
2493 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2495 }
else if (texImageSupportsSizedInternalFormat && lum16FSizedFormatSupported) {
2501 info.fColorTypeInfoCount = 1;
2502 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2506 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2508 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
2518 ctInfo.fExternalIOFormatCount = 2;
2519 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2520 ctInfo.fExternalIOFormatCount);
2524 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2526 ioFormat.fExternalType = lumHalfFloatType;
2528 ioFormat.fExternalReadFormat = 0;
2533 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2536 ioFormat.fExternalTexImageFormat = 0;
2546 info.fFormatType = FormatType::kNormalizedFixedPoint;
2552 bool supportsSizedRGBX =
false;
2558 (texStorageSupported || texImageSupportsSizedInternalFormat)) {
2559 supportsSizedRGBX =
true;
2562 if (supportsSizedRGBX) {
2564 info.fFlags = FormatInfo::kTexturable_Flag |
2565 FormatInfo::kTransfers_Flag |
2567 if (texStorageSupported) {
2568 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2570 info.fColorTypeInfoCount = 1;
2571 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2575 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2577 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2581 ctInfo.fExternalIOFormatCount = 2;
2582 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2583 ctInfo.fExternalIOFormatCount);
2587 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2590 ioFormat.fExternalTexImageFormat =
GR_GL_RGB;
2591 ioFormat.fExternalReadFormat = 0;
2596 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2599 ioFormat.fExternalTexImageFormat = 0;
2609 info.fFormatType = FormatType::kNormalizedFixedPoint;
2614 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2621 info.fFlags |= nonMSAARenderFlags;
2625 info.fFlags |= msaaRenderFlags;
2629 info.fFlags |= msaaRenderFlags;
2631 if (texStorageSupported) {
2632 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2635 info.fInternalFormatForTexImageOrStorage =
2639 info.fColorTypeInfoCount = 1;
2640 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2644 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2646 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2654 ctInfo.fExternalIOFormatCount = 2;
2655 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2656 ctInfo.fExternalIOFormatCount);
2660 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2663 ioFormat.fExternalTexImageFormat =
GR_GL_RGB;
2664 ioFormat.fExternalReadFormat = 0;
2669 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2672 ioFormat.fExternalTexImageFormat = 0;
2681 info.fFormatType = FormatType::kNormalizedFixedPoint;
2686 bool rg8Support =
false;
2695 info.fFlags |= FormatInfo::kTexturable_Flag
2696 | FormatInfo::kTransfers_Flag
2698 if (texStorageSupported) {
2699 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2703 if (!(
info.fFlags & FormatInfo::kUseTexStorage_Flag)) {
2704 info.fInternalFormatForTexImageOrStorage =
2708 info.fColorTypeInfoCount = 1;
2709 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2713 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2715 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2719 ctInfo.fExternalIOFormatCount = 2;
2720 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2721 ctInfo.fExternalIOFormatCount);
2725 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2728 ioFormat.fExternalTexImageFormat =
GR_GL_RG;
2729 ioFormat.fExternalReadFormat = 0;
2730 if (
GR_IS_GR_GL(standard) && !formatWorkarounds.fDisallowDirectRG8ReadPixels) {
2731 ioFormat.fExternalReadFormat =
GR_GL_RG;
2737 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2740 ioFormat.fExternalTexImageFormat = 0;
2750 info.fFormatType = FormatType::kNormalizedFixedPoint;
2757 info.fFlags = FormatInfo::kTexturable_Flag
2758 | FormatInfo::kTransfers_Flag
2761 ctxInfo.
hasExtension(
"GL_EXT_texture_type_2_10_10_10_REV")) {
2762 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2765 if (texStorageSupported) {
2766 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2769 info.fInternalFormatForTexImageOrStorage =
2773 if (
SkToBool(
info.fFlags & FormatInfo::kTexturable_Flag)) {
2774 bool supportsBGRAColorType =
GR_IS_GR_GL(standard) &&
2777 info.fColorTypeInfoCount = supportsBGRAColorType ? 2 : 1;
2778 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2782 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2784 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2788 ctInfo.fExternalIOFormatCount = 2;
2789 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2790 ctInfo.fExternalIOFormatCount);
2794 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2797 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2800 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2805 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2808 ioFormat.fExternalTexImageFormat = 0;
2814 if (supportsBGRAColorType) {
2815 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2817 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2821 ctInfo.fExternalIOFormatCount = 2;
2822 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2823 ctInfo.fExternalIOFormatCount);
2827 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2830 ioFormat.fExternalTexImageFormat =
GR_GL_BGRA;
2831 ioFormat.fExternalReadFormat =
2832 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
2834 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2839 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2842 ioFormat.fExternalTexImageFormat = 0;
2852 info.fFormatType = FormatType::kNormalizedFixedPoint;
2857 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2860 info.fFlags |= msaaRenderFlags;
2863 info.fFlags |= msaaRenderFlags;
2865 info.fFlags |= msaaRenderFlags;
2867 if (texStorageSupported) {
2868 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2871 info.fInternalFormatForTexImageOrStorage =
2875 info.fColorTypeInfoCount = 1;
2876 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2880 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2882 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2886 ctInfo.fExternalIOFormatCount = 2;
2887 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2888 ctInfo.fExternalIOFormatCount);
2892 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2895 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2898 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2903 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2906 ioFormat.fExternalTexImageFormat = 0;
2915 info.fFormatType = FormatType::kNormalizedFixedPoint;
2922 bool srgb8Alpha8TexStorageSupported = texStorageSupported;
2923 bool srgb8Alpha8TextureSupport =
false;
2924 bool srgb8Alpha8RenderTargetSupport =
false;
2927 srgb8Alpha8TextureSupport =
true;
2928 srgb8Alpha8RenderTargetSupport =
true;
2929 }
else if (ctxInfo.
hasExtension(
"GL_EXT_texture_sRGB")) {
2930 srgb8Alpha8TextureSupport =
true;
2933 srgb8Alpha8RenderTargetSupport =
true;
2938 srgb8Alpha8TextureSupport =
true;
2939 srgb8Alpha8RenderTargetSupport =
true;
2945 srgb8Alpha8TexStorageSupported =
false;
2952 srgb8Alpha8TextureSupport =
true;
2953 srgb8Alpha8RenderTargetSupport =
true;
2959 SkASSERT(!srgb8Alpha8TexStorageSupported);
2963 if (srgb8Alpha8TextureSupport) {
2964 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2965 if (srgb8Alpha8RenderTargetSupport) {
2966 info.fFlags |= formatWorkarounds.fDisableSRGBRenderWithMSAAForMacAMD
2967 ? nonMSAARenderFlags
2971 if (srgb8Alpha8TexStorageSupported) {
2972 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2975 info.fInternalFormatForTexImageOrStorage =
2979 if (srgb8Alpha8TextureSupport) {
2980 info.fColorTypeInfoCount = 1;
2981 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2985 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2987 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2991 ctInfo.fExternalIOFormatCount = 1;
2992 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2993 ctInfo.fExternalIOFormatCount);
3011 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3014 ioFormat.fExternalTexImageFormat = texImageExternalFormat;
3024 info.fFormatType = FormatType::kNormalizedFixedPoint;
3027 if (ctxInfo.
hasExtension(
"GL_EXT_texture_compression_s3tc")) {
3028 info.fFlags = FormatInfo::kTexturable_Flag;
3031 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_s3tc")) {
3032 info.fFlags = FormatInfo::kTexturable_Flag;
3042 info.fFormatType = FormatType::kNormalizedFixedPoint;
3045 if (ctxInfo.
hasExtension(
"GL_EXT_texture_compression_s3tc")) {
3046 info.fFlags = FormatInfo::kTexturable_Flag;
3049 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_s3tc")) {
3050 info.fFlags = FormatInfo::kTexturable_Flag;
3060 info.fFormatType = FormatType::kNormalizedFixedPoint;
3062 if (!formatWorkarounds.fDisallowETC2Compression) {
3066 info.fFlags = FormatInfo::kTexturable_Flag;
3070 ctxInfo.
hasExtension(
"GL_OES_compressed_ETC2_RGB8_texture")) {
3071 info.fFlags = FormatInfo::kTexturable_Flag;
3074 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_etc")) {
3075 info.fFlags = FormatInfo::kTexturable_Flag;
3086 info.fFormatType = FormatType::kNormalizedFixedPoint;
3089 if (ctxInfo.
hasExtension(
"GL_OES_compressed_ETC1_RGB8_texture")) {
3090 info.fFlags = FormatInfo::kTexturable_Flag;
3093 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_etc1")) {
3094 info.fFlags = FormatInfo::kTexturable_Flag;
3105 info.fFormatType = FormatType::kNormalizedFixedPoint;
3110 bool r16Supported =
false;
3111 if (!formatWorkarounds.fDisallowTextureUnorm16) {
3116 r16Supported = ctxInfo.
hasExtension(
"GL_EXT_texture_norm16");
3121 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
3122 if (!formatWorkarounds.fDisallowUnorm16Transfers) {
3123 info.fFlags |= FormatInfo::kTransfers_Flag;
3127 if (texStorageSupported) {
3128 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3131 info.fInternalFormatForTexImageOrStorage =
3136 info.fColorTypeInfoCount = 1;
3137 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3141 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3143 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3149 ctInfo.fExternalIOFormatCount = 2;
3150 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3151 ctInfo.fExternalIOFormatCount);
3155 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3158 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
3159 ioFormat.fExternalReadFormat =
GR_GL_RED;
3161 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3166 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3169 ioFormat.fExternalTexImageFormat = 0;
3179 info.fFormatType = FormatType::kNormalizedFixedPoint;
3180 info.fInternalFormatForTexImageOrStorage =
3186 bool rg16Supported =
false;
3187 if (!formatWorkarounds.fDisallowTextureUnorm16) {
3192 rg16Supported = ctxInfo.
hasExtension(
"GL_EXT_texture_norm16");
3196 if (rg16Supported) {
3197 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
3198 if (!formatWorkarounds.fDisallowUnorm16Transfers) {
3199 info.fFlags |= FormatInfo::kTransfers_Flag;
3203 if (texStorageSupported) {
3204 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3207 info.fInternalFormatForTexImageOrStorage =
3211 if (rg16Supported) {
3212 info.fColorTypeInfoCount = 1;
3213 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3217 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3219 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3223 ctInfo.fExternalIOFormatCount = 2;
3224 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3225 ctInfo.fExternalIOFormatCount);
3229 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3232 ioFormat.fExternalTexImageFormat =
GR_GL_RG;
3233 ioFormat.fExternalReadFormat =
GR_GL_RG;
3235 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3240 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3243 ioFormat.fExternalTexImageFormat = 0;
3252 bool rgba16Support =
false;
3253 if (!formatWorkarounds.fDisallowTextureUnorm16) {
3257 rgba16Support = ctxInfo.
hasExtension(
"GL_EXT_texture_norm16");
3262 info.fFormatType = FormatType::kNormalizedFixedPoint;
3268 if (rgba16Support) {
3269 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
3270 if (!formatWorkarounds.fDisallowUnorm16Transfers) {
3271 info.fFlags |= FormatInfo::kTransfers_Flag;
3275 if (texStorageSupported) {
3276 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3279 info.fInternalFormatForTexImageOrStorage =
3283 if (rgba16Support) {
3285 info.fColorTypeInfoCount = 1;
3286 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3289 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3291 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3295 ctInfo.fExternalIOFormatCount = 2;
3296 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3297 ctInfo.fExternalIOFormatCount);
3301 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3304 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
3307 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3312 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3315 ioFormat.fExternalTexImageFormat = 0;
3324 bool rg16FTextureSupport =
false;
3325 bool rg16FRenderTargetSupport =
false;
3328 rg16FTextureSupport =
true;
3329 rg16FRenderTargetSupport =
true;
3338 rg16FTextureSupport =
true;
3341 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float");
3345 rg16FTextureSupport =
true;
3346 rg16FRenderTargetSupport = ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
3354 info.fFormatType = FormatType::kFloat;
3357 info.fDefaultExternalType = halfFloatType;
3359 if (rg16FTextureSupport) {
3360 info.fFlags |= FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
3361 if (rg16FRenderTargetSupport) {
3362 info.fFlags |= fpRenderFlags;
3366 if (texStorageSupported) {
3367 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3370 info.fInternalFormatForTexImageOrStorage =
3374 if (rg16FTextureSupport) {
3375 info.fColorTypeInfoCount = 1;
3376 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3380 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3382 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3386 ctInfo.fExternalIOFormatCount = 2;
3387 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3388 ctInfo.fExternalIOFormatCount);
3392 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3394 ioFormat.fExternalType = halfFloatType;
3395 ioFormat.fExternalTexImageFormat =
GR_GL_RG;
3396 ioFormat.fExternalReadFormat =
GR_GL_RG;
3398 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3403 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3406 ioFormat.fExternalTexImageFormat = 0;
3413 this->setupSampleCounts(ctxInfo, gli);
3420 const auto& formatInfo = fFormatTable[i];
3422 SkASSERT(!((formatInfo.fFlags & FormatInfo::kFBOColorAttachmentWithMSAA_Flag) &&
3423 !(formatInfo.fFlags & FormatInfo::kFBOColorAttachment_Flag)));
3426 SkASSERT(formatInfo.fFormatType != FormatType::kUnknown);
3429 for (
int j = 0; j < formatInfo.fColorTypeInfoCount; ++j) {
3430 const auto& ctInfo = formatInfo.fColorTypeInfos[j];
3435 for (
int k = 0; k < ctInfo.fExternalIOFormatCount; ++k) {
3436 const auto& ioInfo = ctInfo.fExternalIOFormats[k];
3450 int maxSampleCnt = 1;
3457 maxSampleCnt = std::max(1, maxSampleCnt);
3460 if (FormatInfo::kFBOColorAttachmentWithMSAA_Flag & fFormatTable[i].
fFlags) {
3462 SkASSERT(FormatInfo::kFBOColorAttachment_Flag & fFormatTable[i].
fFlags);
3465 ctxInfo.
hasExtension(
"GL_ARB_internalformat_query"))) ||
3468 const bool multisampleIsImplicit =
3477 std::unique_ptr<int[]> temp(
new int[
count]);
3485 fFormatTable[i].fColorSampleCounts.reserve(
count + 1);
3488 fFormatTable[i].fColorSampleCounts.push_back(1);
3489 for (
int j = 0; j <
count; ++j) {
3490#if defined(SK_BUILD_FOR_IOS) && TARGET_OS_SIMULATOR
3495 int sampleCnt = temp[
count - j - 1];
3497 if (multisampleIsImplicit && sampleCnt > maxSampleCnt) {
3500 fFormatTable[i].fColorSampleCounts.push_back(sampleCnt);
3506 static constexpr int kDefaultSamples[] = {1, 2, 4, 8};
3507 int count = std::size(kDefaultSamples);
3509 if (kDefaultSamples[
count - 1] <= maxSampleCnt) {
3514 fFormatTable[i].fColorSampleCounts.append(
count, kDefaultSamples);
3517 }
else if (FormatInfo::kFBOColorAttachment_Flag & fFormatTable[i].
fFlags) {
3518 fFormatTable[i].fColorSampleCounts.resize(1);
3519 fFormatTable[i].fColorSampleCounts[0] = 1;
3526 GrGLFormat srcFormat,
bool srcHasMSAARenderBuffer,
3549 !fAllowBGRA8CopyTexSubImage) {
3558 !fAllowSRGBCopyTexSubImage) {
3567 if (!dstChannels || !srcChannels) {
3573 if ((dstChannels & srcChannels) != srcChannels) {
3587 if (dstHasMSAARenderBuffer || srcHasMSAARenderBuffer) {
3593 if (!dstTypeIfTexture) {
3608 const SkRect& srcBounds,
bool srcBoundsExact,
3610 auto blitFramebufferFlags = fBlitFramebufferFlags;
3627 if (dstSampleCnt > 1 && dstSampleCnt != srcSampleCnt) {
3643 if (srcSampleCnt > 1) {
3644 if (1 == dstSampleCnt) {
3647 if (
SkRect::Make(srcRect) != srcBounds || !srcBoundsExact) {
3654 if (dstSampleCnt > 1) {
3660 if (srcFormat != dstFormat) {
3664 if (srcSampleCnt > 1 && srcFormat != dstFormat) {
3670 if (srcSampleCnt > 1) {
3671 if (dstRect != srcRect) {
3682 !(fDisableScalingCopyAsDraws && scalingCopy);
3701 if (src->isProtected() == GrProtected::kYes && dst->isProtected() != GrProtected::kYes) {
3705 int dstSampleCnt = 0;
3706 int srcSampleCnt = 0;
3708 dstSampleCnt = rtProxy->numSamples();
3711 srcSampleCnt = rtProxy->numSamples();
3725 dstTexTypePtr = &dstTexType;
3729 srcTexTypePtr = &srcTexType;
3735 const bool scalingCopy = srcRect.
size() != dstRect.
size();
3741 return this->
canCopyAsBlit(dstFormat, dstSampleCnt, dstTexTypePtr, srcFormat, srcSampleCnt,
3742 srcTexTypePtr, src->getBoundsRect(), src->priv().isExact(), srcRect,
3751 if (src->asTextureProxy() && !this->isFormatAsColorTypeRenderable(
colorType,
3752 src->backendFormat())) {
3756 if (
const auto* texProxy = src->asTextureProxy()) {
3769 if (src->numSamples() > 1 &&
3774 }
else if (src->numSamples() > 1 && (fBlitFramebufferFlags &
3785 return blitFramebufferRestrictions;
3792 bool srcIsMSAARenderbuffer = src->numSamples() > 1 &&
3794 if (srcIsMSAARenderbuffer) {
3798 return blitFramebufferRestrictions;
3809void GrGLCaps::applyDriverCorrectnessWorkarounds(
const GrGLContextInfo& ctxInfo,
3813 FormatWorkarounds* formatWorkarounds) {
3836 fClearTextureSupport =
false;
3844 fAllowBGRA8CopyTexSubImage =
true;
3850 fAllowSRGBCopyTexSubImage =
true;
3865 fDisallowDynamicMSAA =
true;
3871 fDisallowDynamicMSAA =
true;
3878#if defined(__has_feature)
3879#if defined(SK_BUILD_FOR_MAC) && __has_feature(thread_sanitizer)
3915#ifdef SK_BUILD_FOR_ANDROID
3919 formatWorkarounds->fDisallowR8ForPowerVRSGX54x =
true;
3942 formatWorkarounds->fDisallowTextureUnorm16 =
true;
3943 formatWorkarounds->fDisallowETC2Compression =
true;
3959#ifndef SK_BUILD_FOR_IOS
3973#ifdef SK_BUILD_FOR_MAC
4014 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO =
true;
4046 fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines =
true;
4054 fMaxInstancesPerDrawWithoutCrashing = 999;
4056 fMaxInstancesPerDrawWithoutCrashing = 0x4000000;
4059#ifndef SK_BUILD_FOR_IOS
4069 fMustSetAnyTexParameterToEnableMipmapping =
true;
4084 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO =
true;
4085 fUseDrawInsteadOfAllRenderTargetWrites =
true;
4088#ifdef SK_BUILD_FOR_MAC
4089 static constexpr bool isMAC =
true;
4091 static constexpr bool isMAC =
false;
4094#ifdef SK_BUILD_FOR_ANDROID
4098 fDontSetBaseOrMaxLevelForExternalTextures =
true;
4102 fMipmapLevelControlSupport =
false;
4110 if (fMipmapLevelControlSupport &&
4116 fDoManualMipmapping =
true;
4120#ifdef SK_BUILD_FOR_MAC
4122 fClearToBoundaryValuesIsBroken =
true;
4126 fDrawArraysBaseVertexIsBroken =
true;
4132 fBaseVertexBaseInstanceSupport =
false;
4144 fBaseVertexBaseInstanceSupport =
false;
4173#if defined(SK_BUILD_FOR_MAC)
4206#if defined(SK_BUILD_FOR_ANDROID)
4216 fShaderCaps->fAvoidDfDxForGradientsWhenPossible =
true;
4219#ifdef SK_BUILD_FOR_WIN
4338 fMustResetBlendFuncBetweenDualSourceAndDisable =
true;
4345 if (ctxInfo.
hasExtension(
"GL_OES_EGL_image_external") &&
4353#ifdef SK_BUILD_FOR_IOS
4410 fShaderCaps->fRemoveConstFromFunctionParameters =
true;
4412#ifdef SK_BUILD_FOR_WIN
4424 fNeverDisableColorWrites =
true;
4440 fSRGBWriteControl =
false;
4444#if defined(SK_BUILD_FOR_MAC)
4446 formatWorkarounds->fDisableSRGBRenderWithMSAAForMacAMD =
true;
4452 formatWorkarounds->fDisableRGBA16FTexStorageForCrBug1008003 =
4455#if defined(SK_BUILD_FOR_WIN)
4458 formatWorkarounds->fDisableBGRATextureStorageForIntelWindowsES =
4468 formatWorkarounds->fDisableLuminance16F =
4473#ifdef SK_BUILD_FOR_MAC
4477 formatWorkarounds->fDisallowDirectRG8ReadPixels =
4483#ifdef SK_BUILD_FOR_ANDROID
4496 formatWorkarounds->fDisableTexStorage =
true;
4507 fTiledRenderingSupport =
false;
4518 fTiledRenderingSupport =
false;
4522 formatWorkarounds->fDisallowBGRA8ReadPixels =
true;
4543 fProgramBinarySupport =
false;
4547 if (fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO) {
4569 formatWorkarounds->fDisallowUnorm16Transfers =
true;
4598 fBindTexture0WhenChangingTextureFBOMultisampleCount =
true;
4617 fRebindColorAttachmentAfterCheckFramebufferStatus =
true;
4660 fFlushBeforeWritePixels =
true;
4669 fFlushBeforeWritePixels =
true;
4678 fDisableScalingCopyAsDraws =
true;
4692#ifdef SK_BUILD_FOR_MAC
4695 fPadRG88TransferAlignment =
true;
4701 if (
options.fDisableDriverCorrectnessWorkarounds) {
4703 SkASSERT(!fClearToBoundaryValuesIsBroken);
4704 SkASSERT(0 == fMaxInstancesPerDrawWithoutCrashing);
4705 SkASSERT(!fDrawArraysBaseVertexIsBroken);
4706 SkASSERT(!fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO);
4707 SkASSERT(!fUseDrawInsteadOfAllRenderTargetWrites);
4708 SkASSERT(!fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines);
4709 SkASSERT(!fDontSetBaseOrMaxLevelForExternalTextures);
4710 SkASSERT(!fNeverDisableColorWrites);
4713 fProgramBinarySupport =
false;
4716 switch (
options.fSkipGLErrorChecks) {
4718 fSkipErrorChecks =
false;
4721 fSkipErrorChecks =
true;
4729 if (fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO) {
4731 if (tex->hasBaseLevelBeenBoundToFBO()) {
4736 if (
auto rt =
surface->asRenderTarget()) {
4737 if (fUseDrawInsteadOfAllRenderTargetWrites) {
4740 if (rt->numSamples() > 1 && this->usesMSAARenderBuffers()) {
4763 if (rt->numSamples() > 1 && !rt->asTexture()) {
4773 switch (externalType) {
4788 case GR_GL_UNSIGNED_BYTE_3_3_2:
return sizeof(
GrGLubyte);
4789 case GR_GL_UNSIGNED_BYTE_2_3_3_REV:
return sizeof(
GrGLubyte);
4790 case GR_GL_UNSIGNED_SHORT_5_6_5_REV:
return sizeof(
GrGLushort);
4791 case GR_GL_UNSIGNED_SHORT_4_4_4_4_REV:
return sizeof(
GrGLushort);
4792 case GR_GL_UNSIGNED_SHORT_1_5_5_5_REV:
return sizeof(
GrGLushort);
4793 case GR_GL_UNSIGNED_INT_8_8_8_8:
return sizeof(
GrGLuint);
4794 case GR_GL_UNSIGNED_INT_8_8_8_8_REV:
return sizeof(
GrGLuint);
4795 case GR_GL_UNSIGNED_INT_10_10_10_2:
return sizeof(
GrGLuint);
4796 case GR_GL_UNSIGNED_INT_24_8:
return sizeof(
GrGLuint);
4797 case GR_GL_UNSIGNED_INT_10F_11F_11F_REV:
return sizeof(
GrGLuint);
4798 case GR_GL_UNSIGNED_INT_5_9_9_9_REV:
return sizeof(
GrGLuint);
4800 case GR_GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
return 4;
4821 bool foundSrcCT =
false;
4822 for (
int i = 0; !foundSrcCT && i < formatInfo.fColorTypeInfoCount; ++i) {
4823 if (formatInfo.fColorTypeInfos[i].fColorType == srcColorType) {
4824 const ColorTypeInfo& ctInfo = formatInfo.fColorTypeInfos[i];
4826 for (
int j = 0; j < ctInfo.fExternalIOFormatCount; ++j) {
4827 const auto& ioInfo = ctInfo.fExternalIOFormats[j];
4828 if (ioInfo.fExternalReadFormat != 0) {
4829 if (formatInfo.fHaveQueriedImplementationReadSupport ||
4830 !ioInfo.fRequiresImplementationReadQuery) {
4831 GrGLenum transferOffsetAlignment = 0;
4832 if (formatInfo.fFlags & FormatInfo::kTransfers_Flag) {
4833 transferOffsetAlignment =
4836 transferOffsetAlignment = 2;
4839 if (ioInfo.fColorType == dstColorType) {
4840 return {dstColorType, transferOffsetAlignment};
4845 fallbackRead = {ioInfo.
fColorType, transferOffsetAlignment};
4852 return fallbackRead;
4862 bool foundSurfaceCT =
false;
4863 size_t transferOffsetAlignment = 0;
4864 if (formatInfo.fFlags & FormatInfo::kTransfers_Flag) {
4865 transferOffsetAlignment = 1;
4867 for (
int i = 0; !foundSurfaceCT && i < formatInfo.fColorTypeInfoCount; ++i) {
4868 if (formatInfo.fColorTypeInfos[i].fColorType == surfaceColorType) {
4869 const ColorTypeInfo& ctInfo = formatInfo.fColorTypeInfos[i];
4870 foundSurfaceCT =
true;
4871 for (
int j = 0; j < ctInfo.fExternalIOFormatCount; ++j) {
4872 const auto& ioInfo = ctInfo.fExternalIOFormats[j];
4873 if (ioInfo.fExternalTexImageFormat != 0) {
4874 if (ioInfo.fColorType == srcColorType) {
4875 return {srcColorType, transferOffsetAlignment};
4880 fallbackCT = ioInfo.fColorType;
4886 return {fallbackCT, transferOffsetAlignment};
4890 return std::find(fProgramBinaryFormats.
begin(), fProgramBinaryFormats.
end(), binaryFormat) !=
4891 fProgramBinaryFormats.
end();
4898 return fbInfo.
fFBOID != 0;
4913 const FormatInfo&
info = this->getFormatInfo(
format);
4914 return SkToBool(
info.fFlags & FormatInfo::kTexturable_Flag);
4918 int sampleCount)
const {
4926 const FormatInfo&
info = this->getFormatInfo(f);
4927 if (!
SkToBool(
info.colorTypeFlags(ct) & ColorTypeInfo::kRenderable_Flag)) {
4945 const FormatInfo&
info = this->getFormatInfo(
format);
4947 int count =
info.fColorSampleCounts.size();
4952 requestedCount = std::max(1, requestedCount);
4953 if (1 == requestedCount) {
4954 return info.fColorSampleCounts[0] == 1 ? 1 : 0;
4957 for (
int sampleCount :
info.fColorSampleCounts) {
4958 if (sampleCount >= requestedCount) {
4960 sampleCount = std::min(sampleCount, 4);
4969 const FormatInfo&
info = this->getFormatInfo(
format);
4970 const auto&
table =
info.fColorSampleCounts;
4971 if (
table.empty()) {
4998 const auto& formatInfo =
const_cast<GrGLCaps*
>(
this)->getFormatInfo(
format);
4999 if (!formatInfo.fHaveQueriedImplementationReadSupport) {
5001 bool needQuery =
false;
5002 for (
int i = 0; i < formatInfo.fColorTypeInfoCount && !needQuery; ++i) {
5003 const auto& surfCTInfo = formatInfo.fColorTypeInfos[i];
5004 for (
int j = 0; j < surfCTInfo.fExternalIOFormatCount; ++j) {
5005 if (surfCTInfo.fExternalIOFormats[j].fRequiresImplementationReadQuery) {
5013 const_cast<FormatInfo&
>(formatInfo).fHaveQueriedImplementationReadSupport =
true;
5016 return !formatInfo.fHaveQueriedImplementationReadSupport;
5022 auto& formatInfo =
const_cast<GrGLCaps*
>(
this)->getFormatInfo(
format);
5023 for (
int i = 0; i < formatInfo.fColorTypeInfoCount; ++i) {
5024 auto& surfCTInfo = formatInfo.fColorTypeInfos[i];
5025 for (
int j = 0; j < surfCTInfo.fExternalIOFormatCount; ++j) {
5026 auto& readCTInfo = surfCTInfo.fExternalIOFormats[j];
5027 if (readCTInfo.fRequiresImplementationReadQuery) {
5028 if (readCTInfo.fExternalReadFormat != readFormat ||
5029 readCTInfo.fExternalType != readType) {
5031 readCTInfo.fExternalReadFormat = 0;
5036 formatInfo.fHaveQueriedImplementationReadSupport =
true;
5042 const auto&
info = this->getFormatInfo(glFormat);
5043 for (
int i = 0; i <
info.fColorTypeInfoCount; ++i) {
5044 if (
info.fColorTypeInfos[i].fColorType == ct) {
5061 switch (compressionType) {
5093 const auto&
info = this->getFormatInfo(glFormat);
5094 for (
int i = 0; i <
info.fColorTypeInfoCount; ++i) {
5095 const auto& ctInfo =
info.fColorTypeInfos[i];
5097 return ctInfo.fReadSwizzle;
5100 SkDEBUGFAILF(
"Illegal color type (%d) and format (%d) combination.",
5108 for (
int i = 0; i <
info.fColorTypeInfoCount; ++i) {
5109 const auto& ctInfo =
info.fColorTypeInfos[i];
5111 return ctInfo.fWriteSwizzle;
5114 SkDEBUGFAILF(
"Illegal color type (%d) and format (%d) combination.",
5128 return !fDisallowDynamicMSAA;
5133 return (uint64_t)(glFormat);
5145#if defined(GR_TEST_UTILS)
5146std::vector<GrTest::TestFormatColorTypeCombination> GrGLCaps::getTestingCombinations()
const {
5147 std::vector<GrTest::TestFormatColorTypeCombination> combos = {
5214 size_t count2D = combos.size();
5215 for (
size_t i = 0; i < count2D; ++i) {
5216 auto combo2D = combos[i];
5218 combos.push_back({combo2D.fColorType,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkTextureCompressionType GrBackendFormatToCompressionType(const GrBackendFormat &format)
static bool angle_backend_is_d3d(GrGLANGLEBackend backend)
const char * get_glsl_version_decl_string(GrGLStandard standard, SkSL::GLSLGeneration generation, bool isCoreProfile)
static bool has_msaa_render_buffer(const GrSurfaceProxy *surf, const GrGLCaps &glCaps)
static bool angle_backend_is_metal(GrGLANGLEBackend backend)
bool is_float_fp32(const GrGLContextInfo &ctxInfo, const GrGLInterface *gli, GrGLenum precision)
size_t offset_alignment_for_transfer_buffer(GrGLenum externalType)
#define GR_GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
#define GR_GL_PROGRAM_BINARY_FORMATS
#define GR_GL_CONTEXT_PROFILE_MASK
#define GR_GL_SRGB8_ALPHA8
#define GR_GL_MAX_SAMPLES
#define GR_GL_MAX_WINDOW_RECTANGLES
#define GR_GL_NUM_SAMPLE_COUNTS
#define GR_GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT
#define GR_GL_UNSIGNED_SHORT
#define GR_GL_UNSIGNED_SHORT_5_6_5
#define GR_GL_UNSIGNED_SHORT_4_4_4_4
#define GR_GL_MAX_TEXTURE_IMAGE_UNITS
#define GR_GL_COMPRESSED_ETC1_RGB8
#define GR_GL_HALF_FLOAT_OES
#define GR_GL_COMPRESSED_RGB8_ETC2
#define GR_GL_RENDERBUFFER
#define GR_GL_LUMINANCE8_ALPHA8
#define GR_GL_MAX_SAMPLES_IMG
#define GR_GL_LUMINANCE16F
#define GR_GL_FRAGMENT_SHADER
#define GR_GL_MAX_VERTEX_ATTRIBS
#define GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS
#define GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
#define GR_GL_MAX_RENDERBUFFER_SIZE
#define GR_GL_UNSIGNED_INT
#define GR_GL_NUM_PROGRAM_BINARY_FORMATS
#define GR_GL_TEXTURE_RECTANGLE
#define GR_GL_MEDIUM_FLOAT
#define GR_GL_MAX_TEXTURE_MAX_ANISOTROPY
#define GR_GL_UNSIGNED_SHORT_5_5_5_1
#define GR_GL_UNSIGNED_BYTE
#define GR_GL_MAX_TEXTURE_SIZE
#define GR_GL_CONTEXT_FLAGS
#define GR_GL_VERTEX_SHADER
#define GR_GL_LUMINANCE_ALPHA
#define GR_GL_COMPRESSED_RGB_S3TC_DXT1_EXT
#define GR_GL_TEXTURE_EXTERNAL
#define GR_GL_CONTEXT_CORE_PROFILE_BIT
#define GR_GL_UNSIGNED_INT_2_10_10_10_REV
static constexpr int kGrGLColorFormatCount
unsigned short int GrGLhalf
#define GR_IS_GR_WEBGL(standard)
unsigned short GrGLushort
#define GR_IS_GR_GL(standard)
#define GR_IS_GR_GL_ES(standard)
bool GrGLFormatIsCompressed(GrGLFormat format)
static constexpr size_t GrGLFormatBytesPerBlock(GrGLFormat format)
#define GR_GL_GetInternalformativ(gl, t, f, n, s, p)
#define GR_GL_VER(major, minor)
static constexpr bool GrGLFormatIsSRGB(GrGLFormat format)
#define GR_GL_GetFloatv(gl, e, p)
#define GR_GL_DRIVER_VER(major, minor, point)
static constexpr int GrGLFormatStencilBits(GrGLFormat format)
#define GR_GL_GetIntegerv(gl, e, p)
static constexpr GrGLenum GrGLFormatToEnum(GrGLFormat format)
#define GR_GL_GetShaderPrecisionFormat(gl, st, pt, range, precision)
static constexpr uint32_t GrGLFormatChannels(GrGLFormat format)
#define GR_GL_CALL_RET(IFACE, RET, X)
@ kRequiresTextureBarrier
static const int kGrColorTypeCnt
#define SkAssertResult(cond)
#define SkDEBUGFAILF(fmt,...)
@ kGrayAlpha_SkColorChannelFlags
@ kAlpha_SkColorChannelFlag
@ kGray_SkColorChannelFlag
static constexpr bool SkTextureCompressionTypeIsOpaque(SkTextureCompressionType compression)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static int SkPrevPow2(int value)
static constexpr int32_t SK_MaxS32
void sk_ignore_unused_variable(const T &)
static constexpr bool SkToBool(const T &x)
bool fSupportsProtectedContent
bool advancedBlendEquationSupport() const
bool fDynamicStateArrayGeometryProcessorTextureSupport
int fMaxPreferredRenderTargetSize
bool fFinishedProcAsyncCallbackSupport
bool fReadPixelsRowBytesSupport
bool fNativeDrawIndexedIndirectIsBroken
const GrShaderCaps * shaderCaps() const
std::unique_ptr< GrShaderCaps > fShaderCaps
bool fPreferClientSideDynamicBuffers
bool fMSAAResolvesAutomatically
bool fReuseScratchTextures
GrDriverBugWorkarounds fDriverBugWorkarounds
bool fNativeDrawIndirectSupport
bool fPreferVRAMUseOverFlushes
bool fTransferFromBufferToBufferSupport
bool fTransferFromBufferToTextureSupport
bool fTextureBarrierSupport
bool fAvoidLargeIndexBufferDraws
uint32_t fAdvBlendEqDisableFlags
bool fTransferPixelsToRowBytesSupport
bool fMustSyncGpuDuringAbandon
bool fBackendSemaphoreSupport
@ kAdvancedCoherent_BlendEquationSupport
@ kAdvanced_BlendEquationSupport
@ kBasic_BlendEquationSupport
bool fHalfFloatVertexAttributeSupport
bool fClampToBorderSupport
bool fSampleLocationsSupport
bool fOversizedStencilSupport
bool fUsePrimitiveRestart
bool fReuseScratchBuffers
bool fWritePixelsRowBytesSupport
bool fShouldCollapseSrcOverToSrcWhenAble
bool fPerformColorClearsAsDraws
bool fAvoidReorderingRenderTasks
bool fNPOTTextureTileSupport
bool fSupportsAHardwareBufferImages
bool fTransferFromSurfaceToBufferSupport
bool fMustClearUploadedBufferData
void finishInitialization(const GrContextOptions &options)
bool fShouldInitializeTextures
BlendEquationSupport fBlendEquationSupport
bool fConservativeRasterSupport
bool fDisableTessellationPathRenderer
bool fUseClientSideIndirectBuffers
bool fPerformStencilClearsAsDraws
bool fDrawInstancedSupport
bool fDisablePerspectiveSDFText
bool fCrossContextTextureSupport
bool fPreferFullscreenClears
uint64_t computeFormatKey(const GrBackendFormat &) const override
DstCopyRestrictions getDstCopyRestrictions(const GrRenderTargetProxy *src, GrColorType) const override
bool isFormatAsColorTypeRenderable(GrColorType ct, const GrBackendFormat &format, int sampleCount=1) const override
skgpu::Swizzle onGetReadSwizzle(const GrBackendFormat &, GrColorType) const override
void getReadPixelsFormat(GrGLFormat surfaceFormat, GrColorType surfaceColorType, GrColorType memoryColorType, GrGLenum *externalFormat, GrGLenum *externalType) const
bool onAreColorTypeAndFormatCompatible(GrColorType, const GrBackendFormat &) const override
@ kNoScalingOrMirroring_BlitFramebufferFlag
@ kResolveMustBeFull_BlitFrambufferFlag
@ kNoSupport_BlitFramebufferFlag
@ kRectsMustMatchForMSAASrc_BlitFramebufferFlag
@ kNoFormatConversion_BlitFramebufferFlag
@ kNoFormatConversionForMSAASrc_BlitFramebufferFlag
@ kNoMSAADst_BlitFramebufferFlag
GrGLenum getRenderbufferInternalFormat(GrGLFormat format) const
bool onSurfaceSupportsWritePixels(const GrSurface *) const override
GrBackendFormat getBackendFormatFromCompressionType(SkTextureCompressionType) const override
bool canCopyAsDraw(GrGLFormat dstFormat, bool srcIsTexturable, bool scalingCopy) const
@ kES_EXT_MsToTexture_MSFBOType
@ kES_IMG_MsToTexture_MSFBOType
GrGLCaps(const GrContextOptions &contextOptions, const GrGLContextInfo &ctxInfo, const GrGLInterface *glInterface)
bool onCanCopySurface(const GrSurfaceProxy *dst, const SkIRect &dstRect, const GrSurfaceProxy *src, const SkIRect &srcRect) const override
int maxRenderTargetSampleCount(const GrBackendFormat &format) const override
void didQueryImplementationReadSupport(GrGLFormat format, GrGLenum readFormat, GrGLenum readType) const
void getTexSubImageExternalFormatAndType(GrGLFormat surfaceFormat, GrColorType surfaceColorType, GrColorType memoryColorType, GrGLenum *externalFormat, GrGLenum *externalType) const
@ kMapBufferRange_MapBufferType
@ kMapBuffer_MapBufferType
@ kChromium_MapBufferType
void onApplyOptionsOverrides(const GrContextOptions &options) override
bool usesMSAARenderBuffers() const
bool rectangleTextureSupport() const
Are textures with GL_TEXTURE_RECTANGLE type supported.
bool hasStencilFormatBeenDeterminedForFormat(GrGLFormat format) const
bool formatSupportsTexStorage(GrGLFormat) const
GrGLenum getFormatDefaultExternalType(GrGLFormat format) const
GrProgramDesc makeDesc(GrRenderTarget *, const GrProgramInfo &, ProgramDescOverrideFlags) const override
bool useDrawInsteadOfAllRenderTargetWrites() const
GrBackendFormat onGetDefaultBackendFormat(GrColorType) const override
SupportedRead onSupportedReadPixelsColorType(GrColorType, const GrBackendFormat &, GrColorType) const override
GrDstSampleFlags onGetDstSampleFlagsForProxy(const GrRenderTargetProxy *) const override
bool isFormatSRGB(const GrBackendFormat &) const override
bool isFormatCopyable(const GrBackendFormat &) const override
bool programBinaryFormatIsValid(GrGLenum binaryFormat) const
SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType, const GrBackendFormat &surfaceFormat, GrColorType srcColorType) const override
void getTexSubImageDefaultFormatTypeAndColorType(GrGLFormat format, GrGLenum *externalFormat, GrGLenum *externalType, GrColorType *colorType) const
GrGLFormat getFormatFromColorType(GrColorType colorType) const
SurfaceReadPixelsSupport surfaceSupportsReadPixels(const GrSurface *) const override
bool isFormatRenderable(const GrBackendFormat &format, int sampleCount) const override
bool canFormatBeFBOColorAttachment(GrGLFormat) const
bool canCopyTexSubImage(GrGLFormat dstFormat, bool dstHasMSAARenderBuffer, const GrTextureType *dstTypeIfTexture, GrGLFormat srcFormat, bool srcHasMSAARenderBuffer, const GrTextureType *srcTypeIfTexture) const
void setStencilFormatIndexForFormat(GrGLFormat, int index)
skgpu::Swizzle getWriteSwizzle(const GrBackendFormat &, GrColorType) const override
int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat &format) const override
bool canCopyAsBlit(GrGLFormat dstFormat, int dstSampleCnt, const GrTextureType *dstTypeIfTexture, GrGLFormat srcFormat, int srcSampleCnt, const GrTextureType *srcTypeIfTexture, const SkRect &srcBounds, bool srcBoundsExact, const SkIRect &srcRect, const SkIRect &dstRect) const
void getTexImageExternalFormatAndType(GrGLFormat surfaceFormat, GrGLenum *externalFormat, GrGLenum *externalType) const
@ kDiscard_InvalidateFBType
@ kInvalidate_InvalidateFBType
bool onIsWindowRectanglesSupportedForRT(const GrBackendRenderTarget &) const override
bool shouldQueryImplementationReadSupport(GrGLFormat format) const
bool onSupportsDynamicMSAA(const GrRenderTargetProxy *) const override
bool isFormatTexturable(const GrBackendFormat &, GrTextureType) const override
void onDumpJSON(SkJSONWriter *) const override
GrGLRenderer webglRenderer() const
bool isRunningOverVirgl() const
GrGLVendor angleVendor() const
GrGLANGLEBackend angleBackend() const
GrGLDriver driver() const
GrGLVendor vendor() const
SkSL::GLSLGeneration glslGeneration() const
GrGLVersion version() const
GrGLVendor webglVendor() const
bool isOverCommandBuffer() const
GrGLRenderer renderer() const
GrGLDriver angleDriver() const
bool hasExtension(const char *ext) const
GrGLRenderer angleRenderer() const
GrGLDriverVersion driverVersion() const
GrGLStandard standard() const
static void Build(GrProgramDesc *, const GrProgramInfo &, const GrCaps &)
bool glRTFBOIDIs0() const
virtual GrRenderTargetProxy * asRenderTargetProxy()
virtual GrTextureProxy * asTextureProxy()
GrTextureType textureType() const
void appendS32(int32_t value)
void beginArray(const char *name=nullptr, bool multiline=true)
void beginObject(const char *name=nullptr, bool multiline=true)
void appendBool(bool value)
void appendCString(const char *value)
void appendHexU32(uint32_t value)
static constexpr Swizzle RGB1()
void resize_back(int newCount)
FlutterSemanticsFlag flags
uint32_t uint32_t * format
static float max(float r, float g, float b)
SK_API bool GetGLFramebufferInfo(const GrBackendRenderTarget &, GrGLFramebufferInfo *)
static void usage(char *argv0)
GrSurfaceProxy::RectsMustMatch fRectsMustMatch
bool fAllowMSAAOnNewIntel
bool fAlwaysUseTexStorageWhenAvailable
bool fDisableDriverCorrectnessWorkarounds
bool fAvoidStencilBuffers
GrGLFunction< GrGLEndTilingFn > fEndTiling
GrGLFunction< GrGLStartTilingFn > fStartTiling
struct GrGLInterface::Functions fFunctions
bool fDstReadInShaderSupport
const char * fSecondaryOutputExtensionString
bool fBitManipulationSupport
const char * fSampleVariablesExtensionString
bool fMustObfuscateUniformColor
bool fPreferFlatInterpolation
const char * fNoPerspectiveInterpolationExtensionString
bool fRequiresLocalOutputColorForFBFetch
bool fMustWriteToFragColor
const char * fFBFetchExtensionString
bool fHasLowFragmentPrecision
bool fNonconstantArrayIndexSupport
constexpr SkISize size() const
constexpr int32_t height() const
constexpr int32_t width() const
static SkRect Make(const SkISize &size)
const char * fExternalTextureExtensionString
bool fMustGuardDivisionEvenAfterExplicitZeroCheck
bool fRewriteMatrixComparisons
bool fExternalTextureSupport
bool fFBFetchNeedsCustomOutput
bool fExplicitTextureLodSupport
bool fMustForceNegatedAtanParamToFloat
bool fDualSourceBlendingSupport
bool fEmulateAbsIntFunction
bool fCanUseVoidInSequenceExpressions
const char * fFBFetchColorName
@ kNotSupported_AdvBlendEqInteraction
@ kAutomatic_AdvBlendEqInteraction
@ kGeneralEnable_AdvBlendEqInteraction
bool fUnfoldShortCircuitAsTernary
bool fShaderDerivativeSupport
bool fRemovePowWithConstantExponent
bool fFlatInterpolationSupport
bool fRewriteDoWhileLoops
const char * fShaderDerivativeExtensionString
bool fRewriteSwitchStatements
bool fInverseHyperbolicSupport
const char * fVersionDeclString
AdvBlendEqInteraction fAdvBlendEqInteraction
bool fBuiltinDeterminantSupport
bool fNoPerspectiveInterpolationSupport
bool fAddAndTrueToLoopCondition
bool fNonsquareMatrixSupport
bool fMustDoOpBetweenFloorAndAbs
bool fMustForceNegatedLdexpParamToMultiply
bool fCanUseFractForNegativeValues
const char * fSecondExternalTextureExtensionString
bool fNoDefaultPrecisionForExternalSamplers
bool fUsesPrecisionModifiers
bool fCanUseMinAndAbsTogether
SkSL::GLSLGeneration fGLSLGeneration