| 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 "GrGLSLCaps.h" | 9 #include "GrGLSLCaps.h" |
| 10 | 10 |
| 11 ////////////////////////////////////////////////////////////////////////////////
//////////// | 11 ////////////////////////////////////////////////////////////////////////////////
//////////// |
| 12 | 12 |
| 13 GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) { | 13 GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) { |
| 14 fGLSLGeneration = k330_GrGLSLGeneration; | 14 fGLSLGeneration = k330_GrGLSLGeneration; |
| 15 | 15 |
| 16 fDropsTileOnZeroDivide = false; | 16 fDropsTileOnZeroDivide = false; |
| 17 fFBFetchSupport = false; | 17 fFBFetchSupport = false; |
| 18 fFBFetchNeedsCustomOutput = false; | 18 fFBFetchNeedsCustomOutput = false; |
| 19 fBindlessTextureSupport = false; | 19 fBindlessTextureSupport = false; |
| 20 fUsesPrecisionModifiers = false; | 20 fUsesPrecisionModifiers = false; |
| 21 fCanUseAnyFunctionInShader = true; | 21 fCanUseAnyFunctionInShader = true; |
| 22 fForceHighPrecisionNDSTransform = false; | 22 fForceHighPrecisionNDSTransform = false; |
| 23 fTextureSwizzleSupport = false; |
| 24 fTextureRedSupport = false; |
| 23 fVersionDeclString = nullptr; | 25 fVersionDeclString = nullptr; |
| 26 fShaderDerivativeExtensionString = nullptr; |
| 24 fFBFetchColorName = nullptr; | 27 fFBFetchColorName = nullptr; |
| 25 fFBFetchExtensionString = nullptr; | 28 fFBFetchExtensionString = nullptr; |
| 26 fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction; | 29 fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction; |
| 27 } | 30 } |
| 28 | 31 |
| 29 SkString GrGLSLCaps::dump() const { | 32 SkString GrGLSLCaps::dump() const { |
| 30 SkString r = INHERITED::dump(); | 33 SkString r = INHERITED::dump(); |
| 31 | 34 |
| 32 static const char* kAdvBlendEqInteractionStr[] = { | 35 static const char* kAdvBlendEqInteractionStr[] = { |
| 33 "Not Supported", | 36 "Not Supported", |
| 34 "Automatic", | 37 "Automatic", |
| 35 "General Enable", | 38 "General Enable", |
| 36 "Specific Enables", | 39 "Specific Enables", |
| 37 }; | 40 }; |
| 38 GR_STATIC_ASSERT(0 == kNotSupported_AdvBlendEqInteraction); | 41 GR_STATIC_ASSERT(0 == kNotSupported_AdvBlendEqInteraction); |
| 39 GR_STATIC_ASSERT(1 == kAutomatic_AdvBlendEqInteraction); | 42 GR_STATIC_ASSERT(1 == kAutomatic_AdvBlendEqInteraction); |
| 40 GR_STATIC_ASSERT(2 == kGeneralEnable_AdvBlendEqInteraction); | 43 GR_STATIC_ASSERT(2 == kGeneralEnable_AdvBlendEqInteraction); |
| 41 GR_STATIC_ASSERT(3 == kSpecificEnables_AdvBlendEqInteraction); | 44 GR_STATIC_ASSERT(3 == kSpecificEnables_AdvBlendEqInteraction); |
| 42 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAdvBlendEqInteractionStr) == kLast_AdvBlend
EqInteraction + 1); | 45 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAdvBlendEqInteractionStr) == kLast_AdvBlend
EqInteraction + 1); |
| 43 | 46 |
| 44 r.appendf("--- GLSL-Specific ---\n"); | 47 r.appendf("--- GLSL-Specific ---\n"); |
| 45 | 48 |
| 46 r.appendf("FB Fetch Support: %s\n", (fFBFetchSupport ? "YES" : "NO")); | 49 r.appendf("FB Fetch Support: %s\n", (fFBFetchSupport ? "YES" : "NO")); |
| 47 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 50 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 48 r.appendf("Bindless texture support: %s\n", (fBindlessTextureSupport ? "YES"
: "NO")); | 51 r.appendf("Bindless texture support: %s\n", (fBindlessTextureSupport ? "YES"
: "NO")); |
| 49 r.appendf("Uses precision modifiers: %s\n", (fUsesPrecisionModifiers ? "YES"
: "NO")); | 52 r.appendf("Uses precision modifiers: %s\n", (fUsesPrecisionModifiers ? "YES"
: "NO")); |
| 50 r.appendf("Can Use any() function: %s\n", (fCanUseAnyFunctionInShader ? "YES
" : "NO")); | 53 r.appendf("Can Use any() function: %s\n", (fCanUseAnyFunctionInShader ? "YES
" : "NO")); |
| 51 r.appendf("Force high precision on NDS transform: %s\n", (fForceHighPrecisio
nNDSTransform ? | 54 r.appendf("Force high precision on NDS transform: %s\n", (fForceHighPrecisio
nNDSTransform ? |
| 52 "YES" : "NO")); | 55 "YES" : "NO")); |
| 56 r.appendf("Support texture swizzle: %s\n", (fTextureSwizzleSupport ? "YES":
"NO")); |
| 57 r.appendf("Red texture support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
| 53 r.appendf("Advanced blend equation interaction: %s\n", | 58 r.appendf("Advanced blend equation interaction: %s\n", |
| 54 kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]); | 59 kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]); |
| 55 return r; | 60 return r; |
| 56 } | 61 } |
| 57 | 62 |
| OLD | NEW |