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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& | 274 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& |
275 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; | 275 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; |
276 } | 276 } |
277 else { | 277 else { |
278 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); | 278 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); |
279 | 279 |
280 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || | 280 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || |
281 ctxInfo.hasExtension("GL_OES_standard_derivatives"); | 281 ctxInfo.hasExtension("GL_OES_standard_derivatives"); |
282 } | 282 } |
283 | 283 |
| 284 if (ctxInfo.hasExtension("GL_EXT_shader_pixel_local_storage")) { |
| 285 #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 |
| 286 GR_GL_GetIntegerv(gli, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT, |
| 287 &glslCaps->fPixelLocalStorageSize); |
| 288 glslCaps->fPLSPathRenderingSupport = glslCaps->fFBFetchSupport; |
| 289 } |
| 290 else { |
| 291 glslCaps->fPixelLocalStorageSize = 0; |
| 292 glslCaps->fPLSPathRenderingSupport = false; |
| 293 } |
| 294 |
284 /************************************************************************** | 295 /************************************************************************** |
285 * GrCaps fields | 296 * GrCaps fields |
286 **************************************************************************/ | 297 **************************************************************************/ |
287 | 298 |
288 // We need dual source blending and the ability to disable multisample in or
der to support mixed | 299 // We need dual source blending and the ability to disable multisample in or
der to support mixed |
289 // samples in every corner case. | 300 // samples in every corner case. |
290 if (fMultisampleDisableSupport && | 301 if (fMultisampleDisableSupport && |
291 glslCaps->dualSourceBlendingSupport() && | 302 glslCaps->dualSourceBlendingSupport() && |
292 fShaderCaps->pathRenderingSupport()) { | 303 fShaderCaps->pathRenderingSupport()) { |
293 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample
s") || | 304 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample
s") || |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { | 531 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { |
521 GrGLStandard standard = ctxInfo.standard(); | 532 GrGLStandard standard = ctxInfo.standard(); |
522 GrGLVersion version = ctxInfo.version(); | 533 GrGLVersion version = ctxInfo.version(); |
523 | 534 |
524 /************************************************************************** | 535 /************************************************************************** |
525 * Caps specific to GrGLSLCaps | 536 * Caps specific to GrGLSLCaps |
526 **************************************************************************/ | 537 **************************************************************************/ |
527 | 538 |
528 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 539 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |
529 glslCaps->fGLSLGeneration = ctxInfo.glslGeneration(); | 540 glslCaps->fGLSLGeneration = ctxInfo.glslGeneration(); |
530 | |
531 if (kGLES_GrGLStandard == standard) { | 541 if (kGLES_GrGLStandard == standard) { |
532 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 542 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
533 glslCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); | 543 glslCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); |
534 glslCaps->fFBFetchSupport = true; | 544 glslCaps->fFBFetchSupport = true; |
535 glslCaps->fFBFetchColorName = "gl_LastFragData[0]"; | 545 glslCaps->fFBFetchColorName = "gl_LastFragData[0]"; |
536 glslCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch
"; | 546 glslCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch
"; |
537 } | 547 } |
538 else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 548 else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
539 // Actually, we haven't seen an ES3.0 device with this extension yet
, so we don't know | 549 // Actually, we haven't seen an ES3.0 device with this extension yet
, so we don't know |
540 glslCaps->fFBFetchNeedsCustomOutput = false; | 550 glslCaps->fFBFetchNeedsCustomOutput = false; |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1596 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1587 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1597 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1588 fConfigTable[i].fFormats.fExternalFormat[j]); | 1598 fConfigTable[i].fFormats.fExternalFormat[j]); |
1589 } | 1599 } |
1590 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1600 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1591 } | 1601 } |
1592 #endif | 1602 #endif |
1593 } | 1603 } |
1594 | 1604 |
1595 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1605 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |