forked from AuroraMiddleware/gtk
More texture upload fixes
In some cases, with bpp == 3 and a rowstride that is divisible by 4, we were passing invalid parameters to GL. Fixes: #3198
This commit is contained in:
parent
db4b7e3d11
commit
d6912a6791
@ -299,13 +299,11 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
|
|||||||
else if ((!priv->use_es ||
|
else if ((!priv->use_es ||
|
||||||
(priv->use_es && (priv->gl_version >= 30 || priv->has_unpack_subimage))))
|
(priv->use_es && (priv->gl_version >= 30 || priv->has_unpack_subimage))))
|
||||||
{
|
{
|
||||||
glPixelStorei (GL_UNPACK_ALIGNMENT, bpp);
|
|
||||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / bpp);
|
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / bpp);
|
||||||
|
|
||||||
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, gl_format, gl_type, data);
|
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, gl_format, gl_type, data);
|
||||||
|
|
||||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||||
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user