It's still possible to disable via -Dvulkan=disabled
We force-disable it on Mac OS.
I don't know how to best handle it on Windows. Technically we don't need
it, because the Vulkan stuff we want is about dmabufs, but I have no
idea how to convince the build system to toggle the default to
"disabled" on Windows, so it has to stay enabled for now.
This means we don't need to include gdkvulkancontext.h and it means we
don't initialize Vulkan if it isn't initialized yet.
Should we?
Should we add a button maybe?
No idea.
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.
Add a testsuite called gsk-compare-vulkan to run
the gsk renderer tests with the Vulkan renderer and
gsk-compare-ngl to run them with the NGL renderer.
To run the tests locally, you can do:
meson test -C_build --suite gsk-compare-vulkan
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.
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.
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.
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.
I'm a bit unsure about using the zero rect in the fallback situtation
where one image doesn't exist, but it seems to work.
This removes the last pattern-only rendernode and with that the last
fallback usage with disabled ubershader.
This way we can toggle opacity handling on/off.
THe shader slowly turns into a fancy texture op - but I don't want to
rename it to "fancytexture" just yet.
A variation is a #define/specialization constant that every shader can
use to specialize itself as it sees fit.
This commit adds the infrastrcture, future commits will add
implementations.
gdk_texture_save_to_png_bytes() cannot fail, so ensure that it doesn't.
Testsuite has been updated to check for this case.
Note that we do not load the PNG file that we generate here.
Loading is a lot more scary than saving after all.
If people want to load oversized PNG files, they should use a real PNG
loader.
If we enter the situation where we need to redirect the clipping to an
offscreen, make sure that:
* the ubershader gets only used when beneficial
* we size the offscreen properly and don't let it grow infinitely.
Fixes the clip-intersection-fail-opacity test
There are various places where the alpha is implicitly assumed to be
handled, so just handle it.
As a bonus, this simplifies a bunch of code and makes the texture node
rendering work with alpha.