Remove GrProgramDesc's need for the GrGpu
Although not strictly necessary, being able to compute the program key w/o needing access to the Gpu will give us more flexibility.
Bug: skia:9455
Change-Id: I0cd76d79a3008b69be18636be370e7aaa531bc65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247686
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index 08260c0..9eff843 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -48,11 +48,11 @@
GrGLProgram* GrGLGpu::ProgramCache::refProgram(GrGLGpu* gpu,
GrRenderTarget* renderTarget,
const GrProgramInfo& programInfo) {
- // TODO: can this be unified between GL, Vk and Mtl?
- // Get GrGLProgramDesc
- GrProgramDesc desc;
+ const GrCaps& caps = *gpu->caps();
- if (!GrProgramDesc::Build(&desc, renderTarget, programInfo, gpu)) {
+ GrProgramDesc desc;
+ if (!GrProgramDesc::Build(&desc, renderTarget, programInfo, caps)) {
+
GrCapsDebugf(gpu->caps(), "Failed to gl program descriptor!\n");
return nullptr;
}