-
Notifications
You must be signed in to change notification settings - Fork 65
Cuda interop vk13 #637
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
base: master
Are you sure you want to change the base?
Cuda interop vk13 #637
Changes from 4 commits
d293b9b
f5f1017
6689b33
9ade1c6
bfa7afc
ddb861e
f380398
2f7b517
bd32f36
b1c5a46
0d36581
725a984
d2c9382
2d24604
2114e50
f6320ce
f749ab8
ad1e6ff
a1afcc8
262281f
d7690be
13ff02a
fabc999
0eb8e9a
e59408d
3f41a81
fb1f50d
94ee680
c761d42
04689b9
4a17eaf
5fcad02
3c97ef1
06b43af
fd73e28
153dd21
bc7e24d
b234d3b
b5a633a
2ab33ed
bbc5aa9
d41f279
04d05da
3d034c5
3160a46
8670d42
2d86373
ca2593c
461cb4a
d96fd1d
2d2acc9
60c1c39
3faf1fb
fd4f733
5b1940c
7074256
6449b2f
3d9a530
4d174e5
cbd18f4
23fe8d4
c32fd79
4e2185c
bd0b76a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,7 @@ class IDeviceMemoryBacked : public IBackendObject | |
|
||
//! members | ||
SCachedCreationParams m_cachedCreationParams; | ||
SDeviceMemoryRequirements m_cachedMemoryReqs; | ||
const SDeviceMemoryRequirements m_cachedMemoryReqs; | ||
void* m_cachedExternalHandle = nullptr; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. see #637 (comment), no need for extra member |
||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,25 +48,41 @@ void fill(vk_barrier_t& out, const ResourceBarrier& in, uint32_t selfQueueFamily | |
// https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkBufferMemoryBarrier2-buffer-04088 | ||
if (concurrentSharing) | ||
selfQueueFamilyIndex = IQueue::FamilyIgnored; | ||
|
||
auto mapQFIdx = [](uint32_t idx) | ||
{ | ||
switch (idx) | ||
{ | ||
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 commentThe 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) |
||
break; | ||
} | ||
return idx; | ||
}; | ||
|
||
if constexpr (!std::is_same_v<vk_barrier_t,VkMemoryBarrier2>) | ||
{ | ||
out.srcQueueFamilyIndex = selfQueueFamilyIndex; | ||
out.dstQueueFamilyIndex = selfQueueFamilyIndex; | ||
out.srcQueueFamilyIndex = mapQFIdx(selfQueueFamilyIndex); | ||
out.dstQueueFamilyIndex = mapQFIdx(selfQueueFamilyIndex); | ||
} | ||
const asset::SMemoryBarrier* memoryBarrier; | ||
if constexpr (std::is_same_v<IGPUCommandBuffer::SOwnershipTransferBarrier,ResourceBarrier>) | ||
{ | ||
memoryBarrier = &in.dep; | ||
// in.otherQueueFamilyIndex==selfQueueFamilyIndex not resulting in ownership transfer is implicit | ||
if (!concurrentSharing && in.otherQueueFamilyIndex!=IQueue::FamilyIgnored) | ||
switch (in.ownershipOp) | ||
if (!concurrentSharing && in.otherQueueFamilyIndex != IQueue::FamilyIgnored) | ||
{ | ||
switch (in.ownershipOp) | ||
{ | ||
case IGPUCommandBuffer::SOwnershipTransferBarrier::OWNERSHIP_OP::RELEASE: | ||
out.dstQueueFamilyIndex = in.otherQueueFamilyIndex; | ||
out.dstQueueFamilyIndex = mapQFIdx(in.otherQueueFamilyIndex); | ||
break; | ||
case IGPUCommandBuffer::SOwnershipTransferBarrier::OWNERSHIP_OP::ACQUIRE: | ||
out.srcQueueFamilyIndex = in.otherQueueFamilyIndex; | ||
out.srcQueueFamilyIndex = mapQFIdx(in.otherQueueFamilyIndex); | ||
break; | ||
} | ||
} | ||
} | ||
else | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. new text
|
||
if (!m_cachedCreationParams.skipHandleDestroy) | ||
{ | ||
const CVulkanLogicalDevice* vulkanDevice = static_cast<const CVulkanLogicalDevice*>(getOriginDevice()); | ||
|
Uh oh!
There was an error while loading. Please reload this page.