summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Jin <bjin@ctrl-d.org>2016-06-10 12:28:21 +0000
committerwm4 <wm4@nowhere>2016-06-18 19:16:31 +0200
commit3df95ee57afac4b92524daf50b646fac92072b81 (patch)
tree6879c7da26acd621f6239ac367dae16c18f1cb91
parent61bc96518afcfabfa07d6724ea517db5e9aba165 (diff)
downloadmpv-3df95ee57afac4b92524daf50b646fac92072b81.tar.bz2
mpv-3df95ee57afac4b92524daf50b646fac92072b81.tar.xz
vo_opengl: remove uniform buffer object routines
-rw-r--r--video/out/opengl/common.c11
-rw-r--r--video/out/opengl/common.h3
-rw-r--r--video/out/opengl/utils.c30
-rw-r--r--video/out/opengl/utils.h2
4 files changed, 2 insertions, 44 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 8cc974ba93..30321abc86 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -406,17 +406,6 @@ static const struct gl_functions gl_functions[] = {
{0}
},
},
- // uniform buffer object extensions, requires OpenGL 3.1.
- {
- .ver_core = 310,
- .ver_es_core = 300,
- .extension = "GL_ARB_uniform_buffer_object",
- .functions = (const struct gl_function[]) {
- DEF_FN(GetUniformBlockIndex),
- DEF_FN(UniformBlockBinding),
- {0}
- },
- },
{
.extension = "GL_ANGLE_translated_shader_source",
.functions = (const struct gl_function[]) {
diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h
index 71129ac320..280c1f514b 100644
--- a/video/out/opengl/common.h
+++ b/video/out/opengl/common.h
@@ -226,9 +226,6 @@ struct GL {
GLint (GLAPIENTRY *GetVideoSync)(GLuint *);
GLint (GLAPIENTRY *WaitVideoSync)(GLint, GLint, unsigned int *);
- GLuint (GLAPIENTRY *GetUniformBlockIndex)(GLuint, const GLchar *);
- void (GLAPIENTRY *UniformBlockBinding)(GLuint, GLuint, GLuint);
-
void (GLAPIENTRY *GetTranslatedShaderSourceANGLE)(GLuint, GLsizei,
GLsizei*, GLchar* source);
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c
index 05db335d30..73b411e66c 100644
--- a/video/out/opengl/utils.c
+++ b/video/out/opengl/utils.c
@@ -428,16 +428,11 @@ enum uniform_type {
UT_i,
UT_f,
UT_m,
- UT_buffer,
};
union uniform_val {
GLfloat f[9];
GLint i[4];
- struct {
- char* text;
- GLint binding;
- } buffer;
};
struct sc_uniform {
@@ -504,11 +499,8 @@ void gl_sc_reset(struct gl_shader_cache *sc)
sc->prelude_text.len = 0;
sc->header_text.len = 0;
sc->text.len = 0;
- for (int n = 0; n < sc->num_uniforms; n++) {
+ for (int n = 0; n < sc->num_uniforms; n++)
talloc_free(sc->uniforms[n].name);
- if (sc->uniforms[n].type == UT_buffer)
- talloc_free(sc->uniforms[n].v.buffer.text);
- }
sc->num_uniforms = 0;
}
@@ -711,15 +703,6 @@ void gl_sc_uniform_mat3(struct gl_shader_cache *sc, char *name,
transpose3x3(&u->v.f[0]);
}
-void gl_sc_uniform_buffer(struct gl_shader_cache *sc, char *name,
- const char *text, int binding)
-{
- struct sc_uniform *u = find_uniform(sc, name);
- u->type = UT_buffer;
- u->v.buffer.text = talloc_strdup(sc, text);
- u->v.buffer.binding = binding;
-}
-
// This will call glBindAttribLocation() on the shader before it's linked
// (OpenGL requires this to happen before linking). Basically, it associates
// the input variable names with the fields in the vao.
@@ -781,11 +764,6 @@ static void update_uniform(GL *gl, struct sc_entry *e, struct sc_uniform *u, int
}
}
break;
- case UT_buffer: {
- GLuint idx = gl->GetUniformBlockIndex(e->gl_shader, u->name);
- gl->UniformBlockBinding(e->gl_shader, idx, u->v.buffer.binding);
- break;
- }
default:
abort();
}
@@ -954,11 +932,7 @@ void gl_sc_gen_shader_and_reset(struct gl_shader_cache *sc)
ADD_BSTR(frag, *frag_vaos);
for (int n = 0; n < sc->num_uniforms; n++) {
struct sc_uniform *u = &sc->uniforms[n];
- if (u->type == UT_buffer) {
- ADD(frag, "uniform %s { %s };\n", u->name, u->v.buffer.text);
- } else {
- ADD(frag, "uniform %s %s;\n", u->glsl_type, u->name);
- }
+ ADD(frag, "uniform %s %s;\n", u->glsl_type, u->name);
}
// Additional helpers.
diff --git a/video/out/opengl/utils.h b/video/out/opengl/utils.h
index 33e66cd3de..9b4fd8471d 100644
--- a/video/out/opengl/utils.h
+++ b/video/out/opengl/utils.h
@@ -165,8 +165,6 @@ void gl_sc_uniform_mat2(struct gl_shader_cache *sc, char *name,
bool transpose, GLfloat *v);
void gl_sc_uniform_mat3(struct gl_shader_cache *sc, char *name,
bool transpose, GLfloat *v);
-void gl_sc_uniform_buffer(struct gl_shader_cache *sc, char *name,
- const char *text, int binding);
void gl_sc_set_vao(struct gl_shader_cache *sc, struct gl_vao *vao);
void gl_sc_enable_extension(struct gl_shader_cache *sc, char *name);
void gl_sc_gen_shader_and_reset(struct gl_shader_cache *sc);