Commit Graph

14 Commits

Author SHA1 Message Date
Benjamin Otte
1b2156493b gpu: Remove descriptors
They are no longer a thing with the new way we manage textures.
2024-07-22 19:40:24 +02:00
Benjamin Otte
7b76170f46 gpu: Flip the big switch
Rewrite all shaders to use 2 predefined samplers called GSK_TEXTURE0 and
GSK_TEXTURE1 instead of wrapper functions.

On GL and Vulkan compat mode, these map directly to samplers.
On Vulkan proper, they map to 2 indices into the texture array, like
before.

From now on, the old nvidia GPUs - ie the 3xx drivers - should start
working again.

Fixes: #6564
Fixes: #6574
Fixes: #6654
2024-07-22 19:40:14 +02:00
Benjamin Otte
dc9f0869b1 gpu: Pass used images to shader ops
This by itself is just more work refcounting all those images, but
there's actually a goal here, that will become visible in future
commits.

But this is split out for correctness and benchmarking purposes (the
overhead from refcounting seems to be negligible on my computer).
2024-07-22 18:37:07 +02:00
Benjamin Otte
ea6253c1df gpu: Add a member in ShaderOpClass for number of textures
This just puts the number from the header into a strcut where it can be
accessed.
2024-07-22 18:37:07 +02:00
Benjamin Otte
9644fc2e8f gpu: Use GskGpuShaderImage for mask ops 2024-07-22 18:37:07 +02:00
Benjamin Otte
2fe9ff7918 gpu: Make mask op obey ccs
No colorstate conversions allowed here, though technically we could use
the alternate color state for the source most of the time, as the mask's
colorstate is only relevant for luminance.
2024-07-11 14:57:20 +02:00
Benjamin Otte
6c5ae48a05 gpu: Pass color states as specialization constant
This adds a GdkColorStates that encodes 2 of the default GdkColorStates
and wether their values are premultiplied or not.

Neither do the shaders do anything with this information yet, nor do the
shaders do anything with it yet, this is just the plumbing.
2024-07-11 14:57:20 +02:00
Matthias Clasen
36993ac707 gpu: Print some more details
Print the variations of mask and blendmode operations.
Just because we can.
2024-06-15 14:00:46 -04:00
Benjamin Otte
153b78e2bc gpu: Add a ShaderOp.print_instance vfunc
... and add gsk_shader_op_print() to do the generic stuff.
2024-03-15 19:49:17 +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
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
59d062cb3d gpu: Use variations for the mask mode 2024-01-07 07:22:53 +01:00
Benjamin Otte
d900407a18 gpu: Introduce the concept of "variation"
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.
2024-01-07 07:22:53 +01:00
Benjamin Otte
bd901896ee gpu: Add a mask shader
This shader can take over from the ubershader. And it can be used
instead of launching the ubershader when no offscreens are necessary.

Also includes an optimization that uses the colorize shader when
appropriate.
2024-01-07 07:22:52 +01:00