Chromium Code Reviews| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 763 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { | 763 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { |
| 764 | 764 |
| 765 fMSFBOType = kNone_MSFBOType; | 765 fMSFBOType = kNone_MSFBOType; |
| 766 if (kGL_GrGLStandard != ctxInfo.standard()) { | 766 if (kGL_GrGLStandard != ctxInfo.standard()) { |
| 767 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed | 767 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed |
| 768 // ES3 driver bugs on at least one device with a tiled GPU (N10). | 768 // ES3 driver bugs on at least one device with a tiled GPU (N10). |
| 769 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { | 769 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { |
| 770 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; | 770 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; |
| 771 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) { | 771 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) { |
| 772 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; | 772 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; |
| 773 } else if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples")) { | |
| 774 fMSFBOType = kMixedSamples_MSFBOType; | |
| 773 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { | 775 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
| 774 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; | 776 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; |
| 775 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { | 777 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { |
| 776 // chrome's extension is equivalent to the EXT msaa | 778 // chrome's extension is equivalent to the EXT msaa |
| 777 // and fbo_blit extensions. | 779 // and fbo_blit extensions. |
| 778 fMSFBOType = kDesktop_EXT_MSFBOType; | 780 fMSFBOType = kDesktop_EXT_MSFBOType; |
| 779 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { | 781 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { |
| 780 fMSFBOType = kES_Apple_MSFBOType; | 782 fMSFBOType = kES_Apple_MSFBOType; |
| 781 } | 783 } |
| 782 } else { | 784 } else { |
| 783 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | 785 if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples")) { |
|
Chris Dalton
2015/04/08 04:55:26
We may consider only using MixedSamples if the con
vbuzinov
2015/04/08 12:05:30
Done. Should the caps property (fFBMixedSamplesSu
| |
| 786 fMSFBOType = kMixedSamples_MSFBOType; | |
| 787 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | |
| 784 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { | 788 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { |
| 785 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; | 789 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; |
| 786 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && | 790 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && |
| 787 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { | 791 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { |
| 788 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; | 792 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; |
| 789 } | 793 } |
| 790 } | 794 } |
| 791 } | 795 } |
| 792 | 796 |
| 793 namespace { | 797 namespace { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 985 } | 989 } |
| 986 | 990 |
| 987 static const char* kMSFBOExtStr[] = { | 991 static const char* kMSFBOExtStr[] = { |
| 988 "None", | 992 "None", |
| 989 "ARB", | 993 "ARB", |
| 990 "EXT", | 994 "EXT", |
| 991 "ES 3.0", | 995 "ES 3.0", |
| 992 "Apple", | 996 "Apple", |
| 993 "IMG MS To Texture", | 997 "IMG MS To Texture", |
| 994 "EXT MS To Texture", | 998 "EXT MS To Texture", |
| 999 "Stencil", | |
|
Mark Kilgard
2015/04/08 03:20:09
Stencil doesn't seem sufficiently descriptive
wou
vbuzinov
2015/04/08 12:05:30
Done.
| |
| 995 }; | 1000 }; |
| 996 GR_STATIC_ASSERT(0 == kNone_MSFBOType); | 1001 GR_STATIC_ASSERT(0 == kNone_MSFBOType); |
| 997 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); | 1002 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); |
| 998 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); | 1003 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); |
| 999 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); | 1004 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); |
| 1000 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); | 1005 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); |
| 1001 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); | 1006 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); |
| 1002 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); | 1007 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); |
| 1008 GR_STATIC_ASSERT(7 == kMixedSamples_MSFBOType); | |
| 1003 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); | 1009 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); |
| 1004 | 1010 |
| 1005 static const char* kInvalidateFBTypeStr[] = { | 1011 static const char* kInvalidateFBTypeStr[] = { |
| 1006 "None", | 1012 "None", |
| 1007 "Discard", | 1013 "Discard", |
| 1008 "Invalidate", | 1014 "Invalidate", |
| 1009 }; | 1015 }; |
| 1010 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); | 1016 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); |
| 1011 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); | 1017 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); |
| 1012 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); | 1018 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1050 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1056 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 1051 r.appendf("Fragment coord conventions support: %s\n", | 1057 r.appendf("Fragment coord conventions support: %s\n", |
| 1052 (fFragCoordsConventionSupport ? "YES": "NO")); | 1058 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 1053 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); | 1059 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); |
| 1054 r.appendf("Use non-VBO for dynamic data: %s\n", | 1060 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 1055 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1061 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 1056 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); | 1062 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); |
| 1057 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); | 1063 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); |
| 1058 return r; | 1064 return r; |
| 1059 } | 1065 } |
| OLD | NEW |