GNOME Bugzilla – Bug 660387
test-color-mask fails due to uninitialized texture data
Last modified: 2011-09-29 09:36:12 UTC
Created attachment 197694 [details] [review] initialize texture data in cogl test-color-mask Hello, test-color-mask fails because the texture data sometimes contains random color bits, I've attached a patch that corrects the problem by clearing the texture using the FBO.
For reference (glTexImage2D spec): "In GL version 1.1 or greater, data may be a null pointer. In this case, texture memory is allocated to accommodate a texture of width width and height height. [...] The image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive." So apparently creating a texture_with_size will not zero-initialize it, thus a cogl_clear (or passing data with zeros?) is necessary.
Pushed to master as e7cdb1b11b and cogl-1.8 as 4cd8ba0c4. Good catch, thank you!