inexorgame / vulkan-renderer

A new 3D game engine for Linux and Windows using C++20 and Vulkan API 1.3, in very early but ongoing development
https://inexor.org
MIT License
815 stars 34 forks source link

Render Graph improvements #383

Closed yeetari closed 3 years ago

yeetari commented 3 years ago

This PR adds support to the render graph for dynamic buffers. This allows for changeable octree geometry at runtime, which a small demo has been created for. ImGUI support has also been rewritten to work with the render graph. It now fully uses the render graph for the two buffers and stage, however it still relies on textures being done externally. This brings around a 33% FPS improvement - and that's with the bigger octree. With the original octree, I get an FPS improvement of about 73%.

In terms of the internals of the render graph, the two std::unordered_maps used to map resources&stages to physical resources&stages has been removed. A RenderResource now holds a shared_ptr<PhysicalResource> and a RenderStage now holds a unique_ptr<PhysicalStage>. The reason a RenderResource holds a shared pointer is because, in the future, multiple render resources will be able to point to the same physical resource. This makes accessing the physical resource much easier, and removes the need for the ugly create functions.

Also, instead of storing just a std::vector<std::unique_ptr<RenderResource>>, each different type of resource (BufferResource, TextureResource, etc.) now has its own vector. This makes it faster to iterate each type of resource.

IAmNotHanni commented 3 years ago

Btw I can't seei ImGui. Not on Windows and neither on Ubuntu. I will debug this using RenderDoc.

IAmNotHanni commented 3 years ago

It works now on Ubuntu 20.04 LTS!

image

movabo commented 3 years ago

The validation error has indeed been resolved by your recent changes! :+1:

IAmNotHanni commented 3 years ago

Works both on Linux and Windows for me :+1: