[PATCH 06/10] glamor: Add infrastructure for generating shaders on the fly

Keith Packard keithp at keithp.com
Thu Mar 20 15:30:22 PDT 2014


Markus Wick <markus at selfnet.de> writes:

> First, I like to have some common functions to compile our shaders, bind 
> common uniforms, defining common headers, ...
> But tbh I don't see why it's easier to split up the glsl source 
> completely. Most shaders aren't more than 5 loc, so they are easier to 
> read entirely.
> In dolphin, we've a common glsl "header" which is prepended for every 
> shader and all common functions are defined there. Wouldn't such a 
> "framework" be enough?

It's a hard trade-off -- the current code has the advantage of
separating out the fill code from the geometry code, which makes things
like tiled text 'free' to implement, which seems like a feature to me.

>> +     * To get GL_POINTS drawn in the right spot, we need to adjust the
>> +     * coordinates by 1/2 a pixel. This doesn't hurt rectangles at
>> +     * all, so we just always do it. If we need to change someday, we
>> +     * can add a parameter to this function
>
> This does hurt. Points must be placed on pixel center, but polygon 
> border on pixel center is undefined behavoir.
> Hopefully we won't render lines. I guess for horizontal lines, x must be 
> on pixel border and y on pixel center...

Eric mentioned this and I've added a parameter which does this now.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140320/70cd2ac6/attachment.sig>


More information about the xorg-devel mailing list