Index: src/gpu/GrCaps.cpp |
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp |
index 41f5b9b391357d8a0e5940799df10b75f8927fc5..e2253dbef5e97f24e00642dfc7d206176037442b 100644 |
--- a/src/gpu/GrCaps.cpp |
+++ b/src/gpu/GrCaps.cpp |
@@ -69,9 +69,34 @@ SkString GrShaderCaps::dump() const { |
} |
} |
+ r.append("Effective Float Precisions:\n"); |
+ |
+ for (int s = 0; s < kGrShaderTypeCount; ++s) { |
+ GrShaderType shaderType = static_cast<GrShaderType>(s); |
+ r.appendf("\t%s: ", shader_type_to_string(shaderType)); |
+ for (int p = kGrSLPrecisionCount - 1 ; p >= 0; --p) { |
+ GrSLPrecision precision = static_cast<GrSLPrecision>(p); |
+ r.appendf("%s=%s", precision_to_string(precision), |
+ precision_to_string(fEffectiveFloatPrecisions[s][p])); |
+ r.append(p + 1 < kGrSLPrecisionCount ? " " : "\n"); |
+ } |
+ } |
+ |
return r; |
} |
+void GrShaderCaps::initEffectiveFloatPrecisionTable() { |
+ for (int s = 0; s < kGrShaderTypeCount; ++s) { |
+ const PrecisionInfo* info = fFloatPrecisions[s]; |
+ GrSLPrecision* p = fEffectiveFloatPrecisions[s]; |
+ p[kHigh_GrSLPrecision] = kHigh_GrSLPrecision; |
+ p[kMedium_GrSLPrecision] = info[kHigh_GrSLPrecision] == info[kMedium_GrSLPrecision] ? |
+ kHigh_GrSLPrecision : kMedium_GrSLPrecision; |
+ p[kLow_GrSLPrecision] = info[kMedium_GrSLPrecision] == info[kLow_GrSLPrecision] ? |
+ p[kMedium_GrSLPrecision] : kLow_GrSLPrecision; |
+ } |
+} |
+ |
void GrShaderCaps::applyOptionsOverrides(const GrContextOptions& options) { |
fDualSourceBlendingSupport = fDualSourceBlendingSupport && !options.fSuppressDualSourceBlending; |
this->onApplyOptionsOverrides(options); |