From 57a3ded673ca04f76adee4a2ebf2fa2ba650d4d1 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Thu, 20 Feb 2020 15:20:58 +0000 Subject: [PATCH] Revert "Add private GrContext::compile API" This reverts commit 0cd68ab14a08f83de8580296fb83795225dfd7c7. Reason for revert: unimplement pure virtual Original change's description: > Add private GrContext::compile API > > Currently this is only implemented for GL. > > Bug: skia:9455 > Change-Id: I8f369273b697e80a4bade5dd2283e66df688f0ec > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271742 > Reviewed-by: Greg Daniel > Commit-Queue: Robert Phillips TBR=egdaniel@google.com,robertphillips@google.com Change-Id: If273a3328cfff759e213e9be02eb63c3725ea0f8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:9455 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272342 Reviewed-by: Robert Phillips Commit-Queue: Robert Phillips --- src/gpu/GrContextPriv.h | 2 -- src/gpu/GrGpu.h | 5 ----- src/gpu/dawn/GrDawnGpu.cpp | 4 ---- src/gpu/dawn/GrDawnGpu.h | 3 --- src/gpu/gl/GrGLGpu.h | 13 ------------- src/gpu/gl/GrGLGpuProgramCache.cpp | 6 ------ src/gpu/mock/GrMockGpu.h | 2 -- src/gpu/mtl/GrMtlGpu.h | 2 -- src/gpu/mtl/GrMtlGpu.mm | 4 ---- src/gpu/vk/GrVkGpu.cpp | 4 ---- src/gpu/vk/GrVkGpu.h | 3 --- src/gpu/vk/GrVkPipelineStateCache.cpp | 8 -------- src/gpu/vk/GrVkResourceProvider.h | 5 ----- 13 files changed, 61 deletions(-) diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h index 91bc3f1e9c..8e78956a5e 100644 --- a/src/gpu/GrContextPriv.h +++ b/src/gpu/GrContextPriv.h @@ -123,8 +123,6 @@ public: void moveRenderTasksToDDL(SkDeferredDisplayList*); void copyRenderTasksFromDDL(const SkDeferredDisplayList*, GrRenderTargetProxy* newDest); - void compile(const GrProgramDesc&, const GrProgramInfo&); - GrContextOptions::PersistentCache* getPersistentCache() { return fContext->fPersistentCache; } GrContextOptions::ShaderErrorHandler* getShaderErrorHandler() const { return fContext->fShaderErrorHandler; diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 5551e6e1db..44ed8e24c2 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -552,11 +552,6 @@ public: */ virtual void deleteBackendTexture(const GrBackendTexture&) = 0; - /** - * In this case we have a program descriptor and a program info but no render target. - */ - virtual bool compile(const GrProgramDesc&, const GrProgramInfo&) = 0; - virtual bool precompileShader(const SkData& key, const SkData& data) { return false; } #if GR_TEST_UTILS diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp index 907b719d71..e80d7b6d4b 100644 --- a/src/gpu/dawn/GrDawnGpu.cpp +++ b/src/gpu/dawn/GrDawnGpu.cpp @@ -370,10 +370,6 @@ void GrDawnGpu::deleteBackendTexture(const GrBackendTexture& tex) { } } -bool GrDawnGpu::compile(const GrProgramDesc&, const GrProgramInfo&) { - return false; -} - #if GR_TEST_UTILS bool GrDawnGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { GrDawnTextureInfo info; diff --git a/src/gpu/dawn/GrDawnGpu.h b/src/gpu/dawn/GrDawnGpu.h index d65521557e..32791d7f86 100644 --- a/src/gpu/dawn/GrDawnGpu.h +++ b/src/gpu/dawn/GrDawnGpu.h @@ -53,9 +53,6 @@ public: const BackendTextureData*) override; void deleteBackendTexture(const GrBackendTexture&) override; - - bool compile(const GrProgramDesc&, const GrProgramInfo&) override; - #if GR_TEST_UTILS bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 45a1ad8192..f359c5f220 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -126,11 +126,6 @@ public: const GrRenderTarget* rt, int width, int height, int numStencilSamples) override; void deleteBackendTexture(const GrBackendTexture&) override; - bool compile(const GrProgramDesc& desc, const GrProgramInfo& programInfo) override { - sk_sp tmp = fProgramCache->findOrCreateProgram(desc, programInfo); - return SkToBool(tmp); - } - bool precompileShader(const SkData& key, const SkData& data) override { return fProgramCache->precompileShader(key, data); } @@ -324,19 +319,11 @@ private: void abandon(); void reset(); sk_sp findOrCreateProgram(GrRenderTarget*, const GrProgramInfo&); - sk_sp findOrCreateProgram(const GrProgramDesc& desc, - const GrProgramInfo& programInfo) { - return this->findOrCreateProgram(nullptr, desc, programInfo); - } bool precompileShader(const SkData& key, const SkData& data); private: struct Entry; - sk_sp findOrCreateProgram(GrRenderTarget*, - const GrProgramDesc&, - const GrProgramInfo&); - struct DescHash { uint32_t operator()(const GrProgramDesc& desc) const { return SkOpts::hash_fn(desc.asKey(), desc.keyLength(), 0); diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp index 02c75a11ec..9c7115f544 100644 --- a/src/gpu/gl/GrGLGpuProgramCache.cpp +++ b/src/gpu/gl/GrGLGpuProgramCache.cpp @@ -55,12 +55,6 @@ sk_sp GrGLGpu::ProgramCache::findOrCreateProgram(GrRenderTarget* re return nullptr; } - return this->findOrCreateProgram(renderTarget, desc, programInfo); -} - -sk_sp GrGLGpu::ProgramCache::findOrCreateProgram(GrRenderTarget* renderTarget, - const GrProgramDesc& desc, - const GrProgramInfo& programInfo) { std::unique_ptr* entry = fMap.find(desc); if (entry && !(*entry)->fProgram) { // We've pre-compiled the GL program, but don't have the GrGLProgram scaffolding diff --git a/src/gpu/mock/GrMockGpu.h b/src/gpu/mock/GrMockGpu.h index 15e81ce35d..af95372abd 100644 --- a/src/gpu/mock/GrMockGpu.h +++ b/src/gpu/mock/GrMockGpu.h @@ -153,8 +153,6 @@ private: const BackendTextureData*) override; void deleteBackendTexture(const GrBackendTexture&) override; - bool compile(const GrProgramDesc&, const GrProgramInfo&) override { return false; } - #if GR_TEST_UTILS bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h index a27848fdf4..c464a3e194 100644 --- a/src/gpu/mtl/GrMtlGpu.h +++ b/src/gpu/mtl/GrMtlGpu.h @@ -59,8 +59,6 @@ public: void deleteBackendTexture(const GrBackendTexture&) override; - bool compile(const GrProgramDesc&, const GrProgramInfo&) override; - #if GR_TEST_UTILS bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm index 0fcf4b60e0..4a86ff4911 100644 --- a/src/gpu/mtl/GrMtlGpu.mm +++ b/src/gpu/mtl/GrMtlGpu.mm @@ -1009,10 +1009,6 @@ void GrMtlGpu::deleteBackendTexture(const GrBackendTexture& tex) { // Nothing to do here, will get cleaned up when the GrBackendTexture object goes away } -bool GrMtlGpu::compile(const GrProgramDesc&, const GrProgramInfo&) { - return false; -} - #if GR_TEST_UTILS bool GrMtlGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { SkASSERT(GrBackendApi::kMetal == tex.backend()); diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 5e771b8ebb..0215406f46 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -2006,10 +2006,6 @@ void GrVkGpu::deleteBackendTexture(const GrBackendTexture& tex) { } } -bool GrVkGpu::compile(const GrProgramDesc&, const GrProgramInfo&) { - return false; -} - #if GR_TEST_UTILS bool GrVkGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { SkASSERT(GrBackendApi::kVulkan == tex.fBackend); diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index fe6375e964..1156d900bc 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -75,9 +75,6 @@ public: void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} void deleteBackendTexture(const GrBackendTexture&) override; - - bool compile(const GrProgramDesc&, const GrProgramInfo&) override; - #if GR_TEST_UTILS bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp index 9a75301bd5..a0f5ff47eb 100644 --- a/src/gpu/vk/GrVkPipelineStateCache.cpp +++ b/src/gpu/vk/GrVkPipelineStateCache.cpp @@ -89,14 +89,6 @@ GrVkPipelineState* GrVkResourceProvider::PipelineStateCache::findOrCreatePipelin return nullptr; } - return this->findOrCreatePipeline(renderTarget, desc, programInfo, compatibleRenderPass); -} - -GrVkPipelineState* GrVkResourceProvider::PipelineStateCache::findOrCreatePipeline( - GrRenderTarget* renderTarget, - const GrProgramDesc& desc, - const GrProgramInfo& programInfo, - VkRenderPass compatibleRenderPass) { std::unique_ptr* entry = fMap.find(desc); if (!entry) { #ifdef GR_PIPELINE_STATE_CACHE_STATS diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h index 7e0ffa7321..64b4f93143 100644 --- a/src/gpu/vk/GrVkResourceProvider.h +++ b/src/gpu/vk/GrVkResourceProvider.h @@ -191,11 +191,6 @@ private: private: struct Entry; - GrVkPipelineState* findOrCreatePipeline(GrRenderTarget*, - const GrProgramDesc&, - const GrProgramInfo&, - VkRenderPass compatibleRenderPass); - struct DescHash { uint32_t operator()(const GrProgramDesc& desc) const { return SkOpts::hash_fn(desc.asKey(), desc.keyLength(), 0);