Revert "Redesign program key construction"
This reverts commit bbbf1a7f50a303bd76163793bd5968c72f5f4432.
Reason for revert: D3D Failures
Original change's description:
> Redesign program key construction
>
> This does two things:
> 1) Moves responsibility for bit-packing portions of the key into the key
> itself. A new GrKeyBuilder type manages adding bits, with asserts to
> ensure a value always fits in the requested number. In theory this
> will let us generate smaller keys overall, at the expense of slightly
> more complex code during construction.
> 2) Adds a string label parameter for key methods that fold in data. For
> new methods, the label is required. To ease migration, the old add32
> does not require a label (yet). This will let us generate detailed,
> human readable keys, either based on SK_DEBUG, or a runtime option
> (if we're comfortable paying the cost).
>
> Bug: skia:11372
> Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
Change-Id: I7bfb20905c87083e84a1ea21bc53d63e882e2c68
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378777
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tools/gpu/MemoryCache.h b/tools/gpu/MemoryCache.h
index cf7d284..f70cf13 100644
--- a/tools/gpu/MemoryCache.h
+++ b/tools/gpu/MemoryCache.h
@@ -33,7 +33,7 @@
}
sk_sp<SkData> load(const SkData& key) override;
- void store(const SkData& key, const SkData& data, const SkString& description) override;
+ void store(const SkData& key, const SkData& data) override;
int numCacheMisses() const { return fCacheMissCnt; }
int numCacheStores() const { return fCacheStoreCnt; }
void resetCacheStats() {
@@ -46,7 +46,7 @@
template <typename Fn>
void foreach(Fn&& fn) {
for (auto it = fMap.begin(); it != fMap.end(); ++it) {
- fn(it->first.fKey, it->second.fData, it->second.fDescription, it->second.fHitCount);
+ fn(it->first.fKey, it->second.fData, it->second.fHitCount);
}
}
@@ -65,16 +65,14 @@
struct Value {
Value() = default;
- Value(const SkData& data, const SkString& description)
+ Value(const SkData& data)
: fData(SkData::MakeWithCopy(data.data(), data.size()))
- , fDescription(description)
, fHitCount(1) {}
Value(const Value& that) = default;
Value& operator=(const Value&) = default;
sk_sp<SkData> fData;
- SkString fDescription;
- int fHitCount;
+ int fHitCount;
};
struct Hash {