Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1410383011: Loosen requirements for mixed samples support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 0591f188a56b8ee028fa2ce89a6efba70025d49b..c6a42cfc5432f610aa542a14704a26e0b696ff79 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -310,21 +310,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
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) &&
@@ -340,8 +325,18 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
* 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);
@@ -983,7 +978,7 @@ void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
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;
@@ -995,7 +990,7 @@ void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
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")) {
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698