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/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 63d4c35..cb14885 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -166,7 +166,6 @@
return;
}
sk_sp<SkData> key = SkData::MakeWithoutCopy(this->desc().asKey(), this->desc().keyLength());
- const SkString& description = this->desc().description();
if (fGpu->glCaps().programBinarySupport()) {
// binary cache
GrGLsizei length = 0;
@@ -187,7 +186,7 @@
writer.writePad32(binary.get(), length);
auto data = writer.snapshotAsData();
- this->gpu()->getContext()->priv().getPersistentCache()->store(*key, *data, description);
+ this->gpu()->getContext()->priv().getPersistentCache()->store(*key, *data);
}
} else {
// source cache, plus metadata to allow for a complete precompile
@@ -204,7 +203,7 @@
auto data = GrPersistentCacheUtils::PackCachedShaders(isSkSL ? kSKSL_Tag : kGLSL_Tag,
shaders, &inputs, 1, &meta);
- this->gpu()->getContext()->priv().getPersistentCache()->store(*key, *data, description);
+ this->gpu()->getContext()->priv().getPersistentCache()->store(*key, *data);
}
}