Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::SamplerDescriptor Struct Referencefinal

#include <sampler_descriptor.h>

Public Member Functions

 SamplerDescriptor ()
 
 SamplerDescriptor (std::string_view label, MinMagFilter min_filter, MinMagFilter mag_filter, MipFilter mip_filter)
 

Static Public Member Functions

static uint64_t ToKey (const SamplerDescriptor &d)
 

Public Attributes

MinMagFilter min_filter = MinMagFilter::kNearest
 
MinMagFilter mag_filter = MinMagFilter::kNearest
 
MipFilter mip_filter = MipFilter::kNearest
 
SamplerAddressMode width_address_mode = SamplerAddressMode::kClampToEdge
 
SamplerAddressMode height_address_mode = SamplerAddressMode::kClampToEdge
 
SamplerAddressMode depth_address_mode = SamplerAddressMode::kClampToEdge
 
uint8_t max_anisotropy = 1
 
std::string_view label = "NN Clamp Sampler"
 

Detailed Description

Definition at line 14 of file sampler_descriptor.h.

Constructor & Destructor Documentation

◆ SamplerDescriptor() [1/2]

impeller::SamplerDescriptor::SamplerDescriptor ( )
default

◆ SamplerDescriptor() [2/2]

impeller::SamplerDescriptor::SamplerDescriptor ( std::string_view  label,
MinMagFilter  min_filter,
MinMagFilter  mag_filter,
MipFilter  mip_filter 
)

Member Function Documentation

◆ ToKey()

static uint64_t impeller::SamplerDescriptor::ToKey ( const SamplerDescriptor d)
inlinestatic

Definition at line 38 of file sampler_descriptor.h.

38 {
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 }
auto & d
Definition main.cc:28
SamplerAddressMode
Definition formats.h:618
MipFilter
Options for selecting and filtering between mipmap levels.
Definition formats.h:602
MinMagFilter
Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (...
Definition formats.h:592

References d.

Referenced by impeller::ImmutableSamplerKeyVK::GetHash(), impeller::ImmutableSamplerKeyVK::IsEqual(), and impeller::testing::TEST().

Member Data Documentation

◆ depth_address_mode

SamplerAddressMode impeller::SamplerDescriptor::depth_address_mode = SamplerAddressMode::kClampToEdge

Definition at line 21 of file sampler_descriptor.h.

Referenced by impeller::CreateSampler().

◆ height_address_mode

◆ label

std::string_view impeller::SamplerDescriptor::label = "NN Clamp Sampler"

◆ mag_filter

◆ max_anisotropy

uint8_t impeller::SamplerDescriptor::max_anisotropy = 1

The maximum anisotropy clamp used when sampling. A value of 1 disables anisotropic filtering. Values greater than 1 are clamped to the device limit reported by Capabilities::GetMaxSamplerAnisotropy. Anisotropic filtering only applies when all filters are linear.

Definition at line 27 of file sampler_descriptor.h.

Referenced by impeller::SamplerGLES::ConfigureBoundTexture(), impeller::CreateSampler(), InternalFlutterGpu_RenderPass_BindTexture(), impeller::testing::TEST(), and impeller::testing::TEST().

◆ min_filter

◆ mip_filter

◆ width_address_mode


The documentation for this struct was generated from the following files: