summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/user_shaders.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-07-29 20:41:50 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-03 18:27:36 +0200
commit83f39103989ba6bd289a2ed83abe8177a3ba2f93 (patch)
tree1c516d66cad01a09d3837bb48916d4bb0a336975 /video/out/opengl/user_shaders.h
parente7d31d12bea0463ff2d8f43067d40634d1be6b40 (diff)
downloadmpv-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.h')
-rw-r--r--video/out/opengl/user_shaders.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/video/out/opengl/user_shaders.h b/video/out/opengl/user_shaders.h
index 888422608c..5f3f1d0d93 100644
--- a/video/out/opengl/user_shaders.h
+++ b/video/out/opengl/user_shaders.h
@@ -55,6 +55,13 @@ struct szexp {
} val;
};
+struct compute_info {
+ bool active;
+ int block_w, block_h; // Block size (each block corresponds to one WG)
+ int threads_w, threads_h; // How many threads form a working group
+ bool directly_writes; // If true, shader is assumed to imageStore(out_image)
+};
+
struct gl_user_shader_hook {
struct bstr pass_desc;
struct bstr hook_tex[SHADER_MAX_HOOKS];
@@ -66,8 +73,7 @@ struct gl_user_shader_hook {
struct szexp height[MAX_SZEXP_SIZE];
struct szexp cond[MAX_SZEXP_SIZE];
int components;
- int compute_w;
- int compute_h;
+ struct compute_info compute;
};
struct gl_user_shader_tex {