Commit Graph

16 Commits

Author SHA1 Message Date
Benjamin Otte
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
2017-11-04 00:07:13 +01:00
Matthias Clasen
ff188f6bf0 Add an api to create intermediate textures
The new function creates a vulkan image that is suitable for
use as a framebuffer to render to and as a texture to read from.
2017-09-28 08:39:22 -04:00
Matthias Clasen
e97a78840f gsk: vulkan: Drop an unused api
We don't use the upload-single-region api anymore.
No need to keep it around.
2017-09-21 13:47:17 -04:00
Matthias Clasen
64322a2c41 vulkan: Add an api to update multiple image regions
Instead of doing multiple copy commands with a tiny buffer
for each glyph, we can just batch them all together. This
also avoids the issue of creating multiple barriers for the
same image.
2017-09-21 13:42:57 -04:00
Lionel Landwerlin
b97fb75146 gsk: vulkan: rework image layout/access transitions
By tracking the last transition we can build the appropriate barriers.
Also use the most appropriate initial layout/access at creation :

for linear image : predefined (we prepare the content ourself through memcpy)
for everything else : undefined (we don't care about the content, will most likely be erase)
2017-09-20 23:26:14 -04:00
Matthias Clasen
5ee5af9bc8 vulkan: Add an upload_region api to GskVulkanImage
This will let us update larger textures incrementally.
Sadly, it does not work yet.
2017-09-20 23:26:14 -04:00
Benjamin Otte
786d3a013e vulkan: Implement gsk_renderer_render_texture() 2016-12-23 08:11:01 +01:00
Benjamin Otte
3e4fd32b54 vulkan: Batch upload image barriers together
Doesn't seem to help much though...
2016-12-20 18:01:11 +01:00
Benjamin Otte
7b9ace488b vulkan: Add GskVulkanUploader
It's the thing that makes sure pixels end up on the GPU.
2016-12-20 18:01:11 +01:00
Benjamin Otte
85559d1fd9 vulkan: Split out command pool
This way we can pass the command pool around.
And that allows us to allocate and submitcustom buffers.
And that is necessary to make staging images work.
2016-12-20 18:01:11 +01:00
Benjamin Otte
8756deec58 vulkan: Turn swapchain image targets into GskVulkanImages
This gives us proper refcounting here, too. And there's no longer a
difference between the different types of images.
2016-12-09 18:35:52 +01:00
Benjamin Otte
17c11dd97b vulkan: Store width/height of GskVulkanImage
This is to enable lazy framebuffer creation later.
2016-12-09 18:35:51 +01:00
Benjamin Otte
c160ef16c1 vulkan: Turn GskVulkanImage into a GObject
This way, we can do real refcounting on them.
2016-12-09 18:35:51 +01:00
Benjamin Otte
85bc9ff36b vulkan: Hook up image upload mechanism to env variables
Instead of having to decie at compile-time, check if
GSK_RENDERING=staging-image was given, and if so, select the staging
image upload mode.
2016-12-09 18:35:51 +01:00
Benjamin Otte
13b53656ea vulkan: Upload image data directly
Instead of using a staging iamge, we require the final image to be
linearly allocated and have host-visible memory.

This improves performance quite a bit.

The old code is still there and can be enabled with a simple change
to a #define in gskvulkanimage.h
2016-12-09 18:35:51 +01:00
Benjamin Otte
3c4b952256 vulkan: Make GskVulkanRenderer work
We now create a Cairo renderer, render to an image surface and upload
and retnder it with Vulkan.
2016-12-09 18:35:51 +01:00