Commit Graph

311 Commits

Author SHA1 Message Date
Benjamin Otte
cb6c720d37 gpu: Render enough of a scaled texture offscreen
We were not thinking about pixel alignment and the potential later
linear blend for the final composite.

Fixes #6428
2024-02-14 20:11:29 +01:00
Matthias Clasen
b2d22d8125 Merge branch 'wip/abono/fallthrough' into 'main'
gsk: Remove unnecessary G_GNUC_FALLTHROUGH

See merge request GNOME/gtk!6898
2024-02-13 22:17:50 +00:00
Benjamin Otte
ee34781a13 gpu: Pixel-align the blur rectangle
Fixes blurriness in shadows.

Not sure to do a proper test for this feature. Usually proper pixel
alignment is tested by drawing a crips line and checking that it is
indeed crisp. But we are testing the blur operation here...

Fixes #6380
2024-02-13 21:56:01 +01:00
Benjamin Otte
9fc80a0bd5 gpu: Update blur code to newer internal API
The recommended way to draw offscreens has been init_draw() for a bit,
but apparently this code wasn't updated.
2024-02-13 21:56:01 +01:00
Benjamin Otte
a1dda0ec3c gpu: Adjust shadows clip by shadow offset
When computing the clip of the shadow rect, don't forget that it will
ultimately be offset by the shadow offset.

Fixes #6425
2024-02-13 21:56:01 +01:00
Benjamin Otte
dbbc16947f gpu: Handle one layer of NULL return
This isn't really a useful thing in itself, because none of the callers
handle the NULL return.
But the resulting crash is easier to debug when it's a NULL image than
when add_node() is called on an uninitializes NodeProcessor.
2024-02-13 21:56:01 +01:00
Benjamin Otte
dc47abc60e gpu: Don't oversize node image
There's no need - even if given clip bounds - to render the parts
outside the node.

So clip to the node bounds.
2024-02-13 21:56:01 +01:00
Alessandro Bono
ca9ba3cc80 gsk: Remove unnecessary G_GNUC_FALLTHROUGH
In GSK the following pattern is used four times:
```
  switch (self->filter)
    {
      default:
        g_assert_not_reached ();
        G_GNUC_FALLTHROUGH;
      case GSK_GPU_BLIT_LINEAR:
        filter = GL_LINEAR;
        break;

      case GSK_GPU_BLIT_NEAREST:
        filter = GL_NEAREST;
        break;
    }
```
The G_GNUC_FALLTHROUGH macro is not required. When G_DISABLE_ASSERT
is defined the body of the `default` case is empty, thus there is
no need. When G_DISABLE_ASSERT is not defined the body of the `default`
case contains g_assert_not_reached() thus it won't fallthrough.

This resolves the following:
```
[221/1379] Compiling C object gsk/libgsk.a.p/gpu_gskgpublitop.c.o
[...]
error: fallthrough annotation in unreachable code [-Werror,-Wimplicit-fallthrough]
1 error generated.
```
2024-02-13 18:29:03 +01:00
Matthias Clasen
ea7a61a763 gpu: Print globals when being verbose
This can be helpful to see that there is an enormous scale blowing
things up. We omit the matrix, since it is 16 floats that are hard
to interpret at a glance.
2024-02-13 06:59:58 -05:00
Matthias Clasen
925d2ba9ae Merge branch 'wip/otte/for-main' into 'main'
gpu: Avoid offscreens for disjoint containers

See merge request GNOME/gtk!6889
2024-02-12 12:58:14 +00:00
Benjamin Otte
2fe1f47e6d gpu: Avoid offscreens for disjoint containers
When opacity is set but the container is disjoint - ie no children
overlap - don't redirect into an offscreen, because it's not necessary.
2024-02-12 08:34:18 +01:00
Benjamin Otte
30afac9a6b offload: No need to pass the offload to the diff
We can just check if the subsurfaces contain content - and if they do,
they will be offloading and we can ignore the diff.

This essentially reverts 48740de71a
2024-02-11 20:24:28 -05:00
Benjamin Otte
1b9002afd3 ngl: Check for GL 3.3
The default check is still for GL 3.0 and we don't support that.
2024-02-11 20:04:54 +01:00
Benjamin Otte
6ed4eece04 gpu: debug-print the used shader clip
When using GSK_DEBUG=verbose, print the clip mode used in the shader.

Use cute little unicode indicators to not overload the debug output.
2024-02-11 20:04:54 +01:00
Benjamin Otte
cfaddb5d47 gpu: Use nodprocessor infrastructure for offscreening
The just copied over function can just use the same infrastructure as
the other functions we already have that create slightly adjusted
offscreens.
2024-02-11 20:04:54 +01:00
Benjamin Otte
7c861d8b59 gpu: Don't clip again after already clipping
The 2 callers of gsk_gpu_get_node_as_image() were already computing the
minimum clip region and in particular aligning it to the pixel grid, so
intersecting with node bounds again was causing that alignment to be
busted.
2024-02-11 20:04:54 +01:00
Benjamin Otte
1c3457adfb gpu: Fix sizing of fractionally scaled backbuffer
When using a window size and scale that don't multiply to an integer, we
were using the wrong method to adjust it.

The Wayland fractional scaling spec just says:

> For toplevel surfaces, the size is rounded halfway away from zero.

This is meant to be interpreted as "create a large enough buffer to hold
partial pixels) and the compositor will blend it mapping to the pixel
grid" even if that means the buffer slightly overhangs.

Example:
A 11 units wide window at 150% will need a 11 * 1.5 = 16.5 pixel wide
buffer. This should be rounded to 17 pixels but rendered as if only 16.5
pixels are occupied by the window, not as if all 17 pixels are occupied.
2024-02-11 20:04:54 +01:00
Benjamin Otte
a2e46c4d39 gpu: Move function
It is only used by the nodeprocessor, so put it where it belongs.
2024-02-11 20:04:54 +01:00
Benjamin Otte
df1d024059 Revert "gpu: Fix scale fluctuation"
This commit is wrong.
It does achieve what it sets out to do, but the method doesn't work.

It confused multiple things in one commit, the commit message only
describes the symptoms it tries to fix and not why the fix is correct,
it includes no tests and it wsn't properly reviewed.

Related: !6871
2024-02-11 20:04:54 +01:00
Matthias Clasen
87b66de109 Merge branch 'mip_size' into 'main'
gsk: Fix blit sizes while generating mipmaps on vk

See merge request GNOME/gtk!6875
2024-02-10 19:13:36 +00:00
M Henning
d08412aaa4 gsk: Fix blit sizes while generating mipmaps on vk
A few lines later we already had the correct equation for the size.
See vulkan 1.3 spec section 12.3.2 "Image Mip Level Sizing"
2024-02-10 10:59:44 -05:00
Matthias Clasen
1ac82528d9 gpu: Fix scale fluctuation
We want to use a viewport that gives us the right scale back.
This fixes problems where glyph lookups were inefficient because
the scale part of the key would fluctuate ever so slightly.
2024-02-09 19:49:54 -05:00
Benjamin Otte
9c0ca8803d gpu: Punch hole with a clear again
This reinstates the clear op when possible so we can avoid blending
changes and benefit for large areas, when the clip is appropriate.

Related: #6375
2024-02-09 04:28:32 +01:00
Benjamin Otte
5b184a10a9 gpu: Add a CLEAR blend mode for subsurface hole punching
The previous code was ignoring non-scissor clips, which would make it
overeager at punching holes.

It also was not working with fractional coordinates.

Fixes #6375
2024-02-09 04:28:32 +01:00
Benjamin Otte
269662c888 gpu: Scale the border offset
The shader was forgetting to apply global scale to the offset, which
would cause lines to be offset improperly on hidpi.

Fixes #6412
2024-02-09 04:28:32 +01:00
Guido Günther
3cce78d02c gpu: Print actually checked GLES version
We check for 3.0 not 2.0.
2024-02-08 16:24:50 +01:00
Benjamin Otte
19fccb13c3 gpu: GL < 4.0 needs the ifelse ladder for textures
GL 4.0 (section 4.1.7) allows dynamically uniform expressions as texture
indexes, GL 3.3 (again section 4.1.7) requires constants.

Related: #6401
2024-02-07 19:09:07 +01:00
Benjamin Otte
2a3a5753c1 gpu: Don't optimize too much
The rect clip can only be ignored if the scissor rect is contained in
the clip. But sometimes it isn't.

Fixes #6389
2024-02-04 21:57:13 +01:00
Benjamin Otte
88bed27f85 blurop: Print the blur radius 2024-02-04 21:57:13 +01:00
Matthias Clasen
f93601ed2b Merge branch 'cache-weak-unref' into 'main'
gpu: Fix a problem with texture caches

Closes #6377

See merge request GNOME/gtk!6824
2024-01-29 13:24:56 +00:00
Matthias Clasen
d790268031 gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 08:12:27 -05:00
Matthias Clasen
89712fc750 gpu: Fix syntax confusion. 2024-01-29 08:12:27 -05:00
Matthias Clasen
9b62a5c931 gpu: Drop an unused argument
The timestamp wasn't used in atlas creation.
2024-01-29 08:12:27 -05:00
Matthias Clasen
fbf3836502 gpu: Drop excessive logging
This was logging every frame, which is too much.
2024-01-29 08:12:27 -05:00
Matthias Clasen
8d80f97597 gpu: free non-atlased glyphs
"Only free glyphs when their atlas is freed" works great for
glyphs that are on an atlas. Don't forget the others.
2024-01-29 08:12:27 -05:00
Matthias Clasen
e6ec8133a5 gpu: Don't weak unref too much
We can reach the code that removes the item from the hash table
before or after the weak unref has triggered. Just leave the
weakref in place and let it do its thing, if it hasn't gone
off yet. That matches what we do in free.

Fixes: #6377
2024-01-29 08:11:25 -05:00
Matthias Clasen
6b436fdbbb gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 07:49:59 -05:00
Matthias Clasen
7b2b5469eb gpu: Call make current before gc
We do gc in a timeout, when an arbitrary GL context might be
current, so we need to make sure its ours and we don't free
random textures in another context.

Fixes: #6366
2024-01-29 07:39:57 -05:00
Matthias Clasen
1bac8b439a gpu: Be more aggressive about cache gc
Count dead pixels in textures (ie the number of pixels in GPU
textures that are no longer backed by an alive GdkTexture object),
and when the there's too many, do a gc before rendering the next
frame.
2024-01-28 11:00:07 -05:00
Matthias Clasen
ee52e98b7d gpu: Redo texture caching
Count the uses of cached texture - from the device (via the linked
list) and from the texture (via render data / weak ref), and only
free the item once the use count reaches zero.
2024-01-28 10:50:46 -05:00
Matthias Clasen
5e4eda15c9 gpu: Trigger cache gc from the renderer
Instead of forever running a timeout to do gc, ensure the timeout
is scheduled whenever we render a frame (this is done by calling
gsk_gpu_device_maybe_gc () before gsk_gpu_frame_render (), and
gsk_gpu_device_queue_gc () after).
2024-01-28 10:50:19 -05:00
Matthias Clasen
e861ea4bd2 gpu: Add a knob for cache GC
Read the GSK_CACHE_TIMEOUT environment variable to override the
default 15s timeout for cache gc. This is mainly meant for debugging.

Since we don't really need two knobs, reuse the gc timeout value
for the max age of items too.
2024-01-28 10:49:57 -05:00
Matthias Clasen
8009ed3a3c gpu: Add more details to debug spew
Print the number of items in the cache hash tables.
2024-01-27 19:50:45 -05:00
Matthias Clasen
1d95a171f6 gpu: Don't forget to unage cached textures
Whenever we successfully looking up a cached item, we need to
call use() on it to mark it as fresh.
2024-01-27 19:50:41 -05:00
Matthias Clasen
e0136b283a Cosmetics 2024-01-27 19:49:58 -05:00
Matthias Clasen
42867c7a3c Cosmetics 2024-01-27 19:49:57 -05:00
Matthias Clasen
c1270cf52b gpu: Fix a crash in vulkan
The node processing wasn't skipping 0-size nodes when using the
uber shader, leading to assertions down the road. Since the ngl
renderer doesn't use uber shaders, this only affects vulkan.

Test included.

Fixes: #6370
2024-01-27 10:30:38 -05:00
Benjamin Otte
3a93d52718 gpu: Add support for MacOS default framebuffer
This adds the same code as the GL renderer used to allow backends to
redirect rendering to a different framebuffer.

Related: #6363
2024-01-26 16:55:49 +01:00
Benjamin Otte
d74855fe9f gpu: Don't use layout binding in old GL versions
GL needs version 4.2 before it supports explicit bindings. We use GLES
usually, and Mesa supports GL 4.6, so we didn't hit this case before.

However, MacOS does use GL and Mac OS is stuck on GL 4.1.

Fixes #6363
2024-01-26 14:17:16 +01:00
Benjamin Otte
502fb250ab gpu: Fix zero-width border corner rendering
When a border side has a width of 0 but we're having rounded corners, we
draw content in the edges of that side, and naturally pick its color.
That is wrong though, when the width is zero, we're supposed to keep
using the color of the other side in that corner.

So do that.

Fixes the border-corner-zero-width-rendering.ui reftest.
2024-01-25 19:39:34 +01:00
Benjamin Otte
7d7d3ff35c gpu: Fix variable
I had a test that allocated over 4GB of ops and...
2024-01-25 19:08:32 +01:00
Matthias Clasen
7624e6621a gpu: Add profiler marks around cache gc 2024-01-25 09:41:49 -05:00
Matthias Clasen
cdddb6cb96 gpu: Print more detailed cache statistics
Print out stale glyphs and dead pixel ratios.
2024-01-25 09:41:49 -05:00
Matthias Clasen
f6c01a7674 gpu: Fix ordering problem in clear_cache()
We must free the glyphs before their atlases, since we now maintain
the dead pixel count of the atlas when glyphs are freed.
2024-01-25 09:41:49 -05:00
Matthias Clasen
ffa5bf1b7d gpu: Fix atlas freeing
We need to unset current_atlas if we free that one.
2024-01-25 09:41:49 -05:00
Matthias Clasen
4c6e623ec5 gpu: Keep track of atlas use
Count how many dead pixels we have, and free the atlas if more than
half of its pixels are dead.

As part of this, change when glyphs are freed. We now keep them
in the hash table until their atlas is freed and we only do dead
pixel accounting when should_collect is called. This keeps the
glyphs available for use from the cache as long as are in the atlas.

If a stale glyph is sused, we 'revive' it by removing its pixels
from the dead.

This matches more closely what the gl renderer does.
2024-01-25 09:41:48 -05:00
Matthias Clasen
621ef0703a gpu: Make atlas freeing more robust
Currently, we don't free an atlas before all its glyphs are gone,
but we might revisit that in the future, so be prepared for it.
2024-01-25 09:40:58 -05:00
Matthias Clasen
f514caadb0 gpu: Evict stale glyphs from the cache
Same story as for textures: if it hasn't been used for 4 seconds,
it is stale and can go.
2024-01-25 09:40:58 -05:00
Matthias Clasen
4d92093c67 gpu: Fix texture eviction
If we gc a cached texture for which the GdkTexture is still alive,
the cached texture object will remain accessible via the render
data, so need to make sure not to leave a dangling pointer behind
here.
2024-01-25 09:40:58 -05:00
Matthias Clasen
bd9ea05ebb gpu: Evict stale textures from the cache
This is straightforward. If a texture hasn't been used for 4 seconds,
we consider it stale, and drop it the next time gc comes around.

The choice of 4 seconds is arbitrary.

Fixes: #6346
2024-01-25 09:40:58 -05:00
Matthias Clasen
e8599bd36e gpu: Start doing cache gc
Call the gc function periodically from a timeout to collect
stale cached items.
2024-01-25 09:40:58 -05:00
Matthias Clasen
1accd0c1ba gpu: Print some cache stats
This reuses the GLYPHCACHE debug flag that is used for the same
purpose in the gl renderer.
2024-01-25 09:40:58 -05:00
Matthias Clasen
14488041bc gpu: Add a static assertion
Stating the obvious, maybe.
2024-01-25 09:40:58 -05:00
Benjamin Otte
c31b6ff1d5 gpu: Implement subpixel positioning
This makes glyph rendering match the Cairo and GL renderers.
2024-01-23 06:17:14 +01:00
Benjamin Otte
cf4b9dcb4d gpu: Align glyphs to the pixel grid
Add GSK_GPU_SKIP=glyph-align to turn off the glyph aligning.

FIXME: Should this be handled by the renderer at all or should we rely
on higher rendering layers to align glyphs properly?

This is kind of a tricky question just like with texture-scale nodes and
NEAREST filtering, because rendernodes can be embedded in other nodes
that disturb the pixel grid.
2024-01-23 06:17:14 +01:00
Benjamin Otte
dfc34b7295 gpu: Offset tiles properly
When drawing repeat nodes as tiles, this could result in wrong
renderings when the tiles were clipped wrong.
2024-01-23 06:17:14 +01:00
Benjamin Otte
183d712252 gpu: Handle a full cache
Previously, we only checked if the cache had exhausted the maximum
number of slices.
But we also need to check that the height of the slices doesn't exceed
the height of the texture.
2024-01-22 07:47:10 +01:00
Matthias Clasen
f01208ad94 gpu: Consistently use ceilf
There was a mix of ceil() and ceilf() calls here, but the arguments
are always floats, so use ceilf() throughout.
2024-01-20 11:33:59 -05:00
Matthias Clasen
0d7761269c gpu: Use gsk_rect_scale 2024-01-20 11:33:59 -05:00
Matthias Clasen
b4b7e9b040 gpu: Fix up gc
Make the gc loop free the the right item.
2024-01-20 08:04:43 -05:00
Matthias Clasen
c3fcf0f7b0 gpu: Plug a memory leak
This looks like just a leftover line.
2024-01-20 08:02:20 -05:00
Matthias Clasen
60fc48e71f gpu: Cosmetics
s/timestsamp/timestamp/
2024-01-20 08:01:59 -05:00
Matthias Clasen
7b66bc45aa Cosmetics
Add some vim modelines.
2024-01-19 09:26:32 -05:00
Benjamin Otte
4e2c7d5eb0 gl: Require GL/GLES flag when looking up memory formats
This code just adds the argument to the function and fixes all callers.

It's separate because it's just a bunch of boilerplate.
2024-01-16 20:35:20 +01:00
Matthias Clasen
93715b963e gsk: Fix big glyphs getting clipped
We were inadvertedly shifting the rendering by one pixel.
2024-01-12 15:55:27 -05:00
Benjamin Otte
a51c6aed47 gpu: Introduce "contained" clip
This clip is different from "none" in that the bounds rect cannot be
ignored and that potential drawing outside the clip must be avoided.

In particular it means that clip nodes cannot be discarded if they
encompass the full clip region.

Fixes #6322
2024-01-12 20:06:04 +01:00
Benjamin Otte
b552cf74dd gpu: Remove unnecessary optimization
Every branch in the switch is so optimized that it does this check
early anyway, so there's no need to have it as an extra step.
2024-01-12 20:06:04 +01:00
Matthias Clasen
d240c35850 ngl: Don't leak the backbuffer
Clear it in unrealize, just like the vulkan renderer does with
its targets.
2024-01-10 23:08:01 -05:00
Matthias Clasen
dc30044829 Merge branch 'gpu-fix-mixed-color-text' into 'main'
gpu: Fix handling of mixed-color text runs

See merge request GNOME/gtk!6725
2024-01-10 18:11:23 +00:00
Matthias Clasen
a44ca6756a gpu: Use the right format for atlases
The glyph atlas format needs to match the cairo memory format.
NGL was getting this wrong, causing color glyphs to have their
red and blue swapped.
2024-01-10 08:00:15 -05:00
Matthias Clasen
490a9f193d gpu: Fix handling of mixed color text runs
We need to decide per-glyph whether to use coloring or texture ops.
2024-01-10 08:00:15 -05:00
Benjamin Otte
5b3d14e15b gpu: respect pixel grid for Cairo rendering
Make sure fallbacks and fill/stroke masks use image surfaces with the
same pixel grid as the target if possible.

Fixes blurriness with some path renderings.
2024-01-10 00:13:52 +01:00
Benjamin Otte
a2eb467663 gpu: Change rect_round_pixels() to take an offset
We need to respect the offset when converting to the pixel grid, so pass
the current offset into the function.

Also move the rounded out of gsk_gpu_get_node_as_image() and into the 2
callers, because the offset is not passed into the function and I see no
reason to change that.
2024-01-10 00:13:52 +01:00
Benjamin Otte
aab40ad6a2 gpu: Fix text coordinates in the ubershader 2024-01-09 23:27:55 +01:00
Matthias Clasen
ce7cc942e4 gpu: Use opacity for border colors
We were computing the right colors, but forgot to use them.
2024-01-08 11:17:09 +01:00
Benjamin Otte
3f3629154c gpu: clip to redraw region rects instead of extents
Instead of using the bounds of the clip region, emit individual
renderpasses for each rectangle of the clip region.

