Lines Matching +full:wasm +full:- +full:pack
4 * Use of this source code is governed by a BSD-style license that can be
87 this->init(contextOptions, ctxInfo.makeNonAngle(), glInterface); in GrGLCaps()
91 this->init(contextOptions, ctxInfo, glInterface); in GrGLCaps()
144 // Skia already has a scratch buffer workaround when pack row length in init()
389 this->initGLSL(ctxInfo, gli); in init()
392 // Enable supported shader-related caps in init()
394 shaderCaps->fDualSourceBlendingSupport = in init()
399 shaderCaps->fShaderDerivativeSupport = true; in init()
401 shaderCaps->fIntegerSupport = version >= GR_GL_VER(3, 0) && in init()
404 shaderCaps->fNonsquareMatrixSupport = in init()
406 shaderCaps->fInverseHyperbolicSupport = in init()
409 shaderCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blend_func_extended"); in init()
411 shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(3, 0) || in init()
414 shaderCaps->fIntegerSupport = in init()
418 shaderCaps->fNonsquareMatrixSupport = in init()
420 shaderCaps->fInverseHyperbolicSupport = in init()
423 shaderCaps->fShaderDerivativeSupport = version >= GR_GL_VER(2, 0) || in init()
426 shaderCaps->fIntegerSupport = (version >= GR_GL_VER(2, 0)); in init()
427 shaderCaps->fNonsquareMatrixSupport = in init()
429 shaderCaps->fInverseHyperbolicSupport = in init()
442 shaderCaps->fRewriteSwitchStatements = in init()
445 shaderCaps->fRewriteSwitchStatements = in init()
448 shaderCaps->fRewriteSwitchStatements = version < GR_GL_VER(2, 0); // introduced in WebGL 2 in init()
455 shaderCaps->fMaxFragmentSamplers = std::min<GrGLint>(kMaxSaneSamplers, maxSamplers); in init()
458 // We've measured a performance increase using non-VBO vertex data for dynamic content on these in init()
474 this->initFSAASupport(contextOptions, ctxInfo, gli); in init()
475 this->initStencilSupport(ctxInfo); in init()
503 this->initBlendEqationSupport(ctxInfo); in init()
579 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip filters only in init()
591 // All mipmapping and all wrapping modes are supported for non-power-of- in init()
636 // In a WASM build on Firefox, we see warnings like in init()
801 this->applyDriverCorrectnessWorkarounds(ctxInfo, contextOptions, gli, shaderCaps, in init()
806 this->initFormatTable(ctxInfo, gli, formatWorkarounds); in init()
808 this->finishInitialization(contextOptions); in init()
811 shaderCaps->fDstReadInShaderSupport = shaderCaps->fFBFetchSupport; in init()
899 shaderCaps->fGLSLGeneration = ctxInfo.glslGeneration(); in initGLSL()
904 shaderCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); in initGLSL()
905 shaderCaps->fFBFetchSupport = true; in initGLSL()
906 shaderCaps->fFBFetchColorName = "gl_LastFragData[0]"; in initGLSL()
907 shaderCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; in initGLSL()
911 shaderCaps->fFBFetchNeedsCustomOutput = false; in initGLSL()
912 shaderCaps->fFBFetchSupport = true; in initGLSL()
913 shaderCaps->fFBFetchColorName = "gl_LastFragData[0]"; in initGLSL()
914 shaderCaps->fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; in initGLSL()
918 shaderCaps->fFBFetchNeedsCustomOutput = false; in initGLSL()
919 shaderCaps->fFBFetchSupport = true; in initGLSL()
920 shaderCaps->fFBFetchColorName = "gl_LastFragColorARM"; in initGLSL()
921 shaderCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; in initGLSL()
924 shaderCaps->fUsesPrecisionModifiers = true; in initGLSL()
927 shaderCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); in initGLSL()
928 shaderCaps->fFBFetchSupport = true; in initGLSL()
929 shaderCaps->fFBFetchColorName = "gl_LastFragData[0]"; in initGLSL()
930 shaderCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; in initGLSL()
934 shaderCaps->fUsesPrecisionModifiers = true; in initGLSL()
938 shaderCaps->fFlatInterpolationSupport = in initGLSL()
942 shaderCaps->fFlatInterpolationSupport = in initGLSL()
949 shaderCaps->fPreferFlatInterpolation = shaderCaps->fFlatInterpolationSupport && in initGLSL()
953 shaderCaps->fNoPerspectiveInterpolationSupport = in initGLSL()
958 shaderCaps->fNoPerspectiveInterpolationSupport = true; in initGLSL()
959 shaderCaps->fNoPerspectiveInterpolationExtensionString = in initGLSL()
965 shaderCaps->fSampleMaskSupport = ctxInfo.glslGeneration() >= SkSL::GLSLGeneration::k400; in initGLSL()
968 shaderCaps->fSampleMaskSupport = true; in initGLSL()
970 shaderCaps->fSampleMaskSupport = true; in initGLSL()
971 shaderCaps->fSampleVariablesExtensionString = "GL_OES_sample_variables"; in initGLSL()
983 shaderCaps->fTessellationExtensionString = "GL_OES_tessellation_shader"; in initGLSL()
987 &shaderCaps->fMaxTessellationSegments); in initGLSL()
989 shaderCaps->fMaxTessellationSegments = std::max(0, shaderCaps->fMaxTessellationSegments); in initGLSL()
992 shaderCaps->fVersionDeclString = get_glsl_version_decl_string(standard, in initGLSL()
993 shaderCaps->fGLSLGeneration, in initGLSL()
997 if (SkSL::GLSLGeneration::k110 == shaderCaps->fGLSLGeneration) { in initGLSL()
998 shaderCaps->fShaderDerivativeExtensionString = "GL_OES_standard_derivatives"; in initGLSL()
1003 shaderCaps->fSecondaryOutputExtensionString = "GL_EXT_blend_func_extended"; in initGLSL()
1008 shaderCaps->fExternalTextureSupport = true; in initGLSL()
1009 shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; in initGLSL()
1013 shaderCaps->fExternalTextureSupport = true; in initGLSL()
1014 shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; in initGLSL()
1019 shaderCaps->fVertexIDSupport = true; in initGLSL()
1022 shaderCaps->fVertexIDSupport = ctxInfo.glslGeneration() >= SkSL::GLSLGeneration::k330; in initGLSL()
1029 shaderCaps->fInfinitySupport = (ctxInfo.glslGeneration() >= SkSL::GLSLGeneration::k330); in initGLSL()
1032 shaderCaps->fNonconstantArrayIndexSupport = true; in initGLSL()
1034 shaderCaps->fNonconstantArrayIndexSupport = in initGLSL()
1039 shaderCaps->fBitManipulationSupport = in initGLSL()
1042 shaderCaps->fBitManipulationSupport = in initGLSL()
1046 shaderCaps->fFloatIs32Bits = is_float_fp32(ctxInfo, gli, GR_GL_HIGH_FLOAT); in initGLSL()
1047 shaderCaps->fHalfIs32Bits = is_float_fp32(ctxInfo, gli, GR_GL_MEDIUM_FLOAT); in initGLSL()
1048 shaderCaps->fHasLowFragmentPrecision = ctxInfo.renderer() == GrGLRenderer::kMali4xx; in initGLSL()
1051 shaderCaps->fBuiltinFMASupport = in initGLSL()
1054 shaderCaps->fBuiltinFMASupport = in initGLSL()
1058 shaderCaps->fBuiltinDeterminantSupport = ctxInfo.glslGeneration() >= SkSL::GLSLGeneration::k150; in initGLSL()
1072 // We prefer multisampled-render-to-texture extensions over ES3 MSAA because we've observed in initFSAASupport()
1103 if ((GR_IS_GR_GL(fStandard) && shaderCaps->generation() >= SkSL::GLSLGeneration::k140) || in initBlendEqationSupport()
1104 (GR_IS_GR_GL_ES(fStandard) && shaderCaps->generation() >= SkSL::GLSLGeneration::k330)) { in initBlendEqationSupport()
1112 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kAutomatic_AdvBlendEqInteraction; in initBlendEqationSupport()
1116 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kGeneralEnable_AdvBlendEqInteraction; in initBlendEqationSupport()
1119 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kAutomatic_AdvBlendEqInteraction; in initBlendEqationSupport()
1122 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kGeneralEnable_AdvBlendEqInteraction; in initBlendEqationSupport()
1181 // all of our caps information in a named sub-object. in onDumpJSON()
1182 writer->beginObject("GL caps"); in onDumpJSON()
1184 writer->beginArray("Stencil Formats"); in onDumpJSON()
1187 writer->beginObject(nullptr, false); in onDumpJSON()
1188 writer->appendS32("stencil bits", GrGLFormatStencilBits(fStencilFormats[i])); in onDumpJSON()
1189 writer->appendS32("total bytes", GrGLFormatBytesPerBlock(fStencilFormats[i])); in onDumpJSON()
1190 writer->endObject(); in onDumpJSON()
1193 writer->endArray(); in onDumpJSON()
1231 writer->appendBool("Core Profile", fIsCoreProfile); in onDumpJSON()
1232 writer->appendString("MSAA Type", kMSFBOExtStr[fMSFBOType]); in onDumpJSON()
1233 writer->appendString("Invalidate FB Type", kInvalidateFBTypeStr[fInvalidateFBType]); in onDumpJSON()
1234 writer->appendString("Map Buffer Type", kMapBufferTypeStr[fMapBufferType]); in onDumpJSON()
1235 writer->appendString("Multi Draw Type", multi_draw_type_name(fMultiDrawType)); in onDumpJSON()
1236 writer->appendS32("Max FS Uniform Vectors", fMaxFragmentUniformVectors); in onDumpJSON()
1237 writer->appendBool("Pack Flip Y support", fPackFlipYSupport); in onDumpJSON()
1239 writer->appendBool("Texture Usage support", fTextureUsageSupport); in onDumpJSON()
1240 writer->appendBool("GL_ARB_imaging support", fImagingSupport); in onDumpJSON()
1241 writer->appendBool("Vertex array object support", fVertexArrayObjectSupport); in onDumpJSON()
1242 writer->appendBool("Debug support", fDebugSupport); in onDumpJSON()
1243 writer->appendBool("ES2 compatibility support", fES2CompatibilitySupport); in onDumpJSON()
1244 writer->appendBool("drawRangeElements support", fDrawRangeElementsSupport); in onDumpJSON()
1245 writer->appendBool("Base (vertex base) instance support", fBaseVertexBaseInstanceSupport); in onDumpJSON()
1246 writer->appendBool("Bind uniform location support", fBindUniformLocationSupport); in onDumpJSON()
1247 writer->appendBool("Rectangle texture support", fRectangleTextureSupport); in onDumpJSON()
1248 writer->appendBool("Mipmap LOD control support", fMipmapLodControlSupport); in onDumpJSON()
1249 writer->appendBool("Mipmap level control support", fMipmapLevelControlSupport); in onDumpJSON()
1250 writer->appendBool("Use buffer data null hint", fUseBufferDataNullHint); in onDumpJSON()
1251 writer->appendBool("Clear texture support", fClearTextureSupport); in onDumpJSON()
1252 writer->appendBool("Program binary support", fProgramBinarySupport); in onDumpJSON()
1253 writer->appendBool("Program parameters support", fProgramParameterSupport); in onDumpJSON()
1254 writer->appendBool("Sampler object support", fSamplerObjectSupport); in onDumpJSON()
1255 writer->appendBool("Using sampler objects", fUseSamplerObjects); in onDumpJSON()
1256 writer->appendBool("Texture swizzle support", fTextureSwizzleSupport); in onDumpJSON()
1257 writer->appendBool("Tiled rendering support", fTiledRenderingSupport); in onDumpJSON()
1258 writer->appendBool("FB fetch requires enable per sample", fFBFetchRequiresEnablePerSample); in onDumpJSON()
1259 writer->appendBool("sRGB Write Control", fSRGBWriteControl); in onDumpJSON()
1261 …writer->appendBool("Intermediate texture for partial updates of unorm textures ever bound to FBOs", in onDumpJSON()
1263 writer->appendBool("Intermediate texture for all updates of textures bound to FBOs", in onDumpJSON()
1265 writer->appendBool("Max instances per draw without crashing (or zero)", in onDumpJSON()
1268 writer->beginArray("formats"); in onDumpJSON()
1271 writer->beginObject(nullptr, false); in onDumpJSON()
1272 writer->appendHexU32("flags", fFormatTable[i].fFlags); in onDumpJSON()
1273 writer->appendHexU32("f_type", (uint32_t)fFormatTable[i].fFormatType); in onDumpJSON()
1274 writer->appendHexU32("c_internal", fFormatTable[i].fCompressedInternalFormat); in onDumpJSON()
1275 writer->appendHexU32("i_for_teximage", fFormatTable[i].fInternalFormatForTexImageOrStorage); in onDumpJSON()
1276 writer->appendHexU32("i_for_renderbuffer", fFormatTable[i].fInternalFormatForRenderbuffer); in onDumpJSON()
1277 writer->appendHexU32("default_ex_format", fFormatTable[i].fDefaultExternalFormat); in onDumpJSON()
1278 writer->appendHexU32("default_ex_type", fFormatTable[i].fDefaultExternalType); in onDumpJSON()
1279 writer->appendHexU32("default_color_type", (uint32_t)fFormatTable[i].fDefaultColorType); in onDumpJSON()
1281 writer->beginArray("surface color types"); in onDumpJSON()
1284 writer->beginObject(nullptr, false); in onDumpJSON()
1285 writer->appendHexU32("colorType", (uint32_t)ctInfo.fColorType); in onDumpJSON()
1286 writer->appendHexU32("flags", ctInfo.fFlags); in onDumpJSON()
1288 writer->beginArray("data color types"); in onDumpJSON()
1291 writer->beginObject(nullptr, false); in onDumpJSON()
1292 writer->appendHexU32("colorType", (uint32_t)ioInfo.fColorType); in onDumpJSON()
1293 writer->appendHexU32("ex_type", ioInfo.fExternalType); in onDumpJSON()
1294 writer->appendHexU32("ex_teximage", ioInfo.fExternalTexImageFormat); in onDumpJSON()
1295 writer->appendHexU32("ex_read", ioInfo.fExternalReadFormat); in onDumpJSON()
1296 writer->endObject(); in onDumpJSON()
1298 writer->endArray(); in onDumpJSON()
1299 writer->endObject(); in onDumpJSON()
1301 writer->endArray(); in onDumpJSON()
1302 writer->endObject(); in onDumpJSON()
1305 writer->endArray(); in onDumpJSON()
1306 writer->endObject(); in onDumpJSON()
1314 const auto& info = this->getFormatInfo(surfaceFormat); in getTexImageExternalFormatAndType()
1323 const auto& info = this->getFormatInfo(format); in getTexSubImageDefaultFormatTypeAndColorType()
1334 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType, in getTexSubImageExternalFormatAndType()
1341 this->getExternalFormat(surfaceFormat, surfaceColorType, memoryColorType, in getReadPixelsFormat()
1349 *externalFormat = this->getFormatInfo(surfaceFormat).externalFormat( in getExternalFormat()
1351 *externalType = this->getFormatInfo(surfaceFormat).externalType( in getExternalFormat()
1356 SkASSERT(!this->hasStencilFormatBeenDeterminedForFormat(format)); in setStencilFormatIndexForFormat()
1357 this->getFormatInfo(format).fStencilFormatIndex = in setStencilFormatIndexForFormat()
1397 // when using glTexStorage2D. This appears to affect OOP-R (so not just over command buffer). in initFormatTable()
1425 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA8); in initFormatTable()
1461 this->setColorTypeFormat(GrColorType::kRGBA_8888, GrGLFormat::kRGBA8); in initFormatTable()
1481 ioFormat.fExternalTexImageFormat = 0; // TODO: Enable this on non-ES GL in initFormatTable()
1494 this->setColorTypeFormat(GrColorType::kBGRA_8888, GrGLFormat::kRGBA8); in initFormatTable()
1548 FormatInfo& info = this->getFormatInfo(GrGLFormat::kR8); in initFormatTable()
1589 this->setColorTypeFormat(GrColorType::kR_8, GrGLFormat::kR8); in initFormatTable()
1624 this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kR8); in initFormatTable()
1658 this->setColorTypeFormat(GrColorType::kGray_8, GrGLFormat::kR8); in initFormatTable()
1695 FormatInfo& info = this->getFormatInfo(GrGLFormat::kALPHA8); in initFormatTable()
1751 this->setColorTypeFormat(GrColorType::kAlpha_8, GrGLFormat::kALPHA8); in initFormatTable()
1785 FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE8); in initFormatTable()
1815 // spec. For GLES it does not seem to ever support LUMINANCE8 being color-renderable. For GL in initFormatTable()
1819 // or compatibility) do not list LUMINANCE8 as color-renderable (which is strange since the in initFormatTable()
1834 this->setColorTypeFormat(GrColorType::kGray_8, GrGLFormat::kLUMINANCE8); in initFormatTable()
1865 FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE8_ALPHA8); in initFormatTable()
1907 this->setColorTypeFormat(GrColorType::kGrayAlpha_88, in initFormatTable()
1938 FormatInfo& info = this->getFormatInfo(GrGLFormat::kBGRA8); in initFormatTable()
2005 // on ES2 with this extension. This also side-steps some ambiguous interactions with in initFormatTable()
2033 this->setColorTypeFormat(GrColorType::kBGRA_8888, GrGLFormat::kBGRA8); in initFormatTable()
2067 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGB565); in initFormatTable()
2112 this->setColorTypeFormat(GrColorType::kBGR_565, GrGLFormat::kRGB565); in initFormatTable()
2144 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA16F); in initFormatTable()
2217 this->setColorTypeFormat(GrColorType::kRGBA_F16, GrGLFormat::kRGBA16F); in initFormatTable()
2250 this->setColorTypeFormat(GrColorType::kRGBA_F16_Clamped, GrGLFormat::kRGBA16F); in initFormatTable()
2282 FormatInfo& info = this->getFormatInfo(GrGLFormat::kR16F); in initFormatTable()
2341 this->setColorTypeFormat(GrColorType::kAlpha_F16, GrGLFormat::kR16F); in initFormatTable()
2395 FormatInfo& info = this->getFormatInfo(GrGLFormat::kLUMINANCE16F); in initFormatTable()
2427 this->setColorTypeFormat(GrColorType::kAlpha_F16, GrGLFormat::kLUMINANCE16F); in initFormatTable()
2458 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBX8); in initFormatTable()
2484 this->setColorTypeFormat(GrColorType::kRGB_888x, GrGLFormat::kRGBX8); in initFormatTable()
2514 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGB8); in initFormatTable()
2524 // non-ES GL we don't support MSAA for GL_RGB8. On 4.2+ we could check using in initFormatTable()
2556 this->setColorTypeFormat(GrColorType::kRGB_888x, GrGLFormat::kRGB8); in initFormatTable()
2586 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRG8); in initFormatTable()
2622 this->setColorTypeFormat(GrColorType::kRG_88, GrGLFormat::kRG8); in initFormatTable()
2655 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGB10_A2); in initFormatTable()
2691 this->setColorTypeFormat(GrColorType::kRGBA_1010102, GrGLFormat::kRGB10_A2); in initFormatTable()
2718 //------------------------------------------------------------------ in initFormatTable()
2724 this->setColorTypeFormat(GrColorType::kBGRA_1010102, GrGLFormat::kRGB10_A2); in initFormatTable()
2757 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA4); in initFormatTable()
2789 this->setColorTypeFormat(GrColorType::kABGR_4444, GrGLFormat::kRGBA4); in initFormatTable()
2820 FormatInfo& info = this->getFormatInfo(GrGLFormat::kSRGB8_ALPHA8); in initFormatTable()
2894 this->setColorTypeFormat(GrColorType::kRGBA_8888_SRGB, GrGLFormat::kSRGB8_ALPHA8); in initFormatTable()
2904 // GL does not do srgb<->rgb conversions when transferring between cpu and gpu. in initFormatTable()
2929 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_RGB8_BC1); in initFormatTable()
2943 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_RGBA8_BC1); in initFormatTable()
2957 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_RGB8_ETC2); in initFormatTable()
2979 FormatInfo& info = this->getFormatInfo(GrGLFormat::kCOMPRESSED_ETC1_RGB8); in initFormatTable()
2993 FormatInfo& info = this->getFormatInfo(GrGLFormat::kR16); in initFormatTable()
3035 this->setColorTypeFormat(GrColorType::kAlpha_16, GrGLFormat::kR16); in initFormatTable()
3067 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRG16); in initFormatTable()
3109 this->setColorTypeFormat(GrColorType::kRG_1616, GrGLFormat::kRG16); in initFormatTable()
3150 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRGBA16); in initFormatTable()
3181 this->setColorTypeFormat(GrColorType::kRGBA_16161616, GrGLFormat::kRGBA16); in initFormatTable()
3242 FormatInfo& info = this->getFormatInfo(GrGLFormat::kRG16F); in initFormatTable()
3272 this->setColorTypeFormat(GrColorType::kRG_F16, GrGLFormat::kRG16F); in initFormatTable()
3302 this->setupSampleCounts(ctxInfo, gli); in initFormatTable()
3341 // We assume that MSAA rendering is supported only if we support non-MSAA rendering. in setupSampleCounts()
3349 GrGLenum glFormat = this->getRenderbufferInternalFormat(grGLFormat); in setupSampleCounts()
3357 if (count && temp[count - 1] == 1) { in setupSampleCounts()
3358 --count; in setupSampleCounts()
3359 SkASSERT(!count || temp[count -1] > 1); in setupSampleCounts()
3369 fFormatTable[i].fColorSampleCounts[j+1] = SkPrevPow2(temp[count - j - 1]); in setupSampleCounts()
3371 fFormatTable[i].fColorSampleCounts[j+1] = temp[count - j - 1]; in setupSampleCounts()
3376 // Fake out the table using some semi-standard counts up to the max allowed sample in setupSampleCounts()
3389 for (; count > 0; --count) { in setupSampleCounts()
3390 if (kDefaultSamples[count - 1] <= maxSampleCnt) { in setupSampleCounts()
3414 if (this->getFormatDefaultExternalType(dstFormat) != in canCopyTexSubImage()
3415 this->getFormatDefaultExternalType(srcFormat)) { in canCopyTexSubImage()
3448 // The dst can't have gray if the src is alpha-only. in canCopyTexSubImage()
3471 return this->canFormatBeFBOColorAttachment(srcFormat) && in canCopyTexSubImage()
3483 if (!this->canFormatBeFBOColorAttachment(dstFormat) || in canCopyAsBlit()
3484 !this->canFormatBeFBOColorAttachment(srcFormat)) { in canCopyAsBlit()
3537 return this->isFormatRenderable(dstFormat, 1) && srcIsTexturable; in canCopyAsDraw()
3541 const GrRenderTargetProxy* rt = surf->asRenderTargetProxy(); in has_msaa_render_buffer()
3548 // 3) It's not FBO 0, which is special and always auto-resolves in has_msaa_render_buffer()
3549 return rt->numSamples() > 1 && in has_msaa_render_buffer()
3551 !rt->glRTFBOIDIs0(); in has_msaa_render_buffer()
3558 if (const GrRenderTargetProxy* rtProxy = dst->asRenderTargetProxy()) { in onCanCopySurface()
3559 dstSampleCnt = rtProxy->numSamples(); in onCanCopySurface()
3561 if (const GrRenderTargetProxy* rtProxy = src->asRenderTargetProxy()) { in onCanCopySurface()
3562 srcSampleCnt = rtProxy->numSamples(); in onCanCopySurface()
3564 SkASSERT((dstSampleCnt > 0) == SkToBool(dst->asRenderTargetProxy())); in onCanCopySurface()
3565 SkASSERT((srcSampleCnt > 0) == SkToBool(src->asRenderTargetProxy())); in onCanCopySurface()
3567 const GrTextureProxy* dstTex = dst->asTextureProxy(); in onCanCopySurface()
3568 const GrTextureProxy* srcTex = src->asTextureProxy(); in onCanCopySurface()
3575 dstTexType = dstTex->textureType(); in onCanCopySurface()
3579 srcTexType = srcTex->textureType(); in onCanCopySurface()
3583 auto dstFormat = dst->backendFormat().asGLFormat(); in onCanCopySurface()
3584 auto srcFormat = src->backendFormat().asGLFormat(); in onCanCopySurface()
3585 return this->canCopyTexSubImage(dstFormat, has_msaa_render_buffer(dst, *this), dstTexTypePtr, in onCanCopySurface()
3587 this->canCopyAsBlit(dstFormat, dstSampleCnt, dstTexTypePtr, srcFormat, srcSampleCnt, in onCanCopySurface()
3588 srcTexTypePtr, src->getBoundsRect(), src->priv().isExact(), srcRect, in onCanCopySurface()
3590 this->canCopyAsDraw(dstFormat, SkToBool(srcTex)); in onCanCopySurface()
3597 if (src->asTextureProxy() && !this->isFormatAsColorTypeRenderable(colorType, in getDstCopyRestrictions()
3598 src->backendFormat())) { in getDstCopyRestrictions()
3602 if (const auto* texProxy = src->asTextureProxy()) { in getDstCopyRestrictions()
3603 if (texProxy->textureType() == GrTextureType::kExternal) { in getDstCopyRestrictions()
3611 // possible and we return false to fallback to creating a render target dst for render-to- in getDstCopyRestrictions()
3615 if (src->numSamples() > 1 && in getDstCopyRestrictions()
3620 } else if (src->numSamples() > 1 && (fBlitFramebufferFlags & in getDstCopyRestrictions()
3625 auto srcFormat = src->backendFormat().asGLFormat(); in getDstCopyRestrictions()
3630 if (this->canFormatBeFBOColorAttachment(srcFormat)) { in getDstCopyRestrictions()
3638 bool srcIsMSAARenderbuffer = src->numSamples() > 1 && in getDstCopyRestrictions()
3639 this->usesMSAARenderBuffers(); in getDstCopyRestrictions()
3643 if (this->canFormatBeFBOColorAttachment(srcFormat)) { in getDstCopyRestrictions()
3744 formatWorkarounds->fDisallowR8ForPowerVRSGX54x = true; in applyDriverCorrectnessWorkarounds()
3749 formatWorkarounds->fDisallowTextureUnorm16 = true; // http://crbug.com/1224108 in applyDriverCorrectnessWorkarounds()
3750 formatWorkarounds->fDisallowETC2Compression = true; // http://crbug.com/1224111 in applyDriverCorrectnessWorkarounds()
3781 // crbug.com/768134 - On MacBook Pros, the Intel Iris Pro doesn't always perform in applyDriverCorrectnessWorkarounds()
3783 // crbug.com/773107 - On MacBook Pros, a wide range of Intel GPUs don't always in applyDriverCorrectnessWorkarounds()
3785 // 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()
3787 // crbug.com/1039912 - Crash rate in glClear spiked after OS update, affecting mostly in applyDriverCorrectnessWorkarounds()
3794 // crbug.com/969609 - NVIDIA on Mac sometimes segfaults during glClear in chrome. It seems in applyDriverCorrectnessWorkarounds()
3837 // - A Galaxy J5 (Adreno 306) running Android 6 with driver 140.0 in applyDriverCorrectnessWorkarounds()
3838 // - A Nexus 7 2013 (Adreno 320) running Android 5 with driver 104.0 in applyDriverCorrectnessWorkarounds()
3839 // - A Nexus 7 2013 (Adreno 320) running Android 6 with driver 127.0 in applyDriverCorrectnessWorkarounds()
3840 // - A Nexus 5 (Adreno 330) running Android 6 with driver 127.0 in applyDriverCorrectnessWorkarounds()
3842 // - A Nexus 7 2013 (Adreno 320) running Android 4 with driver 53.0 in applyDriverCorrectnessWorkarounds()
3906 // We support manual mip-map generation (via iterative downsampling draw calls). This fixes in applyDriverCorrectnessWorkarounds()
3907 // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textures when using in applyDriverCorrectnessWorkarounds()
3908 // glGenerateMipmap. Our implementation requires mip-level sampling control. Additionally, in applyDriverCorrectnessWorkarounds()
3909 // it can be much slower (especially on mobile GPUs), so we opt-in only when necessary: in applyDriverCorrectnessWorkarounds()
3946 shaderCaps->fFBFetchSupport = false; in applyDriverCorrectnessWorkarounds()
3953 shaderCaps->fCanUseAnyFunctionInShader = (ctxInfo.vendor() != GrGLVendor::kImagination); in applyDriverCorrectnessWorkarounds()
3958 shaderCaps->fCanUseMinAndAbsTogether = false; in applyDriverCorrectnessWorkarounds()
3962 shaderCaps->fCanUseFractForNegativeValues = false; in applyDriverCorrectnessWorkarounds()
3965 // On Intel GPU there is an issue where it reads the second argument to atan "- %s.x" as an int in applyDriverCorrectnessWorkarounds()
3966 // thus must us -1.0 * %s.x to work correctly in applyDriverCorrectnessWorkarounds()
3968 shaderCaps->fMustForceNegatedAtanParamToFloat = true; in applyDriverCorrectnessWorkarounds()
3973 // The Radeon GLSL compiler on Mac gets confused by ldexp(..., -x). in applyDriverCorrectnessWorkarounds()
3974 // Convert to ldexp(..., x * -1). in applyDriverCorrectnessWorkarounds()
3976 shaderCaps->fMustForceNegatedLdexpParamToMultiply = true; in applyDriverCorrectnessWorkarounds()
3982 // make sure the compiler doesn't re-inline them even if we break the calls apart. in applyDriverCorrectnessWorkarounds()
3984 shaderCaps->fMustDoOpBetweenFloorAndAbs = true; in applyDriverCorrectnessWorkarounds()
3990 if (shaderCaps->fFBFetchSupport && ctxInfo.vendor() == GrGLVendor::kQualcomm) { in applyDriverCorrectnessWorkarounds()
3991 shaderCaps->fRequiresLocalOutputColorForFBFetch = true; in applyDriverCorrectnessWorkarounds()
3996 // on that uniform plus soemthing un-trackable (like a texture read), the compiler will deduce in applyDriverCorrectnessWorkarounds()
4001 shaderCaps->fMustObfuscateUniformColor = true; in applyDriverCorrectnessWorkarounds()
4004 // On Mali G series GPUs, applying transfer functions in the fragment shader with half-floats in applyDriverCorrectnessWorkarounds()
4008 fShaderCaps->fColorSpaceMathNeedsFloat = true; in applyDriverCorrectnessWorkarounds()
4013 fShaderCaps->fAvoidDfDxForGradientsWhenPossible = true; in applyDriverCorrectnessWorkarounds()
4030 shaderCaps->fMustGuardDivisionEvenAfterExplicitZeroCheck = true; in applyDriverCorrectnessWorkarounds()
4042 shaderCaps->fRewriteMatrixComparisons = true; in applyDriverCorrectnessWorkarounds()
4050 shaderCaps->fCanUseFragCoord = false; in applyDriverCorrectnessWorkarounds()
4055 shaderCaps->fCanUseFragCoord = false; in applyDriverCorrectnessWorkarounds()
4058 // On Mali G71, mediump ints don't appear capable of representing every integer beyond +/-2048. in applyDriverCorrectnessWorkarounds()
4061 shaderCaps->fIncompleteShortIntPrecision = true; in applyDriverCorrectnessWorkarounds()
4065 shaderCaps->fAddAndTrueToLoopCondition = true; in applyDriverCorrectnessWorkarounds()
4069 shaderCaps->fUnfoldShortCircuitAsTernary = true; in applyDriverCorrectnessWorkarounds()
4073 shaderCaps->fEmulateAbsIntFunction = true; in applyDriverCorrectnessWorkarounds()
4077 shaderCaps->fRewriteDoWhileLoops = true; in applyDriverCorrectnessWorkarounds()
4081 shaderCaps->fRemovePowWithConstantExponent = true; in applyDriverCorrectnessWorkarounds()
4085 shaderCaps->fDualSourceBlendingSupport = false; in applyDriverCorrectnessWorkarounds()
4090 shaderCaps->fMustWriteToFragColor = true; in applyDriverCorrectnessWorkarounds()
4103 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction; in applyDriverCorrectnessWorkarounds()
4106 // Non-coherent advanced blend has an issue on NVIDIA pre 337.00. in applyDriverCorrectnessWorkarounds()
4111 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction; in applyDriverCorrectnessWorkarounds()
4116 shaderCaps->fAdvBlendEqInteraction = GrShaderCaps::kNotSupported_AdvBlendEqInteraction; in applyDriverCorrectnessWorkarounds()
4119 if (this->advancedBlendEquationSupport()) { in applyDriverCorrectnessWorkarounds()
4122 // Disable color-dodge and color-burn on pre-355.00 NVIDIA. in applyDriverCorrectnessWorkarounds()
4127 // Disable color-burn on ARM until the fix is released. in applyDriverCorrectnessWorkarounds()
4150 !shaderCaps->fExternalTextureSupport) { // i.e. Missing the _essl3 extension in applyDriverCorrectnessWorkarounds()
4151 shaderCaps->fExternalTextureSupport = true; in applyDriverCorrectnessWorkarounds()
4152 shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external"; in applyDriverCorrectnessWorkarounds()
4153 shaderCaps->fSecondExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3"; in applyDriverCorrectnessWorkarounds()
4164 // the GL->Metal layer). in applyDriverCorrectnessWorkarounds()
4198 shaderCaps->fMaxTessellationSegments = 0; in applyDriverCorrectnessWorkarounds()
4205 shaderCaps->fMaxTessellationSegments = 0; in applyDriverCorrectnessWorkarounds()
4213 shaderCaps->fMaxTessellationSegments = 0; in applyDriverCorrectnessWorkarounds()
4229 shaderCaps->fMustWriteToFragColor = true; in applyDriverCorrectnessWorkarounds()
4237 shaderCaps->fNoPerspectiveInterpolationSupport = false; in applyDriverCorrectnessWorkarounds()
4250 formatWorkarounds->fDisableSRGBRenderWithMSAAForMacAMD = true; in applyDriverCorrectnessWorkarounds()
4256 formatWorkarounds->fDisableRGBA16FTexStorageForCrBug1008003 = in applyDriverCorrectnessWorkarounds()
4261 // problems with cross-context SkImages. in applyDriverCorrectnessWorkarounds()
4262 formatWorkarounds->fDisableBGRATextureStorageForIntelWindowsES = in applyDriverCorrectnessWorkarounds()
4272 formatWorkarounds->fDisableLuminance16F = ctxInfo.renderer() == GrGLRenderer::kIntelBroadwell || in applyDriverCorrectnessWorkarounds()
4279 formatWorkarounds->fDisallowDirectRG8ReadPixels = in applyDriverCorrectnessWorkarounds()
4295 formatWorkarounds->fDontDisableTexStorageOnAndroid = true; in applyDriverCorrectnessWorkarounds()
4301 shaderCaps->fNoDefaultPrecisionForExternalSamplers = true; in applyDriverCorrectnessWorkarounds()
4310 if (fTiledRenderingSupport && (!glInterface->fFunctions.fStartTiling || in applyDriverCorrectnessWorkarounds()
4311 !glInterface->fFunctions.fEndTiling)) { in applyDriverCorrectnessWorkarounds()
4321 formatWorkarounds->fDisallowBGRA8ReadPixels = true; in applyDriverCorrectnessWorkarounds()
4341 // SkSL::Program memory. To get better/different crash reports, disable node-pooling, so that in applyDriverCorrectnessWorkarounds()
4344 shaderCaps->fUseNodePools = false; in applyDriverCorrectnessWorkarounds()
4361 fShaderCaps->fVertexIDSupport = false; in applyDriverCorrectnessWorkarounds()
4371 fShaderCaps->fShaderDerivativeSupport = false; in applyDriverCorrectnessWorkarounds()
4375 formatWorkarounds->fDisallowUnorm16Transfers = true; in applyDriverCorrectnessWorkarounds()
4379 // non-MSAA we get corruption in the texture contents. Binding texture 0 and then rebinding the in applyDriverCorrectnessWorkarounds()
4386 // We also so alpha blending issues on these GMs skbug_9819, p3_ovals, p3 on Mali-Gxx devices in applyDriverCorrectnessWorkarounds()
4388 // GL_VERSION : "OpenGL ES 3.2 v1.r19p0-01rel0.###other-sha0123456789ABCDEF0###" in applyDriverCorrectnessWorkarounds()
4389 // GL_RENDERER: "Mali-G72" in applyDriverCorrectnessWorkarounds()
4392 // GL_VERSION : "OpenGL ES 3.2 v1.r16p0-01rel0.4aee637066427cbcd25297324dba15f5" in applyDriverCorrectnessWorkarounds()
4393 // GL_RENDERER: "Mali-G76" in applyDriverCorrectnessWorkarounds()
4396 // GL_VERSION : "OpenGL ES 3.2 v1.r20p0-01rel0.###other-sha0123456789ABCDEF0###" in applyDriverCorrectnessWorkarounds()
4397 // GL_RENDERER: "Mali-G77" in applyDriverCorrectnessWorkarounds()
4413 // GL_RENDERER: "Mali-T880" in applyDriverCorrectnessWorkarounds()
4414 // GL_VERSION : "OpenGL ES 3.2 v1.r22p0-01rel0.f294e54ceb2cb2d81039204fa4b0402e" in applyDriverCorrectnessWorkarounds()
4418 // GL_RENDERER: "Mali-T860" in applyDriverCorrectnessWorkarounds()
4419 // GL_VERSION : "OpenGL ES 3.2 v1.r26p0-01rel0.217d2597f6bd19b169343737782e56e3" in applyDriverCorrectnessWorkarounds()
4457 if (auto tex = static_cast<const GrGLTexture*>(surface->asTexture())) { in onSurfaceSupportsWritePixels()
4458 if (tex->hasBaseLevelBeenBoundToFBO()) { in onSurfaceSupportsWritePixels()
4463 if (auto rt = surface->asRenderTarget()) { in onSurfaceSupportsWritePixels()
4467 if (rt->numSamples() > 1 && this->usesMSAARenderBuffers()) { in onSurfaceSupportsWritePixels()
4470 return SkToBool(surface->asTexture()); in onSurfaceSupportsWritePixels()
4477 if (auto tex = static_cast<const GrGLTexture*>(surface->asTexture())) { in surfaceSupportsReadPixels()
4481 if (tex->target() == GR_GL_TEXTURE_EXTERNAL || GrGLFormatIsCompressed(tex->format())) { in surfaceSupportsReadPixels()
4484 } else if (auto rt = static_cast<const GrGLRenderTarget*>(surface->asRenderTarget())) { in surfaceSupportsReadPixels()
4487 if (rt->numSamples() > 1 && !rt->asTexture()) { in surfaceSupportsReadPixels()
4544 const auto& formatInfo = this->getFormatInfo(srcBackendFormat.asGLFormat()); in onSupportedReadPixelsColorType()
4582 const auto& formatInfo = this->getFormatInfo(surfaceFormat.asGLFormat()); in supportedWritePixelsColorType()
4627 if (textureType == GrTextureType::kRectangle && !this->rectangleTextureSupport()) { in isFormatTexturable()
4630 return this->isFormatTexturable(format.asGLFormat()); in isFormatTexturable()
4634 const FormatInfo& info = this->getFormatInfo(format); in isFormatTexturable()
4640 if (format.textureType() == GrTextureType::kRectangle && !this->rectangleTextureSupport()) { in isFormatAsColorTypeRenderable()
4647 const FormatInfo& info = this->getFormatInfo(f); in isFormatAsColorTypeRenderable()
4652 return this->isFormatRenderable(f, sampleCount); in isFormatAsColorTypeRenderable()
4656 if (format.textureType() == GrTextureType::kRectangle && !this->rectangleTextureSupport()) { in isFormatRenderable()
4662 return this->isFormatRenderable(format.asGLFormat(), sampleCount); in isFormatRenderable()
4666 const FormatInfo& info = this->getFormatInfo(format); in getRenderTargetSampleCount()
4690 const FormatInfo& info = this->getFormatInfo(format); in maxRenderTargetSampleCount()
4695 int count = table[table.count() - 1]; in maxRenderTargetSampleCount()
4703 return SkToBool(this->getFormatInfo(format).fFlags & FormatInfo::kFBOColorAttachment_Flag); in canFormatBeFBOColorAttachment()
4711 return this->canFormatBeFBOColorAttachment(format.asGLFormat()); in isFormatCopyable()
4715 return SkToBool(this->getFormatInfo(format).fFlags & FormatInfo::kUseTexStorage_Flag); in formatSupportsTexStorage()
4719 const auto& formatInfo = const_cast<GrGLCaps*>(this)->getFormatInfo(format); in shouldQueryImplementationReadSupport()
4743 auto& formatInfo = const_cast<GrGLCaps*>(this)->getFormatInfo(format); in didQueryImplementationReadSupport()
4763 const auto& info = this->getFormatInfo(glFormat); in onAreColorTypeAndFormatCompatible()
4773 auto format = this->getFormatFromColorType(ct); in onGetDefaultBackendFormat()
4787 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_ETC2)) { in getBackendFormatFromCompressionType()
4790 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_ETC1_RGB8)) { in getBackendFormatFromCompressionType()
4795 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_BC1)) { in getBackendFormatFromCompressionType()
4801 if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGBA8_BC1)) { in getBackendFormatFromCompressionType()
4814 const auto& info = this->getFormatInfo(glFormat); in onGetReadSwizzle()
4828 const auto& info = this->getFormatInfo(format.asGLFormat()); in getWriteSwizzle()
4841 if (rt->asTextureProxy()) { in onGetDstSampleFlagsForProxy()
4931 if (this->rectangleTextureSupport()) { in getTestingCombinations()