Fix vertex selection error from recent refactor

Temporary fix for regression in 8084b7e6e273e.
This commit is contained in:
Campbell Barton 2020-07-17 17:35:46 +10:00
parent 89a7a1c156
commit 618f31312c

@ -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);
}
}