From dfc7b59909588985ee1be19f313f8bfb858ab8b0 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 12 May 2016 11:27:00 +0200 Subject: 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. --- video/out/opengl/video.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'video/out/opengl/video.c') 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 -- cgit v1.2.3