Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: src/gpu/GrCaps.cpp

Issue 1846963004: Infer sampler precision from pixel config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase, create dependency chain Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698