Commit Graph

76832 Commits

Author SHA1 Message Date
Benjamin Otte
0a5e5023a8 vulkan: Remove unused declaration from shader 2023-06-20 20:15:12 +02:00
Benjamin Otte
c40588886b Merge branch 'wip/otte/for-vulkan' into 'main'
vulkan: Add support for different image formats

See merge request GNOME/gtk!6117
2023-06-19 14:30:50 +00:00
Benjamin Otte
4045a0edd1 vulkan: Check for descriptor indexing extension
By checking if the extension is supported and avoiding devices when it
isn't, we avoid critical warnings later.
2023-06-19 15:08:00 +02:00
Benjamin Otte
636591c080 vulkan: Refactor function
Instead of checking for one specific extension, instead pass the
extension to check for by name.

This way we can reuse it for different extensions.
2023-06-19 15:08:00 +02:00
Benjamin Otte
aa6c670f15 vulkan: Add support for high bit depth 2023-06-19 15:08:00 +02:00
Benjamin Otte
746d0d8fde vulkan: Don't create unnecessary render passes
Pass the render pass to the pipeline creation function instead of
creating an extra one just for pipeline creation.
2023-06-19 15:08:00 +02:00
Benjamin Otte
35b09c727a vulkan: Put the framebuffer in the renderpass
... instead of having fancy caching.

That caching is complicated and it's not necessary.
2023-06-19 15:08:00 +02:00
Benjamin Otte
c35f491795 vulkan: Store the VkFormat in GskVulkanImage
... and use that info when creating renderpasses.
2023-06-19 15:08:00 +02:00
Benjamin Otte
5b64ca7e0a vulkan: Pick high depth texture for high depth nodes
If a node has a higher depth, pick the RGBA format that has that depth
as the texture format we're renderig to with render_texture().

Support for adapting the swapchain is not part of this.
2023-06-19 15:08:00 +02:00
Benjamin Otte
d61737ac7a vulkan: Add format fallback
When a GdkMemoryFormat isn't supported, pick close formats that have a
higher chance of being supported.
Make sure this works recursively and the whole loop always ends up at
R8G8B8A8_UNORM because that one is mandatory.

Roughly, follow these rules:
1. Drop the unpremultiplied
2. Expand channels to include all of RGBA
3. pick swizzle that is RGBA
4. pick next largest depth
5. pick R8G8B8A8_UNORM
2023-06-19 15:08:00 +02:00
Benjamin Otte
ba28971a18 vulkan: Allow mapping images as "read" and/or "write"
This way, we unify the code paths for memory access to textures.

We also technically gain the ability to modify images, though I have no
use case for this.
2023-06-19 15:08:00 +02:00
Benjamin Otte
7b4846bc25 vulkan: Pass format to offscreen creation function
That way, the offscreen can create images of different types.

Its not used in this commit, but will come in handy when we want to
support high bit depth.
2023-06-19 15:08:00 +02:00
Benjamin Otte
eb3ccfb404 vulkan: Remove gsk_vulkan_image_new_for_framebuffer()
Use gsk_vulkan_image_new_for_offscreen() instead, it does the same thing
pretty much.
2023-06-19 15:08:00 +02:00
Benjamin Otte
e4c37ceb34 vulkan: Allow uploading in different formats
This requires quite some code because Vulkan may not support all the
formats and then we need to detect that and fallback properly.
2023-06-19 15:08:00 +02:00
Benjamin Otte
dae1e2b117 vulkan: Create the view in vulkan_image_new()
All callers want it created anyway.

Plus, we can consolidate things in future commits.
2023-06-19 15:08:00 +02:00
Benjamin Otte
49c2366121 testsuite: Unify skipping memorytexture test
... and make it handle more cases of failure, in particular OpenGL and
Vulkan being unsupported by the system.
2023-06-19 15:08:00 +02:00
Emmanuele Bassi
76efe45552 Merge branch 'more-a11y-tweaks' into 'main'
A11y improvements

See merge request GNOME/gtk!6116
2023-06-19 12:53:10 +00:00
Matthias Clasen
1489c764cb docs: Expand role docs
Clarify that presentation and none
can be used interchangeably.
2023-06-19 08:28:54 -04:00
Matthias Clasen
d5a6d09348 dropdown: Use presentation instead of none 2023-06-19 08:28:54 -04:00
Benjamin Otte
ae89f6e6c0 testsuite: Add a vulkan method to memorytexure test
This uses the newly added NULL-surface renderer.
2023-06-19 14:13:03 +02:00
Benjamin Otte
63edecd857 vulkan: Make gsk_renderer_realize() work with NULL surface
Pretty much copy what GL does and just use the default display to create
GPU-related resources without the need for a display.

This also adds gdk_display_create_vulkan_context() but I've
kept it private because the Vulkan API is generally considered in flux,
in particular with our pending attempts to redo how renderers work.
2023-06-19 14:13:03 +02:00
Benjamin Otte
515e1642a4 vulkan: Actually reset the buffer size
Fixes a bug introduced in d1135f9e3c.

Luckily the buffer was large enough that all my testing didn't catch it
because it took a few minutes to overflow.
2023-06-19 14:13:03 +02:00
Benjamin Otte
177ee89b99 vulkan: Renaming fix
This rename was a long time ago...
2023-06-19 14:13:03 +02:00
Matthias Clasen
94f5d2db0d modelbutton: Set a11y shortcuts 2023-06-19 08:09:49 -04:00
Matthias Clasen
d562c86638 printdialog: Some a11y improvements
Add proper roles and labels in some places.
2023-06-19 08:09:49 -04:00
Matthias Clasen
64ff528fe1 printdialog: Give the page range entry a label
This is mainly to pacify the a11y checker.
2023-06-19 08:09:49 -04:00
Matthias Clasen
5993a2a16e notebook: Make sure tabs are labelled 2023-06-19 08:09:49 -04:00
Matthias Clasen
ff20b3f303 windowcontrols: Cosmetics 2023-06-19 08:09:49 -04:00
Matthias Clasen
05ea3470e5 dropdown: Avoid accessibility warnings
The image here is just presentational.
2023-06-19 08:09:49 -04:00
Matthias Clasen
28e1f288c3 infobar: Improve a11y labelling
Treat the close button the same way we treat
the window close button, wrt. to accessibility.
2023-06-19 08:09:48 -04:00
Matthias Clasen
8d9a59f698 gtk-demo: Miscellaneous a11y improvements 2023-06-19 08:09:48 -04:00
Emmanuele Bassi
60a170db88 Merge branch 'a11y-remove-value-opt' into 'main'
a11y: Remove an overzealous optimisation

Closes #5886

See merge request GNOME/gtk!6115
2023-06-19 11:46:19 +00:00
Matthias Clasen
32550fd6fc a11y: Remove an overzealous optimisation
The result of calling update_property needs
to be that the property is marked as set
afterward, even if the value we pass happens
to match the default value.

After this change, scrollbars have value-now
show up as zero in the accessiblity page of
the inspector, even when that matches the lower
bound.

Test included.

Fixes: #5886
2023-06-19 07:22:32 -04:00
Matthias Clasen
12fb249dc6 Merge branch 'a11y-nest-button-redux' into 'main'
Revert "dropdown: Shuffle accessible roles around"

See merge request GNOME/gtk!6111
2023-06-18 15:42:06 +00:00
Matthias Clasen
c3904e8a27 Merge branch 'main' into 'main'
Revert "Use gsk_matrix_transform_point3d consistently"

Closes #5902

See merge request GNOME/gtk!6112
2023-06-18 13:19:07 +00:00
Benjamin Otte
799fd4f4a3 Merge branch 'wip/otte/for-main' into 'main'
memoryformat: Add gdk_memory_format_get_depth()

See merge request GNOME/gtk!6110
2023-06-18 13:14:57 +00:00
Benjamin Otte
090cd2238a gdk: Replace prefers_high_depth with depth
Now that we track depth, we can also pass it into the GDK frame code.

For now it's just passed along, code acts the same as with
prefers_high_depth.
2023-06-18 14:28:39 +02:00
Benjamin Otte
8b8dfcdfb4 rendernode: Change to gsk_render_node_get_preferred_depth()
Instead of just tracking preferred_high_depth(), track the actual depth
we'd like to have.
2023-06-18 14:26:18 +02:00
Benjamin Otte
9015ed1c43 memoryformat: Add gdk_memory_format_get_depth()
Replace gdk_memory_format_prefers_high_depth with the more generic
gdk_memory_format_get_depth() that returns the depth of the individual
channels.

Also make the GL renderer use that to pick the generic F16 format
instead of immediately going for F32 when uploading textures.
2023-06-18 14:26:18 +02:00
Benjamin Otte
1a6d60b7d7 inspector: Handle a11y being disabled 2023-06-18 14:26:18 +02:00
Yiğit Burak
603d9e091c Revert "Use gsk_matrix_transform_point3d consistently"
Revert commit 440d56a4
2023-06-18 15:14:23 +03:00
Matthias Clasen
743b27571d a11y: Special-case nested buttons
Special-case nested buttons in our name computation,
since it is hard to reconcile all the a11y attributes
being on the wrapper, but the focus ending up on the
button inside.

This is a pragmatic approach that works. The only
downside is that the wrapper and the button end up
with the same name+description, but at least orca
seems to only read the focus elements' ones.
2023-06-18 08:12:31 -04:00
Matthias Clasen
30c38951b9 Revert "colordialogbutton: Shuffle accessible roles around"
This reverts commit 343b9d246f.

Unfortunately, this makes it so that the focus ends up on
the 'generic' accessible, not the one with the label, and
orca remains quiet.
2023-06-18 07:35:52 -04:00
Matthias Clasen
11d7052a40 Revert "dropdown: Shuffle accessible roles around"
This reverts commit 5ec0b07baf.

Unfortunately, this makes it so that the focus ends up on
the 'generic' accessible, not the one with the label, and
orca remains quiet.
2023-06-18 07:34:50 -04:00
Matthias Clasen
48d719e58e Merge branch 'matthiasc/for-main' into 'main'
testsuite: Add some more a11y tests

See merge request GNOME/gtk!6109
2023-06-18 03:03:33 +00:00
Matthias Clasen
5ec0b07baf dropdown: Shuffle accessible roles around
Make the internal toggle button generic, so that
the a11y checker doesn't complain about it not
having a label. And mark the icons in the popup
as presentational.
2023-06-17 22:40:17 -04:00
Matthias Clasen
343b9d246f colordialogbutton: Shuffle accessible roles around
Make the color button itself take the button role,
and make the internal toggle button just be generic.

This solves the problem that labelled-by relations
that are set up in ui files via mnemonics point at
the toplevel, not the toggle button.
2023-06-17 22:40:17 -04:00
Matthias Clasen
de622c592d gtk-demo: a11y improvements
Make the clipboard demo come up clean in the
a11y checker.
2023-06-17 22:39:56 -04:00
Matthias Clasen
c2735f98b4 testsuite: Add some more a11y tests
Test that overriding roles works, both
via g_object_new, and via ui files.
2023-06-17 22:00:55 -04:00
Matthias Clasen
7669198d2c Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Fix a crash

Closes #4522

See merge request GNOME/gtk!6108
2023-06-18 01:47:50 +00:00