Skip to content

Add external memory support for vulkan on windows & linux#275

Closed
inner-daemons wants to merge 8 commits into
Traverse-Research:mainfrom
supasim:external-memory-vulkan
Closed

Add external memory support for vulkan on windows & linux#275
inner-daemons wants to merge 8 commits into
Traverse-Research:mainfrom
supasim:external-memory-vulkan

Conversation

@inner-daemons
Copy link
Copy Markdown

@inner-daemons inner-daemons commented Jun 20, 2025

This has been tested by my own project, though no in tree testing is there yet(not sure how I'd add that). Also, the testing is only for vulkan Linux but I suspect it would also work on Windows in its current state.

Based on discussion in #274, also going to ping @Jasper-Bekkers :)

Implementation details: the memory is only allocated with support for exporting it later. The user must manually export the memory later, though this isn't very difficult. Used as a reference was this article from vulkan docs.

@inner-daemons
Copy link
Copy Markdown
Author

I've verified in a personal project that this code works. I'd like to get a review of it so we can hopefully get this merged! Going to ping @Jasper-Bekkers, hopefully this isn't too much of a hassle. No rush here just want to make sure you see it!

Comment thread src/vulkan/mod.rs Outdated
Comment thread src/vulkan/mod.rs Outdated
Comment on lines +385 to +386
// On other platforms you can't create an external capable allocator, so this would be unreachable
#[cfg(any(windows, all(unix, not(target_vendor = "apple"))))]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think on other platforms then we should fail with an error rather then silently failing to create an exportable texture.

Copy link
Copy Markdown
Author

@inner-daemons inner-daemons Jul 17, 2025

Choose a reason for hiding this comment

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

The error would occur elsewhere, see lines 843-845

Comment thread src/vulkan/mod.rs Outdated
@inner-daemons
Copy link
Copy Markdown
Author

I think I've addressed most comments

@inner-daemons
Copy link
Copy Markdown
Author

Going to ping you @MarijnS95 and @Jasper-Bekkers since this has been stale for a while

@inner-daemons
Copy link
Copy Markdown
Author

Going to close this as I'm not getting any response.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants