-
Notifications
You must be signed in to change notification settings - Fork 13
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 #90
base: master
Are you sure you want to change the base?
Conversation
any way to reopen? |
63_CUDAInterop/main.cpp
Outdated
assert(re); | ||
if (!re) logFail("Failed to bind CUDA memory to buffer"); |
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.
btw its return logFail
if you want to quit
63_CUDAInterop/main.cpp
Outdated
// create and allocate CUmem with CUDA and slap it inside a simple IReferenceCounted wrapper | ||
ASSERT_SUCCESS(cudaDevice->createSharedMemory(&cudaMemories[0], { .size = size, .alignment = sizeof(float), .location = CU_MEM_LOCATION_TYPE_DEVICE })); | ||
ASSERT_SUCCESS(cudaDevice->createSharedMemory(&cudaMemories[1], { .size = size, .alignment = sizeof(float), .location = CU_MEM_LOCATION_TYPE_DEVICE })); | ||
ASSERT_SUCCESS(cudaDevice->createSharedMemory(&cudaMemories[2], { .size = size, .alignment = sizeof(float), .location = CU_MEM_LOCATION_TYPE_DEVICE })); | ||
|
||
sema = m_device->createSemaphore({ .externalHandleTypes = ISemaphore::EHT_OPAQUE_WIN32 }); | ||
ASSERT_SUCCESS(cudaDevice->importGPUSemaphore(&cusema, sema.get())); | ||
importedSemaphore = m_device->createSemaphore(0, { .externalHandleTypes = ISemaphore::EHT_OPAQUE_WIN32 }); | ||
ASSERT_SUCCESS(cudaDevice->importGPUSemaphore(&cudaSemaphore, importedSemaphore.get())); |
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.
log a message and return false, don't assert
63_CUDAInterop/main.cpp
Outdated
.levelCount = 1u, | ||
.layerCount = 1u, | ||
} |
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.
explain why you're not doing the usual UNDEFINED to X layout transition we usually see in samples
IIRC its because the CCUDASharedMemory creates a PREINITIALIZED layout image
63_CUDAInterop/main.cpp
Outdated
.subresourceRange = { | ||
.aspectMask = IImage::EAF_COLOR_BIT, | ||
.levelCount = 1u, | ||
.layerCount = 1u, | ||
}, | ||
.oldLayout = IImage::LAYOUT::UNDEFINED, | ||
.oldLayout = IImage::LAYOUT::PREINITIALIZED, |
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.
explain that old layout at the time of release was PREINITIALIZED
and it needs to match at the time of acquire (external user of an image must put it back to same layout after done according to VK spec)
Continues #49