Commit 679151f3 authored by Romain Vimont's avatar Romain Vimont
Browse files

opengl: rename "prepare_shader" callback to "load"

The purpose of this callback is to load sampler data (bind textures,
load uniforms, etc.) to be used for the OpenGL draw call.

The name "load" also allows to possibly add an "unload" function later
(to reset bindings).
parent 81ea5b7b
......@@ -249,7 +249,7 @@ opengl_link_program(struct vlc_gl_renderer *renderer)
assert(sampler->ops &&
sampler->ops->fetch_locations &&
sampler->ops->prepare_shader);
sampler->ops->load);
GLuint program_id =
vlc_gl_BuildProgram(VLC_OBJECT(renderer->gl), vt,
......@@ -739,7 +739,7 @@ vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer)
vt->UseProgram(renderer->program_id);
vlc_gl_sampler_PrepareShader(renderer->sampler);
vlc_gl_sampler_Load(renderer->sampler);
vt->BindBuffer(GL_ARRAY_BUFFER, renderer->texture_buffer_object);
assert(renderer->aloc.PicCoordsIn != -1);
......
......@@ -315,7 +315,7 @@ GetTransformMatrix(const struct vlc_gl_interop *interop)
}
static void
sampler_base_prepare_shader(const struct vlc_gl_sampler *sampler)
sampler_base_load(const struct vlc_gl_sampler *sampler)
{
struct vlc_gl_sampler_priv *priv = PRIV(sampler);
......@@ -408,7 +408,7 @@ sampler_xyz12_fetch_locations(struct vlc_gl_sampler *sampler, GLuint program)
}
static void
sampler_xyz12_prepare_shader(const struct vlc_gl_sampler *sampler)
sampler_xyz12_load(const struct vlc_gl_sampler *sampler)
{
struct vlc_gl_sampler_priv *priv = PRIV(sampler);
const struct vlc_gl_interop *interop = priv->interop;
......@@ -435,7 +435,7 @@ xyz12_shader_init(struct vlc_gl_sampler *sampler)
{
static const struct vlc_gl_sampler_ops ops = {
.fetch_locations = sampler_xyz12_fetch_locations,
.prepare_shader = sampler_xyz12_prepare_shader,
.load = sampler_xyz12_load,
};
sampler->ops = &ops;
......@@ -834,7 +834,7 @@ opengl_fragment_shader_init(struct vlc_gl_sampler *sampler, GLenum tex_target,
static const struct vlc_gl_sampler_ops ops = {
.fetch_locations = sampler_base_fetch_locations,
.prepare_shader = sampler_base_prepare_shader,
.load = sampler_base_load,
};
sampler->ops = &ops;
......
......@@ -89,7 +89,7 @@ struct vlc_gl_sampler_ops {
(*fetch_locations)(struct vlc_gl_sampler *sampler, GLuint program);
/**
* Callback to prepare the fragment shader
* Callback to load sampler data
*
* This function pointer cannot be NULL. This callback can be used to
* specify values of uniform variables.
......@@ -97,7 +97,7 @@ struct vlc_gl_sampler_ops {
* \param sampler the sampler
*/
void
(*prepare_shader)(const struct vlc_gl_sampler *sampler);
(*load)(const struct vlc_gl_sampler *sampler);
};
static inline void
......@@ -107,9 +107,9 @@ vlc_gl_sampler_FetchLocations(struct vlc_gl_sampler *sampler, GLuint program)
}
static inline void
vlc_gl_sampler_PrepareShader(const struct vlc_gl_sampler *sampler)
vlc_gl_sampler_Load(const struct vlc_gl_sampler *sampler)
{
sampler->ops->prepare_shader(sampler);
sampler->ops->load(sampler);
}
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment