| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 fImagingSupport = false; | 43 fImagingSupport = false; |
| 44 fTwoFormatLimit = false; | 44 fTwoFormatLimit = false; |
| 45 fFragCoordsConventionSupport = false; | 45 fFragCoordsConventionSupport = false; |
| 46 fVertexArrayObjectSupport = false; | 46 fVertexArrayObjectSupport = false; |
| 47 fES2CompatibilitySupport = false; | 47 fES2CompatibilitySupport = false; |
| 48 fUseNonVBOVertexAndIndexDynamicData = false; | 48 fUseNonVBOVertexAndIndexDynamicData = false; |
| 49 fIsCoreProfile = false; | 49 fIsCoreProfile = false; |
| 50 fFullClearIsFree = false; | 50 fFullClearIsFree = false; |
| 51 fDropsTileOnZeroDivide = false; | 51 fDropsTileOnZeroDivide = false; |
| 52 fFBFetchSupport = false; | 52 fFBFetchSupport = false; |
| 53 fFBFetchNeedsCustomOutput = false; |
| 53 fFBFetchColorName = NULL; | 54 fFBFetchColorName = NULL; |
| 54 fFBFetchExtensionString = NULL; | 55 fFBFetchExtensionString = NULL; |
| 55 | 56 |
| 56 fReadPixelsSupportedCache.reset(); | 57 fReadPixelsSupportedCache.reset(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { | 60 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
| 60 *this = caps; | 61 *this = caps; |
| 61 } | 62 } |
| 62 | 63 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 86 fImagingSupport = caps.fImagingSupport; | 87 fImagingSupport = caps.fImagingSupport; |
| 87 fTwoFormatLimit = caps.fTwoFormatLimit; | 88 fTwoFormatLimit = caps.fTwoFormatLimit; |
| 88 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 89 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
| 89 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 90 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
| 90 fES2CompatibilitySupport = caps.fES2CompatibilitySupport; | 91 fES2CompatibilitySupport = caps.fES2CompatibilitySupport; |
| 91 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 92 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
| 92 fIsCoreProfile = caps.fIsCoreProfile; | 93 fIsCoreProfile = caps.fIsCoreProfile; |
| 93 fFullClearIsFree = caps.fFullClearIsFree; | 94 fFullClearIsFree = caps.fFullClearIsFree; |
| 94 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; | 95 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
| 95 fFBFetchSupport = caps.fFBFetchSupport; | 96 fFBFetchSupport = caps.fFBFetchSupport; |
| 97 fFBFetchNeedsCustomOutput = caps.fFBFetchNeedsCustomOutput; |
| 96 fFBFetchColorName = caps.fFBFetchColorName; | 98 fFBFetchColorName = caps.fFBFetchColorName; |
| 97 fFBFetchExtensionString = caps.fFBFetchExtensionString; | 99 fFBFetchExtensionString = caps.fFBFetchExtensionString; |
| 98 | 100 |
| 99 return *this; | 101 return *this; |
| 100 } | 102 } |
| 101 | 103 |
| 102 bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 104 bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
| 103 | 105 |
| 104 this->reset(); | 106 this->reset(); |
| 105 if (!ctxInfo.isInitialized()) { | 107 if (!ctxInfo.isInitialized()) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 245 |
| 244 if (kGL_GrGLStandard == standard) { | 246 if (kGL_GrGLStandard == standard) { |
| 245 fES2CompatibilitySupport = ctxInfo.hasExtension("GL_ARB_ES2_compatibilit
y"); | 247 fES2CompatibilitySupport = ctxInfo.hasExtension("GL_ARB_ES2_compatibilit
y"); |
| 246 } | 248 } |
| 247 else { | 249 else { |
| 248 fES2CompatibilitySupport = true; | 250 fES2CompatibilitySupport = true; |
| 249 } | 251 } |
| 250 | 252 |
| 251 if (kGLES_GrGLStandard == standard) { | 253 if (kGLES_GrGLStandard == standard) { |
| 252 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 254 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
| 255 fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0)); |
| 253 fFBFetchSupport = true; | 256 fFBFetchSupport = true; |
| 254 fFBFetchColorName = "gl_LastFragData[0]"; | 257 fFBFetchColorName = "gl_LastFragData[0]"; |
| 255 fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; | 258 fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; |
| 256 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 259 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
| 260 // Actually, we haven't seen an ES3.0 device with this extension yet
, so we don't know |
| 261 fFBFetchNeedsCustomOutput = false; |
| 257 fFBFetchSupport = true; | 262 fFBFetchSupport = true; |
| 258 fFBFetchColorName = "gl_LastFragData[0]"; | 263 fFBFetchColorName = "gl_LastFragData[0]"; |
| 259 fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; | 264 fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; |
| 260 } else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) { | 265 } else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) { |
| 261 // The arm extension also requires an additional flag which we will
set onResetContext | 266 // The arm extension also requires an additional flag which we will
set onResetContext |
| 262 // This is all temporary. | 267 fFBFetchNeedsCustomOutput = false; |
| 263 fFBFetchSupport = true; | 268 fFBFetchSupport = true; |
| 264 fFBFetchColorName = "gl_LastFragColorARM"; | 269 fFBFetchColorName = "gl_LastFragColorARM"; |
| 265 fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; | 270 fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; |
| 266 } | 271 } |
| 267 } | 272 } |
| 268 | 273 |
| 269 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader | 274 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader |
| 270 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); | 275 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); |
| 271 | 276 |
| 272 this->initFSAASupport(ctxInfo, gli); | 277 this->initFSAASupport(ctxInfo, gli); |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1032 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 1028 r.appendf("Fragment coord conventions support: %s\n", | 1033 r.appendf("Fragment coord conventions support: %s\n", |
| 1029 (fFragCoordsConventionSupport ? "YES": "NO")); | 1034 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 1030 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1035 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 1031 r.appendf("Use non-VBO for dynamic data: %s\n", | 1036 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 1032 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1037 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 1033 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1038 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 1034 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1039 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 1035 return r; | 1040 return r; |
| 1036 } | 1041 } |
| OLD | NEW |