diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-23 09:54:42 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-09-23 09:58:27 +0200 |
commit | b0ba193b66b402c5417aa5c0863cc357139e528d (patch) | |
tree | 8e97f4e4a26311a28fa3c94d2c2f4349f83b8a1a /video/out/gpu/shader_cache.h | |
parent | f3ec4946137a29e0b2c2bb181b369a3a770bf4bc (diff) | |
download | mpv-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.h')
-rw-r--r-- | video/out/gpu/shader_cache.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/gpu/shader_cache.h b/video/out/gpu/shader_cache.h index 82a078079b..377293391c 100644 --- a/video/out/gpu/shader_cache.h +++ b/video/out/gpu/shader_cache.h @@ -53,4 +53,7 @@ struct mp_pass_perf gl_sc_dispatch_draw(struct gl_shader_cache *sc, void *ptr, size_t num); struct mp_pass_perf gl_sc_dispatch_compute(struct gl_shader_cache *sc, int w, int h, int d); +// The application can call this on errors, to reset the current shader. This +// is normally done implicitly by gl_sc_dispatch_* +void gl_sc_reset(struct gl_shader_cache *sc); void gl_sc_set_cache_dir(struct gl_shader_cache *sc, const char *dir); |