[vlc-commits] opengl: rename "prepare_shader" callback to "load"
Romain Vimont
git at videolan.org
Mon Jun 15 17:39:08 CEST 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Thu Jun 4 11:52:15 2020 +0200| [0b18d8bda35f38d54d7a8d9b864bbcbe2a1bde6f] | committer: Alexandre Janniaux
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.
In addition, the name "load" also allows to possibly add an "unload"
function later (to reset bindings).
Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b18d8bda35f38d54d7a8d9b864bbcbe2a1bde6f
---
modules/video_output/opengl/renderer.c | 4 ++--
modules/video_output/opengl/sampler.c | 8 ++++----
modules/video_output/opengl/sampler.h | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c
index aa10d1f8bb..6a778ce350 100644
--- a/modules/video_output/opengl/renderer.c
+++ b/modules/video_output/opengl/renderer.c
@@ -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);
diff --git a/modules/video_output/opengl/sampler.c b/modules/video_output/opengl/sampler.c
index 6a7f75fcb6..e8402dd95b 100644
--- a/modules/video_output/opengl/sampler.c
+++ b/modules/video_output/opengl/sampler.c
@@ -316,7 +316,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);
@@ -409,7 +409,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;
@@ -436,7 +436,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;
@@ -838,7 +838,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;
diff --git a/modules/video_output/opengl/sampler.h b/modules/video_output/opengl/sampler.h
index 9eec401490..b8439b004b 100644
--- a/modules/video_output/opengl/sampler.h
+++ b/modules/video_output/opengl/sampler.h
@@ -94,7 +94,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.
@@ -102,7 +102,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
@@ -112,9 +112,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
More information about the vlc-commits
mailing list