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

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

Issue 1151793002: Make mixed samples contingent on auxiliary extensions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months 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/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('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 7d9c50d16b4965e07c80880e2eda11cfd1988abc..22e23dc28c7f2ff2d9f7675a3ca4061b1aa6ae3a 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -44,10 +44,10 @@ void GrGLCaps::reset() {
fFragCoordsConventionSupport = false;
fVertexArrayObjectSupport = false;
fES2CompatibilitySupport = false;
+ fMultisampleDisableSupport = false;
fUseNonVBOVertexAndIndexDynamicData = false;
fIsCoreProfile = false;
fFullClearIsFree = false;
- fFBMixedSamplesSupport = false;
fReadPixelsSupportedCache.reset();
@@ -86,10 +86,10 @@ GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) {
fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport;
fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport;
fES2CompatibilitySupport = caps.fES2CompatibilitySupport;
+ fMultisampleDisableSupport = caps.fMultisampleDisableSupport;
fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicData;
fIsCoreProfile = caps.fIsCoreProfile;
fFullClearIsFree = caps.fFullClearIsFree;
- fFBMixedSamplesSupport = caps.fFBMixedSamplesSupport;
*(reinterpret_cast<GrGLSLCaps*>(fShaderCaps.get())) =
*(reinterpret_cast<GrGLSLCaps*>(caps.fShaderCaps.get()));
@@ -252,6 +252,12 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fES2CompatibilitySupport = true;
}
+ if (kGL_GrGLStandard == standard) {
+ fMultisampleDisableSupport = true;
+ } else {
+ fMultisampleDisableSupport = false;
Chris Dalton 2015/05/21 03:28:52 This will eventually be replaced with a check for
+ }
+
this->initFSAASupport(ctxInfo, gli);
this->initStencilFormats(ctxInfo);
@@ -336,8 +342,6 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
// attachment, hence this min:
fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
- fFBMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples");
-
fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker");
// Disable scratch texture reuse on Mali and Adreno devices
@@ -915,6 +919,7 @@ SkString GrGLCaps::dump() const {
r.appendf("Fragment coord conventions support: %s\n",
(fFragCoordsConventionSupport ? "YES": "NO"));
r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
+ r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO"));
r.appendf("Use non-VBO for dynamic data: %s\n",
(fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO"));
@@ -1034,6 +1039,15 @@ bool GrGLSLCaps::init(const GrGLContextInfo& ctxInfo,
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 (fDualSourceBlendingSupport && glCaps.multisampleDisableSupport()) {
+ // We understand "mixed samples" to mean the collective capability of 3 different extensions
+ fMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") &&
+ ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage") &&
+ ctxInfo.hasExtension("GL_EXT_raster_multisample");
+ }
+
if (glCaps.advancedBlendEquationSupport()) {
bool coherent = glCaps.advancedCoherentBlendEquationSupport();
if (ctxInfo.hasExtension(coherent ? "GL_NV_blend_equation_advanced_coherent"
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698