[mutter/wip/rstrode/rhel-8.0.0: 61/117] cogl/texture-2d-gl: Bind correct target when getting data



commit 6dc7bacf08d98eb6d5e8769feb9c8025ce55322c
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Dec 19 10:12:49 2018 +0100

    cogl/texture-2d-gl: Bind correct target when getting data
    
    While for normal textures, GL_TEXTURE_2D should be used, when it's an external
    texture, binding it using GL_TEXTURE_2D results in an error.
    
    Reading the specification for GL_TEXTURE_EXTERNAL_OES it is unclear whether
    getting pixel data from a texture is possible, and tests show it doesn't result
    in any data, but in case it would eventually start working, at least bind the
    correct target for now.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/362

 cogl/cogl/driver/gl/cogl-texture-2d-gl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
index 53be13216..2cf6fed51 100644
--- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
+++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c
@@ -859,12 +859,12 @@ _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
                                                     width,
                                                     bpp);
 
-  _cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
+  _cogl_bind_gl_texture_transient (tex_2d->gl_target,
                                    tex_2d->gl_texture,
                                    tex_2d->is_foreign);
 
   ctx->texture_driver->gl_get_tex_image (ctx,
-                                         GL_TEXTURE_2D,
+                                         tex_2d->gl_target,
                                          gl_format,
                                          gl_type,
                                          data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]