71 if (texture.NeedsMipmapGeneration()) {
73 <<
"Texture mip count is > 1, but the mipmap has not been generated. "
74 "Texture can not be sampled safely.";
80 if (!target.has_value()) {
85 std::optional<MipFilter> mip_filter = std::nullopt;
86 if (texture.GetTextureDescriptor().mip_count > 1) {
87 mip_filter = desc.mip_filter;
90 gl.TexParameteri(*target, GL_TEXTURE_MIN_FILTER,
91 ToParam(desc.min_filter, mip_filter));
92 gl.TexParameteri(*target, GL_TEXTURE_MAG_FILTER,
ToParam(desc.mag_filter));
94 const auto supports_decal_mode =
95 gl.GetCapabilities()->SupportsDecalSamplerAddressMode();
100 ToAddressMode(desc.height_address_mode, supports_decal_mode);
102 gl.TexParameteri(*target, GL_TEXTURE_WRAP_S, wrap_s);
103 gl.TexParameteri(*target, GL_TEXTURE_WRAP_T, wrap_t);
108 const GLfloat border_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};