diff options
author | Niklas Haas <git@haasn.xyz> | 2017-07-29 20:41:50 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-08-03 18:27:36 +0200 |
commit | 83f39103989ba6bd289a2ed83abe8177a3ba2f93 (patch) | |
tree | 1c516d66cad01a09d3837bb48916d4bb0a336975 /video/out/opengl/user_shaders.c | |
parent | e7d31d12bea0463ff2d8f43067d40634d1be6b40 (diff) | |
download | mpv-83f39103989ba6bd289a2ed83abe8177a3ba2f93.tar.bz2 mpv-83f39103989ba6bd289a2ed83abe8177a3ba2f93.tar.xz |
vo_opengl: make compute shaders more flexible
This allows users to do their own custom sample writing, mainly meant to
address use cases such as RAVU. Also clean up the compute shader code a
bit.
Diffstat (limited to 'video/out/opengl/user_shaders.c')
-rw-r--r-- | video/out/opengl/user_shaders.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/video/out/opengl/user_shaders.c b/video/out/opengl/user_shaders.c index 799367f3e1..58a1ac9e64 100644 --- a/video/out/opengl/user_shaders.c +++ b/video/out/opengl/user_shaders.c @@ -259,7 +259,14 @@ static bool parse_hook(struct mp_log *log, struct bstr *body, } if (bstr_eatstart0(&line, "COMPUTE")) { - if (bstr_sscanf(line, "%d %d", &out->compute_w, &out->compute_h) != 2) { + struct compute_info *ci = &out->compute; + int num = bstr_sscanf(line, "%d %d %d %d", &ci->block_w, &ci->block_h, + &ci->threads_w, &ci->threads_h); + + if (num == 2 || num == 4) { + ci->active = true; + ci->directly_writes = true; + } else { mp_err(log, "Error while parsing COMPUTE!\n"); return false; } |