Fix vertex selection error from recent refactor

Temporary fix for regression in 8084b7e6e2.
This commit is contained in:
Campbell Barton 2020-07-17 17:35:46 +10:00
parent 89a7a1c156
commit 618f31312c
Notes: blender-bot 2023-02-14 03:00:45 +01:00
Referenced by issue #79008, Selecting in Edit mode is broken if X-Ray is off.
1 changed files with 5 additions and 1 deletions

View File

@ -683,6 +683,10 @@ static void gpu_framebuffer_read_color_ex(
{
GLenum type = gpu_get_gl_channel_type(channels);
GLenum gl_format = gpu_get_gl_datatype(format);
/* TODO: needed for selection buffers to work properly, this should be handled better. */
if (type == GL_RED && gl_format == GL_UNSIGNED_INT) {
type = GL_RED_INTEGER;
}
glReadBuffer(readfb);
glReadPixels(x, y, w, h, type, gl_format, data);
}
@ -1075,4 +1079,4 @@ void GPU_frontbuffer_read_pixels(
{
glReadBuffer(GL_FRONT);
gpu_framebuffer_read_color_ex(x, y, w, h, channels, GL_FRONT, format, data);
}
}