70 {
71 if (
texture.NeedsMipmapGeneration()) {
73 << "Texture mip count is > 1, but the mipmap has not been generated. "
74 "Texture can not be sampled safely.";
75 return false;
76 }
77
79
81 return false;
82 }
84
85 std::optional<MipFilter> mip_filter = std::nullopt;
86 if (
texture.GetTextureDescriptor().mip_count > 1) {
87 mip_filter =
desc.mip_filter;
88 }
89
90 gl.TexParameteri(*
target, GL_TEXTURE_MIN_FILTER,
93
94 const auto supports_decal_mode =
95 gl.GetCapabilities()->SupportsDecalSamplerAddressMode();
96
97 const auto wrap_s =
99 const auto wrap_t =
101
102 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_S, wrap_s);
103 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_T, wrap_t);
104
107
108 const GLfloat border_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
110 }
111
112 return true;
113}
const SamplerDescriptor & GetDescriptor() const
constexpr std::optional< GLenum > ToTextureTarget(TextureType type)
static GLint ToAddressMode(SamplerAddressMode mode, bool supports_decal_sampler_address_mode)
static GLint ToParam(MinMagFilter minmag_filter, std::optional< MipFilter > mip_filter=std::nullopt)
#define IMPELLER_GL_TEXTURE_BORDER_COLOR
#define IMPELLER_GL_CLAMP_TO_BORDER