53 bool supports_decal_sampler_address_mode) {
55 case SamplerAddressMode::kClampToEdge:
56 return GL_CLAMP_TO_EDGE;
57 case SamplerAddressMode::kRepeat:
59 case SamplerAddressMode::kMirror:
60 return GL_MIRRORED_REPEAT;
61 case SamplerAddressMode::kDecal:
62 if (supports_decal_sampler_address_mode) {
65 return GL_CLAMP_TO_EDGE;
73 if (
texture.NeedsMipmapGeneration()) {
75 <<
"Texture mip count is > 1, but the mipmap has not been generated. "
76 "Texture can not be sampled safely.";
91 if (
texture.GetTextureDescriptor().mip_count > 1) {
97 gl.TexParameteri(*
target, GL_TEXTURE_MIN_FILTER, min_filter);
98 gl.TexParameteri(*
target, GL_TEXTURE_MAG_FILTER, mag_filter);
100 const auto supports_decal_mode =
108 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_S, wrap_s);
109 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_T, wrap_t);
114 const GLfloat border_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};