45 {
46 MTLSamplerMinMagFilter minMagFilter = [&] {
47 switch (samplerState.
filter()) {
50 }
52 }();
53
54 MTLSamplerMipFilter mipFilter = [&] {
59 }
61 }();
62
63 auto samplerDesc = [[MTLSamplerDescriptor alloc]
init];
64 samplerDesc.rAddressMode = MTLSamplerAddressModeClampToEdge;
69 samplerDesc.magFilter = minMagFilter;
70 samplerDesc.minFilter = minMagFilter;
71 samplerDesc.mipFilter = mipFilter;
72 samplerDesc.lodMinClamp = 0.0f;
73 samplerDesc.lodMaxClamp = FLT_MAX;
74
76 samplerDesc.normalizedCoordinates = true;
77 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
78 samplerDesc.compareFunction = MTLCompareFunctionNever;
79 }
80
83}
static GR_NORETAIN_BEGIN MTLSamplerAddressMode wrap_mode_to_mtl_sampler_address(GrSamplerState::WrapMode wrapMode, const GrCaps &caps)
const GrMtlCaps & mtlCaps() const
id< MTLDevice > device() const
static Key GenerateKey(GrSamplerState)
constexpr WrapMode wrapModeX() const
constexpr Filter filter() const
constexpr MipmapMode mipmapMode() const
constexpr WrapMode wrapModeY() const
static float min(float r, float g, float b)