81 if (texture.NeedsMipmapGeneration()) {
83 <<
"Texture mip count is > 1, but the mipmap has not been generated. "
84 "Texture can not be sampled safely.";
90 if (!target.has_value()) {
95 std::optional<MipFilter> mip_filter = std::nullopt;
96 if (texture.GetTextureDescriptor().mip_count > 1) {
97 mip_filter = desc.mip_filter;
100 gl.TexParameteri(*target, GL_TEXTURE_MIN_FILTER,
101 ToParam(desc.min_filter, mip_filter));
102 gl.TexParameteri(*target, GL_TEXTURE_MAG_FILTER,
ToParam(desc.mag_filter));
104 const auto supports_decal_mode =
105 gl.GetCapabilities()->SupportsDecalSamplerAddressMode();
110 ToAddressMode(desc.height_address_mode, supports_decal_mode);
112 gl.TexParameteri(*target, GL_TEXTURE_WRAP_S, wrap_s);
113 gl.TexParameteri(*target, GL_TEXTURE_WRAP_T, wrap_t);
118 const GLfloat border_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};