summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video_shaders.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-17 10:55:43 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-26 17:25:35 +0200
commit47af509e1fad3e9ce30e3e339d8cd705fcd44ef2 (patch)
tree0f0ac7f905efe2a3efdfe4e0b38cae15d0be8eda /video/out/gpu/video_shaders.c
parentca85a153b4a201c7f6d600f861639ef68c1edfa3 (diff)
downloadmpv-47af509e1fad3e9ce30e3e339d8cd705fcd44ef2.tar.bz2
mpv-47af509e1fad3e9ce30e3e339d8cd705fcd44ef2.tar.xz
vo_gpu: attempt to avoid UBOs for dynamic variables
This makes the radeon driver shut up about frequently updating STATIC_DRAW UBOs (--opengl-debug), and also reduces the amount of synchronization necessary for vulkan uniform buffers. Also add some extra debugging/tracing code paths. I went with a flags-based approach in case we ever want to extend this.
Diffstat (limited to 'video/out/gpu/video_shaders.c')
-rw-r--r--video/out/gpu/video_shaders.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c
index 48a8bc2eae..eb629a13ca 100644
--- a/video/out/gpu/video_shaders.c
+++ b/video/out/gpu/video_shaders.c
@@ -768,6 +768,7 @@ static void prng_init(struct gl_shader_cache *sc, AVLFG *lfg)
// Initialize the PRNG by hashing the position + a random uniform
GLSL(vec3 _m = vec3(HOOKED_pos, random) + vec3(1.0);)
GLSL(float h = permute(permute(permute(_m.x)+_m.y)+_m.z);)
+ gl_sc_uniform_dynamic(sc);
gl_sc_uniform_f(sc, "random", (double)av_lfg_get(lfg) / UINT32_MAX);
}