OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 fInstancedDrawingSupport = false; | 43 fInstancedDrawingSupport = false; |
44 fDirectStateAccessSupport = false; | 44 fDirectStateAccessSupport = false; |
45 fDebugSupport = false; | 45 fDebugSupport = false; |
46 fES2CompatibilitySupport = false; | 46 fES2CompatibilitySupport = false; |
47 fMultisampleDisableSupport = false; | 47 fMultisampleDisableSupport = false; |
48 fUseNonVBOVertexAndIndexDynamicData = false; | 48 fUseNonVBOVertexAndIndexDynamicData = false; |
49 fIsCoreProfile = false; | 49 fIsCoreProfile = false; |
50 fFullClearIsFree = false; | 50 fFullClearIsFree = false; |
51 fBindFragDataLocationSupport = false; | 51 fBindFragDataLocationSupport = false; |
52 fSRGBWriteControl = false; | 52 fSRGBWriteControl = false; |
53 fRGBA8888PixelsOpsAreSlow = false; | |
54 fPartialFBOReadIsSlow = false; | |
53 | 55 |
54 fReadPixelsSupportedCache.reset(); | 56 fReadPixelsSupportedCache.reset(); |
55 | 57 |
56 fShaderCaps.reset(SkNEW_ARGS(GrGLSLCaps, (contextOptions))); | 58 fShaderCaps.reset(SkNEW_ARGS(GrGLSLCaps, (contextOptions))); |
57 | 59 |
58 this->init(contextOptions, ctxInfo, glInterface); | 60 this->init(contextOptions, ctxInfo, glInterface); |
59 } | 61 } |
60 | 62 |
61 void GrGLCaps::init(const GrContextOptions& contextOptions, | 63 void GrGLCaps::init(const GrContextOptions& contextOptions, |
62 const GrGLContextInfo& ctxInfo, | 64 const GrGLContextInfo& ctxInfo, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 | 298 |
297 if (kGL_GrGLStandard == standard) { | 299 if (kGL_GrGLStandard == standard) { |
298 if (version >= GR_GL_VER(3, 0)) { | 300 if (version >= GR_GL_VER(3, 0)) { |
299 fBindFragDataLocationSupport = true; | 301 fBindFragDataLocationSupport = true; |
300 } | 302 } |
301 } else { | 303 } else { |
302 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun c_extended")) { | 304 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun c_extended")) { |
303 fBindFragDataLocationSupport = true; | 305 fBindFragDataLocationSupport = true; |
304 } | 306 } |
305 } | 307 } |
306 | 308 |
robertphillips
2015/07/31 17:17:41
Can we just do all this only when SK_BUILD_FOR_WIN
| |
309 static const bool kIsWindows = | |
310 #ifdef SK_BUILD_FOR_WIN | |
311 true; | |
312 #else | |
313 false; | |
314 #endif | |
315 | |
robertphillips
2015/07/31 17:17:41
Maybe:
bool isAngle = ...;
fRGBA8888PixelsOpsAre
| |
316 // Angle has slow read/write pixel paths for 32bit RGBA (but fast for BGRA). We're assuming that | |
317 // on Windows Chromium we're using ANGLE. | |
318 fRGBA8888PixelsOpsAreSlow = kIsWindows && (ctxInfo.driver() == kChromium_GrG LDriver || | |
319 ctxInfo.driver() == kANGLE_GrGLDr iver); | |
320 // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is s till true and | |
321 // check DX11 ANGLE. | |
322 fPartialFBOReadIsSlow = fRGBA8888PixelsOpsAreSlow; | |
323 | |
307 /************************************************************************** | 324 /************************************************************************** |
308 * GrShaderCaps fields | 325 * GrShaderCaps fields |
309 **************************************************************************/ | 326 **************************************************************************/ |
310 | 327 |
311 glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli ); | 328 glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli ); |
312 | 329 |
313 // For now these two are equivalent but we could have dst read in shader via some other method | 330 // For now these two are equivalent but we could have dst read in shader via some other method |
314 glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; | 331 glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; |
315 | 332 |
316 // Enable supported shader-related caps | 333 // Enable supported shader-related caps |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1125 (fFragCoordsConventionSupport ? "YES": "NO")); | 1142 (fFragCoordsConventionSupport ? "YES": "NO")); |
1126 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); | 1143 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); |
1127 r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YE S": "NO")); | 1144 r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YE S": "NO")); |
1128 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO")); | 1145 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO")); |
1129 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); | 1146 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); |
1130 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO")); | 1147 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO")); |
1131 r.appendf("Use non-VBO for dynamic data: %s\n", | 1148 r.appendf("Use non-VBO for dynamic data: %s\n", |
1132 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1149 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
1133 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); | 1150 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); |
1134 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); | 1151 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); |
1152 r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow? "YES" : "NO")); | |
1153 r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow? "YES" : "NO")); | |
1135 return r; | 1154 return r; |
1136 } | 1155 } |
1137 | 1156 |
1138 static GrGLenum precision_to_gl_float_type(GrSLPrecision p) { | 1157 static GrGLenum precision_to_gl_float_type(GrSLPrecision p) { |
1139 switch (p) { | 1158 switch (p) { |
1140 case kLow_GrSLPrecision: | 1159 case kLow_GrSLPrecision: |
1141 return GR_GL_LOW_FLOAT; | 1160 return GR_GL_LOW_FLOAT; |
1142 case kMedium_GrSLPrecision: | 1161 case kMedium_GrSLPrecision: |
1143 return GR_GL_MEDIUM_FLOAT; | 1162 return GR_GL_MEDIUM_FLOAT; |
1144 case kHigh_GrSLPrecision: | 1163 case kHigh_GrSLPrecision: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1215 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1234 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
1216 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = | 1235 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = |
1217 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p]; | 1236 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p]; |
1218 } | 1237 } |
1219 } | 1238 } |
1220 } | 1239 } |
1221 | 1240 |
1222 | 1241 |
1223 | 1242 |
1224 | 1243 |
OLD | NEW |