1 /* 2 * Copyright 2022 Google LLC. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef skgpu_graphite_DawnTypesPriv_DEFINED 9 #define skgpu_graphite_DawnTypesPriv_DEFINED 10 11 #include "include/gpu/graphite/dawn/DawnTypes.h" 12 13 namespace skgpu::graphite { 14 15 struct DawnTextureSpec { DawnTextureSpecDawnTextureSpec16 DawnTextureSpec() 17 : fFormat(wgpu::TextureFormat::Undefined) 18 , fUsage(wgpu::TextureUsage::None) {} DawnTextureSpecDawnTextureSpec19 DawnTextureSpec(const DawnTextureInfo& info) 20 : fFormat(info.fFormat) 21 , fUsage(info.fUsage) {} 22 23 bool operator==(const DawnTextureSpec& that) const { 24 return fUsage == that.fUsage && 25 fFormat == that.fFormat; 26 } 27 28 wgpu::TextureFormat fFormat; 29 wgpu::TextureUsage fUsage; 30 }; 31 32 DawnTextureInfo DawnTextureSpecToTextureInfo(const DawnTextureSpec& dawnSpec, 33 uint32_t sampleCount, 34 Mipmapped mipmapped); 35 36 } // namespace skgpu::graphite 37 38 #endif // skgpu_graphite_DawnTypesPriv_DEFINED 39