summaryrefslogtreecommitdiff
path: root/gdk/gdkvulkancontext.c
Commit message (Collapse)AuthorAgeFilesLines
* vulkan: Fix swapchain creationMatthias Clasen2020-09-101-3/+3
| | | | | | | | | We end up with a surface that has size 0x0 at the time we create the Vulkan context, and that is a size that Vulkan doesn't like, so ensure we request at least 1x1. Fixes: #3147
* Replace "gchar" with "char"Benjamin Otte2020-07-251-1/+1
|
* Fix minor typosYuri Chornoivan2020-05-281-2/+2
|
* Fix build issue due to missing VK_RESULT_RANGE_SIZEAdrian Perez de Castro2020-05-111-0/+2
| | | | | | | | Conditionally check whether the Vulkan headers version defines VK_RESULT_RANGE_SIZE, and avoid using it for version >=140. The following comming in Vulkan-Headers has removed the enum value: https://github.com/KhronosGroup/Vulkan-Headers/commit/0c5351f5e9114d3e9033aeae51d036a3d201c082#diff-4febd94c0666d59030d8b1dd20c72403
* vulkan: Update error codes enumMatthias Clasen2020-04-261-1/+15
| | | | Do the silly update exercise.
* vulkan: Handle VK_ERROR_UNKNOWNEmmanuele Bassi2020-02-111-1/+4
| | | | A newly added Vulkan 1.2 error.
* wayland/vulkancontext: Fix present region on HiDPIJonas Ådahl2019-12-031-4/+7
| | | | | VkPresentRegionsKHR is expected to operate in buffer coordinates, but the region we get passed is in surface coordinates, so it must be scaled.
* vulkan: Add missing enum valueBenjamin Otte2019-11-011-1/+5
| | | | | Also update comment to point to new header after Vulkan reorganized their repositories.
* vulkan/context: Implement VK_KHR_incremental_presentGeorges Basile Stavracas Neto2019-10-051-7/+68
| | | | | | This is the Vulkan version of eglSwapBuffersWithDamage(), and it's always a good idea to limit the number of pixels we're pushing to the GPU and/or swapping into the display.
* marshallers: ensure g_cclosure_marshal_VOID__VOIDv is usedChristian Hergert2019-05-291-2/+2
| | | | | | | If we set c_marshaller manually, then g_signal_newv() will not setup a va_marshaller for us. However, if we provide c_marshaller as NULL, it will setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
* vulkan: Add missing enumeration valueEmmanuele Bassi2019-04-121-0/+4
| | | | | Vulkan 1.1.97 added VK_ERROR_INVALID_DEVICE_ADDRESS_EXT, and we now must handle it.
* gdk: Rename our vulkan context to GTKMatthias Clasen2019-02-241-1/+1
| | | | Not sure it shows up anywhere, but just for completeness.
* build: Reintroduce warning flags from autotoolsBenjamin Otte2019-01-221-4/+4
| | | | | | | | | Some of the flags got lost in the meson transition or were demoted from error flags to warning flags. This commit reintroduces them. It also includes fixes for the code that had warnings with those flags. The big one being -Wshadow.
* vulkancontext: fix typos in documentationAbderrahim Kitouni2018-11-171-2/+2
|
* vulkancontext: Add missing error switchTimm Bäder2018-11-131-0/+5
|
* drawcontext: Only pass the region that mattersBenjamin Otte2018-04-241-2/+1
| | | | | | We used to pass 2 regions to GdkDrawCotnext.end_frame() but code was confusing what they meant. So we now don't do that anymore and only pass the region that matters: The frame region.
* drawcontext: Add gdk_draw_context_in_frame() APIBenjamin Otte2018-04-241-2/+2
| | | | | | | | This makes the previous gdk_draw_context_is_drawing() function public under a new name. I decided against the old name because we use the term "frame" for a drawing operation, so I wanted to have this boolean flag reuse the term.
* gdk: Move begin/end_frame() functionsBenjamin Otte2018-04-241-6/+4
| | | | | | | | | | As they require a draw context and the draw context is already bound to the surface, it makes much more sense and reduces abiguity by moving these APIs to the draw context. As a side effect, we simplify GdkSurface APIs to a point where GdkSurface now does not concern itself with drawing anymore at all, apart from being the object that creates draw contexts.
* vulkancontext: Add new error enumTimm Bäder2018-04-101-0/+4
|
* vulkan: Use new resize vfunc to recreate swapchainBenjamin Otte2018-04-091-17/+15
| | | | ... instead of checking sizes for every frame.
* vulkan: Reserve 4 images in the swapchain by defaultBenjamin Otte2018-03-291-1/+1
| | | | | | | | | | With the previous approach we would spend most of the time waiting for the swapchain to be filled again because it seems the compositor takes care of 2 images at once from time to time. This is not visible in profiles because waiting for a frame is a read/poll/whatever operation that does not take CPU. It's only noticeable because the app becomes less responsive.
* GdkSurface: Rename lots of stuff from window->surfaceAlexander Larsson2018-03-201-15/+15
| | | | | Mostly these are internal things, but the major public change is that event.window is now event.surface.
* GdkSurface: Rename various functions and variablesAlexander Larsson2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an automatic rename of various things related to the window->surface rename. Public symbols changed by this is: GDK_MODE_WINDOW gdk_device_get_window_at_position gdk_device_get_window_at_position_double gdk_device_get_last_event_window gdk_display_get_monitor_at_window gdk_drag_context_get_source_window gdk_drag_context_get_dest_window gdk_drag_context_get_drag_window gdk_draw_context_get_window gdk_drawing_context_get_window gdk_gl_context_get_window gdk_synthesize_window_state gdk_surface_get_window_type gdk_x11_display_set_window_scale gsk_renderer_new_for_window gsk_renderer_get_window gtk_text_view_buffer_to_window_coords gtk_tree_view_convert_widget_to_bin_window_coords gtk_tree_view_convert_tree_to_bin_window_coords The commands that generated this are: git sed -f g "GDK window" "GDK surface" git sed -f g window_impl surface_impl (cd gdk; git sed -f g impl_window impl_surface) git sed -f g WINDOW_IMPL SURFACE_IMPL git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface git sed -f g gsk_renderer_get_window gsk_renderer_get_surface git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface (cd gdk; git sed -f g window_type surface_type) git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type git sed -f g window_at_position surface_at_position git sed -f g event_window event_surface git sed -f g window_coord surface_coord git sed -f g window_state surface_state git sed -f g window_cursor surface_cursor git sed -f g window_scale surface_scale git sed -f g window_events surface_events git sed -f g monitor_at_window monitor_at_surface git sed -f g window_under_pointer surface_under_pointer (cd gdk; git sed -f g for_window for_surface) git sed -f g window_anchor surface_anchor git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL git sed -f g native_window native_surface git sed -f g source_window source_surface git sed -f g dest_window dest_surface git sed -f g drag_window drag_surface git sed -f g input_window input_surface git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
* GdkWindow -> GdkSurface initial type renameAlexander Larsson2018-03-201-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames the GdkWindow class and related classes (impl, backend subclasses) to surface. Additionally it renames related types: GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType, GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge This is an automatic conversion using the below commands: git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass git sed -f g GdkWindow GdkSurface git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2" git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE" git sed -f g "broadway_window" "broadway_surface" git sed -f g "BroadwayWindow" "BroadwaySurface" git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE" git sed -f g "wayland_window" "wayland_surface" git sed -f g "WaylandWindow" "WaylandSurface" git sed -f g "X11_WINDOW" "X11_SURFACE" git sed -f g "x11_window" "x11_surface" git sed -f g "X11Window" "X11Surface" git sed -f g "WIN32_WINDOW" "WIN32_SURFACE" git sed -f g "win32_window" "win32_surface" git sed -f g "Win32Window" "Win32Surface" git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE" git sed -f g "quartz_window" "quartz_surface" git sed -f g "QuartzWindow" "QuartzSurface" git checkout NEWS* po-properties
* vulkan: Our data is premultiplied, don't pretend it isn'tBenjamin Otte2018-03-161-2/+0
| | | | If the backend can't do premultiplied alpha, better make the backend treat
* vulkan: Don't quiet the compilerBenjamin Otte2018-02-231-1/+29
| | | | | | | This reverts 76461a8004caf4490f84140b0551d1f5296241f6. We don't want to quiet the compiler here because new warnings should be added to the enum the moment they become available.
* vulkan: Add error strings for missing VkResultsBenjamin Otte2018-02-231-0/+12
| | | | | Also, guard newer error returns with proper #if, so they don't trip up older Vulkan versions.
* Make gdk logging per-displayMatthias Clasen2018-01-141-9/+12
| | | | | | | As far as possible, use per-display debug flags. This will minimize the debug spew that we get from the inspector if it is running on a separate display.
* gdk: Reorganize env varsMatthias Clasen2018-01-141-2/+2
| | | | | | Drop GDK_GL, GDK_VULKAN and GDK_RENDERING_MODE. Merge the useful bits into GDK_DEBUG. Drop unused debug flags (CURSOR).
* Quiet a compiler warningMatthias Clasen2018-01-101-1/+1
| | | | | Avoid this warning the other way, without bumping the libvulkan dependency.
* Revert "Quiet a compiler warning"Matthias Clasen2018-01-101-1/+0
| | | | This reverts commit 888f289114756daeb80591afd48496fce1d63e8d.
* vulkan: Add a way to specify a deviceMatthias Clasen2018-01-091-20/+87
| | | | | | | | We should be smarter in picking a good device eventually, but for now, we just allow to explicitly choose one. To see a list of all devices, use GDK_VULKAN_DEVICE=list To specify which device to use, use GDK_VULKAN_DEVICE=<number>
* Quiet a compiler warningMatthias Clasen2018-01-091-0/+1
| | | | Vulkan grew a new error code.
* gdk: Cosmetic rewording of draw context docsMatthias Clasen2017-12-261-3/+3
| | | | | Avoid draw context <> drawing context confusion, as far as possible.
* gdk: Document GdkVulkanContextMatthias Clasen2017-12-261-0/+98
| | | | New API needs documentation.
* gdk: Fill in some blanks in the docsMatthias Clasen2017-12-041-0/+16
| | | | This is just an initial cut; more work is needed.
* vulkan: Don't crash if vkEnumeratePhysicalDevices failsAlexander Larsson2017-11-301-3/+5
|
* vulkan: Handle changing window scaleMatthias Clasen2017-10-281-2/+2
| | | | | | | | The code that checks for the proper size of the our swapchain was not taking window scale fully into account. With this change, setting the window scale to 2 in the inspector causes the window to grow and rendering to be scaled up as expected, with Vulkan, in the same way it already is with cairo.
* vulkan: Add some missing cases to switchMatthias Clasen2017-10-061-0/+2
|
* build: Enable -Wswitch-enum and -Wswitch-defaultBenjamin Otte2017-10-061-0/+6
| | | | | | | | | | | | | | | | | | | 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.
* gdk: Tone down Vulkan validationMatthias Clasen2017-09-261-16/+6
| | | | | | Don't show informational messages by default, only warnings and errors. This makes it much easier to see what is going on.
* gdk/gdkvulkancontext.c: Fix 32-bit Windows buildsChun-wei Fan2017-06-061-1/+1
| | | | | | | | | | | | | The callback function that is used by VkDebugReportCallbackCreateInfoEXT is decorated with VKAPI_CALL (which is __stdcall on Windows). This is not detected on x64 Windows as __stdcall is not really meaningful on x64 Windows, and VKAPI_CALL expands to nothing on non-Windows. As __stdcall functions are treated differently on 32-bit Windows, the 32-bit compiler does require that the function be declared as __stdcall so that things will compile, link and run properly. https://bugzilla.gnome.org/show_bug.cgi?id-773299
* vulkancontext: Improve debug outputGeorges Basile Stavracas Neto2017-01-061-5/+5
|
* vulkancontext: Never abort on validation layer debugGeorges Basile Stavracas Neto2017-01-061-1/+1
| | | | | Validation layers should never interfere on application execution.
* vulkan: Create required number of swapchain imagesBenjamin Otte2017-01-041-1/+3
| | | | | Wayland has minImageCount == 4, so us just creating 2 images is not very nice. So we don't do that anymore.
* gdkvulkan: Track if we reffed the display's vulkan dataBenjamin Otte2017-01-041-2/+5
| | | | | When reffing the display fails in init, we were still trying to unref it. Which obviously failed and spewed warnings to stderr.
* vulkancontext: Assume the window geometry when extents are bogusGeorges Basile Stavracas Neto2017-01-041-0/+11
| | | | | When the current extent is -1, we should assume whatever size the GdkWindow has.
* gdk/gdkvulkancontext.c: Avoid VLAsChun-wei Fan2016-12-291-5/+5
| | | | | | | During the drive to enable Vulkan context creation on Windows, some more VLAs were found here. Replace them with g_newa(). https://bugzilla.gnome.org/show_bug.cgi?id=773299
* gdkvulkan: Track changes per swapchain imageBenjamin Otte2016-12-261-0/+33
| | | | | ... and use those in begin_frame() to ensure all of the invalid area gets invalidated.
* vulkan: We use VK_FORMAT_B8G8R8A8_UNORMBenjamin Otte2016-12-251-1/+1
| | | | | ... not SRGB. SRGB messes up alpha compositing, GdkRGBA and everything else.