Cleanup: GPU: Encapsulate glViewport calls

This commit is contained in:
2020-07-17 19:03:30 +02:00
parent 35f1b3e43b
commit a6bd7777c2
9 changed files with 26 additions and 20 deletions

View File

@@ -320,7 +320,7 @@ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, c
glDepthFunc(GL_LEQUAL);
float viewport[4];
glGetFloatv(GL_VIEWPORT, viewport);
GPU_viewport_size_get_f(viewport);
ps->src.clip_rect = *input;
ps->src.rect_len = rect_len;
@@ -330,7 +330,7 @@ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, c
ps->gl.clip_readpixels[2] = BLI_rcti_size_x(&ps->src.clip_rect);
ps->gl.clip_readpixels[3] = BLI_rcti_size_y(&ps->src.clip_rect);
glViewport(UNPACK4(ps->gl.clip_readpixels));
GPU_viewport(UNPACK4(ps->gl.clip_readpixels));
/* It's possible we don't want to clear depth buffer,
* so existing elements are masked by current z-buffer. */