• Home
  • Raw
  • Download

Lines Matching +full:iris +full:- +full:rules +full:- +full:performance

4  * Use of this source code is governed by a BSD-style license that can be
77 // All of Skia's automated testing of ANGLE and all related tuning of performance and driver in GrGLCaps()
80 // GL driver that our performance and correctness tuning was performed on. To avoid losing in GrGLCaps()
85 this->init(contextOptions, ctxInfo.makeNonAngle(), glInterface); in GrGLCaps()
89 this->init(contextOptions, ctxInfo, glInterface); in GrGLCaps()
376 this->initGLSL(ctxInfo, gli); in init()
379 // Enable supported shader-related caps in init()
381 shaderCaps->fDualSourceBlendingSupport = in init()
386 shaderCaps->fShaderDerivativeSupport = true; in init()
388 shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) && in init()
391 shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; in init()
392 shaderCaps->fInverseHyperbolicSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; in init()
394 shaderCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blend_func_extended"); in init()
396 shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(3, 0) || in init()
399 shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) && in init()
401 shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; in init()
402 shaderCaps->fInverseHyperbolicSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; in init()
404 shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(2, 0) || in init()
407 shaderCaps->fIntegerSupport = (version >= GR_GL_VER(2, 0)); in init()
408 shaderCaps->fNonsquareMatrixSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; in init()
409 shaderCaps->fInverseHyperbolicSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; in init()
421 shaderCaps->fRewriteSwitchStatements = in init()
424 shaderCaps->fRewriteSwitchStatements = in init()
427 shaderCaps->fRewriteSwitchStatements = version < GR_GL_VER(2, 0); // introduced in WebGL 2 in init()
434 shaderCaps->fMaxFragmentSamplers = std::min<GrGLint>(kMaxSaneSamplers, maxSamplers); in init()
437 // We've measured a performance increase using non-VBO vertex data for dynamic content on these in init()
453 this->initFSAASupport(contextOptions, ctxInfo, gli); in init()
454 this->initStencilSupport(ctxInfo); in init()
482 this->initBlendEqationSupport(ctxInfo); in init()
558 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip filters only in init()
570 // All mipmapping and all wrapping modes are supported for non-power-of- in init()
585 // On Mali G71, RT's above 4k have been observed to incur a performance cost. in init()
620 // boost in performance in Firefox. Chrome sees a more modest increase. in init()
666 …// https://github.com/KhronosGroup/OpenGL-Registry/blob/main/extensions/EXT/EXT_multi_draw_indirec… in init()
683 // disabled because of poor performance (http://skbug.com/11998). in init()
764 // The TecnoSpark 3 Pro with a PowerVR GE8300 seems to have a steep dithering performance in init()
773 this->applyDriverCorrectnessWorkarounds(ctxInfo, contextOptions, gli, shaderCaps, in init()
778 this->initFormatTable(ctxInfo, gli, formatWorkarounds); in init()
780 this->finishInitialization(contextOptions); in init()
783 shaderCaps->fDstReadInShaderSupport = shaderCaps->fFBFetchSupport; in init()
871 shaderCaps->fGLSLGeneration = ctxInfo.glslGeneration(); in initGLSL()
876 shaderCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); in initGLSL()
877 shaderCaps->fFBFetchSupport = true; in initGLSL()
878 shaderCaps->fFBFetchColorName = "gl_LastFragData[0]"; in initGLSL()
879 shaderCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; in initGLSL()
883 shaderCaps->fFBFetchNeedsCustomOutput = false; in initGLSL()
884 shaderCaps->fFBFetchSupport = true; in initGLSL()
885 shaderCaps->fFBFetchColorName = "gl_LastFragData[0]"; in initGLSL()
886 shaderCaps->fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; in initGLSL()
890 shaderCaps->fFBFetchNeedsCustomOutput = false; in initGLSL()
891 shaderCaps->fFBFetchSupport = true; in initGLSL()
892 shaderCaps->fFBFetchColorName = "gl_LastFragColorARM"; in initGLSL()
893 shaderCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; in initGLSL()
896 shaderCaps->fUsesPrecisionModifiers = true; in initGLSL()
899 shaderCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); in initGLSL()
900 shaderCaps->fFBFetchSupport = true; in initGLSL()
901 shaderCaps->fFBFetchColorName = "gl_LastFragData[0]"; in initGLSL()
902 shaderCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; in initGLSL()
906 shaderCaps->fUsesPrecisionModifiers = true; in initGLSL()
910 shaderCaps->fFlatInterpolationSupport = ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; in initGLSL()
912 shaderCaps->fFlatInterpolationSupport = in initGLSL()
919 shaderCaps->fPreferFlatInterpolation = shaderCaps->fFlatInterpolationSupport && in initGLSL()
923 shaderCaps->fNoPerspectiveInterpolationSupport = in initGLSL()
928 shaderCaps->fNoPerspectiveInterpolationSupport = true; in initGLSL()
929 shaderCaps->fNoPerspectiveInterpolationExtensionString = in initGLSL()
935 shaderCaps->fSampleMaskSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration; in initGLSL()
938 shaderCaps->fSampleMaskSupport = true; in initGLSL()
940 shaderCaps->fSampleMaskSupport = true; in initGLSL()
941 shaderCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables"; in initGLSL()
953 shaderCaps->fTessellationExtensionString = "GL_OES_tessellation_shader"; in initGLSL()
957 &shaderCaps->fMaxTessellationSegments); in initGLSL()
959 shaderCaps->fMaxTessellationSegments = std::max(0, shaderCaps->fMaxTessellationSegments); in initGLSL()
962 shaderCaps->fVersionDeclString = get_glsl_version_decl_string(standard, in initGLSL()
963 shaderCaps->fGLSLGeneration, in initGLSL()
967 if (k110_GrGLSLGeneration == shaderCaps->fGLSLGeneration) { in initGLSL()
968 shaderCaps->fShaderDerivativeExtensionString = "GL_OES_standard_derivatives"; in initGLSL()
973 shaderCaps->fSecondaryOutputExtensionString = "GL_EXT_blend_func_extended"; in initGLSL()
978 shaderCaps->fExternalTextureSupport = true; in initGLSL()
979 shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; in initGLSL()
983 shaderCaps->fExternalTextureSupport = true; in initGLSL()
984 shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; in initGLSL()
989 shaderCaps->fVertexIDSupport = true; in initGLSL()
992 shaderCaps->fVertexIDSupport = ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; in initGLSL()
996 shaderCaps->fInfinitySupport = shaderCaps->fNonconstantArrayIndexSupport = true; in initGLSL()
999 shaderCaps->fInfinitySupport = shaderCaps->fNonconstantArrayIndexSupport = in initGLSL()
1004 shaderCaps->fBitManipulationSupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration; in initGLSL()
1006 shaderCaps->fBitManipulationSupport = ctxInfo.glslGeneration() >= k310es_GrGLSLGeneration; in initGLSL()
1009 shaderCaps->fFloatIs32Bits = is_float_fp32(ctxInfo, gli, GR_GL_HIGH_FLOAT); in initGLSL()
1010 shaderCaps->fHalfIs32Bits = is_float_fp32(ctxInfo, gli, GR_GL_MEDIUM_FLOAT); in initGLSL()
1011 shaderCaps->fHasLowFragmentPrecision = ctxInfo.renderer() == GrGLRenderer::kMali4xx; in initGLSL()
1014 shaderCaps->fBuiltinFMASupport = ctxInfo.glslGeneration() >= k400_GrGLSLGeneration; in initGLSL()
1016 shaderCaps->fBuiltinFMASupport = ctxInfo.glslGeneration() >= k320es_GrGLSLGeneration; in initGLSL()
1019 shaderCaps->fBuiltinDeterminantSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; in initGLSL()
1022 // WebGL 1.0 doesn't support do-while loops. in initGLSL()
1023 shaderCaps->fCanUseDoLoops = version >= GR_GL_VER(2, 0); in initGLSL()
1038 // We prefer multisampled-render-to-texture extensions over ES3 MSAA because we've observed in initFSAASupport()
1069 if ((GR_IS_GR_GL(fStandard) && shaderCaps->generation() >= k140_GrGLSLGeneration) || in initBlendEqationSupport()
1070 (GR_IS_GR_GL_ES(fStandard) && shaderCaps->generation() >= k330_GrGLSLGeneration)) { in initBlendEqationSupport()
1078 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kAutomatic_AdvBlendEqInteraction; in initBlendEqationSupport()
1082 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kGeneralEnable_AdvBlendEqInteraction; in initBlendEqationSupport()
1085 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kAutomatic_AdvBlendEqInteraction; in initBlendEqationSupport()
1088 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kGeneralEnable_AdvBlendEqInteraction; in initBlendEqationSupport()
1147 // all of our caps information in a named sub-object. in onDumpJSON()
1148 writer->beginObject("GL caps"); in onDumpJSON()
1150 writer->beginArray("Stencil Formats"); in onDumpJSON()
1153 writer->beginObject(nullptr, false); in onDumpJSON()
1154 writer->appendS32("stencil bits", GrGLFormatStencilBits(fStencilFormats[i])); in onDumpJSON()
1155 writer->appendS32("total bytes", GrGLFormatBytesPerBlock(fStencilFormats[i])); in onDumpJSON()
1156 writer->endObject(); in onDumpJSON()
1159 writer->endArray(); in onDumpJSON()
1197 writer->appendBool("Core Profile", fIsCoreProfile); in onDumpJSON()
1198 writer->appendString("MSAA Type", kMSFBOExtStr[fMSFBOType]); in onDumpJSON()
1199 writer->appendString("Invalidate FB Type", kInvalidateFBTypeStr[fInvalidateFBType]); in onDumpJSON()
1200 writer->appendString("Map Buffer Type", kMapBufferTypeStr[fMapBufferType]); in onDumpJSON()
1201 writer->appendString("Multi Draw Type", multi_draw_type_name(fMultiDrawType)); in onDumpJSON()
1202 writer->appendS32("Max FS Uniform Vectors", fMaxFragmentUniformVectors); in onDumpJSON()
1203 writer->appendBool("Pack Flip Y support", fPackFlipYSupport); in onDumpJSON()
1205 writer->appendBool("Texture Usage support", fTextureUsageSupport); in onDumpJSON()
1206 writer->appendBool("GL_ARB_imaging support", fImagingSupport); in onDumpJSON()
1207 writer->appendBool("Vertex array object support", fVertexArrayObjectSupport); in onDumpJSON()
1208 writer->appendBool("Debug support", fDebugSupport); in onDumpJSON()
1209 writer->appendBool("ES2 compatibility support", fES2CompatibilitySupport); in onDumpJSON()
1210 writer->appendBool("drawRangeElements support", fDrawRangeElementsSupport); in onDumpJSON()
1211 writer->appendBool("Base (vertex base) instance support", fBaseVertexBaseInstanceSupport); in onDumpJSON()
1212 writer->appendBool("Bind uniform location support", fBindUniformLocationSupport); in onDumpJSON()
1213 writer->appendBool("Rectangle texture support", fRectangleTextureSupport); in onDumpJSON()
1214 writer->appendBool("Mipmap LOD control support", fMipmapLodControlSupport); in onDumpJSON()
1215 writer->appendBool("Mipmap level control support", fMipmapLevelControlSupport); in onDumpJSON()
1216 writer->appendBool("Use buffer data null hint", fUseBufferDataNullHint); in onDumpJSON()
1217 writer->appendBool("Clear texture support", fClearTextureSupport); in onDumpJSON()
1218 writer->appendBool("Program binary support", fProgramBinarySupport); in onDumpJSON()
1219 writer->appendBool("Program parameters support", fProgramParameterSupport); in onDumpJSON()
1220 writer->appendBool("Sampler object support", fSamplerObjectSupport); in onDumpJSON()
1221 writer->appendBool("Using sampler objects", fUseSamplerObjects); in onDumpJSON()
1222 writer->appendBool("Texture swizzle support", fTextureSwizzleSupport); in onDumpJSON()
1223 writer->appendBool("Tiled rendering support", fTiledRenderingSupport); in onDumpJSON()
1224 writer->appendBool("FB fetch requires enable per sample", fFBFetchRequiresEnablePerSample); in onDumpJSON()
1225 writer->appendBool("sRGB Write Control", fSRGBWriteControl); in onDumpJSON()
1227 …writer->appendBool("Intermediate texture for partial updates of unorm textures ever bound to FBOs", in onDumpJSON()
1229 writer->appendBool("Intermediate texture for all updates of textures bound to FBOs", in onDumpJSON()
1231 writer->appendBool("Max instances per draw without crashing (or zero)", in onDumpJSON()
1234 writer->beginArray("formats"); in onDumpJSON()
1237 writer->beginObject(nullptr, false); in onDumpJSON()
1238 writer->appendHexU32("flags", fFormatTable[i].fFlags); in onDumpJSON()
1239 writer->appendHexU32("f_type", (uint32_t)fFormatTable[i].fFormatType); in onDumpJSON()
1240 writer->appendHexU32("c_internal", fFormatTable[i].fCompressedInternalFormat); in onDumpJSON()
1241 writer->appendHexU32("i_for_teximage", fFormatTable[i].fInternalFormatForTexImageOrStorage); in onDumpJSON()
1242 writer->appendHexU32("i_for_renderbuffer", fFormatTable[i].fInternalFormatForRenderbuffer); in onDumpJSON()
1243 writer->appendHexU32("default_ex_format", fFormatTable[i].fDefaultExternalFormat); in onDumpJSON()
1244 writer->appendHexU32("default_ex_type", fFormatTable[i].fDefaultExternalType); in onDumpJSON()
1245 writer->appendHexU32("default_color_type", (uint32_t)fFormatTable[i].fDefaultColorType); in onDumpJSON()
1247 writer->beginArray("surface color types"); in onDumpJSON()
1250 writer->beginObject(nullptr, false); in onDumpJSON()
1251 writer->appendHexU32("colorType", (uint32_t)ctInfo.fColorType); in onDumpJSON()
1252 writer->appendHexU32("flags", ctInfo.fFlags); in onDumpJSON()
1254 writer->beginArray("data color types"); in onDumpJSON()
1257 writer->beginObject(nullptr, false); in onDumpJSON()
1258 writer->appendHexU32("colorType", (uint32_t)ioInfo.fColorType); in onDumpJSON()
1259 writer->appendHexU32("ex_type", ioInfo.fExternalType); in onDumpJSON()
1260 writer->appendHexU32("ex_teximage", ioInfo.fExternalTexImageFormat); in onDumpJSON()
1261 writer->appendHexU32("ex_read", ioInfo.fExternalReadFormat); in onDumpJSON()
1262 writer->endObject(); in onDumpJSON()
1264 writer->endArray(); in onDumpJSON()
1265 writer->endObject(); in onDumpJSON()
1267 writer->endArray(); in onDumpJSON()
1268 writer->endObject(); in onDumpJSON()
1271 writer->endArray(); in onDumpJSON()
1272 writer->endObject(); in onDumpJSON()
1280 const auto& info = this->getFormatInfo(surfaceFormat); in getTexImageExternalFormatAndType()
1289 const auto& info = this->getFormatInfo(format); in getTexSubImageDefaultFormatTypeAndColorType()
1300 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType, in getTexSubImageExternalFormatAndType()
1307 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType, in getReadPixelsFormat()
1315 *externalFormat = this->getFormatInfo(surfaceFormat).externalFormat( in getExternalFormat()
1317 *externalType = this->getFormatInfo(surfaceFormat).externalType( in getExternalFormat()
1322 SkASSERT(!this->hasStencilFormatBeenDeterminedForFormat(format)); in setStencilFormatIndexForFormat()
1323 this->getFormatInfo(format).fStencilFormatIndex = in setStencilFormatIndexForFormat()
1363 // when using glTexStorage2D. This appears to affect OOP-R (so not just over command buffer). in initFormatTable()
1391 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA8); in initFormatTable()
1427 this->setColorTypeFormat(GrColorType::kRGBA_8888, GrGLFormat::kRGBA8); in initFormatTable()
1447 ioFormat.fExternalTexImageFormat = 0; // TODO: Enable this on non-ES GL in initFormatTable()
1460 this->setColorTypeFormat(GrColorType::kBGRA_8888, GrGLFormat::kRGBA8); in initFormatTable()
1514 FormatInfo& info = this->getFormatInfo(GrGLFormat::kR8); in initFormatTable()
1557 this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kR8); in initFormatTable()
1591 this->setColorTypeFormat(GrColorType::kGray_8, GrGLFormat::kR8); in initFormatTable()
1628 FormatInfo& info = this->getFormatInfo(GrGLFormat::kALPHA8); in initFormatTable()
1684 this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kALPHA8); in initFormatTable()
1718 FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE8); in initFormatTable()
1748 // spec. For GLES it does not seem to ever support LUMINANCE8 being color-renderable. For GL in initFormatTable()
1752 // or compatibility) do not list LUMINANCE8 as color-renderable (which is strange since the in initFormatTable()
1767 this->setColorTypeFormat(GrColorType::kGray_8, GrGLFormat::kLUMINANCE8); in initFormatTable()
1798 FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE8_ALPHA8); in initFormatTable()
1840 this->setColorTypeFormat(GrColorType::kGrayAlpha_88, in initFormatTable()
1871 FormatInfo& info = this->getFormatInfo(GrGLFormat::kBGRA8); in initFormatTable()
1938 // on ES2 with this extension. This also side-steps some ambiguous interactions with in initFormatTable()
1966 this->setColorTypeFormat(GrColorType::kBGRA_8888, GrGLFormat::kBGRA8); in initFormatTable()
2000 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGB565); in initFormatTable()
2045 this->setColorTypeFormat(GrColorType::kBGR_565, GrGLFormat::kRGB565); in initFormatTable()
2077 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA16F); in initFormatTable()
2150 this->setColorTypeFormat(GrColorType::kRGBA_F16, GrGLFormat::kRGBA16F); in initFormatTable()
2183 this->setColorTypeFormat(GrColorType::kRGBA_F16_Clamped, GrGLFormat::kRGBA16F); in initFormatTable()
2215 FormatInfo& info = this->getFormatInfo(GrGLFormat::kR16F); in initFormatTable()
2274 this->setColorTypeFormat(GrColorType::kAlpha_F16, GrGLFormat::kR16F); in initFormatTable()
2328 FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE16F); in initFormatTable()
2360 this->setColorTypeFormat(GrColorType::kAlpha_F16, GrGLFormat::kLUMINANCE16F); in initFormatTable()
2391 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGB8); in initFormatTable()
2401 // non-ES GL we don't support MSAA for GL_RGB8. On 4.2+ we could check using in initFormatTable()
2430 this->setColorTypeFormat(GrColorType::kRGB_888x, GrGLFormat::kRGB8); in initFormatTable()
2459 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRG8); in initFormatTable()
2495 this->setColorTypeFormat(GrColorType::kRG_88, GrGLFormat::kRG8); in initFormatTable()
2528 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGB10_A2); in initFormatTable()
2564 this->setColorTypeFormat(GrColorType::kRGBA_1010102, GrGLFormat::kRGB10_A2); in initFormatTable()
2591 //------------------------------------------------------------------ in initFormatTable()
2597 this->setColorTypeFormat(GrColorType::kBGRA_1010102, GrGLFormat::kRGB10_A2); in initFormatTable()
2630 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA4); in initFormatTable()
2662 this->setColorTypeFormat(GrColorType::kABGR_4444, GrGLFormat::kRGBA4); in initFormatTable()
2693 FormatInfo& info = this->getFormatInfo(GrGLFormat::kSRGB8_ALPHA8); in initFormatTable()
2767 this->setColorTypeFormat(GrColorType::kRGBA_8888_SRGB, GrGLFormat::kSRGB8_ALPHA8); in initFormatTable()
2777 // GL does not do srgb<->rgb conversions when transferring between cpu and gpu. in initFormatTable()
2802 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_RGB8_BC1); in initFormatTable()
2816 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_RGBA8_BC1); in initFormatTable()
2830 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_RGB8_ETC2); in initFormatTable()
2852 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_ETC1_RGB8); in initFormatTable()
2866 FormatInfo& info = this->getFormatInfo(GrGLFormat::kR16); in initFormatTable()
2908 this->setColorTypeFormat(GrColorType::kAlpha_16, GrGLFormat::kR16); in initFormatTable()
2940 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRG16); in initFormatTable()
2982 this->setColorTypeFormat(GrColorType::kRG_1616, GrGLFormat::kRG16); in initFormatTable()
3023 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA16); in initFormatTable()
3054 this->setColorTypeFormat(GrColorType::kRGBA_16161616, GrGLFormat::kRGBA16); in initFormatTable()
3115 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRG16F); in initFormatTable()
3145 this->setColorTypeFormat(GrColorType::kRG_F16, GrGLFormat::kRG16F); in initFormatTable()
3175 this->setupSampleCounts(ctxInfo, gli); in initFormatTable()
3214 // We assume that MSAA rendering is supported only if we support non-MSAA rendering. in setupSampleCounts()
3222 GrGLenum glFormat = this->getRenderbufferInternalFormat(grGLFormat); in setupSampleCounts()
3230 if (count && temp[count - 1] == 1) { in setupSampleCounts()
3231 --count; in setupSampleCounts()
3232 SkASSERT(!count || temp[count -1] > 1); in setupSampleCounts()
3242 fFormatTable[i].fColorSampleCounts[j+1] = SkPrevPow2(temp[count - j - 1]); in setupSampleCounts()
3244 fFormatTable[i].fColorSampleCounts[j+1] = temp[count - j - 1]; in setupSampleCounts()
3249 // Fake out the table using some semi-standard counts up to the max allowed sample in setupSampleCounts()
3262 for (; count > 0; --count) { in setupSampleCounts()
3263 if (kDefaultSamples[count - 1] <= maxSampleCnt) { in setupSampleCounts()
3284 // a sized format or not). These affect the rules about which format types can be copied to in canCopyTexSubImage()
3287 if (this->getFormatDefaultExternalType(dstFormat) != in canCopyTexSubImage()
3288 this->getFormatDefaultExternalType(srcFormat)) { in canCopyTexSubImage()
3321 // The dst can't have gray if the src is alpha-only. in canCopyTexSubImage()
3344 return this->canFormatBeFBOColorAttachment(srcFormat) && in canCopyTexSubImage()
3356 if (!this->canFormatBeFBOColorAttachment(dstFormat) || in canCopyAsBlit()
3357 !this->canFormatBeFBOColorAttachment(srcFormat)) { in canCopyAsBlit()
3410 return this->isFormatRenderable(dstFormat, 1) && srcIsTexturable; in canCopyAsDraw()
3414 const GrRenderTargetProxy* rt = surf->asRenderTargetProxy(); in has_msaa_render_buffer()
3421 // 3) It's not FBO 0, which is special and always auto-resolves in has_msaa_render_buffer()
3422 return rt->numSamples() > 1 && in has_msaa_render_buffer()
3424 !rt->glRTFBOIDIs0(); in has_msaa_render_buffer()
3431 if (const GrRenderTargetProxy* rtProxy = dst->asRenderTargetProxy()) { in onCanCopySurface()
3432 dstSampleCnt = rtProxy->numSamples(); in onCanCopySurface()
3434 if (const GrRenderTargetProxy* rtProxy = src->asRenderTargetProxy()) { in onCanCopySurface()
3435 srcSampleCnt = rtProxy->numSamples(); in onCanCopySurface()
3437 SkASSERT((dstSampleCnt > 0) == SkToBool(dst->asRenderTargetProxy())); in onCanCopySurface()
3438 SkASSERT((srcSampleCnt > 0) == SkToBool(src->asRenderTargetProxy())); in onCanCopySurface()
3440 const GrTextureProxy* dstTex = dst->asTextureProxy(); in onCanCopySurface()
3441 const GrTextureProxy* srcTex = src->asTextureProxy(); in onCanCopySurface()
3448 dstTexType = dstTex->textureType(); in onCanCopySurface()
3452 srcTexType = srcTex->textureType(); in onCanCopySurface()
3456 auto dstFormat = dst->backendFormat().asGLFormat(); in onCanCopySurface()
3457 auto srcFormat = src->backendFormat().asGLFormat(); in onCanCopySurface()
3458 return this->canCopyTexSubImage(dstFormat, has_msaa_render_buffer(dst, *this), dstTexTypePtr, in onCanCopySurface()
3460 this->canCopyAsBlit(dstFormat, dstSampleCnt, dstTexTypePtr, srcFormat, srcSampleCnt, in onCanCopySurface()
3461 srcTexTypePtr, src->getBoundsRect(), src->priv().isExact(), srcRect, in onCanCopySurface()
3463 this->canCopyAsDraw(dstFormat, SkToBool(srcTex)); in onCanCopySurface()
3470 if (src->asTextureProxy() && !this->isFormatAsColorTypeRenderable(colorType, in getDstCopyRestrictions()
3471 src->backendFormat())) { in getDstCopyRestrictions()
3475 if (const auto* texProxy = src->asTextureProxy()) { in getDstCopyRestrictions()
3476 if (texProxy->textureType() == GrTextureType::kExternal) { in getDstCopyRestrictions()
3484 // possible and we return false to fallback to creating a render target dst for render-to- in getDstCopyRestrictions()
3488 if (src->numSamples() > 1 && in getDstCopyRestrictions()
3493 } else if (src->numSamples() > 1 && (fBlitFramebufferFlags & in getDstCopyRestrictions()
3498 auto srcFormat = src->backendFormat().asGLFormat(); in getDstCopyRestrictions()
3503 if (this->canFormatBeFBOColorAttachment(srcFormat)) { in getDstCopyRestrictions()
3511 bool srcIsMSAARenderbuffer = src->numSamples() > 1 && in getDstCopyRestrictions()
3512 this->usesMSAARenderBuffers(); in getDstCopyRestrictions()
3516 if (this->canFormatBeFBOColorAttachment(srcFormat)) { in getDstCopyRestrictions()
3617 formatWorkarounds->fDisallowR8ForPowerVRSGX54x = true; in applyDriverCorrectnessWorkarounds()
3622 formatWorkarounds->fDisallowTextureUnorm16 = true; // http://crbug.com/1224108 in applyDriverCorrectnessWorkarounds()
3623 formatWorkarounds->fDisallowETC2Compression = true; // http://crbug.com/1224111 in applyDriverCorrectnessWorkarounds()
3654 // crbug.com/768134 - On MacBook Pros, the Intel Iris Pro doesn't always perform in applyDriverCorrectnessWorkarounds()
3656 // crbug.com/773107 - On MacBook Pros, a wide range of Intel GPUs don't always in applyDriverCorrectnessWorkarounds()
3658 // Update on 4/4/2018 - This appears to be fixed on driver 10.30.12 on a macOS 10.13.2 on a in applyDriverCorrectnessWorkarounds()
3659 // Retina MBP Early 2015 with Iris 6100. It is possibly fixed on earlier drivers as well. in applyDriverCorrectnessWorkarounds()
3660 // crbug.com/1039912 - Crash rate in glClear spiked after OS update, affecting mostly in applyDriverCorrectnessWorkarounds()
3667 // crbug.com/969609 - NVIDIA on Mac sometimes segfaults during glClear in chrome. It seems in applyDriverCorrectnessWorkarounds()
3704 // It appears that all the Adreno GPUs have less than optimal performance when in applyDriverCorrectnessWorkarounds()
3710 // - A Galaxy J5 (Adreno 306) running Android 6 with driver 140.0 in applyDriverCorrectnessWorkarounds()
3711 // - A Nexus 7 2013 (Adreno 320) running Android 5 with driver 104.0 in applyDriverCorrectnessWorkarounds()
3712 // - A Nexus 7 2013 (Adreno 320) running Android 6 with driver 127.0 in applyDriverCorrectnessWorkarounds()
3713 // - A Nexus 5 (Adreno 330) running Android 6 with driver 127.0 in applyDriverCorrectnessWorkarounds()
3715 // - A Nexus 7 2013 (Adreno 320) running Android 4 with driver 53.0 in applyDriverCorrectnessWorkarounds()
3779 // We support manual mip-map generation (via iterative downsampling draw calls). This fixes in applyDriverCorrectnessWorkarounds()
3780 // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textures when using in applyDriverCorrectnessWorkarounds()
3781 // glGenerateMipmap. Our implementation requires mip-level sampling control. Additionally, in applyDriverCorrectnessWorkarounds()
3782 // it can be much slower (especially on mobile GPUs), so we opt-in only when necessary: in applyDriverCorrectnessWorkarounds()
3819 shaderCaps->fFBFetchSupport = false; in applyDriverCorrectnessWorkarounds()
3826 shaderCaps->fCanUseAnyFunctionInShader = (ctxInfo.vendor() != GrGLVendor::kImagination); in applyDriverCorrectnessWorkarounds()
3831 shaderCaps->fCanUseMinAndAbsTogether = false; in applyDriverCorrectnessWorkarounds()
3835 shaderCaps->fCanUseFractForNegativeValues = false; in applyDriverCorrectnessWorkarounds()
3839 shaderCaps->fCanUseDoLoops = false; in applyDriverCorrectnessWorkarounds()
3842 // On Intel GPU there is an issue where it reads the second argument to atan "- %s.x" as an int in applyDriverCorrectnessWorkarounds()
3843 // thus must us -1.0 * %s.x to work correctly in applyDriverCorrectnessWorkarounds()
3845 shaderCaps->fMustForceNegatedAtanParamToFloat = true; in applyDriverCorrectnessWorkarounds()
3850 // The Radeon GLSL compiler on Mac gets confused by ldexp(..., -x). in applyDriverCorrectnessWorkarounds()
3851 // Convert to ldexp(..., x * -1). in applyDriverCorrectnessWorkarounds()
3853 shaderCaps->fMustForceNegatedLdexpParamToMultiply = true; in applyDriverCorrectnessWorkarounds()
3859 // make sure the compiler doesn't re-inline them even if we break the calls apart. in applyDriverCorrectnessWorkarounds()
3861 shaderCaps->fMustDoOpBetweenFloorAndAbs = true; in applyDriverCorrectnessWorkarounds()
3867 if (shaderCaps->fFBFetchSupport && ctxInfo.vendor() == GrGLVendor::kQualcomm) { in applyDriverCorrectnessWorkarounds()
3868 shaderCaps->fRequiresLocalOutputColorForFBFetch = true; in applyDriverCorrectnessWorkarounds()
3873 // on that uniform plus soemthing un-trackable (like a texture read), the compiler will deduce in applyDriverCorrectnessWorkarounds()
3878 shaderCaps->fMustObfuscateUniformColor = true; in applyDriverCorrectnessWorkarounds()
3881 // On Mali G series GPUs, applying transfer functions in the fragment shader with half-floats in applyDriverCorrectnessWorkarounds()
3885 fShaderCaps->fColorSpaceMathNeedsFloat = true; in applyDriverCorrectnessWorkarounds()
3890 fShaderCaps->fAvoidDfDxForGradientsWhenPossible = true; in applyDriverCorrectnessWorkarounds()
3907 shaderCaps->fMustGuardDivisionEvenAfterExplicitZeroCheck = true; in applyDriverCorrectnessWorkarounds()
3919 shaderCaps->fRewriteMatrixComparisons = true; in applyDriverCorrectnessWorkarounds()
3927 shaderCaps->fCanUseFragCoord = false; in applyDriverCorrectnessWorkarounds()
3932 shaderCaps->fCanUseFragCoord = false; in applyDriverCorrectnessWorkarounds()
3935 // On Mali G71, mediump ints don't appear capable of representing every integer beyond +/-2048. in applyDriverCorrectnessWorkarounds()
3938 shaderCaps->fIncompleteShortIntPrecision = true; in applyDriverCorrectnessWorkarounds()
3942 shaderCaps->fAddAndTrueToLoopCondition = true; in applyDriverCorrectnessWorkarounds()
3946 shaderCaps->fUnfoldShortCircuitAsTernary = true; in applyDriverCorrectnessWorkarounds()
3950 shaderCaps->fEmulateAbsIntFunction = true; in applyDriverCorrectnessWorkarounds()
3954 shaderCaps->fRewriteDoWhileLoops = true; in applyDriverCorrectnessWorkarounds()
3958 shaderCaps->fRemovePowWithConstantExponent = true; in applyDriverCorrectnessWorkarounds()
3962 shaderCaps->fDualSourceBlendingSupport = false; in applyDriverCorrectnessWorkarounds()
3967 shaderCaps->fMustWriteToFragColor = true; in applyDriverCorrectnessWorkarounds()
3980 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction; in applyDriverCorrectnessWorkarounds()
3983 // Non-coherent advanced blend has an issue on NVIDIA pre 337.00. in applyDriverCorrectnessWorkarounds()
3988 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction; in applyDriverCorrectnessWorkarounds()
3993 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction; in applyDriverCorrectnessWorkarounds()
3996 if (this->advancedBlendEquationSupport()) { in applyDriverCorrectnessWorkarounds()
3999 // Disable color-dodge and color-burn on pre-355.00 NVIDIA. in applyDriverCorrectnessWorkarounds()
4004 // Disable color-burn on ARM until the fix is released. in applyDriverCorrectnessWorkarounds()
4027 !shaderCaps->fExternalTextureSupport) { // i.e. Missing the _essl3 extension in applyDriverCorrectnessWorkarounds()
4028 shaderCaps->fExternalTextureSupport = true; in applyDriverCorrectnessWorkarounds()
4029 shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; in applyDriverCorrectnessWorkarounds()
4030 shaderCaps->fSecondExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; in applyDriverCorrectnessWorkarounds()
4041 // the GL->Metal layer). in applyDriverCorrectnessWorkarounds()
4075 shaderCaps->fMaxTessellationSegments = 0; in applyDriverCorrectnessWorkarounds()
4082 shaderCaps->fMaxTessellationSegments = 0; in applyDriverCorrectnessWorkarounds()
4090 shaderCaps->fMaxTessellationSegments = 0; in applyDriverCorrectnessWorkarounds()
4106 shaderCaps->fMustWriteToFragColor = true; in applyDriverCorrectnessWorkarounds()
4114 shaderCaps->fNoPerspectiveInterpolationSupport = false; in applyDriverCorrectnessWorkarounds()
4127 formatWorkarounds->fDisableSRGBRenderWithMSAAForMacAMD = true; in applyDriverCorrectnessWorkarounds()
4133 formatWorkarounds->fDisableRGBA16FTexStorageForCrBug1008003 = in applyDriverCorrectnessWorkarounds()
4138 // problems with cross-context SkImages. in applyDriverCorrectnessWorkarounds()
4139 formatWorkarounds->fDisableBGRATextureStorageForIntelWindowsES = in applyDriverCorrectnessWorkarounds()
4143 // On the Intel Iris 6100, interacting with LUM16F seems to confuse the driver. After in applyDriverCorrectnessWorkarounds()
4149 formatWorkarounds->fDisableLuminance16F = ctxInfo.renderer() == GrGLRenderer::kIntelBroadwell || in applyDriverCorrectnessWorkarounds()
4156 formatWorkarounds->fDisallowDirectRG8ReadPixels = in applyDriverCorrectnessWorkarounds()
4163 // We don't usually use glTexStorage() on Android for performance reasons. (crbug.com/945506). in applyDriverCorrectnessWorkarounds()
4172 formatWorkarounds->fDontDisableTexStorageOnAndroid = true; in applyDriverCorrectnessWorkarounds()
4178 shaderCaps->fNoDefaultPrecisionForExternalSamplers = true; in applyDriverCorrectnessWorkarounds()
4187 if (fTiledRenderingSupport && (!glInterface->fFunctions.fStartTiling || in applyDriverCorrectnessWorkarounds()
4188 !glInterface->fFunctions.fEndTiling)) { in applyDriverCorrectnessWorkarounds()
4198 formatWorkarounds->fDisallowBGRA8ReadPixels = true; in applyDriverCorrectnessWorkarounds()
4201 // We disable MSAA for all Intel GPUs. Before Gen9, performance was very bad. Even with Gen9, in applyDriverCorrectnessWorkarounds()
4209 // ANGLE doesn't support do-while loops. in applyDriverCorrectnessWorkarounds()
4211 shaderCaps->fCanUseDoLoops = false; in applyDriverCorrectnessWorkarounds()
4221 // SkSL::Program memory. To get better/different crash reports, disable node-pooling, so that in applyDriverCorrectnessWorkarounds()
4224 shaderCaps->fUseNodePools = false; in applyDriverCorrectnessWorkarounds()
4241 fShaderCaps->fVertexIDSupport = false; in applyDriverCorrectnessWorkarounds()
4251 fShaderCaps->fShaderDerivativeSupport = false; in applyDriverCorrectnessWorkarounds()
4255 formatWorkarounds->fDisallowUnorm16Transfers = true; in applyDriverCorrectnessWorkarounds()
4259 // non-MSAA we get corruption in the texture contents. Binding texture 0 and then rebinding the in applyDriverCorrectnessWorkarounds()
4266 // We also so alpha blending issues on these GMs skbug_9819, p3_ovals, p3 on Mali-Gxx devices in applyDriverCorrectnessWorkarounds()
4268 // GL_VERSION : "OpenGL ES 3.2 v1.r19p0-01rel0.###other-sha0123456789ABCDEF0###" in applyDriverCorrectnessWorkarounds()
4269 // GL_RENDERER: "Mali-G72" in applyDriverCorrectnessWorkarounds()
4272 // GL_VERSION : "OpenGL ES 3.2 v1.r16p0-01rel0.4aee637066427cbcd25297324dba15f5" in applyDriverCorrectnessWorkarounds()
4273 // GL_RENDERER: "Mali-G76" in applyDriverCorrectnessWorkarounds()
4276 // GL_VERSION : "OpenGL ES 3.2 v1.r20p0-01rel0.###other-sha0123456789ABCDEF0###" in applyDriverCorrectnessWorkarounds()
4277 // GL_RENDERER: "Mali-G77" in applyDriverCorrectnessWorkarounds()
4293 // GL_RENDERER: "Mali-T880" in applyDriverCorrectnessWorkarounds()
4294 // GL_VERSION : "OpenGL ES 3.2 v1.r22p0-01rel0.f294e54ceb2cb2d81039204fa4b0402e" in applyDriverCorrectnessWorkarounds()
4298 // GL_RENDERER: "Mali-T860" in applyDriverCorrectnessWorkarounds()
4299 // GL_VERSION : "OpenGL ES 3.2 v1.r26p0-01rel0.217d2597f6bd19b169343737782e56e3" in applyDriverCorrectnessWorkarounds()
4337 if (auto tex = static_cast<const GrGLTexture*>(surface->asTexture())) { in onSurfaceSupportsWritePixels()
4338 if (tex->hasBaseLevelBeenBoundToFBO()) { in onSurfaceSupportsWritePixels()
4343 if (auto rt = surface->asRenderTarget()) { in onSurfaceSupportsWritePixels()
4347 if (rt->numSamples() > 1 && this->usesMSAARenderBuffers()) { in onSurfaceSupportsWritePixels()
4350 return SkToBool(surface->asTexture()); in onSurfaceSupportsWritePixels()
4357 if (auto tex = static_cast<const GrGLTexture*>(surface->asTexture())) { in surfaceSupportsReadPixels()
4361 if (tex->target() == GR_GL_TEXTURE_EXTERNAL || GrGLFormatIsCompressed(tex->format())) { in surfaceSupportsReadPixels()
4364 } else if (auto rt = static_cast<const GrGLRenderTarget*>(surface->asRenderTarget())) { in surfaceSupportsReadPixels()
4367 if (rt->numSamples() > 1 && !rt->asTexture()) { in surfaceSupportsReadPixels()
4424 const auto& formatInfo = this->getFormatInfo(srcBackendFormat.asGLFormat()); in onSupportedReadPixelsColorType()
4462 const auto& formatInfo = this->getFormatInfo(surfaceFormat.asGLFormat()); in supportedWritePixelsColorType()
4502 if (textureType == GrTextureType::kRectangle && !this->rectangleTextureSupport()) { in isFormatTexturable()
4505 return this->isFormatTexturable(format.asGLFormat()); in isFormatTexturable()
4509 const FormatInfo& info = this->getFormatInfo(format); in isFormatTexturable()
4515 if (format.textureType() == GrTextureType::kRectangle && !this->rectangleTextureSupport()) { in isFormatAsColorTypeRenderable()
4522 const FormatInfo& info = this->getFormatInfo(f); in isFormatAsColorTypeRenderable()
4527 return this->isFormatRenderable(f, sampleCount); in isFormatAsColorTypeRenderable()
4531 if (format.textureType() == GrTextureType::kRectangle && !this->rectangleTextureSupport()) { in isFormatRenderable()
4537 return this->isFormatRenderable(format.asGLFormat(), sampleCount); in isFormatRenderable()
4541 const FormatInfo& info = this->getFormatInfo(format); in getRenderTargetSampleCount()
4565 const FormatInfo& info = this->getFormatInfo(format); in maxRenderTargetSampleCount()
4570 int count = table[table.count() - 1]; in maxRenderTargetSampleCount()
4578 return SkToBool(this->getFormatInfo(format).fFlags & FormatInfo::kFBOColorAttachment_Flag); in canFormatBeFBOColorAttachment()
4586 return this->canFormatBeFBOColorAttachment(format.asGLFormat()); in isFormatCopyable()
4590 return SkToBool(this->getFormatInfo(format).fFlags & FormatInfo::kUseTexStorage_Flag); in formatSupportsTexStorage()
4594 const auto& formatInfo = const_cast<GrGLCaps*>(this)->getFormatInfo(format); in shouldQueryImplementationReadSupport()
4618 auto& formatInfo = const_cast<GrGLCaps*>(this)->getFormatInfo(format); in didQueryImplementationReadSupport()
4638 const auto& info = this->getFormatInfo(glFormat); in onAreColorTypeAndFormatCompatible()
4648 auto format = this->getFormatFromColorType(ct); in onGetDefaultBackendFormat()
4662 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_ETC2)) { in getBackendFormatFromCompressionType()
4665 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_ETC1_RGB8)) { in getBackendFormatFromCompressionType()
4670 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_BC1)) { in getBackendFormatFromCompressionType()
4676 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGBA8_BC1)) { in getBackendFormatFromCompressionType()
4688 const auto& info = this->getFormatInfo(glFormat); in onGetReadSwizzle()
4701 const auto& info = this->getFormatInfo(format.asGLFormat()); in getWriteSwizzle()
4714 if (rt->asTextureProxy()) { in onGetDstSampleFlagsForProxy()
4804 if (this->rectangleTextureSupport()) { in getTestingCombinations()