Skip to content

docs: add RFC for opaque generational handles#8

Open
gituser12981u2 wants to merge 5 commits intoalex_stufffrom
docs/rfc-0001-opaque-generational-handles
Open

docs: add RFC for opaque generational handles#8
gituser12981u2 wants to merge 5 commits intoalex_stufffrom
docs/rfc-0001-opaque-generational-handles

Conversation

@gituser12981u2
Copy link
Copy Markdown
Owner

Added RFC for opaque handles.

Please put all comments about this RFC here.

@gituser12981u2 gituser12981u2 self-assigned this Mar 22, 2026
@gituser12981u2 gituser12981u2 added the documentation Improvements or additions to documentation label Mar 22, 2026
@alexcu2718
Copy link
Copy Markdown
Collaborator

I do wonder if the singular handle type view maybe a blocker for more eccentric design choices down the road?

One thing we may want to do is use (or create a simple one ourselves?) for a bump allocator, it's piss easy if it's thread local to self write but obviously not suitable. Probably best to investigate this?

(The bump allocator would have to be non-homogenous, pretty simple though.)

*Maybe this comes into mind later down the road, when we're handling game entity objects.

Other than that random discourse, looks really slick. Also love the concept use haha.

@gituser12981u2
Copy link
Copy Markdown
Owner Author

gituser12981u2 commented Mar 30, 2026

Okay, I add allocator input (optional)

@@ -1,3 +1,6 @@
#include "quark/utils/error_types.hpp"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quark/utils/diagnostic.hpp already includes error_types.hpp and result.hpp.

We should only need diagnostic_prelude. So remove diagnostic.hpp and error_types.hpp and result.hpp and keep only diagnostic_prelude.hpp

@@ -1,11 +1,18 @@
#include "quark/utils/details/diagnostic_details.hpp"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of these are included in diagnostic_prelude.

Make sure to delete extra imports before PRing or else I will tell Benjamin Netanyahu of all your transgressions and then you will be barred from Isreal.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOOOOO

#include <string_view>
#include <vector>
#include <vulkan/vulkan.h>
#include <vulkan/vk_platform.h>
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this.

Should cut down on compile times since vulkan.h is bigger than vk_platform + vulkan_core.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should look into a header that forward declares all the vk functionality much like .


bool enable_portability = false;
#if defined(__APPLE__)
#ifdef __APPLE__
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaningless change?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why write long words when few word do trick yes

@@ -1,13 +1,18 @@
#include <cstddef>
#include "quark/utils/result.hpp"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result is included in diagnostic.

#include <quark/vk/instance/details/instance_handle.hpp>
#include <quark/vk/instance/details/instance_registry.hpp>
#include <quark/vk/instance/instance_bundle.hpp>
#include <vulkan/vulkan_core.h>
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? I don't see any Vulkan specifics here.

// Destroy views
if (device_ != VK_NULL_HANDLE) {
for (VkImageView v : image_views_) {
for (VkImageView const v : image_views_) {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was wrong, it just creates a const ptr, not a const object.


const void *GlfwWindow::query_interface(InterfaceId id) const noexcept {
if (const void *cached = iface_.find(id)) {
if (const void *const cached = iface_.find(id)) {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the additions of const where needed. Netanyahu will be happy.

Comment thread .clang-tidy
value: true
- key: cppcoreguidelines-rvalue-reference-param-not-moved.IgnoreUnnamedParams
value: true
- key: readability-convert-member-functions-to-static
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely keep this true

@gituser12981u2
Copy link
Copy Markdown
Owner Author

I do wonder if the singular handle type view maybe a blocker for more eccentric design choices down the road?

One thing we may want to do is use (or create a simple one ourselves?) for a bump allocator, it's piss easy if it's thread local to self write but obviously not suitable. Probably best to investigate this?

(The bump allocator would have to be non-homogenous, pretty simple though.)

*Maybe this comes into mind later down the road, when we're handling game entity objects.

Other than that random discourse, looks really slick. Also love the concept use haha.

Good idea. I think this should be at the registry level and not the handle level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants