Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
sampler_descriptor.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_CORE_SAMPLER_DESCRIPTOR_H_
6#define FLUTTER_IMPELLER_CORE_SAMPLER_DESCRIPTOR_H_
7
9
10namespace impeller {
11
12class Context;
13
14struct SamplerDescriptor final {
18
22
23 /// The maximum anisotropy clamp used when sampling. A value of 1 disables
24 /// anisotropic filtering. Values greater than 1 are clamped to the device
25 /// limit reported by `Capabilities::GetMaxSamplerAnisotropy`. Anisotropic
26 /// filtering only applies when all filters are linear.
27 uint8_t max_anisotropy = 1;
28
29 std::string_view label = "NN Clamp Sampler";
30
32
33 SamplerDescriptor(std::string_view label,
37
38 static uint64_t ToKey(const SamplerDescriptor& d) {
39 static_assert(sizeof(MinMagFilter) == 1);
40 static_assert(sizeof(MipFilter) == 1);
41 static_assert(sizeof(SamplerAddressMode) == 1);
42
43 return static_cast<uint64_t>(d.min_filter) << 0 |
44 static_cast<uint64_t>(d.mag_filter) << 8 |
45 static_cast<uint64_t>(d.mip_filter) << 16 |
46 static_cast<uint64_t>(d.width_address_mode) << 24 |
47 static_cast<uint64_t>(d.height_address_mode) << 32 |
48 static_cast<uint64_t>(d.depth_address_mode) << 40 |
49 static_cast<uint64_t>(d.max_anisotropy) << 48;
50 }
51};
52
53} // namespace impeller
54
55#endif // FLUTTER_IMPELLER_CORE_SAMPLER_DESCRIPTOR_H_
auto & d
Definition main.cc:28
SamplerAddressMode
Definition formats.h:618
MipFilter
Options for selecting and filtering between mipmap levels.
Definition formats.h:602
@ kNearest
The nearst mipmap level is selected.
MinMagFilter
Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (...
Definition formats.h:592
@ kNearest
Select nearest to the sample point. Most widely supported.
SamplerAddressMode depth_address_mode
SamplerAddressMode width_address_mode
SamplerAddressMode height_address_mode
static uint64_t ToKey(const SamplerDescriptor &d)