summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/shader_cache.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-23 09:54:42 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-23 09:58:27 +0200
commitb0ba193b66b402c5417aa5c0863cc357139e528d (patch)
tree8e97f4e4a26311a28fa3c94d2c2f4349f83b8a1a /video/out/gpu/shader_cache.c
parentf3ec4946137a29e0b2c2bb181b369a3a770bf4bc (diff)
downloadmpv-b0ba193b66b402c5417aa5c0863cc357139e528d.tar.bz2
mpv-b0ba193b66b402c5417aa5c0863cc357139e528d.tar.xz
vo_gpu: handle texture initialization errors gracefully
Tested by making the ra_tex_resize function always fail (apart from the initial FBO check). This required a few changes: 1. reset shaders on failed dispatch 2. reset cleanup binds on failed dispatch 3. fall back to initializing the struct image to 1x1 on failure 4. handle output_fbo_valid gracefully
Diffstat (limited to 'video/out/gpu/shader_cache.c')
-rw-r--r--video/out/gpu/shader_cache.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c
index ead759d931..86939083db 100644
--- a/video/out/gpu/shader_cache.c
+++ b/video/out/gpu/shader_cache.c
@@ -104,8 +104,6 @@ struct gl_shader_cache {
struct mpv_global *global; // can be NULL
};
-static void gl_sc_reset(struct gl_shader_cache *sc);
-
struct gl_shader_cache *gl_sc_create(struct ra *ra, struct mpv_global *global,
struct mp_log *log)
{
@@ -120,8 +118,8 @@ struct gl_shader_cache *gl_sc_create(struct ra *ra, struct mpv_global *global,
}
// Reset the previous pass. This must be called after gl_sc_generate and before
-// starting a new shader.
-static void gl_sc_reset(struct gl_shader_cache *sc)
+// starting a new shader. It may also be called on errors.
+void gl_sc_reset(struct gl_shader_cache *sc)
{
sc->prelude_text.len = 0;
sc->header_text.len = 0;