23 return wgpu::FilterMode::Nearest;
25 return wgpu::FilterMode::Linear;
34 return wgpu::MipmapFilterMode::Nearest;
36 return wgpu::MipmapFilterMode::Nearest;
38 return wgpu::MipmapFilterMode::Linear;
44DawnSampler::DawnSampler(
const DawnSharedContext* sharedContext,
47 , fSampler(
std::move(sampler)) {}
52 return wgpu::AddressMode::ClampToEdge;
54 return wgpu::AddressMode::Repeat;
56 return wgpu::AddressMode::MirrorRepeat;
59 return wgpu::AddressMode::ClampToEdge;
68 wgpu::SamplerDescriptor
desc;
71 desc.magFilter = filter_mode_to_dawn_filter_mode(samplingOptions.
filter);
73 desc.mipmapFilter = mipmap_mode_to_dawn_filter_mode(samplingOptions.
mipmap);
74 desc.lodMinClamp = 0.0f;
77 desc.lodMaxClamp = 0.0f;
79 desc.lodMaxClamp = FLT_MAX;
81 desc.maxAnisotropy = 1;
82 desc.compare = wgpu::CompareFunction::Undefined;
86 static const char* tileModeLabels[] = {
"Clamp",
"Repeat",
"Mirror",
"Decal"};
87 static const char* minMagFilterLabels[] = {
"Nearest",
"Linear"};
88 static const char* mipFilterLabels[] = {
"MipNone",
"MipNearest",
"MipLinear"};
89 label.append(
"X").append(tileModeLabels[
static_cast<int>(xTileMode)]);
90 label.append(
"Y").append(tileModeLabels[
static_cast<int>(yTileMode)]);
91 label.append(minMagFilterLabels[
static_cast<int>(samplingOptions.
filter)]);
92 label.append(mipFilterLabels[
static_cast<int>(samplingOptions.
mipmap)]);
93 desc.label = label.c_str();
96 auto sampler = sharedContext->
device().CreateSampler(&
desc);
103void DawnSampler::freeGpuData() {
bool setBackendLabels() const
const wgpu::Device & device() const
const Caps * caps() const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
std::function< ProfileSample(void)> Sampler
Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version ...
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
static wgpu::AddressMode tile_mode_to_dawn_address_mode(SkTileMode tileMode)
const SkFilterMode filter
const SkMipmapMode mipmap