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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 490 } |
491 // for now we don't support floating point MSAA on ES | 491 // for now we don't support floating point MSAA on ES |
492 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; | 492 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; |
493 } | 493 } |
494 } | 494 } |
495 | 495 |
496 if (this->isConfigTexturable(kAlpha_half_GrPixelConfig)) { | 496 if (this->isConfigTexturable(kAlpha_half_GrPixelConfig)) { |
497 if (kGL_GrGLStandard == standard) { | 497 if (kGL_GrGLStandard == standard) { |
498 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true; | 498 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true; |
499 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = true; | 499 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = true; |
| 500 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
| 501 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true; |
| 502 // for now we don't support floating point MSAA on ES |
| 503 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; |
500 } else { | 504 } else { |
501 // in theory, check for "GL_EXT_color_buffer_half_float" | 505 if (ctxInfo.hasExtension("GL_EXT_color_buffer_half_float") && fTextu
reRedSupport) { |
502 // for now we don't support half float alpha render target on ES | 506 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true
; |
503 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = false; | 507 } else { |
| 508 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = fals
e; |
| 509 } |
| 510 // for now we don't support floating point MSAA on ES |
504 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; | 511 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; |
505 } | 512 } |
506 } | 513 } |
507 | 514 |
508 // If we don't support MSAA then undo any places above where we set a config
as renderable with | 515 // If we don't support MSAA then undo any places above where we set a config
as renderable with |
509 // msaa. | 516 // msaa. |
510 if (kNone_MSFBOType == fMSFBOType) { | 517 if (kNone_MSFBOType == fMSFBOType) { |
511 for (int i = 0; i < kGrPixelConfigCnt; ++i) { | 518 for (int i = 0; i < kGrPixelConfigCnt; ++i) { |
512 fConfigRenderSupport[i][kYes_MSAA] = false; | 519 fConfigRenderSupport[i][kYes_MSAA] = false; |
513 } | 520 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 fConfigTextureSupport[kRGBA_float_GrPixelConfig] = hasFPTextures; | 649 fConfigTextureSupport[kRGBA_float_GrPixelConfig] = hasFPTextures; |
643 | 650 |
644 // Check for fp16 texture support | 651 // Check for fp16 texture support |
645 // NOTE: We disallow floating point textures on ES devices if linear | 652 // NOTE: We disallow floating point textures on ES devices if linear |
646 // filtering modes are not supported. This is for simplicity, but a more | 653 // filtering modes are not supported. This is for simplicity, but a more |
647 // granular approach is possible. Coincidentally, 16-bit floating point tex
tures became part of | 654 // granular approach is possible. Coincidentally, 16-bit floating point tex
tures became part of |
648 // the standard in ES3.1 / OGL 3.1, hence the shorthand | 655 // the standard in ES3.1 / OGL 3.1, hence the shorthand |
649 bool hasHalfFPTextures = version >= GR_GL_VER(3, 1); | 656 bool hasHalfFPTextures = version >= GR_GL_VER(3, 1); |
650 if (!hasHalfFPTextures) { | 657 if (!hasHalfFPTextures) { |
651 hasHalfFPTextures = ctxInfo.hasExtension("GL_ARB_texture_float") || | 658 hasHalfFPTextures = ctxInfo.hasExtension("GL_ARB_texture_float") || |
652 (ctxInfo.hasExtension("GL_OES_texture_half_float_linear") && | 659 (ctxInfo.hasExtension("GL_OES_texture_half_float_lin
ear") && |
653 ctxInfo.hasExtension("GL_OES_texture_half_float")); | 660 ctxInfo.hasExtension("GL_OES_texture_half_float")); |
654 } | 661 } |
655 fConfigTextureSupport[kAlpha_half_GrPixelConfig] = hasHalfFPTextures && fTex
tureRedSupport; | 662 fConfigTextureSupport[kAlpha_half_GrPixelConfig] = hasHalfFPTextures; |
656 } | 663 } |
657 | 664 |
658 bool GrGLCaps::doReadPixelsSupported(const GrGLInterface* intf, | 665 bool GrGLCaps::doReadPixelsSupported(const GrGLInterface* intf, |
659 GrGLenum format, | 666 GrGLenum format, |
660 GrGLenum type) const { | 667 GrGLenum type) const { |
661 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { | 668 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { |
662 // ES 2 guarantees this format is supported | 669 // ES 2 guarantees this format is supported |
663 return true; | 670 return true; |
664 } | 671 } |
665 | 672 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1001 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
995 r.appendf("Fragment coord conventions support: %s\n", | 1002 r.appendf("Fragment coord conventions support: %s\n", |
996 (fFragCoordsConventionSupport ? "YES": "NO")); | 1003 (fFragCoordsConventionSupport ? "YES": "NO")); |
997 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1004 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
998 r.appendf("Use non-VBO for dynamic data: %s\n", | 1005 r.appendf("Use non-VBO for dynamic data: %s\n", |
999 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1006 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
1000 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1007 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
1001 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1008 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
1002 return r; | 1009 return r; |
1003 } | 1010 } |
OLD | NEW |