diff options
author | Niklas Haas <git@nand.wakku.to> | 2016-05-12 11:27:00 +0200 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2016-05-15 20:42:02 +0200 |
commit | dfc7b59909588985ee1be19f313f8bfb858ab8b0 (patch) | |
tree | 3f563890139c210f573312727db61d89a8e43e14 /video/out/opengl/video.c | |
parent | 034faaa9d818bd8c1c52c879e383b8e7350d3df5 (diff) | |
download | mpv-dfc7b59909588985ee1be19f313f8bfb858ab8b0.tar.bz2 mpv-dfc7b59909588985ee1be19f313f8bfb858ab8b0.tar.xz |
vo_opengl: make the screen blue on shader errors
This helps visually signify that somthing went wrong, and prevents
confusing shader compilation errors with other types of bugs.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r-- | video/out/opengl/video.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 2a1d623f0b..ae1800821f 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -613,6 +613,8 @@ static void uninit_rendering(struct gl_video *p) gl_video_reset_surfaces(p); gl_video_reset_hooks(p); + + gl_sc_reset_error(p->sc); } void gl_video_update_profile(struct gl_video *p) @@ -2500,6 +2502,8 @@ static void pass_render_frame(struct gl_video *p) static void pass_draw_to_screen(struct gl_video *p, int fbo) { + GL *gl = p->gl; + if (p->dumb_mode) pass_render_frame_dumb(p, fbo); @@ -2525,6 +2529,13 @@ static void pass_draw_to_screen(struct gl_video *p, int fbo) pass_dither(p); finish_pass_direct(p, fbo, p->vp_w, p->vp_h, &p->dst_rect); + + if (gl_sc_error_state(p->sc)) { + // Make the screen solid blue to make it visually clear that an + // error has occurred + gl->ClearColor(0.0, 0.05, 0.5, 1.0); + gl->Clear(GL_COLOR_BUFFER_BIT); + } } // Draws an interpolate frame to fbo, based on the frame timing in t |