-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cuda interop vk13 #637
base: master
Are you sure you want to change the base?
Cuda interop vk13 #637
Conversation
inline bool isDedicated() const {return m_dedicated;} | ||
inline bool isDedicated() const {return m_params.dedicated;} | ||
|
||
//! Returns the size of the memory allocation | ||
inline size_t getAllocationSize() const {return m_allocationSize;} | ||
inline size_t getAllocationSize() const {return m_params.allocationSize;} | ||
|
||
//! | ||
inline core::bitflag<E_MEMORY_ALLOCATE_FLAGS> getAllocateFlags() const { return m_allocateFlags; } | ||
inline core::bitflag<E_MEMORY_ALLOCATE_FLAGS> getAllocateFlags() const { return m_params.allocateFlags; } | ||
|
||
//! | ||
inline core::bitflag<E_MEMORY_PROPERTY_FLAGS> getMemoryPropertyFlags() const { return m_memoryPropertyFlags; } | ||
inline core::bitflag<E_MEMORY_PROPERTY_FLAGS> getMemoryPropertyFlags() const { return m_params.memoryPropertyFlags; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self I'll probably remove all these getters later since we have a struct that we cache
@@ -111,6 +127,7 @@ class IDeviceMemoryBacked : public IBackendObject | |||
//! members | |||
SCachedCreationParams m_cachedCreationParams; | |||
SDeviceMemoryRequirements m_cachedMemoryReqs; | |||
void* m_cachedExternalHandle = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what even sets this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #637 (comment), no need for extra member
uint32_t exportableTypes : 7 = ~0u; | ||
uint32_t compatibleTypes : 7 = ~0u; | ||
uint32_t dedicatedOnly : 1 = 0u; | ||
uint32_t exportable : 1 = ~0u; | ||
uint32_t importable : 1 = ~0u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++20, you can slap enums in bitfields now
case IQueue::FamilyExternal: | ||
case IQueue::FamilyIgnored: | ||
case IQueue::FamilyForeign: | ||
idx |= 1u << 31; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is kinda flaky, cause it relies on my encoding I have that I only use 1 bit for something else, I'd rather do a real switch-case-return (the VK enum)
@@ -9,7 +9,6 @@ namespace nbl::video | |||
CVulkanImage::~CVulkanImage() | |||
{ | |||
preDestroyStep(); | |||
// don't destroy imported handles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new text
// e.g. don't destroy imported handles from the same VkInstance (e.g. if hooking into external Vulkan codebase)
// truly EXTERNAL_MEMORY imported handles, do need to be destroyed + CloseHandled (separate thing)
VkExportMemoryWin32HandleInfoKHR handleInfo = { | ||
.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR, | ||
.dwAccess = GENERIC_ALL, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifdef win32 around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/nbl/video/ILogicalDevice.cpp
Outdated
else if (stageMask.hasFlags(asset::ACCESS_FLAGS::SHADER_WRITE_BITS) && shaderCapableFamily) | ||
stageMask ^= asset::ACCESS_FLAGS::SHADER_WRITE_BITS; | ||
return getSupportedAccessMask(queueFamilyIndex).hasFlags(stageMask); | ||
VK_ACCESS_SHADER_WRITE_BIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one stale line leftover?
inline bool valid() const | ||
enum Validity | ||
{ | ||
INVALID, | ||
VALID, | ||
WORK_WITHOUT_SYNC, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, you have a logger for a reason.
Description
Testing
TODO list: