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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 // Enable supported shader-related caps | 273 // Enable supported shader-related caps |
274 if (kGL_GrGLStandard == standard) { | 274 if (kGL_GrGLStandard == standard) { |
275 glslCaps->fDualSourceBlendingSupport = (ctxInfo.version() >= GR_GL_VER(3
, 3) || | 275 glslCaps->fDualSourceBlendingSupport = (ctxInfo.version() >= GR_GL_VER(3
, 3) || |
276 ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && | 276 ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && |
277 GrGLSLSupportsNamedFragmentShaderOutputs(ctxInfo.glslGeneration()); | 277 GrGLSLSupportsNamedFragmentShaderOutputs(ctxInfo.glslGeneration()); |
278 glslCaps->fShaderDerivativeSupport = true; | 278 glslCaps->fShaderDerivativeSupport = true; |
279 // we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS | 279 // we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS |
280 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& | 280 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& |
281 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; | 281 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; |
| 282 glslCaps->fIntegerSupport = ctxInfo.version() >= GR_GL_VER(3, 0) && |
| 283 ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; |
282 } | 284 } |
283 else { | 285 else { |
284 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); | 286 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); |
285 | 287 |
286 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || | 288 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || |
287 ctxInfo.hasExtension("GL_OES_standard_derivatives"); | 289 ctxInfo.hasExtension("GL_OES_standard_derivatives"); |
| 290 |
| 291 glslCaps->fIntegerSupport = ctxInfo.version() >= GR_GL_VER(3, 0) && |
| 292 ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // We use this va
lue for GLSL ES 3.0. |
288 } | 293 } |
289 | 294 |
290 if (ctxInfo.hasExtension("GL_EXT_shader_pixel_local_storage")) { | 295 if (ctxInfo.hasExtension("GL_EXT_shader_pixel_local_storage")) { |
291 #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 | 296 #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 |
292 GR_GL_GetIntegerv(gli, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT, | 297 GR_GL_GetIntegerv(gli, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT, |
293 &glslCaps->fPixelLocalStorageSize); | 298 &glslCaps->fPixelLocalStorageSize); |
294 glslCaps->fPLSPathRenderingSupport = glslCaps->fFBFetchSupport; | 299 glslCaps->fPLSPathRenderingSupport = glslCaps->fFBFetchSupport; |
295 } | 300 } |
296 else { | 301 else { |
297 glslCaps->fPixelLocalStorageSize = 0; | 302 glslCaps->fPixelLocalStorageSize = 0; |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1664 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1660 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1665 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1661 fConfigTable[i].fFormats.fExternalFormat[j]); | 1666 fConfigTable[i].fFormats.fExternalFormat[j]); |
1662 } | 1667 } |
1663 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1668 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1664 } | 1669 } |
1665 #endif | 1670 #endif |
1666 } | 1671 } |
1667 | 1672 |
1668 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1673 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |