[PATCH weston v2 00/16] Fix pixman-renderer cropping

Bill Spitzak spitzak at gmail.com
Tue Mar 10 15:44:15 PDT 2015


Yea looks like you are right. I thought the matrix in the vertex shader 
was a final output one, but it is instead the projection to clipping 
space. I would suspect even if you could mess with whatever is done to 
convert clipping space to pixel space would just make it clip at the 
wrong location, for instance it would clip everything outside the 
lower-left pixel if it was possible to make the matrix translate to pixels.

On 03/10/2015 01:45 PM, Jason Ekstrand wrote:
>
>
> On Tue, Mar 10, 2015 at 12:51 PM, Bill Spitzak <spitzak at gmail.com
> <mailto:spitzak at gmail.com>> wrote:
>
>     This all looks really good to me.
>
>     It is possible to avoid "GL coordinates" even in GL. Set the
>     projection matrix to an ortho matrix:
>
>        glMatrixMode(GL_PROJECTION);
>        glLoadIdentity()
>        glOrtho(0, width, height, 0, -1, 1);
>        glTranslate(-width/2, -height/2, 0);
>        glMatrixMode(GL_MODELVIEW);
>
>     I remember in our code we did this by directly with glLoadMatrix.
>     This avoided any error with how the center was calculated, and made
>     the Z output to be zero. However I am unsure if that is portable to
>     all devices.
>
>     This would reduce the number of coordinate spaces you need to think
>     about.
>
>
> Except weston's GL render is GLES2 which doesn't have a matrix stack...
>


More information about the wayland-devel mailing list