[vlc-devel] [PATCH V2] opengl: Addition of XYZ to RGB conversion in GLSL
Ilkka Ollakka
ileoo at videolan.org
Sat Jun 29 11:32:24 CEST 2013
On Thu, Jun 27, 2013 at 09:48:16AM +0200, Nicolas Bertrand wrote:
Hi, thanks for the patch
> ---
> modules/video_output/opengl.c | 75 ++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 67 insertions(+), 8 deletions(-)
These could be on their own patch, as they aren't directly to the shader
part of XYZ?
> @@ -923,10 +977,15 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
> {
> vgl->UseProgram(vgl->program[program]);
> if (program == 0) {
> - vgl->Uniform4fv(vgl->GetUniformLocation(vgl->program[0], "Coefficient"), 4, vgl->local_value);
> - vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture0"), 0);
> - vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture1"), 1);
> - vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture2"), 2);
> + if (vgl->chroma->plane_count == 3) {
> + vgl->Uniform4fv(vgl->GetUniformLocation(vgl->program[0], "Coefficient"), 4, vgl->local_value);
> + vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture0"), 0);
> + vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture1"), 1);
> + vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture2"), 2);
> + }
> + else if (vgl->chroma->plane_count == 1) {
> + vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[0], "Texture0"), 0);
> + }
> } else {
> vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[1], "Texture0"), 0);
> vgl->Uniform4f(vgl->GetUniformLocation(vgl->program[1], "FillColor"), 1.0f, 1.0f, 1.0f, 1.0f);
> @@ -1001,7 +1060,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
> }
> #ifdef SUPPORTS_SHADERS
> - if (vgl->program[0] && vgl->chroma->plane_count == 3)
> + if (vgl->program[0] && (vgl->chroma->plane_count == 3 || vgl->chroma->plane_count == 1))
> DrawWithShaders(vgl, left, top, right, bottom, 0);
> else if (vgl->program[1] && vgl->chroma->plane_count == 1)
> DrawWithShaders(vgl, left, top, right, bottom, 1);
--
Ilkka Ollakka
Everything bows to success, even grammar.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130629/6f8640ae/attachment.sig>
More information about the vlc-devel
mailing list