Commit Graph

809 Commits

Author SHA1 Message Date
Timm Bäder
352590cf9f gl driver: Remove vao API
Unused.
2017-12-29 05:48:43 +01:00
Timm Bäder
825608af2a gl renderer: Remove unused parameter 2017-12-29 05:48:43 +01:00
Timm Bäder
4abbf929ad gl renderer: Remove some unused uniforms from shader 2017-12-29 05:48:42 +01:00
Timm Bäder
aeaab5557b gl renderer: Only draw what we have to 2017-12-29 05:48:42 +01:00
Timm Bäder
2bc10fa365 gl renderer: draw all outset shadows
Instead of falling back to cairo for most of them.
2017-12-29 05:48:40 +01:00
Timm Bäder
9f2674077a gl renderer: Properly flip texture in render_texture path
Just do this on the CPU instead.
2017-12-28 16:48:35 +01:00
Timm Bäder
a720a63fa3 gl renderer: Insert render target op in render_texture path 2017-12-28 16:48:35 +01:00
Timm Bäder
7a2d30323e gl renderer: try doing outset box shadows
Still fall back in cases we can't handle that way.
2017-12-21 19:12:33 +01:00
Timm Bäder
d211f42091 gl renderer: Remove unused vertex shader 2017-12-21 19:12:32 +01:00
Timm Bäder
f044b01549 gl renderer: Don't crash if the first op is an opacity one 2017-12-21 19:12:32 +01:00
Timm Bäder
490e15021c gl renderer: Force cross-fade nodes offscreen 2017-12-21 19:12:32 +01:00
Timm Bäder
48be2aed23 gl renderer: Use one function per op type to apply data 2017-12-21 19:12:32 +01:00
Timm Bäder
28499032da gl renderer: Don't leak gl resources 2017-12-21 19:12:32 +01:00
Timm Bäder
ee27b17a12 gl renderer: Fix indentation mishap 2017-12-21 19:12:32 +01:00
Timm Bäder
a83037c440 gl renderer: Implement cross fade nodes 2017-12-21 19:12:32 +01:00
Timm Bäder
bed03aa319 gl renderer: Fix linear gradient shader color calculation
This fixes both the wrong headerbar color and the broken border color in
of the circular button in the widget-factory.
2017-12-21 19:12:32 +01:00
Timm Bäder
eb221ff305 gl renderer: Only take glyph texture alpha into account
This way, we can use the very same coloring program to draw text shadows
of fonts with colored glyphs.
2017-12-21 19:12:32 +01:00
Timm Bäder
075e6ac266 gl renderer: Fix shadow nodes if the child is a container 2017-12-21 19:12:32 +01:00
Timm Bäder
18e7d777a2 gl renderer: Move declarations to the beginning of the block 2017-12-21 19:12:32 +01:00
Timm Bäder
e9be72a73e gl renderer: Fix use of uninitialized values 2017-12-21 19:12:32 +01:00
Timm Bäder
33457b4035 gl renderer: Ensure texture sizes arent 0
We already ceil() the given float texture sizes here, so if they are
valid, the result should definitely be > 0. Textures with size 0 can't
be properly used, especially not as render targets, where they will
trigger an assertion failure later in a glCheckFramebuffer call.
2017-12-21 19:12:32 +01:00
Timm Bäder
49c7cf36e4 gl renderer: Fix inset and outset shadows in hidpi 2017-12-21 19:12:32 +01:00
Timm Bäder
b03f08960b gl renderer: Fix cairo node surface size in hidpi 2017-12-21 19:12:32 +01:00
Timm Bäder
d9e135dcb5 gl renderer: Fix rounded clips in hidpi 2017-12-21 19:12:32 +01:00
Timm Bäder
3411e648b4 gl renderer: Handle borders in hidpi better 2017-12-21 19:12:32 +01:00
Timm Bäder
64400e82b5 gl renderer: Default to 0px clip and border radius
Finally fix the division by 0 in the clip code.
2017-12-21 19:12:32 +01:00
Timm Bäder
703c4cf003 gl renderer: Ignore render ops before we have a valid program 2017-12-21 19:12:32 +01:00
Timm Bäder
2d3e87da46 gl renderer: Try to fix border rendering 2017-12-21 19:12:32 +01:00
Timm Bäder
a59f380d31 gl renderer: Use one function per node-type
So a profiler can actually tell me what's slow and not just point at
_add_render_ops in all cases.
2017-12-21 19:12:32 +01:00
Timm Bäder
ab53ee7377 gl renderer: Don't render opacity nodes offscreen
We already drag a u_alpha uniform around in every shader, so use that
one.
2017-12-21 19:12:32 +01:00
Timm Bäder
fd0b7caa7c gl renderer: Fix shadow shader
We need to take the alpha of the shadow color into account as well.
2017-12-21 19:12:32 +01:00
Timm Bäder
476450b93e gl renderer: Ignore shadow color matrix nodes...
... if the color matrix nodes don't touch the child alpha.
2017-12-21 19:12:32 +01:00
Timm Bäder
98ba28b5d7 gl renderer: Add a helper function
We'll use this for the common case of a color matrix node inside a
shadow node.
2017-12-21 19:12:32 +01:00
Timm Bäder
49785974cf gl renderer: Don't zero initialize render ops GArray 2017-12-21 19:12:32 +01:00
Timm Bäder
7cc868910b gl renderer: Avoid crashing tooltips 2017-12-21 19:12:31 +01:00
Timm Bäder
39a241b763 gl renderer: Sort border sides by color 2017-12-21 19:12:31 +01:00
Timm Bäder
c9af94f6db gl renderer: Keep track of border program state 2017-12-21 19:12:31 +01:00
Timm Bäder
f978bf057f gl renderer: Avoid using a new modelview for shadow nodes
We can just move the vertex data directly.
2017-12-21 19:12:31 +01:00
Timm Bäder
7ad8f211c6 gl renderer: Default to GL_LINEAR scaling filters 2017-12-21 19:12:31 +01:00
Timm Bäder
5cdd46e38e gl renderer: Remove superfluous modelview matrix changes 2017-12-21 19:12:31 +01:00
Timm Bäder
1fce25c7af gl renderer: Remove unused struct member 2017-12-21 19:12:31 +01:00
Timm Bäder
9479bb6bfc gl renderer: Keep track of color matrix op state 2017-12-21 19:12:31 +01:00
Timm Bäder
b33d85b594 gl renderer: Avoid consecutive opacity ops 2017-12-21 19:12:31 +01:00
Timm Bäder
a0e033b2cd gl renderer: Define debug structs inline 2017-12-21 19:12:31 +01:00
Timm Bäder
5d0c279351 gl renderer: Add more detailed render op output 2017-12-21 19:12:31 +01:00
Timm Bäder
7831d9a463 gl renderer: Only draw blurred shadow nodes once 2017-12-21 19:12:31 +01:00
Timm Bäder
7dc6a46cff gl renderer: Remove consecutive clip ops 2017-12-21 19:12:31 +01:00
Timm Bäder
bb69d64a0f gl renderer: Rename a macro 2017-12-21 19:12:31 +01:00
Timm Bäder
8463040ad1 gl renderer: Fix debugging output 2017-12-21 19:12:31 +01:00
Timm Bäder
3b7cfd068b gl renderer: Implement simple border nodes 2017-12-21 19:12:31 +01:00
Timm Bäder
8089cde977 gl renderer: Don't render unblurred text shadows to a texture
We can do the same thing by simply drawing the text in the given shadow
color.
2017-12-21 19:12:31 +01:00
Timm Bäder
d5a759652f gl renderer: Split out text rendering function
We'll use that for text shadow nodes
2017-12-21 19:12:31 +01:00
Timm Bäder
e95b356465 gl renderer: Implement simple shadow nodes 2017-12-21 19:12:31 +01:00
Timm Bäder
c524ac7bb5 gl renderer: Split out a utility function 2017-12-21 19:12:31 +01:00
Timm Bäder
8c9e203458 gl renderer: Fix inset shadow offset calculation 2017-12-21 19:12:31 +01:00
Timm Bäder
47c4bf5be0 gl renderer: Implement unblurred outset shadows 2017-12-21 19:12:31 +01:00
Timm Bäder
5c7838e168 gl renderer: Rework program creation
Make sure all uniform names have to match between the shader names and
the _location integers we save in every Program struct.
2017-12-21 19:12:31 +01:00
Timm Bäder
388157b995 gl renderer: Implement unblurred inset shadows 2017-12-21 19:12:31 +01:00
Timm Bäder
6a1a70c677 gl renderer: Implement blur nodes 2017-12-21 19:12:31 +01:00
Timm Bäder
ff1cacb54a gl renderer: Remove some unused members 2017-12-21 19:12:31 +01:00
Timm Bäder
19700fccb2 gl renderer: Keep track of current program color value 2017-12-21 19:12:31 +01:00
Timm Bäder
2865ab84a9 gl renderer: Don't draw texture nodes to a framebuffer
We don't need to create a texture from a texture node. We can simply use
its texture instead and draw it however we want.
2017-12-21 19:12:31 +01:00
Timm Bäder
e3264d5fd3 gl renderer: Implement color matrix nodes again 2017-12-21 19:12:31 +01:00
Timm Bäder
cb9c4e362c gl render ops: Rename a member 2017-12-21 19:12:31 +01:00
Timm Bäder
b56a7afd19 gl renderer: Factor out a helper function for offscreen drawing 2017-12-21 19:12:30 +01:00
Timm Bäder
95051e13c3 gl ops: Remove dead code
This is already checked further up in that function
2017-12-21 19:12:30 +01:00
Timm Bäder
832920c6ba gl renderer: Optimize text drawing
Text nodes will almost always end up using the exact same texture and
the same program. So, in that case we can simply add vertex data for all
the characters we need to draw and use just one draw call.
2017-12-21 19:12:30 +01:00
Timm Bäder
fa564e1f93 gl renderer: Remove unused VAO 2017-12-21 19:12:30 +01:00
Timm Bäder
d5eeb9d6f0 gl renderer: Stop collecting VAOs in clear_tree
We don't use that part of the gl driver anymore.
2017-12-21 19:12:30 +01:00
Timm Bäder
6606c1f682 gl renderer: Only check for color glyphs once per text node
It does not depend on the glyph, so no need to do it once for every
glyph.
2017-12-21 19:12:30 +01:00
Timm Bäder
5615fd26c2 gl renderer: Implement cairo nodes again 2017-12-21 19:12:30 +01:00
Timm Bäder
a1d3e77347 gl renderer: Move render ops into separate file 2017-12-21 19:12:30 +01:00
Timm Bäder
823369f275 gsk: Move all gskgl* files into gl/ 2017-12-21 19:12:30 +01:00
Timm Bäder
358c139a43 gl renderer: Rework once more
Last time, I swear.
2017-12-21 19:12:30 +01:00
Timm Bäder
dd1a9745db gl renderer: Don't initialize modelview matrix twice 2017-12-21 19:12:30 +01:00
Timm Bäder
59a7584386 gl renderer: Group render node types by render item creation 2017-12-21 19:12:30 +01:00
Timm Bäder
f4304336ea gl renderer: Don't pass MVP to shaders
We already pass both modelview and projection matrix individually.
2017-12-21 19:12:30 +01:00
Timm Bäder
4cf2a482ea gl: Add glyph cache
Based on the one used by the vulkan renderer
2017-12-21 19:12:30 +01:00
Timm Bäder
3e23f6c22b gl renderer: Remove unused member 2017-12-21 19:12:30 +01:00
Timm Bäder
9b400134d5 gl renderer: Remove unused shaders 2017-12-21 19:12:30 +01:00
Timm Bäder
33aa61ef2c gl renderer: Save clip in every node 2017-12-21 19:12:30 +01:00
Timm Bäder
1f5fd4d564 gl renderer: Don't create framebuffer for texture opacity children
Slowly a pattern emerges...
2017-12-21 19:12:30 +01:00
Timm Bäder
24e69bb877 gl renderer: Implement rounded clip nodes
mostly a proof of concept
2017-12-21 19:12:30 +01:00
Timm Bäder
cd730ccff5 gl renderer: save on some frame buffers
If the child of a color matrix node is a texture, we can directly use
that instead of drawing it to a texture first and then using that
texture.
2017-12-21 19:12:30 +01:00
Timm Bäder
1d1c6a98ce GskGLDriver: Add profiler
Count the newly created textures, the reused ones and the uploads from
cairo surfaces per frame.
2017-12-21 19:12:30 +01:00
Timm Bäder
ddb77d6c9b GskGLDriver: Use float for texture size in create_texture
Render nodes can end up with bounds < 1 since they are floats, and the
implicit cast to int ends up creating a texture with 0 width or height.
Use ceil() instead in create_texture so we don't have to do that on the
caller side everywhere.
2017-12-21 18:25:52 +01:00
Timm Bäder
4aa3f51016 test-render-nodes: Add color matrix test 2017-12-21 18:25:52 +01:00
Timm Bäder
6bce14bee2 Rework the GL renderer 2017-12-21 18:25:52 +01:00
Timm Bäder
5fa5008ee9 gl renderer: Remove some unused code 2017-12-21 18:25:52 +01:00
Timm Bäder
fe7db31663 gl driver: Make some members const 2017-12-21 18:25:52 +01:00
Timm Bäder
b488329104 GskRenderer: Remove viewport property 2017-12-21 18:25:52 +01:00
Georges Basile Stavracas Neto
8993a51893 vulkan: Destroy buffer before releasing associate memory
Exact same issue as the previous commit.
2017-12-13 23:14:58 -02:00
Georges Basile Stavracas Neto
147a455171 vulkan: Destroy image before releasing associate memory
VkImage contains a reference to the VkDeviceMemory and, because
the current code frees the VkDeviceMemory before destroying the
VkImage that references it, a warning is triggered by the validation
layers.

