bool pathRenderingSupport() const { return fPathRenderingSupport; }
bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; }
- bool mixedSamplesSupport() const { return fMixedSamplesSupport; }
bool programmableSampleLocationsSupport() const { return fProgrammableSampleLocationsSupport; }
/**
bool fPathRenderingSupport : 1;
bool fDstReadInShaderSupport : 1;
bool fDualSourceBlendingSupport : 1;
- bool fMixedSamplesSupport : 1;
bool fProgrammableSampleLocationsSupport : 1;
bool fShaderPrecisionVaries;
bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSupport; }
bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
bool textureBarrierSupport() const { return fTextureBarrierSupport; }
+ bool mixedSamplesSupport() const { return fMixedSamplesSupport; }
bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; }
bool useDrawInsteadOfPartialRenderTargetWrite() const {
bool fCompressedTexSubImageSupport : 1;
bool fOversizedStencilSupport : 1;
bool fTextureBarrierSupport : 1;
+ bool fMixedSamplesSupport : 1;
bool fSupportsInstancedDraws : 1;
bool fFullClearIsFree : 1;
bool fMustClearUploadedBufferData : 1;
fPathRenderingSupport = false;
fDstReadInShaderSupport = false;
fDualSourceBlendingSupport = false;
- fMixedSamplesSupport = false;
fProgrammableSampleLocationsSupport = false;
fShaderPrecisionVaries = false;
}
r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]);
r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]);
r.appendf("Dual Source Blending Support : %s\n", gNY[fDualSourceBlendingSupport]);
- r.appendf("Mixed Samples Support : %s\n", gNY[fMixedSamplesSupport]);
r.appendf("Programmable Sample Locations Support : %s\n", gNY[fProgrammableSampleLocationsSupport]);
r.appendf("Shader Float Precisions (varies: %s) :\n", gNY[fShaderPrecisionVaries]);
fCompressedTexSubImageSupport = false;
fOversizedStencilSupport = false;
fTextureBarrierSupport = false;
+ fMixedSamplesSupport = false;
fSupportsInstancedDraws = false;
fFullClearIsFree = false;
fMustClearUploadedBufferData = false;
r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSubImageSupport]);
r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencilSupport]);
r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSupport]);
+ r.appendf("Mixed Samples Support : %s\n", gNY[fMixedSamplesSupport]);
r.appendf("Supports instanced draws : %s\n", gNY[fSupportsInstancedDraws]);
r.appendf("Full screen clear is free : %s\n", gNY[fFullClearIsFree]);
r.appendf("Must clear buffer memory : %s\n", gNY[fMustClearUploadedBufferData]);
ctxInfo.hasExtension("GL_OES_standard_derivatives");
}
- // We need dual source blending and the ability to disable multisample in order to support mixed
- // samples in every corner case.
- if (fMultisampleDisableSupport && glslCaps->fDualSourceBlendingSupport) {
- // We understand "mixed samples" to mean the collective capability of 3 different extensions
- glslCaps->fMixedSamplesSupport =
- ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") &&
- ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage") &&
- ctxInfo.hasExtension("GL_EXT_raster_multisample");
- }
- // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed samples.
- if (kNVIDIA_GrGLDriver == ctxInfo.driver() && fShaderCaps->mixedSamplesSupport()) {
- fDiscardRenderTargetSupport = false;
- fInvalidateFBType = kNone_InvalidateFBType;
- }
-
if (kGL_GrGLStandard == standard) {
glslCaps->fProgrammableSampleLocationsSupport =
ctxInfo.version() >= GR_GL_VER(4, 3) &&
* GrCaps fields
**************************************************************************/
- // fPathRenderingSupport and fMixedSampleSupport must be set before calling initFSAASupport.
- // Both of these are set in the GrShaderCaps.
+ // We need dual source blending and the ability to disable multisample in order to support mixed
+ // samples in every corner case.
+ if (fMultisampleDisableSupport && glslCaps->dualSourceBlendingSupport()) {
+ fMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples");
+ // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed samples.
+ if (fMixedSamplesSupport && kNVIDIA_GrGLDriver == ctxInfo.driver()) {
+ fDiscardRenderTargetSupport = false;
+ fInvalidateFBType = kNone_InvalidateFBType;
+ }
+ }
+
+ // fPathRenderingSupport and fMixedSamplesSupport must be set before calling initFSAASupport.
this->initFSAASupport(ctxInfo, gli);
this->initBlendEqationSupport(ctxInfo);
this->initStencilFormats(ctxInfo);
fMSFBOType = kES_EXT_MsToTexture_MSFBOType;
} else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")) {
fMSFBOType = kES_IMG_MsToTexture_MSFBOType;
- } else if (fShaderCaps->mixedSamplesSupport() && fShaderCaps->pathRenderingSupport()) {
+ } else if (fMixedSamplesSupport && fShaderCaps->pathRenderingSupport()) {
fMSFBOType = kMixedSamples_MSFBOType;
} else if (ctxInfo.version() >= GR_GL_VER(3,0)) {
fMSFBOType = GrGLCaps::kES_3_0_MSFBOType;
fMSFBOType = kES_Apple_MSFBOType;
}
} else {
- if (fShaderCaps->mixedSamplesSupport() && fShaderCaps->pathRenderingSupport()) {
+ if (fMixedSamplesSupport && fShaderCaps->pathRenderingSupport()) {
fMSFBOType = kMixedSamples_MSFBOType;
} else if ((ctxInfo.version() >= GR_GL_VER(3,0)) ||
ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
// "opacity", which can then be blended into the color buffer to accomplish antialiasing.
// Enable coverage modulation suitable for premultiplied alpha colors.
// This state has no effect when not rendering to a mixed sampled target.
- if (this->glCaps().shaderCaps()->mixedSamplesSupport()) {
+ if (this->caps()->mixedSamplesSupport()) {
GL_CALL(CoverageModulation(GR_GL_RGBA));
}
}