71 {
72 if (
texture.NeedsMipmapGeneration()) {
74 << "Texture mip count is > 1, but the mipmap has not been generated. "
75 "Texture can not be sampled safely.";
76 return false;
77 }
78
80
82 return false;
83 }
85
87
88
89 GLint min_filter;
90 if (
texture.GetTextureDescriptor().mip_count > 1) {
92 } else {
94 }
95
96 gl.TexParameteri(*
target, GL_TEXTURE_MIN_FILTER, min_filter);
97 gl.TexParameteri(*
target, GL_TEXTURE_MAG_FILTER, mag_filter);
98
99 const auto supports_decal_mode =
100 gl.GetCapabilities()->SupportsDecalSamplerAddressMode();
101
102 const auto wrap_s =
104 const auto wrap_t =
106
107 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_S, wrap_s);
108 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_T, wrap_t);
109
112
113 const GLfloat border_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
115 }
116
117 return true;
118}
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)
#define IMPELLER_GL_TEXTURE_BORDER_COLOR
#define IMPELLER_GL_CLAMP_TO_BORDER