This is not critical, since we release both resources at the same
place. But the warning triggered by the validation layers sums up
adding 1 MB per second of extra debug logging, making the debugging
process much more painful.

This commit simply swaps the destruction order, and destroys the
VkImage first, then the now unused VkDeviceMemory.
2017-12-13 22:49:16 -02:00
Benjamin Otte
52b1cd40d1 gsk: Remove gsk_render_node_set_scaling_filters()
This is a leftover from the very early rendernode that we forgot to delete.

This can be seen by the fact that it is settable on an immutable object.
2017-12-03 21:57:21 +01:00
Benjamin Otte
9048d40bc2 vulkan: Fix mask shader to premultiply color
The inColor wasn't premultiplied, so the resulting colors were wrong
with translucent borders.
2017-12-02 16:21:58 +01:00
Benjamin Otte
abc8d61730 vulkan: Fix border shader to premultiply color
The inColor wasn't premultiplied, so the resulting colors were wrong
with translucent borders.
2017-12-02 16:21:58 +01:00
Timm Bäder
34e233e1c3 GskVulkanGlyphCache: Remove unused struct member 2017-12-01 07:30:25 +01:00
Alexander Larsson
521b09cc96 broadway: Send diffs of node trees
Reusing pre-created nodes is a lot faster both in terms of
dom modifications and of transfer sizes.
2017-11-30 21:57:42 +01:00
Matthias Clasen
9b582db492 gsk: Quiet a compiler warning
We insist on handling all cases in a switch, nowadays.
2017-11-24 08:51:22 -05:00
Alexander Larsson
820f999f14 broadway: Disable fallback spew by default 2017-11-23 10:48:29 +01:00
Alexander Larsson
12d3cd8f29 broadway: Handle cairo nodes
This means we can directly upload these as textures, rather than
create a new surface and draw it into that. We still have to upload,
but there isn't a lot we can do about this as for these nodes
we generally redraw everything each time.
2017-11-23 10:48:29 +01:00
Alexander Larsson
4d1eca0d57 broadway: Handle texture gsd nodes 2017-11-23 10:48:29 +01:00
Alexander Larsson
b74959a605 broadway: Add clip node 2017-11-23 10:48:29 +01:00
Alexander Larsson
7a180f554d broadway: Don't log cache hits 2017-11-23 10:48:29 +01:00
Alexander Larsson
0d4a26f148 broadway: Cache color translated textures
These happen a lot due to the recolored symbolics
2017-11-23 10:48:29 +01:00
Alexander Larsson
9e5a22bbe5 broadway: Add opacity node 2017-11-23 10:48:29 +01:00
Alexander Larsson
9b1f6acc2b broadway: Add shadow node 2017-11-23 10:48:29 +01:00
Alexander Larsson
cbbbf49043 broadway: Add node cache for text 2017-11-23 10:48:29 +01:00
Alexander Larsson
278370c8e5 broadway: Add linear gradient node 2017-11-23 10:48:29 +01:00
Alexander Larsson
f7ff6dbb66 broadway: Add RoundedClip node 2017-11-23 10:48:29 +01:00
Alexander Larsson
0083c084e4 broadway: Add inset shadow 2017-11-23 10:48:29 +01:00
Alexander Larsson
35ceb8e626 broadway: Add outset shadow node 2017-11-23 10:48:29 +01:00
Alexander Larsson
cf03229a99 broadway: Add border node 2017-11-23 10:48:29 +01:00
Alexander Larsson
0b38ab339e broadway: Add color nodes 2017-11-23 10:48:29 +01:00
Alexander Larsson
f7d8ee041b broadway: Initial version of using actual render nodes 2017-11-23 10:48:29 +01:00
Alexander Larsson
23845a57a9 broadway: Add GskBroadwayRenderer
This is a custom renderer for broadway windows, although at the
moment it doesn't really do anything other than the old cairo
fallbacks.
2017-11-23 10:46:47 +01:00
Emmanuele Bassi
481b5d1b89 Partially revert GskTexture → GdkTexture rename
Excessive use of sed when moving GskTexture to GDK; the GskTextureNode
should still live under the GSK namespace.
2017-11-04 15:06:00 +00:00
Benjamin Otte
bd287ba3cf renderer: Assert having been unrealized in dispose
We cannot unrealize a renderer in the dispose function, because that
would cause this chain to happen:
  gsk_gl_renderer_dispose
  gsk_renderer_dispose
  gsk_renderer_unrealize
  gsk_gl_renderer_unrealize
