Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
DawnTypesPriv.cpp
Go to the documentation of this file.
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
9
10namespace skgpu::graphite {
11
13 return SkStringPrintf("format=0x%08X,viewFormat=0x%08X,usage=0x%08X,aspect=0x%08X,slice=%u",
14 static_cast<unsigned int>(fFormat),
15 static_cast<unsigned int>(fViewFormat),
16 static_cast<unsigned int>(fUsage),
17 static_cast<unsigned int>(fAspect),
18 fSlice);
19}
20
23 return DawnTextureInfo(
24 wgpuTextureGetSampleCount(texture),
25 wgpuTextureGetMipLevelCount(texture) > 1 ? Mipmapped::kYes : Mipmapped::kNo,
26 /*format=*/static_cast<wgpu::TextureFormat>(wgpuTextureGetFormat(texture)),
27 /*viewFormat=*/static_cast<wgpu::TextureFormat>(wgpuTextureGetFormat(texture)),
28 static_cast<wgpu::TextureUsage>(wgpuTextureGetUsage(texture)),
29 wgpu::TextureAspect::All, /*slice=*/0);
30}
31
33 uint32_t sampleCount,
34 Mipmapped mipmapped) {
36 // Shared info
37 info.fSampleCount = sampleCount;
38 info.fMipmapped = mipmapped;
39
40 // Dawn info
41 info.fFormat = dawnSpec.fFormat;
42 info.fViewFormat = dawnSpec.fViewFormat;
43 info.fUsage = dawnSpec.fUsage;
44 info.fAspect = dawnSpec.fAspect;
45
46 return info;
47}
48
49} // namespace skgpu::graphite
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
#define SkASSERT(cond)
Definition SkAssert.h:116
SK_API SkString static SkString SkStringPrintf()
Definition SkString.h:287
FlTexture * texture
DawnTextureInfo DawnTextureInfoFromWGPUTexture(WGPUTexture texture)
DawnTextureInfo DawnTextureSpecToTextureInfo(const DawnTextureSpec &dawnSpec, uint32_t sampleCount, Mipmapped mipmapped)
Mipmapped
Definition GpuTypes.h:53
wgpu::TextureFormat fViewFormat