Repository navigation
layers: Check dedicated export handle types at allocation - #13245
Conversation
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
08e04e1 to
6ac4e89
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
|
CI Vulkan-ValidationLayers build queued with queue ID 136825. |
|
CI Vulkan-ValidationLayers build # 24715 running. |
|
CI Vulkan-ValidationLayers build # 24715 failed. |
|
hitting ... when I get time this week, will debug on my local device, need to understand why the AHB is not marked exportable when it clearly should be |
6ac4e89 to
0f1cb25
Compare
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
|
I think I found it: that test's image uses an external format ( |
|
CI Vulkan-ValidationLayers build queued with queue ID 137173. |
|
CI Vulkan-ValidationLayers build # 24720 running. |
|
CI Vulkan-ValidationLayers build # 24720 passed. |
Fixes #10507, picking up from the discussion there. As was pointed out on the issue,
00639itself is always satisfied onceVkMemoryDedicatedAllocateInfonames a buffer or image, but that's also exactly when the export handle types can be checked against the resource atvkAllocateMemory. So this is a first go at that check, usingUNASSIGNED-VUIDs so the spec side can settle the wording:UNASSIGNED-VkMemoryAllocateInfo-pNext-dedicated-buffer-exportUNASSIGNED-VkMemoryAllocateInfo-pNext-dedicated-image-exportWhen the allocation is dedicated and exported, it checks that each handle type in
VkExportMemoryAllocateInfo::handleTypesis reported as exportable for the dedicated buffer or image, and, once they all are, that they're compatible with each other. It's essentially what09860checks at bind time today, just done a little earlier, with the resource the allocation is actually meant for.A few notes on how I went about it:
HasExternalMemoryImportSupportalready did (including the DRM format modifier path for images) now live inGetExternalMemoryProperties, so the import checks and the new check share them.09860exportable/compatible check so the same mistake doesn't get reported twice.00639and the other bind-time checks are unchanged, and non-dedicated memory is still checked at bind time exactly as before. If you'd rather keep both reports, I'm happy to drop that part.VkMemoryDedicatedAllocateInfoTensorARM) aren't covered here, but I'd be glad to add them in a follow-up if that would be useful.Tests:
NegativeExternalMemorySync.DedicatedBufferExportUnsupportedHandleTypeandDedicatedImageExportUnsupportedHandleTypealways allocate dedicated memory with an unsupported handle type and expect the new VUIDs atvkAllocateMemory. They fail on main and pass with this change on the mock ICD, lavapipe and RADV (RX 9070 XT).PositiveExternalMemorySync.DedicatedExportallocates and binds valid dedicated exports for a buffer and an image.BufferMemoryWith{Unsupported,Incompatible}HandleType(s)andImageMemoryWith{Unsupported,Incompatible}HandleType(s)only use a dedicated allocation when the driver requires one, so they now expect the new VUID in that case and09860at bind otherwise. Between the three drivers, both paths get exercised.Very open to reshaping any of this to fit however you'd like the spec change to read.