Fix RGBA vs RGB selection when creating GLTexture.

PiperOrigin-RevId: 499877590
This commit is contained in:
MediaPipe Team 2023-01-05 07:55:57 -08:00 committed by Copybara-Service
parent 43bf02443c
commit 463cbb60ee

View File

@ -285,7 +285,7 @@ class GlProcessor : public ImageToTensorConverter {
auto source_texture = gl_helper_.CreateSourceTexture(input);
tflite::gpu::gl::GlTexture input_texture(
GL_TEXTURE_2D, source_texture.name(),
input_num_channels == 4 ? GL_RGB : GL_RGBA,
input_num_channels == 4 ? GL_RGBA : GL_RGB,
source_texture.width() * source_texture.height() *
input_num_channels * sizeof(uint8_t),
/*layer=*/0,