in case of glTex{Sub}Image{1,2,3}D(). Texture has already been
allocated at this point and we have no data to upload. With out
this patch, with create_pbo = true, we end up creating a temporary
pbo and then uploading uninitialzed texture data.

Signed-off-by: Anuj Phogat <[email protected]>
Cc: Neil Roberts <[email protected]>
---
 src/mesa/drivers/common/meta_tex_subimage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/common/meta_tex_subimage.c 
b/src/mesa/drivers/common/meta_tex_subimage.c
index e159127..d984a85 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -153,7 +153,8 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint 
dims,
    bool success = false;
    int z;
 
-   if (!_mesa_is_bufferobj(packing->BufferObj) && !create_pbo)
+   if (!_mesa_is_bufferobj(packing->BufferObj) &&
+       (!create_pbo || pixels == NULL))
       return false;
 
    if (format == GL_DEPTH_COMPONENT ||
-- 
1.9.3

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to