From 2adbf9ce1c17c5163bd8a93f894872b755585af0 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Tue, 10 Sep 2019 12:35:02 -0400 Subject: [PATCH] Update Dawn backend to accommodate recent Skia API changes. Change-Id: Ib0667fbff9a16fe796378134a17008ece6267d06 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240508 Reviewed-by: Robert Phillips Commit-Queue: Stephen White --- src/gpu/dawn/GrDawnGpu.cpp | 8 +++++--- src/gpu/dawn/GrDawnGpu.h | 8 +++++--- src/gpu/dawn/GrDawnUniformHandler.cpp | 4 ++++ src/gpu/dawn/GrDawnUniformHandler.h | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp index c8b89a67bd..0aba404adf 100644 --- a/src/gpu/dawn/GrDawnGpu.cpp +++ b/src/gpu/dawn/GrDawnGpu.cpp @@ -119,7 +119,8 @@ void GrDawnGpu::disconnect(DisconnectType type) { GrOpsRenderPass* GrDawnGpu::getOpsRenderPass( GrRenderTarget* rt, GrSurfaceOrigin origin, const SkRect& bounds, const GrOpsRenderPass::LoadAndStoreInfo& colorInfo, - const GrOpsRenderPass::StencilLoadAndStoreInfo& stencilInfo) { + const GrOpsRenderPass::StencilLoadAndStoreInfo& stencilInfo, + const SkTArray& sampledProxies) { fOpsRenderPass.reset(new GrDawnOpsRenderPass(this, rt, origin, colorInfo, stencilInfo)); return fOpsRenderPass.get(); } @@ -136,8 +137,9 @@ sk_sp GrDawnGpu::onCreateBuffer(size_t size, GrGpuBufferType type, //////////////////////////////////////////////////////////////////////////////// bool GrDawnGpu::onWritePixels(GrSurface* surface, int left, int top, int width, int height, - GrColorType textureColorType, GrColorType bufferColorType, - const GrMipLevel texels[], int mipLevelCount) { + GrColorType surfaceColorType, GrColorType srcColorType, + const GrMipLevel texels[], int mipLevelCount, + bool prepForTexSampling) { GrDawnTexture* texture = static_cast(surface->asTexture()); if (!texture) { SkASSERT(!"uploading to non-texture unimplemented"); diff --git a/src/gpu/dawn/GrDawnGpu.h b/src/gpu/dawn/GrDawnGpu.h index d1c49eeacb..42bd486315 100644 --- a/src/gpu/dawn/GrDawnGpu.h +++ b/src/gpu/dawn/GrDawnGpu.h @@ -62,7 +62,8 @@ public: GrOpsRenderPass* getOpsRenderPass( GrRenderTarget*, GrSurfaceOrigin, const SkRect& bounds, const GrOpsRenderPass::LoadAndStoreInfo&, - const GrOpsRenderPass::StencilLoadAndStoreInfo&) override; + const GrOpsRenderPass::StencilLoadAndStoreInfo&, + const SkTArray& sampledProxies) override; SkSL::Compiler* shaderCompiler() const { return fCompiler.get(); @@ -134,8 +135,9 @@ private: size_t rowBytes) override; bool onWritePixels(GrSurface* surface, int left, int top, int width, int height, - GrColorType surfaceColorType, GrColorType dstColorType, - const GrMipLevel texels[], int mipLevelCount) override; + GrColorType surfaceColorType, GrColorType srcColorType, + const GrMipLevel texels[], int mipLevelCount, + bool prepForTexSampling) override; bool onTransferPixelsTo(GrTexture*, int left, int top, int width, int height, GrColorType textureColorType, GrColorType bufferColorType, diff --git a/src/gpu/dawn/GrDawnUniformHandler.cpp b/src/gpu/dawn/GrDawnUniformHandler.cpp index f323cdfc03..4226326b75 100644 --- a/src/gpu/dawn/GrDawnUniformHandler.cpp +++ b/src/gpu/dawn/GrDawnUniformHandler.cpp @@ -233,6 +233,10 @@ GrGLSLUniformHandler::UniformHandle GrDawnUniformHandler::internalAddUniformArra return GrGLSLUniformHandler::UniformHandle(fUniforms.count() - 1); } +void GrDawnUniformHandler::updateUniformVisibility(UniformHandle u, uint32_t visibility) { + fUniforms[u.toIndex()].fVisibility |= visibility; +} + GrGLSLUniformHandler::SamplerHandle GrDawnUniformHandler::addSampler(const GrTexture* texture, const GrSamplerState&, const GrSwizzle& swizzle, diff --git a/src/gpu/dawn/GrDawnUniformHandler.h b/src/gpu/dawn/GrDawnUniformHandler.h index 1cc813b608..223fb1577c 100644 --- a/src/gpu/dawn/GrDawnUniformHandler.h +++ b/src/gpu/dawn/GrDawnUniformHandler.h @@ -47,6 +47,8 @@ private: int arrayCount, const char** outName) override; + void updateUniformVisibility(UniformHandle u, uint32_t visibility) override; + UniformInfoArray fUniforms; UniformInfoArray fSamplers; UniformInfoArray fTextures;