46#include <initializer_list>
52#if defined(SK_BUILD_FOR_IOS)
53#include <TargetConditionals.h>
61 fPackFlipYSupport =
false;
62 fTextureUsageSupport =
false;
63 fImagingSupport =
false;
64 fVertexArrayObjectSupport =
false;
65 fDebugSupport =
false;
66 fES2CompatibilitySupport =
false;
67 fDrawRangeElementsSupport =
false;
68 fBaseVertexBaseInstanceSupport =
false;
69 fIsCoreProfile =
false;
70 fBindFragDataLocationSupport =
false;
71 fRectangleTextureSupport =
false;
72 fBindUniformLocationSupport =
false;
73 fMipmapLevelControlSupport =
false;
74 fMipmapLodControlSupport =
false;
75 fDoManualMipmapping =
false;
76 fClearToBoundaryValuesIsBroken =
false;
77 fClearTextureSupport =
false;
78 fDrawArraysBaseVertexIsBroken =
false;
79 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO =
false;
80 fUseDrawInsteadOfAllRenderTargetWrites =
false;
81 fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines =
false;
82 fDontSetBaseOrMaxLevelForExternalTextures =
false;
83 fNeverDisableColorWrites =
false;
84 fMustSetAnyTexParameterToEnableMipmapping =
false;
85 fAllowBGRA8CopyTexSubImage =
false;
86 fAllowSRGBCopyTexSubImage =
false;
87 fDisallowDynamicMSAA =
false;
88 fMustResetBlendFuncBetweenDualSourceAndDisable =
false;
89 fBindTexture0WhenChangingTextureFBOMultisampleCount =
false;
90 fRebindColorAttachmentAfterCheckFramebufferStatus =
false;
91 fFlushBeforeWritePixels =
false;
92 fDisableScalingCopyAsDraws =
false;
93 fPadRG88TransferAlignment =
false;
94 fProgramBinarySupport =
false;
95 fProgramParameterSupport =
false;
96 fSamplerObjectSupport =
false;
97 fUseSamplerObjects =
false;
98 fTextureSwizzleSupport =
false;
99 fTiledRenderingSupport =
false;
100 fFenceSyncSupport =
false;
101 fFBFetchRequiresEnablePerSample =
false;
102 fSRGBWriteControl =
false;
103 fSkipErrorChecks =
false;
107 this->
init(contextOptions, ctxInfo, glInterface);
126#if defined(GR_TEST_UTILS)
129 this->setDeviceName(
reinterpret_cast<const char*
>(deviceName));
135 fMaxFragmentUniformVectors =
max / 4;
143 &fMaxFragmentUniformVectors);
147 fMaxFragmentUniformVectors =
std::min(fMaxFragmentUniformVectors, 32);
154 fPackFlipYSupport =
false;
161 ctxInfo.
hasExtension(
"GL_ANGLE_pack_reverse_row_order");
207 }
else if (ctxInfo.
hasExtension(
"GL_EXT_discard_framebuffer")) {
241 fDebugSupport =
true;
245 fDebugSupport =
false;
249 fES2CompatibilitySupport = ctxInfo.
hasExtension(
"GL_ARB_ES2_compatibility");
252 fES2CompatibilitySupport =
true;
254 fES2CompatibilitySupport =
true;
258 fClientCanDisableMultisample =
true;
260 fClientCanDisableMultisample = ctxInfo.
hasExtension(
"GL_EXT_multisample_compatibility");
262 fClientCanDisableMultisample =
false;
285 fBindFragDataLocationSupport =
true;
289 fBindFragDataLocationSupport =
true;
292 fBindFragDataLocationSupport =
false;
295 fBindUniformLocationSupport = ctxInfo.
hasExtension(
"GL_CHROMIUM_bind_uniform_location");
300 fRectangleTextureSupport =
true;
303 fRectangleTextureSupport = ctxInfo.
hasExtension(
"GL_ARB_texture_rectangle") ||
306 fRectangleTextureSupport =
false;
329 fTextureSwizzleSupport =
true;
333 fTextureSwizzleSupport =
true;
336 fTextureSwizzleSupport =
false;
340 fMipmapLevelControlSupport =
true;
341 fMipmapLodControlSupport =
true;
344 fMipmapLevelControlSupport =
true;
345 fMipmapLodControlSupport =
true;
348 fMipmapLevelControlSupport =
false;
349 fMipmapLodControlSupport =
false;
366 fClearTextureSupport = ctxInfo.
hasExtension(
"GL_EXT_clear_texture");
368 fClearTextureSupport =
false;
371#if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
382 fSRGBWriteControl = ctxInfo.
hasExtension(
"GL_EXT_sRGB_write_control");
388 fSkipErrorChecks =
true;
395 if (!ctxInfo.
hasExtension(
"GL_EXT_protected_textures")) {
409 this->initGLSL(ctxInfo, gli);
459 if (ctxInfo.
hasExtension(
"GL_NV_conservative_raster")) {
480 static const uint8_t kMaxSaneSamplers = 32;
505 this->initFSAASupport(contextOptions, ctxInfo, gli);
506 this->initStencilSupport(ctxInfo);
514 fBlitFramebufferFlags = 0;
522 }
else if (ctxInfo.
hasExtension(
"GL_CHROMIUM_framebuffer_multisample") ||
534 this->initBlendEqationSupport(ctxInfo);
620 ctxInfo.
hasExtension(
"GL_ARB_texture_filter_anisotropic") ||
621 ctxInfo.
hasExtension(
"GL_EXT_texture_filter_anisotropic");
670#ifdef SK_BUILD_FOR_WIN
713 if (fBaseVertexBaseInstanceSupport) {
722 if (ctxInfo.
hasExtension(
"GL_ANGLE_base_vertex_base_instance")) {
723 fBaseVertexBaseInstanceSupport =
true;
729 fBaseVertexBaseInstanceSupport = ctxInfo.
hasExtension(
"GL_EXT_base_instance");
740 "WEBGL_draw_instanced_base_vertex_base_instance");
741 if (fBaseVertexBaseInstanceSupport && ctxInfo.
hasExtension(
742 "GL_WEBGL_multi_draw_instanced_base_vertex_base_instance")) {
753 fBaseVertexBaseInstanceSupport =
false;
779 fFenceSyncSupport =
true;
804 fProgramBinarySupport =
809 if (fProgramBinarySupport) {
815 reinterpret_cast<GrGLint*
>(fProgramBinaryFormats.
data()));
817 fProgramBinarySupport =
false;
821 fSamplerObjectSupport =
829 fUseSamplerObjects = fSamplerObjectSupport;
832 fTiledRenderingSupport = ctxInfo.
hasExtension(
"GL_QCOM_tiled_rendering");
839#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
848 FormatWorkarounds formatWorkarounds;
851 this->applyDriverCorrectnessWorkarounds(ctxInfo, contextOptions, gli,
shaderCaps,
856 this->initFormatTable(ctxInfo, gli, formatWorkarounds);
865 bool isCoreProfile) {
867 switch (generation) {
869 return "#version 110\n";
871 return "#version 130\n";
873 return "#version 140\n";
876 return "#version 150\n";
878 return "#version 150 compatibility\n";
882 return "#version 330\n";
884 return "#version 330 compatibility\n";
888 return "#version 400\n";
890 return "#version 400 compatibility\n";
894 return "#version 420\n";
896 return "#version 420 compatibility\n";
902 switch (generation) {
904 return "#version 100\n";
906 return "#version 300 es\n";
908 return "#version 310 es\n";
910 return "#version 320 es\n";
915 return "<no version>";
931 if (range[0] < 127 || range[1] < 127 ||
bits < 23) {
951 if (ctxInfo.
hasExtension(
"GL_EXT_shader_framebuffer_fetch")) {
956 fFBFetchRequiresEnablePerSample =
false;
957 }
else if (ctxInfo.
hasExtension(
"GL_NV_shader_framebuffer_fetch")) {
963 fFBFetchRequiresEnablePerSample =
false;
964 }
else if (ctxInfo.
hasExtension(
"GL_ARM_shader_framebuffer_fetch")) {
970 fFBFetchRequiresEnablePerSample =
true;
974 if (ctxInfo.
hasExtension(
"GL_EXT_shader_framebuffer_fetch")) {
979 fFBFetchRequiresEnablePerSample =
false;
1010 if (ctxInfo.
hasExtension(
"GL_NV_shader_noperspective_interpolation") &&
1014 "GL_NV_shader_noperspective_interpolation";
1023 }
else if (ctxInfo.
hasExtension(
"GL_OES_sample_variables")) {
1043 if (ctxInfo.
hasExtension(
"GL_OES_EGL_image_external")) {
1047 }
else if (ctxInfo.
hasExtension(
"GL_OES_EGL_image_external_essl3") ||
1048 ctxInfo.
hasExtension(
"OES_EGL_image_external_essl3")) {
1105 }
else if (ctxInfo.
hasExtension(
"GL_EXT_framebuffer_multisample") &&
1112 if (ctxInfo.
hasExtension(
"GL_EXT_multisampled_render_to_texture")) {
1115 }
else if (ctxInfo.
hasExtension(
"GL_IMG_multisampled_render_to_texture")) {
1120 }
else if (ctxInfo.
hasExtension(
"GL_CHROMIUM_framebuffer_multisample")) {
1122 }
else if (ctxInfo.
hasExtension(
"GL_ANGLE_framebuffer_multisample")) {
1124 }
else if (ctxInfo.
hasExtension(
"GL_APPLE_framebuffer_multisample")) {
1137void GrGLCaps::initBlendEqationSupport(
const GrGLContextInfo& ctxInfo) {
1140 bool layoutQualifierSupport =
false;
1143 layoutQualifierSupport =
true;
1148 if (ctxInfo.
hasExtension(
"GL_NV_blend_equation_advanced_coherent")) {
1151 }
else if (ctxInfo.
hasExtension(
"GL_KHR_blend_equation_advanced_coherent") &&
1152 layoutQualifierSupport) {
1155 }
else if (ctxInfo.
hasExtension(
"GL_NV_blend_equation_advanced")) {
1158 }
else if (ctxInfo.
hasExtension(
"GL_KHR_blend_equation_advanced") && layoutQualifierSupport) {
1174 bool supportsPackedDS =
1184 if (supportsPackedDS) {
1204#ifdef SK_ENABLE_DUMP_GPU
1208 switch (multiDrawType) {
1224 for (
int i = 0;
i < fStencilFormats.
size(); ++
i) {
1233 auto msfboStr = [&] {
1234 switch (fMSFBOType) {
1244 auto invalidateFBTypeStr = [&] {
1245 switch (fInvalidateFBType) {
1253 auto invalidateBufferTypeStr = [&] {
1254 switch (fInvalidateBufferType) {
1262 auto mapBufferTypeStr = [&] {
1263 switch (fMapBufferType) {
1272 writer->
appendBool(
"Core Profile", fIsCoreProfile);
1274 writer->
appendCString(
"Invalidate FB Type", invalidateFBTypeStr());
1275 writer->
appendCString(
"Invalidate Buffer Type", invalidateBufferTypeStr());
1276 writer->
appendCString(
"Map Buffer Type", mapBufferTypeStr());
1277 writer->
appendCString(
"Multi Draw Type", multi_draw_type_name(fMultiDrawType));
1278 writer->
appendS32(
"Max FS Uniform Vectors", fMaxFragmentUniformVectors);
1279 writer->
appendBool(
"Pack Flip Y support", fPackFlipYSupport);
1281 writer->
appendBool(
"Texture Usage support", fTextureUsageSupport);
1282 writer->
appendBool(
"GL_ARB_imaging support", fImagingSupport);
1283 writer->
appendBool(
"Vertex array object support", fVertexArrayObjectSupport);
1284 writer->
appendBool(
"Debug support", fDebugSupport);
1285 writer->
appendBool(
"ES2 compatibility support", fES2CompatibilitySupport);
1286 writer->
appendBool(
"drawRangeElements support", fDrawRangeElementsSupport);
1287 writer->
appendBool(
"Base (vertex base) instance support", fBaseVertexBaseInstanceSupport);
1288 writer->
appendBool(
"Bind uniform location support", fBindUniformLocationSupport);
1289 writer->
appendBool(
"Rectangle texture support", fRectangleTextureSupport);
1290 writer->
appendBool(
"Mipmap LOD control support", fMipmapLodControlSupport);
1291 writer->
appendBool(
"Mipmap level control support", fMipmapLevelControlSupport);
1292 writer->
appendBool(
"Clear texture support", fClearTextureSupport);
1293 writer->
appendBool(
"Program binary support", fProgramBinarySupport);
1294 writer->
appendBool(
"Program parameters support", fProgramParameterSupport);
1295 writer->
appendBool(
"Sampler object support", fSamplerObjectSupport);
1296 writer->
appendBool(
"Using sampler objects", fUseSamplerObjects);
1297 writer->
appendBool(
"Texture swizzle support", fTextureSwizzleSupport);
1298 writer->
appendBool(
"Tiled rendering support", fTiledRenderingSupport);
1299 writer->
appendBool(
"Fence sync support", fFenceSyncSupport);
1300 writer->
appendBool(
"FB fetch requires enable per sample", fFBFetchRequiresEnablePerSample);
1301 writer->
appendBool(
"sRGB Write Control", fSRGBWriteControl);
1303 writer->
appendBool(
"Intermediate texture for partial updates of unorm textures ever bound to FBOs",
1304 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO);
1305 writer->
appendBool(
"Intermediate texture for all updates of textures bound to FBOs",
1306 fUseDrawInsteadOfAllRenderTargetWrites);
1307 writer->
appendBool(
"Max instances per draw without crashing (or zero)",
1308 fMaxInstancesPerDrawWithoutCrashing);
1315 writer->
appendHexU32(
"f_type", (uint32_t)fFormatTable[
i].fFormatType);
1316 writer->
appendHexU32(
"c_internal", fFormatTable[
i].fCompressedInternalFormat);
1317 writer->
appendHexU32(
"i_for_teximage", fFormatTable[
i].fInternalFormatForTexImageOrStorage);
1318 writer->
appendHexU32(
"i_for_renderbuffer", fFormatTable[
i].fInternalFormatForRenderbuffer);
1319 writer->
appendHexU32(
"default_ex_format", fFormatTable[
i].fDefaultExternalFormat);
1320 writer->
appendHexU32(
"default_ex_type", fFormatTable[
i].fDefaultExternalType);
1321 writer->
appendHexU32(
"default_color_type", (uint32_t)fFormatTable[
i].fDefaultColorType);
1324 for (
int j = 0; j < fFormatTable[
i].fColorTypeInfoCount; ++j) {
1325 const auto& ctInfo = fFormatTable[
i].fColorTypeInfos[j];
1327 writer->
appendHexU32(
"colorType", (uint32_t)ctInfo.fColorType);
1331 for (
int k = 0; k < ctInfo.fExternalIOFormatCount; ++k) {
1332 const auto& ioInfo = ctInfo.fExternalIOFormats[k];
1334 writer->
appendHexU32(
"colorType", (uint32_t)ioInfo.fColorType);
1336 writer->
appendHexU32(
"ex_teximage", ioInfo.fExternalTexImageFormat);
1337 writer->
appendHexU32(
"ex_read", ioInfo.fExternalReadFormat);
1356 const auto&
info = this->getFormatInfo(surfaceFormat);
1357 *externalType =
info.fDefaultExternalType;
1358 *externalFormat =
info.fDefaultExternalFormat;
1365 const auto&
info = this->getFormatInfo(
format);
1366 *externalType =
info.fDefaultExternalType;
1367 *externalFormat =
info.fDefaultExternalFormat;
1376 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType,
1377 kTexImage_ExternalFormatUsage, externalFormat, externalType);
1383 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType,
1384 kReadPixels_ExternalFormatUsage, externalFormat, externalType);
1390 SkASSERT(externalFormat && externalType);
1391 *externalFormat = this->getFormatInfo(surfaceFormat).externalFormat(
1392 surfaceColorType, memoryColorType,
usage);
1393 *externalType = this->getFormatInfo(surfaceFormat).externalType(
1394 surfaceColorType, memoryColorType);
1399 this->getFormatInfo(
format).fStencilFormatIndex =
1400 index < 0 ? FormatInfo::kUnsupported_StencilFormatIndex : index;
1406 fColorTypeToFormatTable[idx] =
format;
1410 const FormatWorkarounds& formatWorkarounds) {
1416 uint32_t nonMSAARenderFlags = FormatInfo::kFBOColorAttachment_Flag;
1417 uint32_t msaaRenderFlags = nonMSAARenderFlags;
1419 msaaRenderFlags |= FormatInfo::kFBOColorAttachmentWithMSAA_Flag;
1422 bool texStorageSupported =
false;
1435 texStorageSupported =
false;
1438 if (formatWorkarounds.fDisableTexStorage) {
1439 texStorageSupported =
false;
1444 bool texImageSupportsSizedInternalFormat =
1448 uint32_t fpRenderFlags = (
GR_IS_GR_GL(standard)) ? msaaRenderFlags : nonMSAARenderFlags;
1465 info.fFormatType = FormatType::kNormalizedFixedPoint;
1470 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1472 info.fFlags |= msaaRenderFlags;
1476 info.fFlags |= msaaRenderFlags;
1479 info.fFlags |= msaaRenderFlags;
1482 if (texStorageSupported) {
1483 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1486 info.fInternalFormatForTexImageOrStorage =
1490 bool supportsBGRAColorType =
GR_IS_GR_GL(standard) &&
1492 info.fColorTypeInfoCount = supportsBGRAColorType ? 3 : 2;
1493 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1497 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1499 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1503 ctInfo.fExternalIOFormatCount = 2;
1504 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1505 ctInfo.fExternalIOFormatCount);
1509 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1512 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
1517 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1520 ioFormat.fExternalTexImageFormat = 0;
1521 ioFormat.fExternalReadFormat =
1522 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
1524 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1529 if (supportsBGRAColorType) {
1530 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1532 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1536 ctInfo.fExternalIOFormatCount = 2;
1537 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1538 ctInfo.fExternalIOFormatCount);
1542 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1545 ioFormat.fExternalTexImageFormat =
GR_GL_BGRA;
1546 ioFormat.fExternalReadFormat =
1547 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
1549 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1554 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1557 ioFormat.fExternalTexImageFormat = 0;
1564 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1566 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1570 ctInfo.fExternalIOFormatCount = 1;
1571 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1572 ctInfo.fExternalIOFormatCount);
1576 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1579 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
1588 info.fFormatType = FormatType::kNormalizedFixedPoint;
1593 bool r8Support =
false;
1601 if (formatWorkarounds.fDisallowR8ForPowerVRSGX54x) {
1606 info.fFlags |= FormatInfo::kTexturable_Flag
1607 | FormatInfo::kTransfers_Flag
1611 if (texStorageSupported) {
1612 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1615 info.fInternalFormatForTexImageOrStorage =
1620 info.fColorTypeInfoCount = 3;
1621 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1625 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1627 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1631 ctInfo.fExternalIOFormatCount = 2;
1632 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1633 ctInfo.fExternalIOFormatCount);
1637 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1640 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
1641 ioFormat.fExternalReadFormat =
GR_GL_RED;
1643 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1648 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1651 ioFormat.fExternalTexImageFormat = 0;
1658 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1660 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
1666 ctInfo.fExternalIOFormatCount = 2;
1667 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1668 ctInfo.fExternalIOFormatCount);
1672 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1675 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
1676 ioFormat.fExternalReadFormat =
GR_GL_RED;
1678 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1683 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1686 ioFormat.fExternalTexImageFormat = 0;
1693 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1695 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1700 ctInfo.fExternalIOFormatCount = 2;
1701 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1702 ctInfo.fExternalIOFormatCount);
1706 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1709 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
1710 ioFormat.fExternalReadFormat =
GR_GL_RED;
1712 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1717 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1720 ioFormat.fExternalTexImageFormat = 0;
1729 bool alpha8IsValidForGL =
GR_IS_GR_GL(standard) &&
1735 info.fFormatType = FormatType::kNormalizedFixedPoint;
1739 bool alpha8SizedEnumSupported =
1740 alpha8IsValidForGL ||
1741 (alpha8IsValidForGLES && ctxInfo.
hasExtension(
"GL_EXT_texture_storage"));
1742 bool alpha8TexStorageSupported = alpha8SizedEnumSupported && texStorageSupported;
1744 bool alpha8IsRenderable =
false;
1745 if (alpha8IsValidForGL) {
1755 if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
1756 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1758 if (alpha8IsRenderable && alpha8IsValidForGL) {
1760 SkASSERT(alpha8SizedEnumSupported);
1761 info.fFlags |= msaaRenderFlags;
1763 if (alpha8TexStorageSupported) {
1764 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1769 if (!
GR_IS_GR_GL_ES(standard) && texImageSupportsSizedInternalFormat &&
1770 alpha8SizedEnumSupported) {
1777 if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
1778 info.fColorTypeInfoCount = 1;
1779 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1783 if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
1784 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1786 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag |
1787 ColorTypeInfo::kRenderable_Flag;
1794 ctInfo.fExternalIOFormatCount = 2;
1795 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1796 ctInfo.fExternalIOFormatCount);
1800 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1806 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
1811 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1814 ioFormat.fExternalTexImageFormat = 0;
1823 bool lum8Supported =
false;
1824 bool lum8SizedFormatSupported =
false;
1826 lum8Supported =
true;
1827 lum8SizedFormatSupported =
true;
1829 lum8Supported =
true;
1834 lum8SizedFormatSupported =
1835 texStorageSupported && ctxInfo.
hasExtension(
"GL_EXT_texture_storage");
1837 lum8Supported =
true;
1843 info.fFormatType = FormatType::kNormalizedFixedPoint;
1849 if (lum8Supported) {
1850 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1852 if (texStorageSupported && lum8SizedFormatSupported) {
1853 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1855 }
else if (texImageSupportsSizedInternalFormat && lum8SizedFormatSupported) {
1869 if (lum8Supported) {
1870 info.fColorTypeInfoCount = 1;
1871 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1875 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1877 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1884 ctInfo.fExternalIOFormatCount = 2;
1885 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1886 ctInfo.fExternalIOFormatCount);
1890 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1894 ioFormat.fExternalReadFormat = 0;
1899 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1902 ioFormat.fExternalTexImageFormat = 0;
1912 info.fFormatType = FormatType::kNormalizedFixedPoint;
1917 if (lum8Supported) {
1918 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
1920 if (texStorageSupported && lum8SizedFormatSupported) {
1921 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
1923 }
else if (texImageSupportsSizedInternalFormat && lum8SizedFormatSupported) {
1930 if (lum8Supported) {
1931 info.fColorTypeInfoCount = 1;
1932 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
1936 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
1938 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
1946 ctInfo.fExternalIOFormatCount = 2;
1947 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
1948 ctInfo.fExternalIOFormatCount);
1952 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1956 ioFormat.fExternalReadFormat = 0;
1961 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
1964 ioFormat.fExternalTexImageFormat = 0;
1973 info.fFormatType = FormatType::kNormalizedFixedPoint;
1982 if (ctxInfo.
hasExtension(
"GL_EXT_texture_format_BGRA8888")) {
2000 bool supportsBGRATexStorage =
false;
2003 if (ctxInfo.
hasExtension(
"GL_EXT_texture_format_BGRA8888")) {
2014 info.fFlags = FormatInfo::kTexturable_Flag
2015 | FormatInfo::kTransfers_Flag;
2037 info.fFlags |= msaaRenderFlags;
2046 info.fFlags |= nonMSAARenderFlags;
2052 !formatWorkarounds.fDisableBGRATextureStorageForIntelWindowsES) {
2053 supportsBGRATexStorage =
true;
2055 }
else if (ctxInfo.
hasExtension(
"GL_APPLE_texture_format_BGRA8888")) {
2067 info.fFlags = FormatInfo::kTexturable_Flag
2068 | FormatInfo::kTransfers_Flag
2073 supportsBGRATexStorage =
true;
2077 if (texStorageSupported && supportsBGRATexStorage) {
2078 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2081 info.fInternalFormatForTexImageOrStorage = bgraTexImageFormat;
2084 if (
SkToBool(
info.fFlags & FormatInfo::kTexturable_Flag)) {
2085 info.fColorTypeInfoCount = 2;
2086 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2090 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2092 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2096 ctInfo.fExternalIOFormatCount = 2;
2097 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2098 ctInfo.fExternalIOFormatCount);
2102 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2105 ioFormat.fExternalTexImageFormat =
GR_GL_BGRA;
2106 ioFormat.fExternalReadFormat = 0;
2107 ioFormat.fExternalReadFormat =
2108 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
2110 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2115 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2118 ioFormat.fExternalTexImageFormat = 0;
2125 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2127 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
2131 ctInfo.fExternalIOFormatCount = 1;
2132 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2133 ctInfo.fExternalIOFormatCount);
2137 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2140 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2150 info.fFormatType = FormatType::kNormalizedFixedPoint;
2157 info.fFlags = FormatInfo::kTexturable_Flag
2158 | FormatInfo::kTransfers_Flag
2162 info.fFlags = FormatInfo::kTexturable_Flag
2163 | FormatInfo::kTransfers_Flag
2166 info.fFlags = FormatInfo::kTexturable_Flag
2167 | FormatInfo::kTransfers_Flag
2178 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2181 info.fInternalFormatForTexImageOrStorage =
2185 if (
SkToBool(
info.fFlags &FormatInfo::kTexturable_Flag)) {
2186 info.fColorTypeInfoCount = 1;
2187 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2191 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2193 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2197 ctInfo.fExternalIOFormatCount = 2;
2198 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2199 ctInfo.fExternalIOFormatCount);
2203 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2206 ioFormat.fExternalTexImageFormat =
GR_GL_RGB;
2207 ioFormat.fExternalReadFormat =
GR_GL_RGB;
2209 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2214 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2217 ioFormat.fExternalTexImageFormat = 0;
2230 info.fDefaultExternalType = halfFloatType;
2232 bool rgba16FTextureSupport =
false;
2233 bool rgba16FRenderTargetSupport =
false;
2237 rgba16FTextureSupport =
true;
2238 rgba16FRenderTargetSupport =
true;
2239 }
else if (ctxInfo.
hasExtension(
"GL_ARB_texture_float")) {
2240 rgba16FTextureSupport =
true;
2244 rgba16FTextureSupport =
true;
2245 rgba16FRenderTargetSupport =
2247 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
2249 }
else if (ctxInfo.
hasExtension(
"GL_OES_texture_half_float") &&
2250 ctxInfo.
hasExtension(
"GL_OES_texture_half_float_linear")) {
2251 rgba16FTextureSupport =
true;
2252 rgba16FRenderTargetSupport = ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float");
2256 rgba16FTextureSupport =
true;
2257 rgba16FRenderTargetSupport =
2258 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
2262 }
else if ((ctxInfo.
hasExtension(
"GL_OES_texture_half_float") ||
2264 (ctxInfo.
hasExtension(
"GL_OES_texture_half_float_linear") ||
2265 ctxInfo.
hasExtension(
"OES_texture_half_float_linear"))) {
2266 rgba16FTextureSupport =
true;
2268 rgba16FRenderTargetSupport =
2269 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
2274 if (rgba16FTextureSupport) {
2275 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2276 if (rgba16FRenderTargetSupport) {
2277 info.fFlags |= fpRenderFlags;
2280 if (texStorageSupported && !formatWorkarounds.fDisableRGBA16FTexStorageForCrBug1008003) {
2281 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2284 info.fInternalFormatForTexImageOrStorage =
2288 if (rgba16FTextureSupport) {
2289 uint32_t
flags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2291 info.fColorTypeInfoCount = 2;
2292 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2296 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2298 ctInfo.fFlags =
flags;
2302 ctInfo.fExternalIOFormatCount = 2;
2303 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2304 ctInfo.fExternalIOFormatCount);
2308 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2310 ioFormat.fExternalType = halfFloatType;
2311 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2314 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2319 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2322 ioFormat.fExternalTexImageFormat = 0;
2329 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2331 ctInfo.fFlags =
flags;
2335 ctInfo.fExternalIOFormatCount = 2;
2336 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2337 ctInfo.fExternalIOFormatCount);
2341 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2343 ioFormat.fExternalType = halfFloatType;
2344 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2347 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2352 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2355 ioFormat.fExternalTexImageFormat = 0;
2368 info.fDefaultExternalType = halfFloatType;
2370 bool r16FTextureSupport =
false;
2371 bool r16FRenderTargetSupport =
false;
2375 r16FTextureSupport =
true;
2376 r16FRenderTargetSupport =
true;
2385 r16FTextureSupport =
true;
2388 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float");
2392 r16FTextureSupport =
true;
2393 r16FRenderTargetSupport = ctxInfo.
hasExtension(
"GL_EXT_color_buffer_float") ||
2398 if (r16FTextureSupport) {
2399 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2400 if (r16FRenderTargetSupport) {
2401 info.fFlags |= fpRenderFlags;
2404 if (texStorageSupported) {
2405 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2408 info.fInternalFormatForTexImageOrStorage =
2412 if (r16FTextureSupport) {
2414 info.fColorTypeInfoCount = 1;
2415 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2418 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2420 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2426 ctInfo.fExternalIOFormatCount = 2;
2427 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2428 ctInfo.fExternalIOFormatCount);
2432 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2434 ioFormat.fExternalType = halfFloatType;
2435 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
2436 ioFormat.fExternalReadFormat =
GR_GL_RED;
2438 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2443 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2446 ioFormat.fExternalTexImageFormat = 0;
2457 bool lum16FSupported =
false;
2458 bool lum16FSizedFormatSupported =
false;
2459 GrGLenum lumHalfFloatType = halfFloatType;
2461 if (!fIsCoreProfile && ctxInfo.
hasExtension(
"GL_ARB_texture_float")) {
2462 lum16FSupported =
true;
2463 lum16FSizedFormatSupported =
true;
2466 if (ctxInfo.
hasExtension(
"GL_OES_texture_half_float_linear") &&
2468 lum16FSupported =
true;
2475 lum16FSizedFormatSupported = ctxInfo.
hasExtension(
"GL_EXT_texture_storage");
2479 if (formatWorkarounds.fDisableLuminance16F) {
2480 lum16FSupported =
false;
2487 info.fDefaultExternalType = lumHalfFloatType;
2490 if (lum16FSupported) {
2491 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2493 if (texStorageSupported && lum16FSizedFormatSupported) {
2494 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2496 }
else if (texImageSupportsSizedInternalFormat && lum16FSizedFormatSupported) {
2502 info.fColorTypeInfoCount = 1;
2503 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2507 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2509 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag;
2519 ctInfo.fExternalIOFormatCount = 2;
2520 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2521 ctInfo.fExternalIOFormatCount);
2525 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2527 ioFormat.fExternalType = lumHalfFloatType;
2529 ioFormat.fExternalReadFormat = 0;
2534 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2537 ioFormat.fExternalTexImageFormat = 0;
2547 info.fFormatType = FormatType::kNormalizedFixedPoint;
2553 bool supportsSizedRGBX =
false;
2559 (texStorageSupported || texImageSupportsSizedInternalFormat)) {
2560 supportsSizedRGBX =
true;
2563 if (supportsSizedRGBX) {
2565 info.fFlags = FormatInfo::kTexturable_Flag |
2566 FormatInfo::kTransfers_Flag |
2568 if (texStorageSupported) {
2569 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2571 info.fColorTypeInfoCount = 1;
2572 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2576 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2578 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2582 ctInfo.fExternalIOFormatCount = 2;
2583 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2584 ctInfo.fExternalIOFormatCount);
2588 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2591 ioFormat.fExternalTexImageFormat =
GR_GL_RGB;
2592 ioFormat.fExternalReadFormat = 0;
2597 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2600 ioFormat.fExternalTexImageFormat = 0;
2610 info.fFormatType = FormatType::kNormalizedFixedPoint;
2615 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2622 info.fFlags |= nonMSAARenderFlags;
2626 info.fFlags |= msaaRenderFlags;
2630 info.fFlags |= msaaRenderFlags;
2632 if (texStorageSupported) {
2633 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2636 info.fInternalFormatForTexImageOrStorage =
2640 info.fColorTypeInfoCount = 1;
2641 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2645 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2647 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2655 ctInfo.fExternalIOFormatCount = 2;
2656 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2657 ctInfo.fExternalIOFormatCount);
2661 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2664 ioFormat.fExternalTexImageFormat =
GR_GL_RGB;
2665 ioFormat.fExternalReadFormat = 0;
2670 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2673 ioFormat.fExternalTexImageFormat = 0;
2682 info.fFormatType = FormatType::kNormalizedFixedPoint;
2687 bool rg8Support =
false;
2696 info.fFlags |= FormatInfo::kTexturable_Flag
2697 | FormatInfo::kTransfers_Flag
2699 if (texStorageSupported) {
2700 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2704 if (!(
info.fFlags & FormatInfo::kUseTexStorage_Flag)) {
2705 info.fInternalFormatForTexImageOrStorage =
2709 info.fColorTypeInfoCount = 1;
2710 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2714 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2716 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2720 ctInfo.fExternalIOFormatCount = 2;
2721 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2722 ctInfo.fExternalIOFormatCount);
2726 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2729 ioFormat.fExternalTexImageFormat =
GR_GL_RG;
2730 ioFormat.fExternalReadFormat = 0;
2731 if (
GR_IS_GR_GL(standard) && !formatWorkarounds.fDisallowDirectRG8ReadPixels) {
2732 ioFormat.fExternalReadFormat =
GR_GL_RG;
2738 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2741 ioFormat.fExternalTexImageFormat = 0;
2751 info.fFormatType = FormatType::kNormalizedFixedPoint;
2758 info.fFlags = FormatInfo::kTexturable_Flag
2759 | FormatInfo::kTransfers_Flag
2762 ctxInfo.
hasExtension(
"GL_EXT_texture_type_2_10_10_10_REV")) {
2763 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2766 if (texStorageSupported) {
2767 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2770 info.fInternalFormatForTexImageOrStorage =
2774 if (
SkToBool(
info.fFlags & FormatInfo::kTexturable_Flag)) {
2775 bool supportsBGRAColorType =
GR_IS_GR_GL(standard) &&
2778 info.fColorTypeInfoCount = supportsBGRAColorType ? 2 : 1;
2779 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2783 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2785 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2789 ctInfo.fExternalIOFormatCount = 2;
2790 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2791 ctInfo.fExternalIOFormatCount);
2795 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2798 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2801 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2806 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2809 ioFormat.fExternalTexImageFormat = 0;
2815 if (supportsBGRAColorType) {
2816 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2818 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2822 ctInfo.fExternalIOFormatCount = 2;
2823 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2824 ctInfo.fExternalIOFormatCount);
2828 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2831 ioFormat.fExternalTexImageFormat =
GR_GL_BGRA;
2832 ioFormat.fExternalReadFormat =
2833 formatWorkarounds.fDisallowBGRA8ReadPixels ? 0 :
GR_GL_BGRA;
2835 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2840 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2843 ioFormat.fExternalTexImageFormat = 0;
2853 info.fFormatType = FormatType::kNormalizedFixedPoint;
2858 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2861 info.fFlags |= msaaRenderFlags;
2864 info.fFlags |= msaaRenderFlags;
2866 info.fFlags |= msaaRenderFlags;
2868 if (texStorageSupported) {
2869 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2872 info.fInternalFormatForTexImageOrStorage =
2876 info.fColorTypeInfoCount = 1;
2877 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2881 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2883 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2887 ctInfo.fExternalIOFormatCount = 2;
2888 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2889 ctInfo.fExternalIOFormatCount);
2893 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2896 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
2899 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
2904 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
2907 ioFormat.fExternalTexImageFormat = 0;
2916 info.fFormatType = FormatType::kNormalizedFixedPoint;
2923 bool srgb8Alpha8TexStorageSupported = texStorageSupported;
2924 bool srgb8Alpha8TextureSupport =
false;
2925 bool srgb8Alpha8RenderTargetSupport =
false;
2928 srgb8Alpha8TextureSupport =
true;
2929 srgb8Alpha8RenderTargetSupport =
true;
2930 }
else if (ctxInfo.
hasExtension(
"GL_EXT_texture_sRGB")) {
2931 srgb8Alpha8TextureSupport =
true;
2934 srgb8Alpha8RenderTargetSupport =
true;
2939 srgb8Alpha8TextureSupport =
true;
2940 srgb8Alpha8RenderTargetSupport =
true;
2946 srgb8Alpha8TexStorageSupported =
false;
2953 srgb8Alpha8TextureSupport =
true;
2954 srgb8Alpha8RenderTargetSupport =
true;
2960 SkASSERT(!srgb8Alpha8TexStorageSupported);
2964 if (srgb8Alpha8TextureSupport) {
2965 info.fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
2966 if (srgb8Alpha8RenderTargetSupport) {
2967 info.fFlags |= formatWorkarounds.fDisableSRGBRenderWithMSAAForMacAMD
2968 ? nonMSAARenderFlags
2972 if (srgb8Alpha8TexStorageSupported) {
2973 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
2976 info.fInternalFormatForTexImageOrStorage =
2980 if (srgb8Alpha8TextureSupport) {
2981 info.fColorTypeInfoCount = 1;
2982 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
2986 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
2988 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
2992 ctInfo.fExternalIOFormatCount = 1;
2993 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
2994 ctInfo.fExternalIOFormatCount);
3012 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3015 ioFormat.fExternalTexImageFormat = texImageExternalFormat;
3025 info.fFormatType = FormatType::kNormalizedFixedPoint;
3028 if (ctxInfo.
hasExtension(
"GL_EXT_texture_compression_s3tc")) {
3029 info.fFlags = FormatInfo::kTexturable_Flag;
3032 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_s3tc")) {
3033 info.fFlags = FormatInfo::kTexturable_Flag;
3043 info.fFormatType = FormatType::kNormalizedFixedPoint;
3046 if (ctxInfo.
hasExtension(
"GL_EXT_texture_compression_s3tc")) {
3047 info.fFlags = FormatInfo::kTexturable_Flag;
3050 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_s3tc")) {
3051 info.fFlags = FormatInfo::kTexturable_Flag;
3061 info.fFormatType = FormatType::kNormalizedFixedPoint;
3063 if (!formatWorkarounds.fDisallowETC2Compression) {
3067 info.fFlags = FormatInfo::kTexturable_Flag;
3071 ctxInfo.
hasExtension(
"GL_OES_compressed_ETC2_RGB8_texture")) {
3072 info.fFlags = FormatInfo::kTexturable_Flag;
3075 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_etc")) {
3076 info.fFlags = FormatInfo::kTexturable_Flag;
3087 info.fFormatType = FormatType::kNormalizedFixedPoint;
3090 if (ctxInfo.
hasExtension(
"GL_OES_compressed_ETC1_RGB8_texture")) {
3091 info.fFlags = FormatInfo::kTexturable_Flag;
3094 if (ctxInfo.
hasExtension(
"WEBGL_compressed_texture_etc1")) {
3095 info.fFlags = FormatInfo::kTexturable_Flag;
3106 info.fFormatType = FormatType::kNormalizedFixedPoint;
3111 bool r16Supported =
false;
3112 if (!formatWorkarounds.fDisallowTextureUnorm16) {
3117 r16Supported = ctxInfo.
hasExtension(
"GL_EXT_texture_norm16");
3122 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
3123 if (!formatWorkarounds.fDisallowUnorm16Transfers) {
3124 info.fFlags |= FormatInfo::kTransfers_Flag;
3128 if (texStorageSupported) {
3129 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3132 info.fInternalFormatForTexImageOrStorage =
3137 info.fColorTypeInfoCount = 1;
3138 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3142 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3144 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3150 ctInfo.fExternalIOFormatCount = 2;
3151 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3152 ctInfo.fExternalIOFormatCount);
3156 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3159 ioFormat.fExternalTexImageFormat =
GR_GL_RED;
3160 ioFormat.fExternalReadFormat =
GR_GL_RED;
3162 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3167 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3170 ioFormat.fExternalTexImageFormat = 0;
3180 info.fFormatType = FormatType::kNormalizedFixedPoint;
3181 info.fInternalFormatForTexImageOrStorage =
3187 bool rg16Supported =
false;
3188 if (!formatWorkarounds.fDisallowTextureUnorm16) {
3193 rg16Supported = ctxInfo.
hasExtension(
"GL_EXT_texture_norm16");
3197 if (rg16Supported) {
3198 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
3199 if (!formatWorkarounds.fDisallowUnorm16Transfers) {
3200 info.fFlags |= FormatInfo::kTransfers_Flag;
3204 if (texStorageSupported) {
3205 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3208 info.fInternalFormatForTexImageOrStorage =
3212 if (rg16Supported) {
3213 info.fColorTypeInfoCount = 1;
3214 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3218 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3220 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3224 ctInfo.fExternalIOFormatCount = 2;
3225 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3226 ctInfo.fExternalIOFormatCount);
3230 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3233 ioFormat.fExternalTexImageFormat =
GR_GL_RG;
3234 ioFormat.fExternalReadFormat =
GR_GL_RG;
3236 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3241 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3244 ioFormat.fExternalTexImageFormat = 0;
3253 bool rgba16Support =
false;
3254 if (!formatWorkarounds.fDisallowTextureUnorm16) {
3258 rgba16Support = ctxInfo.
hasExtension(
"GL_EXT_texture_norm16");
3263 info.fFormatType = FormatType::kNormalizedFixedPoint;
3269 if (rgba16Support) {
3270 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
3271 if (!formatWorkarounds.fDisallowUnorm16Transfers) {
3272 info.fFlags |= FormatInfo::kTransfers_Flag;
3276 if (texStorageSupported) {
3277 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3280 info.fInternalFormatForTexImageOrStorage =
3284 if (rgba16Support) {
3286 info.fColorTypeInfoCount = 1;
3287 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3290 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3292 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3296 ctInfo.fExternalIOFormatCount = 2;
3297 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3298 ctInfo.fExternalIOFormatCount);
3302 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3305 ioFormat.fExternalTexImageFormat =
GR_GL_RGBA;
3308 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3313 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3316 ioFormat.fExternalTexImageFormat = 0;
3325 bool rg16FTextureSupport =
false;
3326 bool rg16FRenderTargetSupport =
false;
3329 rg16FTextureSupport =
true;
3330 rg16FRenderTargetSupport =
true;
3339 rg16FTextureSupport =
true;
3342 ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float");
3346 rg16FTextureSupport =
true;
3347 rg16FRenderTargetSupport = ctxInfo.
hasExtension(
"GL_EXT_color_buffer_half_float") ||
3358 info.fDefaultExternalType = halfFloatType;
3360 if (rg16FTextureSupport) {
3361 info.fFlags |= FormatInfo::kTexturable_Flag | FormatInfo::kTransfers_Flag;
3362 if (rg16FRenderTargetSupport) {
3363 info.fFlags |= fpRenderFlags;
3367 if (texStorageSupported) {
3368 info.fFlags |= FormatInfo::kUseTexStorage_Flag;
3371 info.fInternalFormatForTexImageOrStorage =
3375 if (rg16FTextureSupport) {
3376 info.fColorTypeInfoCount = 1;
3377 info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(
info.fColorTypeInfoCount);
3381 auto& ctInfo =
info.fColorTypeInfos[ctIdx++];
3383 ctInfo.fFlags = ColorTypeInfo::kUploadData_Flag | ColorTypeInfo::kRenderable_Flag;
3387 ctInfo.fExternalIOFormatCount = 2;
3388 ctInfo.fExternalIOFormats = std::make_unique<ColorTypeInfo::ExternalIOFormats[]>(
3389 ctInfo.fExternalIOFormatCount);
3393 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3395 ioFormat.fExternalType = halfFloatType;
3396 ioFormat.fExternalTexImageFormat =
GR_GL_RG;
3397 ioFormat.fExternalReadFormat =
GR_GL_RG;
3399 ioFormat.fRequiresImplementationReadQuery = !
GR_IS_GR_GL(standard);
3404 auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
3407 ioFormat.fExternalTexImageFormat = 0;
3414 this->setupSampleCounts(ctxInfo, gli);
3421 const auto& formatInfo = fFormatTable[
i];
3423 SkASSERT(!((formatInfo.fFlags & FormatInfo::kFBOColorAttachmentWithMSAA_Flag) &&
3424 !(formatInfo.fFlags & FormatInfo::kFBOColorAttachment_Flag)));
3430 for (
int j = 0; j < formatInfo.fColorTypeInfoCount; ++j) {
3431 const auto& ctInfo = formatInfo.fColorTypeInfos[j];
3436 for (
int k = 0; k < ctInfo.fExternalIOFormatCount; ++k) {
3437 const auto& ioInfo = ctInfo.fExternalIOFormats[k];
3451 int maxSampleCnt = 1;
3458 maxSampleCnt =
std::max(1, maxSampleCnt);
3461 if (FormatInfo::kFBOColorAttachmentWithMSAA_Flag & fFormatTable[
i].
fFlags) {
3463 SkASSERT(FormatInfo::kFBOColorAttachment_Flag & fFormatTable[
i].
fFlags);
3466 ctxInfo.
hasExtension(
"GL_ARB_internalformat_query"))) ||
3469 const bool multisampleIsImplicit =
3478 std::unique_ptr<int[]> temp(
new int[
count]);
3486 fFormatTable[
i].fColorSampleCounts.reserve(
count + 1);
3489 fFormatTable[
i].fColorSampleCounts.push_back(1);
3490 for (
int j = 0; j <
count; ++j) {
3491#if defined(SK_BUILD_FOR_IOS) && TARGET_OS_SIMULATOR
3496 int sampleCnt = temp[
count - j - 1];
3498 if (multisampleIsImplicit && sampleCnt > maxSampleCnt) {
3501 fFormatTable[
i].fColorSampleCounts.push_back(sampleCnt);
3507 static constexpr int kDefaultSamples[] = {1, 2, 4, 8};
3510 if (kDefaultSamples[
count - 1] <= maxSampleCnt) {
3515 fFormatTable[
i].fColorSampleCounts.append(
count, kDefaultSamples);
3518 }
else if (FormatInfo::kFBOColorAttachment_Flag & fFormatTable[
i].
fFlags) {
3519 fFormatTable[
i].fColorSampleCounts.resize(1);
3520 fFormatTable[
i].fColorSampleCounts[0] = 1;
3527 GrGLFormat srcFormat,
bool srcHasMSAARenderBuffer,
3550 !fAllowBGRA8CopyTexSubImage) {
3559 !fAllowSRGBCopyTexSubImage) {
3568 if (!dstChannels || !srcChannels) {
3574 if ((dstChannels & srcChannels) != srcChannels) {
3588 if (dstHasMSAARenderBuffer || srcHasMSAARenderBuffer) {
3594 if (!dstTypeIfTexture) {
3609 const SkRect& srcBounds,
bool srcBoundsExact,
3611 auto blitFramebufferFlags = fBlitFramebufferFlags;
3628 if (dstSampleCnt > 1 && dstSampleCnt != srcSampleCnt) {
3644 if (srcSampleCnt > 1) {
3645 if (1 == dstSampleCnt) {
3648 if (
SkRect::Make(srcRect) != srcBounds || !srcBoundsExact) {
3655 if (dstSampleCnt > 1) {
3661 if (srcFormat != dstFormat) {
3665 if (srcSampleCnt > 1 && srcFormat != dstFormat) {
3671 if (srcSampleCnt > 1) {
3672 if (dstRect != srcRect) {
3683 !(fDisableScalingCopyAsDraws && scalingCopy);
3706 int dstSampleCnt = 0;
3707 int srcSampleCnt = 0;
3709 dstSampleCnt = rtProxy->numSamples();
3712 srcSampleCnt = rtProxy->numSamples();
3726 dstTexTypePtr = &dstTexType;
3730 srcTexTypePtr = &srcTexType;
3736 const bool scalingCopy = srcRect.
size() != dstRect.
size();
3742 return this->
canCopyAsBlit(dstFormat, dstSampleCnt, dstTexTypePtr, srcFormat, srcSampleCnt,
3743 srcTexTypePtr,
src->getBoundsRect(),
src->priv().isExact(), srcRect,
3752 if (
src->asTextureProxy() && !this->isFormatAsColorTypeRenderable(
colorType,
3753 src->backendFormat())) {
3757 if (
const auto* texProxy =
src->asTextureProxy()) {
3770 if (
src->numSamples() > 1 &&
3775 }
else if (
src->numSamples() > 1 && (fBlitFramebufferFlags &
3786 return blitFramebufferRestrictions;
3793 bool srcIsMSAARenderbuffer =
src->numSamples() > 1 &&
3795 if (srcIsMSAARenderbuffer) {
3799 return blitFramebufferRestrictions;
3810void GrGLCaps::applyDriverCorrectnessWorkarounds(
const GrGLContextInfo& ctxInfo,
3814 FormatWorkarounds* formatWorkarounds) {
3837 fClearTextureSupport =
false;
3845 fAllowBGRA8CopyTexSubImage =
true;
3851 fAllowSRGBCopyTexSubImage =
true;
3866 fDisallowDynamicMSAA =
true;
3872 fDisallowDynamicMSAA =
true;
3879#if defined(__has_feature)
3880#if defined(SK_BUILD_FOR_MAC) && __has_feature(thread_sanitizer)
3916#ifdef SK_BUILD_FOR_ANDROID
3920 formatWorkarounds->fDisallowR8ForPowerVRSGX54x =
true;
3943 formatWorkarounds->fDisallowTextureUnorm16 =
true;
3944 formatWorkarounds->fDisallowETC2Compression =
true;
3960#ifndef SK_BUILD_FOR_IOS
3974#ifdef SK_BUILD_FOR_MAC
4015 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO =
true;
4047 fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines =
true;
4055 fMaxInstancesPerDrawWithoutCrashing = 999;
4057 fMaxInstancesPerDrawWithoutCrashing = 0x4000000;
4060#ifndef SK_BUILD_FOR_IOS
4070 fMustSetAnyTexParameterToEnableMipmapping =
true;
4085 fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO =
true;
4086 fUseDrawInsteadOfAllRenderTargetWrites =
true;
4089#ifdef SK_BUILD_FOR_MAC
4090 static constexpr bool isMAC =
true;
4092 static constexpr bool isMAC =
false;
4095#ifdef SK_BUILD_FOR_ANDROID
4099 fDontSetBaseOrMaxLevelForExternalTextures =
true;
4103 fMipmapLevelControlSupport =
false;
4111 if (fMipmapLevelControlSupport &&
4117 fDoManualMipmapping =
true;
4121#ifdef SK_BUILD_FOR_MAC
4123 fClearToBoundaryValuesIsBroken =
true;
4127 fDrawArraysBaseVertexIsBroken =
true;
4133 fBaseVertexBaseInstanceSupport =
false;
4145 fBaseVertexBaseInstanceSupport =
false;
4174#if defined(SK_BUILD_FOR_MAC)
4207#if defined(SK_BUILD_FOR_ANDROID)
4217 fShaderCaps->fAvoidDfDxForGradientsWhenPossible =
true;
4220#ifdef SK_BUILD_FOR_WIN
4339 fMustResetBlendFuncBetweenDualSourceAndDisable =
true;
4346 if (ctxInfo.
hasExtension(
"GL_OES_EGL_image_external") &&
4354#ifdef SK_BUILD_FOR_IOS
4411 fShaderCaps->fRemoveConstFromFunctionParameters =
true;
4413#ifdef SK_BUILD_FOR_WIN
4425 fNeverDisableColorWrites =
true;
4441 fSRGBWriteControl =
false;
4445#if defined(SK_BUILD_FOR_MAC)
4447 formatWorkarounds->fDisableSRGBRenderWithMSAAForMacAMD =
true;
4453 formatWorkarounds->fDisableRGBA16FTexStorageForCrBug1008003 =
4456#if defined(SK_BUILD_FOR_WIN)
4459 formatWorkarounds->fDisableBGRATextureStorageForIntelWindowsES =
4469 formatWorkarounds->fDisableLuminance16F =
4474#ifdef SK_BUILD_FOR_MAC
4478 formatWorkarounds->fDisallowDirectRG8ReadPixels =
4484#ifdef SK_BUILD_FOR_ANDROID
4497 formatWorkarounds->fDisableTexStorage =
true;
4508 fTiledRenderingSupport =
false;
4519 fTiledRenderingSupport =
false;
4523 formatWorkarounds->fDisallowBGRA8ReadPixels =
true;
4544 fProgramBinarySupport =
false;
4548 if (fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO) {
4570 formatWorkarounds->fDisallowUnorm16Transfers =
true;
4599 fBindTexture0WhenChangingTextureFBOMultisampleCount =
true;
4618 fRebindColorAttachmentAfterCheckFramebufferStatus =
true;
4661 fFlushBeforeWritePixels =
true;
4670 fDisableScalingCopyAsDraws =
true;
4684#ifdef SK_BUILD_FOR_MAC
4687 fPadRG88TransferAlignment =
true;
4693 if (
options.fDisableDriverCorrectnessWorkarounds) {
4695 SkASSERT(!fClearToBoundaryValuesIsBroken);
4696 SkASSERT(0 == fMaxInstancesPerDrawWithoutCrashing);
4697 SkASSERT(!fDrawArraysBaseVertexIsBroken);
4698 SkASSERT(!fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO);
4699 SkASSERT(!fUseDrawInsteadOfAllRenderTargetWrites);
4700 SkASSERT(!fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines);
4701 SkASSERT(!fDontSetBaseOrMaxLevelForExternalTextures);
4702 SkASSERT(!fNeverDisableColorWrites);
4705 fProgramBinarySupport =
false;
4708 switch (
options.fSkipGLErrorChecks) {
4710 fSkipErrorChecks =
false;
4713 fSkipErrorChecks =
true;
4720bool GrGLCaps::onSurfaceSupportsWritePixels(
const GrSurface*
surface)
const {
4721 if (fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO) {
4723 if (tex->hasBaseLevelBeenBoundToFBO()) {
4728 if (
auto rt =
surface->asRenderTarget()) {
4729 if (fUseDrawInsteadOfAllRenderTargetWrites) {
4732 if (rt->numSamples() > 1 && this->usesMSAARenderBuffers()) {
4755 if (rt->numSamples() > 1 && !rt->asTexture()) {
4765 switch (externalType) {
4780 case GR_GL_UNSIGNED_BYTE_3_3_2:
return sizeof(
GrGLubyte);
4781 case GR_GL_UNSIGNED_BYTE_2_3_3_REV:
return sizeof(
GrGLubyte);
4782 case GR_GL_UNSIGNED_SHORT_5_6_5_REV:
return sizeof(
GrGLushort);
4783 case GR_GL_UNSIGNED_SHORT_4_4_4_4_REV:
return sizeof(
GrGLushort);
4784 case GR_GL_UNSIGNED_SHORT_1_5_5_5_REV:
return sizeof(
GrGLushort);
4785 case GR_GL_UNSIGNED_INT_8_8_8_8:
return sizeof(
GrGLuint);
4786 case GR_GL_UNSIGNED_INT_8_8_8_8_REV:
return sizeof(
GrGLuint);
4787 case GR_GL_UNSIGNED_INT_10_10_10_2:
return sizeof(
GrGLuint);
4788 case GR_GL_UNSIGNED_INT_24_8:
return sizeof(
GrGLuint);
4789 case GR_GL_UNSIGNED_INT_10F_11F_11F_REV:
return sizeof(
GrGLuint);
4790 case GR_GL_UNSIGNED_INT_5_9_9_9_REV:
return sizeof(
GrGLuint);
4792 case GR_GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
return 4;
4813 bool foundSrcCT =
false;
4814 for (
int i = 0; !foundSrcCT &&
i < formatInfo.fColorTypeInfoCount; ++
i) {
4815 if (formatInfo.fColorTypeInfos[
i].fColorType == srcColorType) {
4816 const ColorTypeInfo& ctInfo = formatInfo.fColorTypeInfos[
i];
4818 for (
int j = 0; j < ctInfo.fExternalIOFormatCount; ++j) {
4819 const auto& ioInfo = ctInfo.fExternalIOFormats[j];
4820 if (ioInfo.fExternalReadFormat != 0) {
4821 if (formatInfo.fHaveQueriedImplementationReadSupport ||
4822 !ioInfo.fRequiresImplementationReadQuery) {
4823 GrGLenum transferOffsetAlignment = 0;
4824 if (formatInfo.fFlags & FormatInfo::kTransfers_Flag) {
4825 transferOffsetAlignment =
4828 transferOffsetAlignment = 2;
4831 if (ioInfo.fColorType == dstColorType) {
4832 return {dstColorType, transferOffsetAlignment};
4837 fallbackRead = {ioInfo.
fColorType, transferOffsetAlignment};
4844 return fallbackRead;
4854 bool foundSurfaceCT =
false;
4855 size_t transferOffsetAlignment = 0;
4856 if (formatInfo.fFlags & FormatInfo::kTransfers_Flag) {
4857 transferOffsetAlignment = 1;
4859 for (
int i = 0; !foundSurfaceCT &&
i < formatInfo.fColorTypeInfoCount; ++
i) {
4860 if (formatInfo.fColorTypeInfos[
i].fColorType == surfaceColorType) {
4861 const ColorTypeInfo& ctInfo = formatInfo.fColorTypeInfos[
i];
4862 foundSurfaceCT =
true;
4863 for (
int j = 0; j < ctInfo.fExternalIOFormatCount; ++j) {
4864 const auto& ioInfo = ctInfo.fExternalIOFormats[j];
4865 if (ioInfo.fExternalTexImageFormat != 0) {
4866 if (ioInfo.fColorType == srcColorType) {
4867 return {srcColorType, transferOffsetAlignment};
4872 fallbackCT = ioInfo.fColorType;
4878 return {fallbackCT, transferOffsetAlignment};
4882 return std::find(fProgramBinaryFormats.
begin(), fProgramBinaryFormats.
end(), binaryFormat) !=
4883 fProgramBinaryFormats.
end();
4890 return fbInfo.
fFBOID != 0;
4905 const FormatInfo&
info = this->getFormatInfo(
format);
4906 return SkToBool(
info.fFlags & FormatInfo::kTexturable_Flag);
4910 int sampleCount)
const {
4918 const FormatInfo&
info = this->getFormatInfo(
f);
4919 if (!
SkToBool(
info.colorTypeFlags(ct) & ColorTypeInfo::kRenderable_Flag)) {
4937 const FormatInfo&
info = this->getFormatInfo(
format);
4939 int count =
info.fColorSampleCounts.size();
4944 requestedCount =
std::max(1, requestedCount);
4945 if (1 == requestedCount) {
4946 return info.fColorSampleCounts[0] == 1 ? 1 : 0;
4949 for (
int sampleCount :
info.fColorSampleCounts) {
4950 if (sampleCount >= requestedCount) {
4952 sampleCount =
std::min(sampleCount, 4);
4961 const FormatInfo&
info = this->getFormatInfo(
format);
4962 const auto&
table =
info.fColorSampleCounts;
4963 if (
table.empty()) {
4990 const auto& formatInfo =
const_cast<GrGLCaps*
>(
this)->getFormatInfo(
format);
4991 if (!formatInfo.fHaveQueriedImplementationReadSupport) {
4993 bool needQuery =
false;
4994 for (
int i = 0;
i < formatInfo.fColorTypeInfoCount && !needQuery; ++
i) {
4995 const auto& surfCTInfo = formatInfo.fColorTypeInfos[
i];
4996 for (
int j = 0; j < surfCTInfo.fExternalIOFormatCount; ++j) {
4997 if (surfCTInfo.fExternalIOFormats[j].fRequiresImplementationReadQuery) {
5005 const_cast<FormatInfo&
>(formatInfo).fHaveQueriedImplementationReadSupport =
true;
5008 return !formatInfo.fHaveQueriedImplementationReadSupport;
5014 auto& formatInfo =
const_cast<GrGLCaps*
>(
this)->getFormatInfo(
format);
5015 for (
int i = 0;
i < formatInfo.fColorTypeInfoCount; ++
i) {
5016 auto& surfCTInfo = formatInfo.fColorTypeInfos[
i];
5017 for (
int j = 0; j < surfCTInfo.fExternalIOFormatCount; ++j) {
5018 auto& readCTInfo = surfCTInfo.fExternalIOFormats[j];
5019 if (readCTInfo.fRequiresImplementationReadQuery) {
5020 if (readCTInfo.fExternalReadFormat != readFormat ||
5021 readCTInfo.fExternalType != readType) {
5023 readCTInfo.fExternalReadFormat = 0;
5028 formatInfo.fHaveQueriedImplementationReadSupport =
true;
5031bool GrGLCaps::onAreColorTypeAndFormatCompatible(
GrColorType ct,
5034 const auto&
info = this->getFormatInfo(glFormat);
5035 for (
int i = 0;
i <
info.fColorTypeInfoCount; ++
i) {
5036 if (
info.fColorTypeInfos[
i].fColorType == ct) {
5053 switch (compressionType) {
5085 const auto&
info = this->getFormatInfo(glFormat);
5086 for (
int i = 0;
i <
info.fColorTypeInfoCount; ++
i) {
5087 const auto& ctInfo =
info.fColorTypeInfos[
i];
5089 return ctInfo.fReadSwizzle;
5092 SkDEBUGFAILF(
"Illegal color type (%d) and format (%d) combination.",
5100 for (
int i = 0;
i <
info.fColorTypeInfoCount; ++
i) {
5101 const auto& ctInfo =
info.fColorTypeInfos[
i];
5103 return ctInfo.fWriteSwizzle;
5106 SkDEBUGFAILF(
"Illegal color type (%d) and format (%d) combination.",
5120 return !fDisallowDynamicMSAA;
5125 return (uint64_t)(glFormat);
5137#if defined(GR_TEST_UTILS)
5138std::vector<GrTest::TestFormatColorTypeCombination> GrGLCaps::getTestingCombinations()
const {
5139 std::vector<GrTest::TestFormatColorTypeCombination> combos = {
5206 size_t count2D = combos.size();
5207 for (
size_t i = 0;
i < count2D; ++
i) {
5208 auto combo2D = combos[
i];
5210 combos.push_back({combo2D.fColorType,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
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 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)
int find(T *array, int N, T item)
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
void getReadPixelsFormat(GrGLFormat surfaceFormat, GrColorType surfaceColorType, GrColorType memoryColorType, GrGLenum *externalFormat, GrGLenum *externalType) const
@ kNoScalingOrMirroring_BlitFramebufferFlag
@ kResolveMustBeFull_BlitFrambufferFlag
@ kNoSupport_BlitFramebufferFlag
@ kRectsMustMatchForMSAASrc_BlitFramebufferFlag
@ kNoFormatConversion_BlitFramebufferFlag
@ kNoFormatConversionForMSAASrc_BlitFramebufferFlag
@ kNoMSAADst_BlitFramebufferFlag
GrGLenum getRenderbufferInternalFormat(GrGLFormat format) const
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)
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
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
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 shouldQueryImplementationReadSupport(GrGLFormat format) const
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
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)
static float min(float r, float g, float b)
SK_API bool GetGLFramebufferInfo(const GrBackendRenderTarget &, GrGLFramebufferInfo *)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
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