Cleanup: Port glClear calls to GPU module functions
This commit is contained in:
parent
bc85081156
commit
ab19abe223
|
@ -76,8 +76,7 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
|
|||
DRW_draw_pass(pass);
|
||||
|
||||
float *data = MEM_mallocN(sizeof(float[3]) * w * h, "lut");
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
glReadPixels(0, 0, w, h, GL_RGB, GL_FLOAT, data);
|
||||
GPU_framebuffer_read_color(fb, 0, 0, w, h, 3, 0, data);
|
||||
|
||||
printf("{");
|
||||
for (int i = 0; i < w * h * 3; i += 3) {
|
||||
|
|
|
@ -398,8 +398,8 @@ static bool gpencil_render_offscreen(tGPDfill *tgpf)
|
|||
GPU_matrix_push();
|
||||
GPU_matrix_identity_set();
|
||||
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
GPU_clear_color(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
GPU_clear(GPU_COLOR_BIT | GPU_DEPTH_BIT);
|
||||
|
||||
ED_view3d_update_viewmat(
|
||||
tgpf->depsgraph, tgpf->scene, tgpf->v3d, tgpf->region, NULL, winmat, NULL, true);
|
||||
|
|
|
@ -357,12 +357,12 @@ static void region_draw_status_text(ScrArea *area, ARegion *region)
|
|||
bool overlap = ED_region_is_overlap(area->spacetype, region->regiontype);
|
||||
|
||||
if (overlap) {
|
||||
GPU_clear_color(0.0, 0.0, 0.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear_color(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
}
|
||||
else {
|
||||
UI_ThemeClearColor(TH_HEADER);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
}
|
||||
|
||||
int fontid = BLF_set_default();
|
||||
|
@ -527,7 +527,7 @@ void ED_region_do_draw(bContext *C, ARegion *region)
|
|||
|
||||
if (area && area_is_pseudo_minimized(area)) {
|
||||
UI_ThemeClearColor(TH_EDITOR_OUTLINE);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
return;
|
||||
}
|
||||
/* optional header info instead? */
|
||||
|
|
|
@ -736,8 +736,8 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo)
|
|||
|
||||
wm_draw_region_buffer_create(region, false, false);
|
||||
wm_draw_region_bind(region, 0);
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear_color(0, 0, 0, 0);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
ED_region_do_draw(C, region);
|
||||
wm_draw_region_unbind(region);
|
||||
|
||||
|
@ -759,8 +759,8 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view)
|
|||
* Actually this is only a problem when resizing the window.
|
||||
* If it becomes a problem we should clear only when window size changes. */
|
||||
#if 0
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear_color(0, 0, 0, 0);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
#endif
|
||||
|
||||
/* Blit non-overlapping area regions. */
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
#include "BIF_glutil.h"
|
||||
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_framebuffer.h"
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_immediate_util.h"
|
||||
#include "GPU_init_exit.h"
|
||||
|
@ -309,8 +310,8 @@ static void playanim_toscreen(
|
|||
CLAMP(offs_x, 0.0f, 1.0f);
|
||||
CLAMP(offs_y, 0.0f, 1.0f);
|
||||
|
||||
glClearColor(0.1, 0.1, 0.1, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear_color(0.1, 0.1, 0.1, 0.0);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
|
||||
/* checkerboard for case alpha */
|
||||
if (ibuf->planes == 32) {
|
||||
|
@ -1315,8 +1316,8 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
|
|||
maxwiny = ibuf->y * (1 + (maxwiny / ibuf->y));
|
||||
}
|
||||
|
||||
glClearColor(0.1, 0.1, 0.1, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear_color(0.1, 0.1, 0.1, 0.0);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
|
||||
int win_x, win_y;
|
||||
playanim_window_get_size(&win_x, &win_y);
|
||||
|
|
|
@ -648,10 +648,10 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm,
|
|||
}
|
||||
#endif
|
||||
/* until screens get drawn, make it nice gray */
|
||||
glClearColor(0.55, 0.55, 0.55, 0.0);
|
||||
GPU_clear_color(0.55, 0.55, 0.55, 0.0);
|
||||
/* Crash on OSS ATI: bugs.launchpad.net/ubuntu/+source/mesa/+bug/656100 */
|
||||
if (!GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
GPU_clear(GPU_COLOR_BIT);
|
||||
}
|
||||
|
||||
/* needed here, because it's used before it reads userdef */
|
||||
|
|
Loading…
Reference in New Issue