summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/shader_cache.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-28 00:07:42 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-28 01:54:38 +0200
commit67fd5882b86bc544e27a9cb0b188d63bdb950623 (patch)
tree7b0cd41803e8432cf2a5124c85cdf96cf73382a9 /video/out/gpu/shader_cache.h
parent002a0ce23200c7044ce744555223e4b884350436 (diff)
downloadmpv-67fd5882b86bc544e27a9cb0b188d63bdb950623.tar.bz2
mpv-67fd5882b86bc544e27a9cb0b188d63bdb950623.tar.xz
vo_gpu: make the vertex attribs dynamic
This has several advantages: 1. no more redundant texcoords when we don't need them 2. no more arbitrary limit on how many textures we can bind 3. (that extends to user shaders as well) 4. no more arbitrary limits on tscale radius To realize this, the VAO was moved from a hacky stateful approach (gl_sc_set_vertex_attribs) - which always bothered me since it was required for compute shaders as well even though they ignored it - to be a proper parameter of gl_sc_dispatch_draw, and internally plumbed into gl_sc_generate, which will make a (properly mangled) deep copy into params.vertex_attribs.
Diffstat (limited to 'video/out/gpu/shader_cache.h')
-rw-r--r--video/out/gpu/shader_cache.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/video/out/gpu/shader_cache.h b/video/out/gpu/shader_cache.h
index d64bb3a0f4..2fe7dcfb9d 100644
--- a/video/out/gpu/shader_cache.h
+++ b/video/out/gpu/shader_cache.h
@@ -43,9 +43,6 @@ void gl_sc_uniform_mat2(struct gl_shader_cache *sc, char *name,
bool transpose, float *v);
void gl_sc_uniform_mat3(struct gl_shader_cache *sc, char *name,
bool transpose, float *v);
-void gl_sc_set_vertex_format(struct gl_shader_cache *sc,
- const struct ra_renderpass_input *vertex_attribs,
- int vertex_stride);
void gl_sc_blend(struct gl_shader_cache *sc,
enum ra_blend blend_src_rgb,
enum ra_blend blend_dst_rgb,
@@ -54,6 +51,8 @@ void gl_sc_blend(struct gl_shader_cache *sc,
void gl_sc_enable_extension(struct gl_shader_cache *sc, char *name);
struct mp_pass_perf gl_sc_dispatch_draw(struct gl_shader_cache *sc,
struct ra_tex *target,
+ const struct ra_renderpass_input *vao,
+ int vao_len, size_t vertex_stride,
void *ptr, size_t num);
struct mp_pass_perf gl_sc_dispatch_compute(struct gl_shader_cache *sc,
int w, int h, int d);