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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 else { | 264 else { |
265 fES2CompatibilitySupport = true; | 265 fES2CompatibilitySupport = true; |
266 } | 266 } |
267 | 267 |
268 if (kGL_GrGLStandard == standard) { | 268 if (kGL_GrGLStandard == standard) { |
269 fMultisampleDisableSupport = true; | 269 fMultisampleDisableSupport = true; |
270 } else { | 270 } else { |
271 fMultisampleDisableSupport = false; | 271 fMultisampleDisableSupport = false; |
272 } | 272 } |
273 | 273 |
274 if (kGL_GrGLStandard == standard && version >= GR_GL_VER(3, 0)) { | 274 if (kGL_GrGLStandard == standard) { |
275 fBindFragDataLocationSupport = true; | 275 if (version >= GR_GL_VER(3, 0)) { |
| 276 fBindFragDataLocationSupport = true; |
| 277 } |
| 278 } else { |
| 279 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun
c_extended")) { |
| 280 fBindFragDataLocationSupport = true; |
| 281 } |
276 } | 282 } |
277 | 283 |
278 /************************************************************************** | 284 /************************************************************************** |
279 * GrShaderCaps fields | 285 * GrShaderCaps fields |
280 **************************************************************************/ | 286 **************************************************************************/ |
281 | 287 |
282 glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli
); | 288 glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli
); |
283 | 289 |
284 // For now these two are equivalent but we could have dst read in shader via
some other method | 290 // For now these two are equivalent but we could have dst read in shader via
some other method |
285 glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; | 291 glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; |
286 | 292 |
287 // Enable supported shader-related caps | 293 // Enable supported shader-related caps |
288 if (kGL_GrGLStandard == standard) { | 294 if (kGL_GrGLStandard == standard) { |
289 glslCaps->fDualSourceBlendingSupport = (ctxInfo.version() >= GR_GL_VER(3
, 3) || | 295 glslCaps->fDualSourceBlendingSupport = (ctxInfo.version() >= GR_GL_VER(3
, 3) || |
290 ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && | 296 ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && |
291 GrGLSLSupportsNamedFragmentShaderOutputs(ctxInfo.glslGeneration()); | 297 GrGLSLSupportsNamedFragmentShaderOutputs(ctxInfo.glslGeneration()); |
292 glslCaps->fShaderDerivativeSupport = true; | 298 glslCaps->fShaderDerivativeSupport = true; |
293 // we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS | 299 // we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS |
294 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& | 300 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& |
295 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; | 301 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; |
296 } | 302 } |
297 else { | 303 else { |
| 304 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); |
| 305 |
298 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || | 306 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || |
299 ctxInfo.hasExtension("GL_OES_standard_derivatives"); | 307 ctxInfo.hasExtension("GL_OES_standard_derivatives"); |
300 } | 308 } |
301 | 309 |
302 // We need dual source blending and the ability to disable multisample in or
der to support mixed | 310 // We need dual source blending and the ability to disable multisample in or
der to support mixed |
303 // samples in every corner case. | 311 // samples in every corner case. |
304 if (fMultisampleDisableSupport && glslCaps->fDualSourceBlendingSupport) { | 312 if (fMultisampleDisableSupport && glslCaps->fDualSourceBlendingSupport) { |
305 // We understand "mixed samples" to mean the collective capability of 3
different extensions | 313 // We understand "mixed samples" to mean the collective capability of 3
different extensions |
306 glslCaps->fMixedSamplesSupport = | 314 glslCaps->fMixedSamplesSupport = |
307 ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") && | 315 ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") && |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1209 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
1202 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = | 1210 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = |
1203 glslCaps->fFloatPrecisions[kVerte
x_GrShaderType][p]; | 1211 glslCaps->fFloatPrecisions[kVerte
x_GrShaderType][p]; |
1204 } | 1212 } |
1205 } | 1213 } |
1206 } | 1214 } |
1207 | 1215 |
1208 | 1216 |
1209 | 1217 |
1210 | 1218 |
OLD | NEW |