The benefit of this depends on how many pixels the clip region covers,
but for widget factory it reduces the required rendering by a huge
amount.

This is now the best clipping renderer - Cairo doesn't clip at all and
GL clips based on the extents.
2024-01-08 09:28:26 +01:00
Benjamin Otte
c3cfabfa96 gpu: Respect the initial scissor clip in the clip region
Previously, we would set a scissor rect when doing a partial redraw, but
we would not clip the nodes based on that rectangle.

Do that now.

This massively reduces the amount of ops we emit for small redraws.
2024-01-08 09:28:26 +01:00
Matthias Clasen
59578c6d18 Fix typos throughout
These were pointed out by codespell.
2024-01-07 20:44:05 -05:00
Benjamin Otte
7830535c04 vulkan: Guard dmabuf code with HAVE_DMABUF 2024-01-07 15:07:15 +01:00
Benjamin Otte
3ac50b81f2 vulkan: Make gdk_display_create_vulkan_context() take a surface
This is so we can deprecate gdk_surface_create_vulkan_context() which is
public API in the next commit.
2024-01-07 14:47:22 +01:00
Benjamin Otte
6bac377fa5 gdk: Don't include vulkan.h in public API anymore 2024-01-07 14:47:22 +01:00
Benjamin Otte
df09975753 renderer: Pass the display as part of the vfunc
We allow realizing renderers without surfaces. But they still need a
display, so pass it explicitly.
2024-01-07 14:47:22 +01:00
Benjamin Otte
d21467e2e8 gdk: Remove all VulkanContext API
All API for GdkVulkanContext gets removed here. It was experimental and
it's not a good API. So get rid of it.
2024-01-07 14:47:22 +01:00
Benjamin Otte
5f03053569 gsk: include Vulkan renderer in public header
The Vulkan renderer can just be public API, because it doesn't expose
any Vulkan-specific APIs.
And it can just exist when compiled without Vulkan, because it can fail
to realize.

Also move get rid of the gsk/vulkan/gskvulkanrenderer.h header. It was
experimental and isn't necessary now that the renderer is included via
gsk.h.
2024-01-07 14:47:22 +01:00
Benjamin Otte
03cd652063 gpu: Disable the ubershader when shaders aren't nonuniform
If shaders don't support nonuniform indexing, we emulate it via if/else
ladders (or switch ladders) which get inlined by the GLSL compiles and
massively blow up the code.

And that makes compilation of the shaders take minutes and results in
shader code that isn't necessarily faster.

So we disable it on GL entirely and on Vulkan if the required features
aren't available.

As it's only an optimization and does not fall back to Cairo anymore,
this should be fine.
2024-01-07 08:18:36 +01:00
Benjamin Otte
1723ab34e1 gpu: Setup attribute locations
Make the generator generate calls for the correct glBindAttribLocation()
calls.

Usually this was done correctly, but we can't rely on it. So do it
explicitly.
2024-01-07 07:22:53 +01:00
Benjamin Otte
55dbf0accb gpu: Add GSK_GPU_SKIP=blit
This allows bypassing all blit operations using gsk_gpu_blit_op()
in favor of shaders.
2024-01-07 07:22:53 +01:00
Benjamin Otte
b3d044a0b1 gpu: Add more assertions to blitop
The blitop is nasty, so we should make sure we have supported images
when using it.
2024-01-07 07:22:53 +01:00
Benjamin Otte
2fef71da5c gpu: Generate mipmap by default when downscaling too much
When downscaling more than 2x in either dimension, force mipmap use for
the texture in a texture node.
It improves the quality of textures but takes extra work.

The GL renderer does this, too (for textures that aren't in the icon cache).

This can be disabled via GSK_GPU_SKIP=mipmap.

Fixes the big-checkerboard-scaled-down2 test.
2024-01-07 07:22:53 +01:00
Benjamin Otte
48c1f5fd27 gpu: Add supersampling for gradients
Unless GSK_GPU_SKIP=gradients is given, we sample every point 4x instead
of 1x. That makes the shader run slower (by roughly a factor of 2.5x)
but it improves quality quite a bit.
2024-01-07 07:22:53 +01:00