diff options
author | wm4 <wm4@nowhere> | 2016-03-10 22:42:20 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-03-10 22:42:20 +0100 |
commit | 0e1e4005fb231dee4a86322d308870cfd765b751 (patch) | |
tree | 8a11c591025458c6bb1c9853f833e24f334f88a0 /video/out/opengl/utils.c | |
parent | 5199c2ee3ad593285e8d7fcbcf9be70b93ddfe8e (diff) | |
download | mpv-0e1e4005fb231dee4a86322d308870cfd765b751.tar.bz2 mpv-0e1e4005fb231dee4a86322d308870cfd765b751.tar.xz |
vo_opengl: use the same type for cached and current uniform values
Slightly improvement over the previous commit.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r-- | video/out/opengl/utils.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index 001875354b..7ce9c30bf9 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -526,29 +526,28 @@ enum uniform_type { UT_buffer, }; +union uniform_val { + GLfloat f[9]; + GLint i[4]; + struct { + char* text; + GLint binding; + } buffer; +}; + struct sc_uniform { char *name; enum uniform_type type; const char *glsl_type; int size; GLint loc; - union { - GLfloat f[9]; - GLint i[4]; - struct { - char* text; - GLint binding; - } buffer; - } v; + union uniform_val v; }; struct sc_entry { GLuint gl_shader; GLint uniform_locs[SC_UNIFORM_ENTRIES]; - union { - GLfloat f[9]; - GLint i[4]; - } cached_v[SC_UNIFORM_ENTRIES]; + union uniform_val cached_v[SC_UNIFORM_ENTRIES]; // the following fields define the shader's contents char *key; // vertex+frag shader (mangled) struct gl_vao *vao; |