[virglrenderer-devel] [PATCH] shader: Invert y coordonate if we use gles

Gert Wollny gert.wollny at collabora.com
Fri Apr 27 15:48:56 UTC 2018


Am Freitag, den 27.04.2018, 13:48 +0100 schrieb Elie Tournier:
> Hello,
> 
> This patch is still unreviewed.
> Comments are welcome.
> 
> Elie

A few nitpicks: 

> On Fri, Apr 20, 2018 at 05:17:47PM +0100, Elie Tournier wrote:
> > OpenGL ES didn't support GL_POINT_SPRITE_COORD_ORIGIN.
doesn't 

> > So when we read from an fbo, the image is upside down.
from a fbo

> > This patch invert the y coordonate.
inverts 

I'd change the initial line (and subject of th email) to 

   ".. if we use gles on the host"

and add a comment why the coordinate is flipped at all. Considering
that both the guest and the host use gles this is quite surprising.  

Otherwise the patch looks okay to me, and it does what it promises,
hence:

Tested-by: Gert Wollny <gert.wollny at collabora.com>


> > Fixes: dEQP-GLES2.functional.shaders.builtin_variable.pointcoord
> > 
> > Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
> > ---
> >  src/vrend_shader.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/vrend_shader.c b/src/vrend_shader.c
> > index bab603e..f7f3b86 100644
> > --- a/src/vrend_shader.c
> > +++ b/src/vrend_shader.c
> > @@ -415,7 +415,10 @@ iter_declaration(struct tgsi_iterate_context
> > *iter,
> >        case TGSI_SEMANTIC_GENERIC:
> >           if (iter->processor.Processor == TGSI_PROCESSOR_FRAGMENT)
> > {
> >              if (ctx->key->coord_replace & (1 << ctx-
> > >inputs[i].sid)) {
> > -               name_prefix = "vec4(gl_PointCoord, 0.0, 1.0)";
> > +               if (ctx->cfg->use_gles)
> > +                  name_prefix = "vec4(gl_PointCoord.x, 1.0 -
> > gl_PointCoord.y, 0.0, 1.0)";
> > +               else
> > +                  name_prefix = "vec4(gl_PointCoord, 0.0, 1.0)";
> >                 ctx->inputs[i].glsl_predefined_no_emit = true;
> >                 ctx->inputs[i].glsl_no_index = true;
> >                 break;
> > -- 
> > 2.17.0
> > 
> 
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel


More information about the virglrenderer-devel mailing list