本文整理汇总了C++中GrGLCaps::advancedCoherentBlendEquationSupport方法的典型用法代码示例。如果您正苦于以下问题:C++ GrGLCaps::advancedCoherentBlendEquationSupport方法的具体用法?C++ GrGLCaps::advancedCoherentBlendEquationSupport怎么用?C++ GrGLCaps::advancedCoherentBlendEquationSupport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrGLCaps
的用法示例。
在下文中一共展示了GrGLCaps::advancedCoherentBlendEquationSupport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool GrGLSLCaps::init(const GrGLContextInfo& ctxInfo,
const GrGLInterface* gli,
const GrGLCaps& glCaps) {
this->reset();
if (!ctxInfo.isInitialized()) {
return false;
}
GrGLStandard standard = ctxInfo.standard();
GrGLVersion version = ctxInfo.version();
/**************************************************************************
* Caps specific to GrGLSLCaps
**************************************************************************/
if (kGLES_GrGLStandard == standard) {
if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) {
fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0));
fFBFetchSupport = true;
fFBFetchColorName = "gl_LastFragData[0]";
fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch";
}
else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) {
// Actually, we haven't seen an ES3.0 device with this extension yet, so we don't know
fFBFetchNeedsCustomOutput = false;
fFBFetchSupport = true;
fFBFetchColorName = "gl_LastFragData[0]";
fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch";
}
else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) {
// The arm extension also requires an additional flag which we will set onResetContext
fFBFetchNeedsCustomOutput = false;
fFBFetchSupport = true;
fFBFetchColorName = "gl_LastFragColorARM";
fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch";
}
}
// Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero in a shader
fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor();
/**************************************************************************
* GrShaderCaps fields
**************************************************************************/
fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
if (fPathRenderingSupport) {
if (kGL_GrGLStandard == standard) {
// We only support v1.3+ of GL_NV_path_rendering which allows us to
// set individual fragment inputs with ProgramPathFragmentInputGen. The API
// additions are detected by checking the existence of the function.
fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_access") &&
((ctxInfo.version() >= GR_GL_VER(4, 3) ||
ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
gli->fFunctions.fProgramPathFragmentInputGen);
}
else {
fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3, 1);
}
}
// For now these two are equivalent but we could have dst read in shader via some other method
fDstReadInShaderSupport = fFBFetchSupport;
// Enable supported shader-related caps
if (kGL_GrGLStandard == standard) {
fDualSourceBlendingSupport = ctxInfo.version() >= GR_GL_VER(3, 3) ||
ctxInfo.hasExtension("GL_ARB_blend_func_extended");
fShaderDerivativeSupport = true;
// we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS
fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2) &&
ctxInfo.glslGeneration() >= k150_GrGLSLGeneration;
}
else {
fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0) ||
ctxInfo.hasExtension("GL_OES_standard_derivatives");
}
if (glCaps.advancedBlendEquationSupport()) {
bool coherent = glCaps.advancedCoherentBlendEquationSupport();
if (ctxInfo.hasExtension(coherent ? "GL_NV_blend_equation_advanced_coherent"
: "GL_NV_blend_equation_advanced")) {
fAdvBlendEqInteraction = kAutomatic_AdvBlendEqInteraction;
} else {
fAdvBlendEqInteraction = kGeneralEnable_AdvBlendEqInteraction;
// TODO: Use the following on any platform where "blend_support_all_equations" is slow.
//fAdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction;
}
}
this->initShaderPrecisionTable(ctxInfo, gli);
return true;
}