mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-04 00:25:17 +00:00
Fix crash in GL_RED textures uploading.
This commit is contained in:
@@ -469,6 +469,7 @@ void Viewport::RendererGL::paintTile(
|
|||||||
f.glActiveTexture(GL_TEXTURE0);
|
f.glActiveTexture(GL_TEXTURE0);
|
||||||
textures.values.bind(f, textures.textureIndex * 3 + 0);
|
textures.values.bind(f, textures.textureIndex * 3 + 0);
|
||||||
if (upload) {
|
if (upload) {
|
||||||
|
f.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
uploadOne(GL_RED, GL_RED, yuv->size, yuv->y.stride, yuv->y.data);
|
uploadOne(GL_RED, GL_RED, yuv->size, yuv->y.stride, yuv->y.data);
|
||||||
}
|
}
|
||||||
f.glActiveTexture(GL_TEXTURE1);
|
f.glActiveTexture(GL_TEXTURE1);
|
||||||
@@ -480,6 +481,7 @@ void Viewport::RendererGL::paintTile(
|
|||||||
textures.values.bind(f, textures.textureIndex * 3 + 2);
|
textures.values.bind(f, textures.textureIndex * 3 + 2);
|
||||||
if (upload) {
|
if (upload) {
|
||||||
uploadOne(GL_RED, GL_RED, otherSize, yuv->v.stride, yuv->v.data);
|
uploadOne(GL_RED, GL_RED, otherSize, yuv->v.stride, yuv->v.data);
|
||||||
|
f.glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||||
}
|
}
|
||||||
_yuv420Program->setUniformValue("y_texture", GLint(0));
|
_yuv420Program->setUniformValue("y_texture", GLint(0));
|
||||||
_yuv420Program->setUniformValue("u_texture", GLint(1));
|
_yuv420Program->setUniformValue("u_texture", GLint(1));
|
||||||
|
Reference in New Issue
Block a user