Repository navigation
Conversation
Follow-up to ruis issue #190: the shareable-object make_* functions now live on a new vulkan::factory that wraps the shared vulkan_device (VkInstance + VkDevice + VkQueue). vulkan::context takes an injected factory and no longer creates GPU objects; it uses the factory's device for swapchain/framebuffer/draw work. The one-shot command buffer, descriptor pool, and pipeline cache/layout/dsl resources move to the factory (shared across all windows). all_textures (deferred upload tracking) moves to the factory.
|
The base-class 'factory' data member hides the type in derived scope, so the downcasts in the concrete buffer/texture classes now use the fully-qualified ruis::render::vulkan::factory type.
igagis
commented
Nov 19, 2026
igagis
commented
Nov 19, 2026
igagis
commented
Nov 19, 2026
igagis
commented
Nov 19, 2026
igagis
commented
Nov 19, 2026
- Rename the factory constructor parameter from rendering_context to factory and pass it by value with std::move (a shared_ref should be passed by value, not by const reference). - Drop the redundant ctx_ref members from the Vulkan shaders, GPU objects (texture_2d, vertex_buffer, texture_depth, index_buffer) and the frame_buffer: the base classes already retain the factory (now protected) or the context (frame_buffer), so the derived classes access them directly. - Hide the factory's all_textures list behind private mutable state with const register_texture()/unregister_texture() accessors, so the texture ctor/dtor no longer need a const_cast on the const factory reference. - Rename the context's retained factory reference from vu_factory to factory and remove the now-unnecessary const_casts on the factory (all of its methods are const).
igagis
commented
Nov 19, 2026
The factory obtains all GPU handles from the surface provider and never uses the native window, so the parameter was dead weight. Drop it.
- Rename surface_provider class to surface (file and class name) - Make vulkan_device constructor public (remove make() factory method) so callers can use make_shared directly - Rename VkSurfaceKHR member to vk_surface to avoid name clash with class
igagis-bot
reviewed
Nov 20, 2026
- Rename vulkan_device class to device (file and class name) - Rename VkDevice member to vk_device to avoid name clash with class - Rename surface member 'const device* device' to 'vu_device'
Remove the deferred texture upload mechanism. Textures are now uploaded synchronously to the GPU when created, using a one-shot command buffer. This simplifies the code and eliminates the need for tracking uploaded state across frames.
The Vulkan context now handles presentation through the render context's swap_frame_buffers() virtual method, eliminating the need for the native window to hold a pointer back to the context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to cppfw/ruis#190 (render context redesign).
The shareable-object
make_*functions now live on a newvulkan::factorythat wraps the sharedvulkan_device(VkInstance+VkDevice+VkQueue).vulkan::contexttakes an injected factory and no longer creates GPU objects; it uses the factory's device for swapchain/framebuffer/draw work. The one-shot command buffer, descriptor pool, and pipeline cache/layout/dsl resources move to the factory (shared across all windows), as doesall_textures(deferred upload tracking).Depends on cppfw/ruis#192.