Benjamin Otte
6a60e335cd
vulkan: Add push constants to fragment shader
...
That way we don't need to move the clip rounded rect manually through
the vertex shader into the fragment shader but can just look at the push
constants.
Simplifies shaders a lot.
2017-01-17 06:17:55 +01:00
Benjamin Otte
c7d899c535
vulkan: Move push constants into their own header
...
This is the first step towards easing maintenance of the Vulkan shaders
by moving common code into headers.
2017-01-17 06:17:55 +01:00
Benjamin Otte
b186bce7ff
vulkan: Add shader for border rendering
2017-01-11 18:33:09 +01:00
Benjamin Otte
f05f0377df
vulkan: Modernize blend pipeline
...
- Rename from blit => blend
- Use instances
- Add clip versions
2017-01-04 13:22:57 +01:00
Benjamin Otte
1aa0f79e8b
vulkan: Make the effect renderer take matrix + offset
...
This is in preparation for the new color matrix node.
I don't think keeping support for a separate opacity shader is worth it.
2016-12-31 14:37:20 +01:00
Benjamin Otte
91741f6b63
vulkan: Handle opacity nodes
...
Well, "handle" them actually. We still draw the node's child using
Cairo, but we apply the opacity manually now.
2016-12-31 02:49:47 +01:00
Benjamin Otte
af917c4ade
vulkan: Handle linear gradients
...
Note: We interpolate premultiplied colors as per the CSS spec. This i
different from Cairo, which interpolates unpremultiplied.
So in testcases with translucent gradients, it's actually Cairo that is
wrong.
2016-12-26 17:22:02 +01:00
Benjamin Otte
3c8518dce3
gsk: Add missing Mozilla copyright header
...
I stole one of their shader functions, and if I steal, I might as well
do it right.
2016-12-26 17:22:01 +01:00
Benjamin Otte
5878f9d8af
vulkan: Add shader for color drawing with rectangle clip
2016-12-25 06:23:12 +01:00
Benjamin Otte
b30225e67c
vulkan: We use VK_FORMAT_B8G8R8A8_UNORM
...
... not SRGB. SRGB messes up alpha compositing, GdkRGBA and everything
else.
2016-12-25 06:23:12 +01:00
Benjamin Otte
aa0ec774bf
vulkan: Add proof-of-concept clip implementation
...
We can now clip to cicular rounded rectangles when drawing colors.
2016-12-24 06:19:16 +01:00
Benjamin Otte
81c487b841
vulkan: Fold clip into push constants
...
As a side effect, the clipping data is now available inside shaders.
Not that any shader would use them yet, but they could!
2016-12-24 06:19:16 +01:00
Benjamin Otte
1760e0d3f3
vulkan: Get rid of color in push constants
...
The color comes in instance data now, no need to abuse push constants
for it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
b04eecf860
vulkan: Pass color rects in instance data
...
This way, we don't need push constants or per-vertex data, we can render
colored rectangles completely via instance data.
2016-12-20 18:01:11 +01:00
Benjamin Otte
4c74695a85
vulkan: Don't pass texture coordinates to the color pipeline
2016-12-20 18:01:11 +01:00
Benjamin Otte
08a2a29c26
vulkan: Add infrastructure for multiple pipelines
...
And use it to draw solid colors with a 2nd pipeline.
2016-12-20 18:01:11 +01:00
Benjamin Otte
583956266e
vulkan: Make MVP matrix available to vertex shader
...
We use push constants for this.
2016-12-09 18:35:51 +01:00
Benjamin Otte
3c4b952256
vulkan: Make GskVulkanRenderer work
...
We now create a Cairo renderer, render to an image surface and upload
and retnder it with Vulkan.
2016-12-09 18:35:51 +01:00
Benjamin Otte
a7cbbaf8fc
gsk: Pass texture coordinates to Vulkan renderer
...
We just render the coordinates as color, we don't do anything with them
yet.
2016-12-09 18:35:51 +01:00
Benjamin Otte
2a0e7f8829
gsk: Loads of work on Vulkan backend
...
We can now upload vertices.
And we use this to draw a yellow background. Which is clearly superior
to not drawing anything.
Also, we have shaders now. If you modify them, you need glslc installed
so they can be recompiled into Spir-V bytecode.
2016-12-09 18:35:51 +01:00