From 4040aa664ce7f75ae2e45a3b10783d1a2792b519 Mon Sep 17 00:00:00 2001 From: Colin Blundell Date: Fri, 14 Jun 2024 13:11:31 +0000 Subject: [PATCH] [Dawn] Add FormatBytesPerBlock() for format type External Bug: b/41488897 Change-Id: Ib4d1b3c3820ee7846764cb328ca773be6d083083 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/866816 Commit-Queue: Colin Blundell Reviewed-by: Greg Daniel Reviewed-by: Michael Ludwig --- src/gpu/graphite/dawn/DawnUtils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gpu/graphite/dawn/DawnUtils.cpp b/src/gpu/graphite/dawn/DawnUtils.cpp index e423010de336..da708e7ed72a 100644 --- a/src/gpu/graphite/dawn/DawnUtils.cpp +++ b/src/gpu/graphite/dawn/DawnUtils.cpp @@ -41,6 +41,11 @@ size_t DawnFormatBytesPerBlock(wgpu::TextureFormat format) { #if !defined(__EMSCRIPTEN__) case wgpu::TextureFormat::R16Unorm: return 2; case wgpu::TextureFormat::RG16Unorm: return 4; + // Note: We don't actually know the size of external formats, so this + // is an arbitrary value. We will see external formats only in wrapped + // SkImages, so this won't impact Skia's internal budgeting. + case wgpu::TextureFormat::External: + return 4; #endif default: SkUNREACHABLE;