[vlc-commits] opengl: simplify pf_prepare_shader()
Romain Vimont
git at videolan.org
Wed May 20 14:55:52 CEST 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Wed Feb 5 15:20:37 2020 +0100| [2f830657efa9251169264eaa580d57e57b538ffb] | committer: Alexandre Janniaux
opengl: simplify pf_prepare_shader()
Remove tex_width and tex_height parameters, as they are either unused or
accessible from the sampler itself.
Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f830657efa9251169264eaa580d57e57b538ffb
---
modules/video_output/opengl/fragment_shaders.c | 14 ++++----------
modules/video_output/opengl/renderer.c | 3 +--
modules/video_output/opengl/sampler.h | 6 +-----
3 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index a15bca319c..68b12ae4e7 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -277,11 +277,8 @@ GetTransformMatrix(const struct vlc_gl_interop *interop)
}
static void
-sampler_base_prepare_shader(const struct vlc_gl_sampler *sampler,
- const GLsizei *tex_width,
- const GLsizei *tex_height)
+sampler_base_prepare_shader(const struct vlc_gl_sampler *sampler)
{
- (void) tex_width; (void) tex_height;
const struct vlc_gl_interop *interop = sampler->interop;
const opengl_vtable_t *vt = sampler->vt;
@@ -310,8 +307,8 @@ sampler_base_prepare_shader(const struct vlc_gl_sampler *sampler,
if (interop->tex_target == GL_TEXTURE_RECTANGLE)
{
for (unsigned i = 0; i < interop->tex_count; ++i)
- vt->Uniform2f(sampler->uloc.TexSize[i], tex_width[i],
- tex_height[i]);
+ vt->Uniform2f(sampler->uloc.TexSize[i], sampler->tex_width[i],
+ sampler->tex_height[i]);
}
#ifdef HAVE_LIBPLACEBO
@@ -376,11 +373,8 @@ sampler_xyz12_fetch_locations(struct vlc_gl_sampler *sampler, GLuint program)
}
static void
-sampler_xyz12_prepare_shader(const struct vlc_gl_sampler *sampler,
- const GLsizei *tex_width,
- const GLsizei *tex_height)
+sampler_xyz12_prepare_shader(const struct vlc_gl_sampler *sampler)
{
- (void) tex_width; (void) tex_height;
const struct vlc_gl_interop *interop = sampler->interop;
const opengl_vtable_t *vt = sampler->vt;
diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c
index f544198345..6dd2684683 100644
--- a/modules/video_output/opengl/renderer.c
+++ b/modules/video_output/opengl/renderer.c
@@ -831,8 +831,7 @@ static void DrawWithShaders(struct vlc_gl_renderer *renderer)
{
struct vlc_gl_sampler *sampler = renderer->sampler;
const opengl_vtable_t *vt = renderer->vt;
- sampler->pf_prepare_shader(sampler, sampler->tex_width,
- sampler->tex_height);
+ sampler->pf_prepare_shader(sampler);
vt->BindBuffer(GL_ARRAY_BUFFER, renderer->texture_buffer_object);
assert(renderer->aloc.PicCoordsIn != -1);
diff --git a/modules/video_output/opengl/sampler.h b/modules/video_output/opengl/sampler.h
index c295083df2..7ef2d950c3 100644
--- a/modules/video_output/opengl/sampler.h
+++ b/modules/video_output/opengl/sampler.h
@@ -109,12 +109,8 @@ struct vlc_gl_sampler {
* specify values of uniform variables.
*
* \param sampler the sampler
- * \param tex_width array of tex width (one per plane)
- * \param tex_height array of tex height (one per plane)
*/
- void (*pf_prepare_shader)(const struct vlc_gl_sampler *sampler,
- const GLsizei *tex_width,
- const GLsizei *tex_height);
+ void (*pf_prepare_shader)(const struct vlc_gl_sampler *sampler);
};
/**
More information about the vlc-commits
mailing list