Open nox opened 5 years ago
Those methods take a buffer, pass it to a GL API as a pointer, and let GL decide how many bytes it should read from it through a combination of other inputs (for example, width and height), these methods should be unsafe:
width
height
Gl::tex_image_2d
Gl::tex_sub_image_2d
Furthermore, the GL functions for compressed textures also specify that undefined results can occur "if data is not encoded in a manner consistent with the extension specification defining the internal compression format", so the two methods using them should probably marked as unsafe too:
data
Gl::compressed_tex_image_2d
Gl::compressed_tex_sub_image_2d
I think we can add read_pixels to that list, since it returns unintialized values if you ask it to read outside the framebuffer.
read_pixels
Those methods take a buffer, pass it to a GL API as a pointer, and let GL decide how many bytes it should read from it through a combination of other inputs (for example,
width
andheight
), these methods should be unsafe:Gl::tex_image_2d
Gl::tex_sub_image_2d
Furthermore, the GL functions for compressed textures also specify that undefined results can occur "if
data
is not encoded in a manner consistent with the extension specification defining the internal compression format", so the two methods using them should probably marked as unsafe too:Gl::compressed_tex_image_2d
Gl::compressed_tex_sub_image_2d