• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DawnTypes_DEFINED
9 #define skgpu_graphite_DawnTypes_DEFINED
10 
11 #include "include/gpu/graphite/GraphiteTypes.h"
12 #include "webgpu/webgpu_cpp.h"
13 
14 namespace skgpu::graphite {
15 
16 struct DawnTextureInfo {
17     uint32_t fSampleCount = 1;
18     Mipmapped fMipmapped = Mipmapped::kNo;
19 
20     // wgpu::TextureDescriptor properties
21     wgpu::TextureFormat fFormat = wgpu::TextureFormat::Undefined;
22     wgpu::TextureUsage  fUsage = wgpu::TextureUsage::None;
23 
24     DawnTextureInfo() = default;
25     DawnTextureInfo(const wgpu::Texture& texture);
DawnTextureInfoDawnTextureInfo26     DawnTextureInfo(uint32_t sampleCount,
27                     Mipmapped mipmapped,
28                     wgpu::TextureFormat format,
29                     wgpu::TextureUsage usage)
30             : fSampleCount(sampleCount)
31             , fMipmapped(mipmapped)
32             , fFormat(format)
33             , fUsage(usage) {}
34 };
35 
36 } // namespace skgpu::graphite
37 
38 #endif // skgpu_graphite_DawnTypes_DEFINED
39 
40 
41