From 0e1e4005fb231dee4a86322d308870cfd765b751 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 10 Mar 2016 22:42:20 +0100 Subject: vo_opengl: use the same type for cached and current uniform values Slightly improvement over the previous commit. --- video/out/opengl/utils.c | 23 +++++++++++------------ 1 file 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; -- cgit v1.2.3