| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& | 277 glslCaps->fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2)
&& |
| 278 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; | 278 ctxInfo.glslGeneration() >= k150_GrGLSLGeneration; |
| 279 } | 279 } |
| 280 else { | 280 else { |
| 281 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); | 281 glslCaps->fDualSourceBlendingSupport = ctxInfo.hasExtension("GL_EXT_blen
d_func_extended"); |
| 282 | 282 |
| 283 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || | 283 glslCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0
) || |
| 284 ctxInfo.hasExtension("GL_OES_standard_derivatives"); | 284 ctxInfo.hasExtension("GL_OES_standard_derivatives"); |
| 285 } | 285 } |
| 286 | 286 |
| 287 if (ctxInfo.hasExtension("GL_EXT_shader_pixel_local_storage")) { |
| 288 #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 |
| 289 GR_GL_GetIntegerv(gli, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT, |
| 290 &glslCaps->fPixelLocalStorageSize); |
| 291 glslCaps->fPLSPathRenderingSupport = glslCaps->fFBFetchSupport; |
| 292 } |
| 293 else { |
| 294 glslCaps->fPixelLocalStorageSize = 0; |
| 295 glslCaps->fPLSPathRenderingSupport = false; |
| 296 } |
| 297 |
| 287 /************************************************************************** | 298 /************************************************************************** |
| 288 * GrCaps fields | 299 * GrCaps fields |
| 289 **************************************************************************/ | 300 **************************************************************************/ |
| 290 | 301 |
| 291 // We need dual source blending and the ability to disable multisample in or
der to support mixed | 302 // We need dual source blending and the ability to disable multisample in or
der to support mixed |
| 292 // samples in every corner case. | 303 // samples in every corner case. |
| 293 if (fMultisampleDisableSupport && | 304 if (fMultisampleDisableSupport && |
| 294 glslCaps->dualSourceBlendingSupport() && | 305 glslCaps->dualSourceBlendingSupport() && |
| 295 fShaderCaps->pathRenderingSupport()) { | 306 fShaderCaps->pathRenderingSupport()) { |
| 296 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample
s") || | 307 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample
s") || |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { | 535 void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) { |
| 525 GrGLStandard standard = ctxInfo.standard(); | 536 GrGLStandard standard = ctxInfo.standard(); |
| 526 GrGLVersion version = ctxInfo.version(); | 537 GrGLVersion version = ctxInfo.version(); |
| 527 | 538 |
| 528 /************************************************************************** | 539 /************************************************************************** |
| 529 * Caps specific to GrGLSLCaps | 540 * Caps specific to GrGLSLCaps |
| 530 **************************************************************************/ | 541 **************************************************************************/ |
| 531 | 542 |
| 532 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 543 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |
| 533 glslCaps->fGLSLGeneration = ctxInfo.glslGeneration(); | 544 glslCaps->fGLSLGeneration = ctxInfo.glslGeneration(); |
| 534 | |
| 535 if (kGLES_GrGLStandard == standard) { | 545 if (kGLES_GrGLStandard == standard) { |
| 536 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 546 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
| 537 glslCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); | 547 glslCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); |
| 538 glslCaps->fFBFetchSupport = true; | 548 glslCaps->fFBFetchSupport = true; |
| 539 glslCaps->fFBFetchColorName = "gl_LastFragData[0]"; | 549 glslCaps->fFBFetchColorName = "gl_LastFragData[0]"; |
| 540 glslCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch
"; | 550 glslCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch
"; |
| 541 } | 551 } |
| 542 else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 552 else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
| 543 // Actually, we haven't seen an ES3.0 device with this extension yet
, so we don't know | 553 // Actually, we haven't seen an ES3.0 device with this extension yet
, so we don't know |
| 544 glslCaps->fFBFetchNeedsCustomOutput = false; | 554 glslCaps->fFBFetchNeedsCustomOutput = false; |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1625 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1635 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1626 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1636 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1627 fConfigTable[i].fFormats.fExternalFormat[j]); | 1637 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1628 } | 1638 } |
| 1629 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1639 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1630 } | 1640 } |
| 1631 #endif | 1641 #endif |
| 1632 } | 1642 } |
| 1633 | 1643 |
| 1634 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1644 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |