Commit Graph

24 Commits

Author SHA1 Message Date
Benjamin Otte
a5f8a74ec1 vulkan: Only render minimal region
It's faster to render once for every rectangle in the clip region than
rendering the outline of the clip region.
Especially because this reduces the time necessary to build up the frame
data.

In widget-factory (where we have 3 rectangles), this leads to a 5x
speedup in the rendering time rendering alone.
Snapshotting time goes from 10ms to ~1ms, which is another huge
improvement.
2016-12-27 00:31:33 +01:00
Benjamin Otte
786d3a013e vulkan: Implement gsk_renderer_render_texture() 2016-12-23 08:11:01 +01:00
Benjamin Otte
2d2209859e gsk: Rename to gsk_texture_download_surface()
I want to reuse the name gsk_texture_download() for downloading the
actual bytes.
2016-12-23 08:11:01 +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
f258af9cce gsk: Remove GskRenderNodeIter 2016-12-20 18:01:09 +01:00
Benjamin Otte
f52dd12569 vulkan: Implement texture caching
And with this change, the GPU looks bored again.
2016-12-09 18:35:52 +01:00
Benjamin Otte
6525fbe90f vulkan: Don't create more than one render object
By creating unlimited render objects, we would never wait on the GPU.

This would mean that if the GPU was the bottleneck, we would fill its
queue with render commands faster than it could process them.

And because the nvidia binary driver and my code work surprisingly well
and bugfree, this lead to exhaustion of RAM. I had 50GB of swap
configured and my hard disk was quicker as swap storage than my GPU was
at processing the commands, so stuff still filled up.

At that point my computer became rather unresponsive and I decided to
reboot it, so I that could write this patch.
2016-12-09 18:35:52 +01:00
Benjamin Otte
f4685e0291 vulkan: Move remaining structs to VulkanRender object
It now gets to maintain things.
2016-12-09 18:35:52 +01:00
Benjamin Otte
e989375c04 vulkan: Create framebuffers from GskVulkanRender object
Also create them on-demand, as they need to be created per-image and
per-framebuffer, so we don't want to create loads of them.
2016-12-09 18:35:52 +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
ac9d48151b vulkan: Keep render objects around
That way we can reuse them. We only create a new one if the last render
operation hasn't finished executing.
2016-12-09 18:35:51 +01:00
Benjamin Otte
adff39953d vulkan: Move command pool and fence into render object 2016-12-09 18:35:51 +01:00
Benjamin Otte
eb94153a2c vulkan: Make the VulkanRender object allocated
That way, we can have multiple of those and keep them around for reuse.
2016-12-09 18:35:51 +01:00
Benjamin Otte
3c5b25b1d1 vulkan: Add GskVulkanRenderPass
And move the actual rendering code there.

A RenderPass is a collection of operations on the same target that
get executed one after another. It roughly targets VkRenderPass or
rather the subpasses of a VkRenderPass.

For now, only the infrastructure is there. No real stuff is happening.
2016-12-09 18:35:51 +01:00
Benjamin Otte
681554787b vulkan: Add GskVulkanRender object
This is refactoring work.

GskVulkanRender is supposed to be the global object for a render
operation, ie GskVulkanRenderer.render() will create this object for
what it does.

The object will be split into stages that perform the operations
necessary to create a drawing.
2016-12-09 18:35:51 +01:00
Benjamin Otte
583956266e vulkan: Make MVP matrix available to vertex shader
We use push constants for this.
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
Benjamin Otte
a7cbbaf8fc gsk: Pass texture coordinates to Vulkan renderer
We just render the coordinates as color, we don't do anything with them
yet.
2016-12-09 18:35:51 +01:00
Benjamin Otte
2a0e7f8829 gsk: Loads of work on Vulkan backend
We can now upload vertices.

And we use this to draw a yellow background. Which is clearly superior
to not drawing anything.

Also, we have shaders now. If you modify them, you need glslc installed
so they can be recompiled into Spir-V bytecode.
2016-12-09 18:35:51 +01:00
Benjamin Otte
8ba2898e08 vulkan: acquire/present images when drawing
Another step towards the final goal of actually showing something.
2016-12-09 18:35:51 +01:00
Benjamin Otte
06657fa23b gskvulkan: Create render pass and command pool 2016-12-09 18:35:51 +01:00
Benjamin Otte
3e59b11700 gskvulkanrenderer: Create imagevies and framebuffers 2016-12-09 18:35:51 +01:00
Benjamin Otte
a753f047df gsk: Add skeleton for Vulkan renderer
The renderer itself obviously doesn't do anything.
2016-12-09 18:35:51 +01:00