Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The next phase of shader cleanup #106

Merged
merged 5 commits into from Sep 10, 2014
Merged

Conversation

@mrobinson
Copy link
Member

mrobinson commented Sep 6, 2014

In preparation for proper support for "masks to bounds" clean up the shader code. This will make it easier to fiddle with the vertex coordinates.

@mrobinson mrobinson changed the title Clean up shader code some more The next phase of shader cleanup Sep 10, 2014
@mrobinson mrobinson force-pushed the mrobinson:shader-cleanup branch from f25cced to 72f810e Sep 10, 2014
@pcwalton
Copy link
Contributor

pcwalton commented Sep 10, 2014

r=me modulo a couple of uber-nits.

mrobinson added 5 commits Sep 6, 2014
Share most of the code between rectangular and texture programs by
using a texture space transformation which modifies texture coordinates
per-vertex. This also allows the elimination of the flipped texture
coordinates, further simplifying things. This is a preliminary step
to make it easier to implement masking to layer boundaries.
This simplifies things slightly and better encapsulates the shared
logic of shaders.
Things seem to function properly without this, but this is more correct.
The z-coordinate is always 0, so we can just make it a constant in the
shader. This should result in less data streaming to the GPU when the
vertex coordinates change with clipping support.
This can always be inferred from the unit rectangle coordinates, so we
simply omit them from the list of attributes passed to the shader.
@mrobinson mrobinson force-pushed the mrobinson:shader-cleanup branch from 72f810e to d14f4de Sep 10, 2014
mrobinson added a commit that referenced this pull request Sep 10, 2014
The next phase of shader cleanup
@mrobinson mrobinson merged commit 254c76c into servo:master Sep 10, 2014
@mrobinson mrobinson deleted the mrobinson:shader-cleanup branch Sep 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.