- pixels = weights.bilinear_weights_fp16;
- }
-
- if (int(weights.src_bilinear_samples) == last_texture_width &&
- int(weights.dst_samples) == last_texture_height &&
- internal_format == last_texture_internal_format) {
- // Texture dimensions and type are unchanged; it is more efficient
- // to just update it rather than making an entirely new texture.
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, weights.src_bilinear_samples, weights.dst_samples, GL_RG, type, pixels);
- } else {
- glTexImage2D(GL_TEXTURE_2D, 0, internal_format, weights.src_bilinear_samples, weights.dst_samples, 0, GL_RG, type, pixels);
- last_texture_width = weights.src_bilinear_samples;
- last_texture_height = weights.dst_samples;
- last_texture_internal_format = internal_format;