So we would call into thje GL renderers unrealize when it has already
(partially) disposed itself and ause accesses to dead variables.
2017-11-04 15:22:25 +01:00
Benjamin Otte
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
2017-11-04 00:07:13 +01:00
Benjamin Otte
6b3d979196 gskgl: Deal with being rerealized 2017-11-01 15:48:00 +01:00
Matthias Clasen
ca7c148687 gsk: Apply scale factor for fallback rendering
This fixes blurry text and icons whenever we apply shadows
in a hidpi window. Shadow nodes are the last ones that we
still use fallback for, and this was causing us to render
the text blurry.
2017-10-28 14:38:49 -04:00
Matthias Clasen
439e1054c4 Triival cleanup
No need to go to the window, we store a copy of the scale factor
in the render pass object.
2017-10-28 14:38:21 -04:00
Matthias Clasen
a0bbd14325 gsk: Scale glyphs in the glyph cache
Pass a scale factor when caching glyphs or looking them
up in the cache. The glyphs in the cache are rendered
with subpixel precision determined by the scale. Update
all callers to pass a scale factor according to the window
scale. This lets us render crisp glyphs on hidpi systems.
2017-10-28 13:13:31 -04:00
Matthias Clasen
dc0570cc17 gsk: Drop the GskRenderer::scale-factor property
This is can always be obtained from the window that is already
associated with the renderer, no need to maintain a separate
property for it.
2017-10-28 11:49:39 -04:00
Matthias Clasen
ea91ab1d99 gsk: Make text nodes more compact
The copy of the PangoGlyphString we do here was showing up
in some profiles. To avoid it, allocate the PangoGlyphInfo array
as part of the node itself. Update all callers to deal with
the slight api change required for this.
2017-10-27 17:13:40 -04:00
Benjamin Otte
e1572e003a vulkan: No need to redefine gl_PerVertex
The compiler has those predefined, so use them.
2017-10-24 01:29:28 +02:00
Benjamin Otte
e4dbff6bfc vulkan: Delete unused shaders
These have been renamed to .frag/.vert, apparently the originals weren't
deleted.
2017-10-24 01:29:28 +02:00
Emmanuele Bassi
dd4c800542 Remove unnecessary const
We return a scalar value, so we don't need it to be constant.

https://bugzilla.gnome.org/show_bug.cgi?id=789351
2017-10-23 15:23:09 +01:00
Matthias Clasen
9e78fbaac4 Fix compiler warnings
I overlooked these when I recently did the render node api changes.
2017-10-21 15:17:36 +02:00
Matthias Clasen
e474e9e274 Remove some outdated information
Render nodes don't have transformations, currently.
Only transform nodes do.
2017-10-20 13:54:01 +02:00
Matthias Clasen
b76c5abb57 Tweak transform node apis
Rename the getter to follow the peek naming scheme.

Update all callers.
2017-10-20 13:54:01 +02:00
Matthias Clasen
04f6b26205 gsk: Tweak text node apis
Rename getters to follow the peek naming pattern.

Update all callers.
2017-10-20 13:54:01 +02:00
Matthias Clasen
243bd4f0c8 gsk: Tweak cairo node apis
Rename the surface getter to peek, following other render
node getters, and make the surface-based constructor private,
since it is not something we want to encourage.

Update all callers.
2017-10-20 13:54:01 +02:00
Matthias Clasen
eee89587c3 Make render node getter public
Keeping these private does not really buy us anything.
2017-10-20 13:54:01 +02:00
Matthias Clasen
b564dd853c Avoid super-luminous pixels
The color-matrix shader was creating pixels with r,g,b > a in
some cases, which leads to unexpected test failures. In particular
this as visible the opacity render node test for opacity 0.
2017-10-19 15:16:54 +02:00
Timm Bäder
af734c4007 rendernode: Don't leak mem_surface 2017-10-10 09:49:35 +02:00
Matthias Clasen
76aa237cce Fix blendmode shader
My reading of the spec formulas was imperfect.
2017-10-08 21:12:22 -04:00
Matthias Clasen
090ec2e56f Revise coordinate handling for blend nodes
This is the same change that was applied to cross-fade
nodes.
2017-10-08 20:06:33 -04:00
Matthias Clasen
5280a2c874 Revise the coordinate handling one more time
This makes the new reftests pass and hopefully does not
break other things.
2017-10-08 19:21:52 -04:00
Matthias Clasen
9a9aec05c0 vulkan: Fix cross-fade node coordinates
This is the same fix as was just committed for blendmode nodes.
2017-10-08 11:31:55 -04:00
Matthias Clasen
4d7b8f5a66 vulkan: Fix blendmode coordinate handling
We were node handling coordinates correctly when dealing
with differently sized child nodes in a blendmode node.
This was showing up in the gtk4-demo css blendmode example,
for blendmodes other than normal.
2017-10-08 09:02:35 -04:00
Matthias Clasen
fe6e80fdde vulkan: Fix repeat node coordinates
We were not treating non-trivial child bounds right at all.
This was visible in the css blendmode cmyk example in gtk4-demo,
for the normal blendmode.
2017-10-08 09:02:35 -04:00
Umang Jain
a933c7c4bd gsk: Move gsk_cairo_node_new_for_surface into public API
https://bugzilla.gnome.org/show_bug.cgi?id=788534
2017-10-08 18:22:34 +05:30
Umang Jain
74f8fc80d3 gsk: Fix serialization of cairo node
https://bugzilla.gnome.org/show_bug.cgi?id=788534
2017-10-08 18:22:34 +05:30
Matthias Clasen
b9b03cf570 gskrenderer: Make the window property not construct
We never set this, since it is assigned as a side-effect
of realizing the renderer. Make this a plain readonly property.
2017-10-06 19:29:42 -04:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Benjamin Otte
c1e9869329 build: Don't turn off critical warnings
-Wint-conversion is important because it checks casts from ints to
pointers.

-Wdiscarded-qualifiers is important to catch cases where we don't
strings when we should.
2017-10-06 16:03:08 +02:00
Matthias Clasen
3aaea0ef40 Clip intermediate textures
In some cases, we were creating gigantic intermediate textures
only to clip out a small section afterwards (e.g. in the listbox
example in gtk4-demo). This is wasteful if we apply effects on
the texture, such as blur or color-matrix. So, clip the dimensions
of the intermediate texture with the current clip. To make this
feasible, we move the texture coordinate computation out of the
pipeline setup functions into the node_as_texture function where
this clipping happens.

One extra complication we encounter is that the node might get
clipped away completely. Since Vulkan does not allow to create
empty images, we bail out in this case and not draw anything.

With these changes, the listbox example in gtk4-demo goes from
32M pixels of intermediate texture to 320000.
2017-10-01 19:22:04 -04:00
Matthias Clasen
4e33be124d Add a forgotten rename
When I renamed blend to texture, I overlooked that the color
text pipeline also uses this shader. Fix it.
2017-09-30 17:58:23 -04:00
Matthias Clasen
50bea37320 Reshuffle things a little bit
Instead of having a function with lots of arguments in
GskVulkanRender that we call from GskVulkanRenderPass which
then just calls back into GskVulkanRenderPass, just create
the new render pass object locally, and an api to add it
to the list that GskVulkanRender keeps. This makes it
a lot easier to preserve all the relevant parameters from
the parent render pass.
2017-09-30 17:58:23 -04:00
Matthias Clasen
983e0b7956 Small simplification
Just keep the viewport as a graphene_rect_t, we don't need
to use the Vulkan type here.
2017-09-30 17:58:23 -04:00
Matthias Clasen
4c29102753 vulkan: Add a counter for intermediate textures
Count how many pixels of intermediate textures we create.
If we can count it, we can optimize it.
2017-09-30 17:58:23 -04:00
Matthias Clasen
3a37440be6 Cosmetics
Factor out a helper function.
2017-09-30 17:58:23 -04:00
Matthias Clasen
52afccb6a3 Fix a doc comment
It was missing a return.
2017-09-30 17:58:23 -04:00
Matthias Clasen
836e18cc96 Support repeat nodes in vulkan
We can use the texture pipeline for this, with a repeating sampler.
2017-09-29 23:08:14 -04:00
Matthias Clasen
31d8fe3a6a vulkan: Add a repeating sampler
None of the render ops use it, yet.
2017-09-29 23:08:14 -04:00
Matthias Clasen
e382f956f3 vulkan: Move sampler creation down
This is in preparation of allowing multiple samplers.
2017-09-29 23:08:14 -04:00
Matthias Clasen
5577fde990 vulkan: Rename blend pipeline to texture
This is what it does, and the name blend is easily
confused with blend-mode.
2017-09-29 23:08:09 -04:00
Matthias Clasen
538e7c7982 vulkan: Allow to control scaling in the blend pipeline
Pass in a second rect that defines the size of the texture.
Update the sole caller to pass in the same rect, for unchanged
behavior.
2017-09-29 22:12:25 -04:00
Matthias Clasen
e91051a562 vulkan: Fix setup for dependent render passes
We were not correctly preserving the modelview transform.
2017-09-29 15:58:16 -04:00
Matthias Clasen
9e2e6c1115 gsk: Fix a typo
Repeating linear gradient nodes share most of the implementation
with linear gradient nodes, but they shouldn't share the class name.
2017-09-28 21:06:52 -04:00
Matthias Clasen
e45ab76664 gsk: remove gsk_blend_node_get_blend_mode from public api
We don't have any other such getters in the public api at
this point, so leave this one out as well.
2017-09-28 19:39:16 -04:00
Matthias Clasen
535529ca98 vulkan: Measure gpu time
Since this value is only meaningful if we wait for the rendering
to end, we only keep this timer if GSK_RENDERING_MODE=sync is
enabled.
2017-09-28 10:29:16 -04:00
Matthias Clasen
72d043d51f gsk: Change the profiler setup
Move away from the idea of intra-frame sampling, since we only
push samples once per frame, anyway. Instead, make the profiler
keep a rolling average of the last n frames.
2017-09-28 10:26:01 -04:00
Matthias Clasen
767966933d gsk: Redo the sampling in the profiler
Reset the min/max/average counters before calculating,
and only print the values if we have samples. In addition,
print the number of samples.
2017-09-28 10:25:49 -04:00
Matthias Clasen
4d8e7d71ca gsk: Add a profile counter for vulkan render passes
This is interesting now that we have multiple render passes.
2017-09-28 08:39:22 -04:00
Matthias Clasen
d61a715909 vulkan: Implement multiple render passes
Whenever we need a node as a texture, we now start a new render
pass that renders the node into a new intermediate texture, and
set up a semaphore to make the current render pass wait for it.

As part of this reorganization, much of the setup and drawing
code moved from gskvulkanrender.c to gskvulkanrenderpass.c.
2017-09-28 08:39:22 -04:00
Matthias Clasen
cbf897ab22 Add an api to get the vertex data for a render pass 2017-09-28 08:39:22 -04:00
Matthias Clasen
85e4e0672a Add semaphores to the command buffer submit api
Allow to pass in semaphores to wait for before executing
and to signal after executing the command buffer. This
just exposes the capabilities of the underlying Vulkan
api. Update all callers to pass no semaphores, for now.

We will use this in the future.
2017-09-28 08:39:22 -04:00
Matthias Clasen
ff188f6bf0 Add an api to create intermediate textures
The new function creates a vulkan image that is suitable for
use as a framebuffer to render to and as a texture to read from.
2017-09-28 08:39:22 -04:00
Matthias Clasen
485470511f vulkan: Update the outset-shadow fragment shaders
These were missing the blur-radius parameter that is written
by the vertex shader, causing Vulkan validation to complain.
2017-09-26 18:24:52 -04:00
Matthias Clasen
145e4fde92 gsk: Fix Vulkan validation errors for image upload
I've finally figured out the right combination of src and dest
stage and access flags to make all validation warnings go away.
This commit only fixes the direct upload code.
2017-09-26 18:18:31 -04:00
Matthias Clasen
ae2c645a2a gsk: report fallback pixels as a profile counter
This makes the value show up in the inspector without
any extra work. We report the number per-frame, since
that makes the most sense.
2017-09-25 21:02:21 -04:00
Matthias Clasen
cfbd6b4b99 gsk: Add a way to reset profiler counters
It is often useful to count things per-frame, and reset
the counter afterwards.
2017-09-25 20:58:10 -04:00
Matthias Clasen
b1e98d106d vulkan: add a frame counter to the profiler
This is just to match the gl renderer and to learn how
counters work.
2017-09-25 18:37:22 -04:00
Matthias Clasen
816b47d70d gsk: Make profiler counters more useful
Make it possible to have counters that get incremented
by values other than 1.
2017-09-25 17:03:06 -04:00
Matthias Clasen
4970404d33 gsk: count fallback pixels
Always helps to have some measure of progress.
2017-09-25 09:28:18 -04:00
Rico Tzschichholz
d09f695172 gsk: Some g-i annotation fixes 2017-09-25 11:15:14 +02:00
Matthias Clasen
f6626a9e0e gsk: Documentation additions
Document newly added apis, and ensure that all public apis
are listed in the docs.
2017-09-24 22:26:39 -04:00
Matthias Clasen
b5ac277654 Plug a memory leak
A function with ensure in the name would better check if the
thing it is supposed to ensure already exists.
2017-09-24 21:48:07 -04:00
Matthias Clasen
4a5ac93762 gsk: Fix a prefix mishap
There shouldn't be any gst_ functions in here...
2017-09-23 13:15:30 -04:00
Matthias Clasen
a7f077a3a9 Cosmetics
Go back to a single GskVulkanOpRender that can
handle 0, 1 or 2 sources.
2017-09-23 09:47:05 -04:00
Matthias Clasen
3c98b90fc6 vulkan: Implement nonseparable blendmodes
This is a directly-from-the-spec, unoptimized implementation.
2017-09-23 09:16:58 -04:00
Matthias Clasen
d61f6ff393 vulkan: Implement blend modes
This is another example for a 2-texture shader.
So far, only separable blend modes are implemented.
The implementation is not optimized, with an
if-else cascade in the shader.
2017-09-23 01:59:50 -04:00
Matthias Clasen
b192120f39 vulkan: fix a clip handling problem
We were looking at uninitialized memory here, instead
of the type of the source clip, as we should.

This showed up as mispositioned clip in the first frame
of a crossfade stack transition, and also as overdraw in
sliding stack transitions.
2017-09-22 22:16:10 -04:00
Matthias Clasen
a75d995bd4 vulkan: Implement crossfade
This is the first shader using two textures. It almost works.
2017-09-22 22:16:10 -04:00
Matthias Clasen
8ad0539cf7 vulkan: Drop GskVulkanPipelineLayout
We already move the descriptor set layout out of it,
so we can just as well keep the pipeline layouts in
the render object as well, and get rid of this extra
object. Update all callers.
2017-09-22 22:16:09 -04:00
Matthias Clasen
9b0ee4ac99 Allow different pipeline layouts
These are differentiated by the number of textures; currently
we have shaders with 0 and 1 textures.
2017-09-22 22:16:09 -04:00
Matthias Clasen
5ff6481310 Add a getter to the pipeline layout directly from the pipeline
This is a step towards allowing multiple pipeline layouts.
2017-09-22 22:16:09 -04:00
Matthias Clasen
4c7a51f88a vulkan: Move descriptor set layout to the render object
We want to maintain a single descriptor set layout while introducing
multiple pipeline layouts, so split this off.
2017-09-22 22:16:09 -04:00
Matthias Clasen
e97a78840f gsk: vulkan: Drop an unused api
We don't use the upload-single-region api anymore.
No need to keep it around.
2017-09-21 13:47:17 -04:00
Matthias Clasen
dbc0caf27d vulkan: Batch uploads from the glyph cache
This uses the new api that was introduced in the previous
commit.
2017-09-21 13:45:01 -04:00
Matthias Clasen
64322a2c41 vulkan: Add an api to update multiple image regions
Instead of doing multiple copy commands with a tiny buffer
for each glyph, we can just batch them all together. This
also avoids the issue of creating multiple barriers for the
same image.
2017-09-21 13:42:57 -04:00
Matthias Clasen
9a1460218c vulkan: Quiet another validation warning
It complains if a vertex shader has an out that is not matched
to an in of the fragment shader.
2017-09-21 12:05:00 -04:00
Matthias Clasen
8e26864778 vulkan: Quiet another validation error 2017-09-20 23:46:16 -04:00
Matthias Clasen
75bf6db5e0 Cosmetic change 2017-09-20 23:26:15 -04:00
Matthias Clasen
ce06c4b840 gsk: Make repeat nodes deserializable
This was just a simple oversight.
2017-09-20 23:26:15 -04:00
Matthias Clasen
b18ab9761a gsk: Fix serialization of text nodes 2017-09-20 23:26:15 -04:00
Matthias Clasen
b5eeb98374 Add simple aging for the glyph cache
This should prevent the cache from growing out of bounds.
2017-09-20 23:26:14 -04:00
Lionel Landwerlin
7d7f8e5f8e gsk vulkan: Use new api in the glyph cache
Use the newly introduced gsk_vulkan_image_new_for_atlas.
2017-09-20 23:26:14 -04:00
Lionel Landwerlin
b97fb75146 gsk: vulkan: rework image layout/access transitions
By tracking the last transition we can build the appropriate barriers.
Also use the most appropriate initial layout/access at creation :

for linear image : predefined (we prepare the content ourself through memcpy)
for everything else : undefined (we don't care about the content, will most likely be erase)
2017-09-20 23:26:14 -04:00
Lionel Landwerlin
28bd26ca06 gsk: vulkan: silence anisotropy validation warning 2017-09-20 23:26:14 -04:00
Matthias Clasen
b321b26a73 glyph cache: Upload glyphs incrementally
This does not work yet.
2017-09-20 23:26:14 -04:00
Matthias Clasen
7bbd4d41e0 vulkan: pass the context when creating a glyph cache 2017-09-20 23:26:14 -04:00
Matthias Clasen
5ee5af9bc8 vulkan: Add an upload_region api to GskVulkanImage
This will let us update larger textures incrementally.
Sadly, it does not work yet.
2017-09-20 23:26:14 -04:00
Matthias Clasen
6dbec5e4fc Add some debug output for the glyph cache
Print out some statistics and dump the glyph caches to a png,
for now.
2017-09-20 23:26:14 -04:00
Matthias Clasen
baeff2a49b Make the glyph cache grow as needed
Make it possible to have more than one texture in the
glyph cache, and create new ones when we run out of space
in the existing ones.
2017-09-20 23:26:14 -04:00
Matthias Clasen
cead00757d vulkan: Move glyph cache to a separate file
Otherwise things will get too messy.
2017-09-20 23:26:14 -04:00
Matthias Clasen
4d4a0212fb vulkan: Better glyph cache api
Move the glyph caching api to something that can support using
multiple textures. We now split the text render ops into multiple
ops for different textures, and make each op render just a substring
of the text node's glyph string.
2017-09-20 23:26:14 -04:00
Matthias Clasen
ff45a86a1c Fix rendering glyphs from the cache
We were not quite using all the right dimensions.
2017-09-11 14:45:36 -04:00
Matthias Clasen
b0d108291b Some fixes for the glyph cache
Copy the way cogl does its glyph caching some more.
At the minimum, this fixes problems where we were getting
wrong-sized Emoji inserted.
2017-09-11 14:02:44 -04:00
Matthias Clasen
40031930b2 Cosmetic changes
Make sure the cache size does not get out of sync with the
actual surface size.
2017-09-11 11:22:59 -04:00
Matthias Clasen
31ca709e23 Cosmetic changes
Use Pango macros for handling PANGO_SCALE.
2017-09-11 11:22:10 -04:00
Matthias Clasen
781821bae4 rate-limit the glyph cache dumping
Writing the file out every frame really isn't necessary.
Do it once per second.
2017-09-11 11:15:00 -04:00
Matthias Clasen
47cf17c70c vulkan: Add a primitive glyph cache
This is just a proof of concept - we use a single 1024x1024 surface,
and just give up when we run out of space. The cache is populated
incrementally, and items are never removed.
2017-09-10 21:56:37 -04:00
Matthias Clasen
b0e8d8483d More work on text nodes
This commit takes several steps towards rendering text
like we want to.

The creation of the cairo surface and texture is moved
to the backend (in GskVulkanRenderer). We add a mask
shader that is used in the next text pipeline to use
the texture as a mask, like cairo_mask_surface does.
There is a separate color text pipeline that uses the
already existing blend shaders to use the texture as
a source, like cairo_paint does.

The text node api is simplified to have just a single
offset, which determines the left end of the text baseline,
like all our other text drawing APIs.
2017-09-10 14:36:26 -04:00
Patrick Griffis
a55b57caff build: Improve vulkan resource handling
This fixes the proper dependencies getting set up for generating
the shaders and only the necessary things getting rebuilt on
resources changing in gsk.
2017-09-05 15:18:56 -04:00
Matthias Clasen
4800a248bd Typo fix 2017-09-04 23:32:31 -04:00
Matthias Clasen
7bb5b8df0b A somewhat working blur shader
This is a very direct implementation of a Gaussian blur,
without any optimizations.
2017-09-04 23:32:31 -04:00
Matthias Clasen
e2869853dc gsk: Add a blur node
For now, this has just a fallback implementation using
the typical box filter approximation.
2017-09-04 14:28:16 -04:00
Matthias Clasen
86c0c243a0 Add rules to regenerate all shader variants
We were missing rules to build the clip variants of
the shaders.
2017-09-03 19:58:41 -04:00
Matthias Clasen
59b1206468 Avoid empty nodes another way
Make gsk_text_node_new return NULL if the extents are empty.
2017-09-03 19:35:02 -04:00
Matthias Clasen
2101f26b49 vulkan: Add more debug spew 2017-09-03 11:34:41 -04:00
Matthias Clasen
a05895e029 Record node names for debug output
This is useful for GSK_NOTE output as well.
2017-09-03 11:32:09 -04:00
Matthias Clasen
8db13c3362 gsk: Improve debug output
If we don't have node names, we can still print class names.
2017-09-03 10:32:55 -04:00
Matthias Clasen
440e534053 gsk: add a has_color boolean to text nodes
Currently, this information is not used since cairo_show_glyphs
deals with color glyphs for us. But when we get to uploading
glyphs to a texture atlas, we will need it to do the right thing.

We don't look at individual glyphs here, but just whether the
font has the has-color flag set. In practice, all glyphs in
such a font will be color glyphs, and we can avoid loading all
the glyphs this way.
2017-09-02 11:09:03 -04:00
Matthias Clasen
4975aa7920 Add a render node for text
This is just a wrapper around a PangoGlyphString + PangoFont.
Basically, the arguments that are passed to pango_renderer_draw_glyphs.
2017-09-01 13:30:03 -04:00
Daniel Boles
97b5f3d029 gskenums: Fix typo/grammar in GskRenderNodeType doc 2017-08-31 19:59:25 +01:00
Timm Bäder
c18d2872f2 GskRenderNode: Fix fallback border drawing 2017-08-29 11:48:42 +02:00
Timm Bäder
9a43881a19 gskrendernode: Fix inset shadow drawing 2017-08-28 17:50:34 +02:00
Timm Bäder
4045794801 gskrendernode: Constify some parameters 2017-08-28 17:50:34 +02:00
Lionel Landwerlin
48df19287b gsk: vulkan: fix image uploading
The memory alignment requirements are different from the image layout.
We want the rowPitch to know where to upload the lines.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=786485
2017-08-18 19:41:36 -04:00
Emmanuele Bassi
4904491b77 build: Move Vulkan shader handling to its own directory
Spooky action at a distance is not really allowed in Meson, so the rules
to generate the SPV files should go in their own directory.

Tested by: Rico Tzschichholz <ricotz@ubuntu.com>
2017-08-15 17:07:21 +01:00
Timm Bäder
7685d157bc build: Remove more wrong kwargs
declare_dependency does not take a depends: kwarg and meson 0.42.0
started warning about that.
2017-08-15 14:56:13 +02:00
Emmanuele Bassi
391d1a04ec Drop Autotools build
We are officially switching to Meson as the default build system for
GTK+.
2017-08-14 22:23:09 +01:00
Timm Bäder
2eaf416062 gsk: Add color shader sources to meson build files 2017-08-13 18:01:58 +02:00
Daniel Boles
0740fb5c64 gskrendernodeimpl: Fix leak of cairo_pattern_t
It was not destroyed after setting it on the cairo_context_t, as it is
in every other case.

https://bugzilla.gnome.org/show_bug.cgi?id=785793
2017-08-04 00:59:33 +01:00
Emmanuele Bassi
6728f45aa0 build: Ensure that Vulkan shaders are rebuilt if glslc is found
If glslc is found, rebuild the shaders from GLSL to SPIR-V; otherwise,
we're just going to use the built files we have committed in the source
repository.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
d35d82fb35 build: Rename GSK resource generator script
Maintain the naming convention, since we have similar scripts for GDK
and GTK already.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
e18d9a85ca build: Use the common linker flags in GDK and GSK
Instead of hard-coding `-Bsymbolic`.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
68039b610b build: Add compiler warnings and errors
We don't want to build buggy code.
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
e850973956 meson: build input modules
We have to work around some ordering problems here. We still
manage to keep most of the guts in modules/input/meson.build,
so it's not too ugly overall.

(The autotools build solves this with a 'make -C ../../input/modules'
inside gtk/Makefile, but that's not something we can or want to do.)
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
f67a9d58db meson: make sure gsk/gdk generated headers exist for libgtk_dep users
Add back dependencies on libgdk_dep and libsk_dep which are declared
dependencies. We removed this before because these declarations had
link_with: lines that dragged in the static libgdk.a and libgsk.a libs
which are linked into libgtk-4.so anyway and thus shouldn't be used
when linking internal exes/tools against libgtk-4. Remove the static
libs from the declared dependencies and have libgtk link those in
explicitly, so that the declared deps now just provide all the built
dependencies and include dirs and such for declared libgtk_dep users
such as the internal exes/tools, which want all the generated gsk/gdk/gtk
headers to exist before attempting to compile anything against the
gtk+ headers.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
07ffb19c42 meson: gdk, gsk: fix install path of generated files 2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
a0c207614a meson: gsk: install public headers 2017-05-03 15:10:53 +01:00
Tim-Philipp Müller
7b6b3c7786 meson: gsk: use gnome.mkenums() to generate enum types 2017-05-03 15:10:53 +01:00
Tim-Philipp Müller
fed7d22df7 meson: gsk: generate gsk.resources.xml 2017-05-03 15:10:53 +01:00
Tim-Philipp Müller
95979f4d2f meson: add vulkan bits 2017-05-03 15:10:53 +01:00
Tim-Philipp Müller
37d5938561 meson: update list of sources for changes in git master 2017-05-03 15:10:53 +01:00
Timm Bäder
4fcca9945f meson: update build files 2017-05-03 15:10:52 +01:00
Emmanuele Bassi
35c26d00d7 gsk: Include the private header
Both gskprivate.c and gskvulkanrenderer.c call `gsk_ensure_resources`
but fail in clude `gskprivate.h`, where the function is declared.
2017-05-03 15:00:12 +01:00
Emmanuele Bassi
fca3f93114 gsk: Mark finalize() implementation as static 2017-04-26 17:28:14 +01:00
Emmanuele Bassi
9442ef055d gsk: Mark internal symbol as static
Nothing uses this function outside of GskVulkaneRenderPass.
2017-04-26 17:27:24 +01:00
Emmanuele Bassi
c71aeff9b2 gsk: Mark internal symbols as static
These symbols are not used anywhere outside of GskVulkanImage.
2017-04-26 17:25:24 +01:00
Emmanuele Bassi
7ae5b516ac gsk: Mark private symbol as static
The ellipsis_contains_point() function is not used anywhere else.
2017-04-26 17:25:24 +01:00
Timm Bäder
dfcde113e8 GskRoundedRect: Include private header file
So we don't have implementations without previous prototypes.
2017-04-26 11:07:40 +02:00
Timm Bäder
0105bf82c0 GskRenderNode: Fix set_scaling_filters function name
The implementation sed _filters while the prototype used _filter.
2017-04-26 11:06:55 +02:00
Timm Bäder
6c7f1d8885 GskRenderNode: add missing prototype 2017-04-26 11:06:32 +02:00
Timm Bäder
d55249c6f1 gsk: Add color shaders to resources 2017-04-01 16:16:03 +02:00
Timm Bäder
d8f78d3a32 glrenderer: Reuse the GArray for render items 2017-03-31 09:50:39 +02:00
Timm Bäder
67e7f44654 glrenderer: Add render items for child nodes 2017-03-31 09:50:39 +02:00
Timm Bäder
fbada8e758 glrenderer: Handle color nodes 2017-03-31 09:50:39 +02:00
Timm Bäder
a33e90a029 glrenderer: Store uniform locations per program 2017-03-31 09:50:39 +02:00
Daniel Boles
d33878c5fe gskrendernodeimpl: Fix documentation argument type 2017-03-27 22:16:56 +01:00
Daniel Boles
3d11edf1bc GSK: Fix a bunch of warnings from the GIR scanner
arising from conflicting argument names, missing annotations, etc.
2017-03-27 20:22:07 +01:00
Alexander Larsson
e307a35c33 gsk: Take scale factor into account when setting up the gl scissor 2017-03-20 10:53:58 +01:00
Alexander Larsson
9e12fc7853 gl renderer: Fix hidpi fallback rendering
When allocating the surface, take scale into consideration.
2017-03-20 10:53:58 +01:00
Timm Bäder
6637b20b4c GdkRenderer: Fix a compiler warning 2017-03-19 15:44:15 +01:00
Tim-Philipp Müller
37b99ed671 vulkan: fix compilation 2017-03-18 12:23:39 +00:00
Timm Bäder
242368bdf6 GtkShaderBuilder Fix copy/paste error in precondition
gtk_shader_builder_add_define should check both define_name and
define_value for not-NULL and not-empty, but the second precondition
check checks define_name again for not-empty-ness.
2017-03-17 18:35:43 +01:00
Alexander Larsson
1fe4b13871 Allow custom renderer for the inspector
If you set GTK_INSPECTOR_RENDERER to the same type of
values that GSK_RENDERER takes this can change the renderer
used for the inspector. This is useful if you're debugging
one renderer and don't want to affect the inspector.
2017-03-17 16:12:45 +01:00
Benjamin Otte
ee9828d49c vulkan: Fix copy/paste error 2017-01-18 16:46:04 +01:00
Benjamin Otte
12637195de vulkan: Add compiled shaders
I forgot to include them when adding the shaders.
2017-01-18 16:42:01 +01:00
Benjamin Otte
cde933ebd9 vulkan: Compute right size for outset shadow
We were emitting the box and not the shadow box as the rectangle. So we
didn't draw any shadows. Oops.
2017-01-18 16:39:27 +01:00
Benjamin Otte
bd24ca5b18 vulkan: Add support for unblurred box-shadow 2017-01-18 04:13:56 +01:00
Benjamin Otte
84c1204853 rendernode: Add getters for box-shadow nodes 2017-01-18 04:13:56 +01:00
Benjamin Otte
01d16524da vulkan: Add fallback message for node-as-texture
This is mainly to motivate me to implement it.
2017-01-17 06:38:36 +01:00
Benjamin Otte
6bec7aae89 vulkan: Generate clip shaders from same source
Instead of having 3 different shaders for the different clipping
versions, just have one shader and use a preprocessor define to use
different clip functions.

That preprocessor define is set in the Makefile.

Also use foo.frag and foo.vert as the file extensions instead of using
foo.frag.glsl and foo.vert.glsl, as that's what glslc suggests as
extension.
2017-01-17 06:17:55 +01:00
Benjamin Otte
3768c676c6 vulkan: Add clip.vert.glsl
Implement clipping the same way as in the last commit for the
fragment shaders.
2017-01-17 06:17:55 +01:00
Benjamin Otte
cf65443fb3 vulkan: Add a clip.frag.glsl include
This include is supposed to handle clipping for the different clipping
methods.

So far, we only use it in the rounded rect cases.
2017-01-17 06:17:55 +01:00
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
10bc71a5e6 build: List resource files explicitly
This way, we ensure that files that are built during make always get
properly listed. And we ensure that creating the resources actually
depends on them.
2017-01-11 18:33:09 +01:00
Benjamin Otte
b186bce7ff vulkan: Add shader for border rendering 2017-01-11 18:33:09 +01:00
Alexander Larsson
2f453cc57e gsk_rounded_rect_init_copy: Don't normalize
This was showing up quite high on the profiles, and there is
no real reason for copy to normalize, as the source is a
GskRoundedRect which should be normalized already unless
you did something very strange (and then you should have normalized
manually).
2017-01-11 09:23:37 +01:00
Chun-wei Fan
ea58ebe76d Visual Studio builds: Move project files to win32/
It was suggested that the project files to be moved to win32/, so that we can
have one less layer of directories we need to go down into to reach the project files.
2017-01-09 15:38:48 +08:00
Benjamin Otte
e4d0459d52 vulkan: Reallocate descriptor sets
Because wee now reset the descriptor pool, we also need to reallocate
the descriptor sets.
2017-01-06 18:10:12 +01:00
Benjamin Otte
5a6ead8760 vulkan: Keep vertex buffer around until cleanup
Don't just free it while the command buffer using it is still pending.
2017-01-06 17:16:38 +01:00
Benjamin Otte
639b5ffb9b vulkan: Reset descriptor pool
We don't want the pool to reference images we're gonna destroy. Drivers
don't like that at all.
2017-01-06 16:31:53 +01:00
Benjamin Otte
833607c19e gsk: Don't use wildcards
Explicitly list all the shaders, so new ones get picked up properly and
cause the resource file to be regenerated (due to Makefile.am changing).
2017-01-06 16:31:53 +01:00
Benjamin Otte
078902e8b0 gsk: Have variables for resources
Instead of relying on --generate-dependencies and the resource file,
actually list the resources in Make variables.

Fixes make not building new shaders because they're not inside the
resource file.
2017-01-06 16:31:53 +01:00
Georges Basile Stavracas Neto
33a6347766 vulkanrender: Create descriptor pools with correct descriptor number 2017-01-06 02:46:27 -02:00
Georges Basile Stavracas Neto
67894ace64 vulkanpushconstants: Don't report invalid ranges
Vulkan doesn't accept empty ranges, so simply don't report
them.
2017-01-04 18:40:42 +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
b993acfe2c gsk: Add GskRepeatNode
Also add gtk_snapshot_push_repeat() and use that to draw backgrounds.

With that change, CSS background snapshots are created without Cairo
nodes.
2017-01-01 19:53:36 +01:00
Benjamin Otte
2571036c07 gsk: Turn GskTexture into a GObject 2017-01-01 19:53:36 +01:00
Benjamin Otte
2fe01a5b57 vulkan: Optimize getting textures
When we already have a texture or know we need to upload, just do that
instead of rendering to Cairo.
2017-01-01 19:53:36 +01:00
Benjamin Otte
e18d5ca835 vulkan: Add support for color matrix nodes
@keyframes weee {
    100% { filter: hue-rotate(1turn); }
}

.background {
    animation: linear infinite 3s weee;
}
2016-12-31 14:37:20 +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
7540702cf0 gsk: Add GskColorMatrixNode
This node essentially implements the feColorMatrix SVG filter. I got the
idea yesterday after looking at the opacity implementation.

It can be used for opacity (not sure if we want to) and to implement a
bunch of the CSS filters.
2016-12-31 02:49:47 +01:00