Stop using GrPixelConfig in Metal & Dawn's GrProgramDesc creation
In order to be able to create GrProgramDescs pre-flush we would like as little reliance on the GrRenderTarget as possible (also GrPixelConfig is going away).
Bug: skia:9455
Change-Id: Ie35c87758bb1ed97c99c6e9e130eaeb3355f4139
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256457
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index d0b4f23..1821790 100644
--- a/src/gpu/GrProgramDesc.cpp
+++ b/src/gpu/GrProgramDesc.cpp
@@ -174,6 +174,12 @@
bool GrProgramDesc::Build(GrProgramDesc* desc, const GrRenderTarget* renderTarget,
const GrProgramInfo& programInfo, const GrCaps& caps) {
+#ifdef SK_DEBUG
+ if (renderTarget) {
+ SkASSERT(programInfo.backendFormat() == renderTarget->backendFormat());
+ }
+#endif
+
// The descriptor is used as a cache key. Thus when a field of the
// descriptor will not affect program generation (because of the attribute
// bindings in use or other descriptor field settings) it should be set