AnsweredAssumed Answered

Interop of Vulkan Image and D3D11 Texture

Question asked by roman380 on Jul 23, 2019
Latest reply on Aug 19, 2019 by dorisyan

I am trying to figure out how to create a Vulkan 2D image shared with D3D11 texture.

 

My Windows 10 development system is equipped with Radeon RX 570 Series card which is a primary GPU device with monitors connected to it. I have 19.7.2 driver installed along with Vulkan RT and SDK 1.1.108.

 

For the record, there is a related topic here, which however does not help me enough.

 

I have a derivative of Vulkan SDK vcubecpp application which code as described below. This is a branch with code, and this is, separately, a diff which highlights my code edit.

 

It is worth mentioning that vkGetPhysicalDeviceImageFormatProperties2 gets me VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT | VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT external memory features with VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT compatible handle for VK_FORMAT_R8G8B8A8_UNORM image. And this is what I am trying to do: to "import" an existing D3D11 texture for allocation of Vulkan image, if I understand the concept of import right.

 

Things are not going well at already vkGetImageMemoryRequirements2 step here.

 

If validation layer is not enabled, I get a memory access violation inside the call.

 

If however, the layer is enabled, the call passes through, but output VkMemoryRequirements remain uninitialized.

 

If I attempt to "fix" this by regular vkGetImageMemoryRequirements and use the data for allocation, I seem to be able to complete allocation and binding and the rest of the calls succeed (with still no confirmation whether the copied data got into the texture).

 

In a more complicated application where I do seemingly the same thing, but the source of the data is coming from image receiving render results, I have a consistent BSOD inside vkQueueSubmit call. Even though the properties of the images look the same, submission of work causes a kernel bugcheck (also attached bugcheck.txt):

 

VIDEO_SCHEDULER_INTERNAL_ERROR (119)
The video scheduler has detected that fatal violation has occurred. This resulted
in a condition that video scheduler can no longer progress. Any other values after
parameter 1 must be individually examined according to the subtype.
Arguments:
Arg1: 0000000000000001, The driver has reported an invalid fence ID.
Arg2: 00000000ffb93b0a
Arg3: 00000000000002ea
Arg4: ffffad0f724e7000

 

...

 

nt!KeBugCheckEx
watchdog!WdLogEvent5_WdCriticalError+0xe0
dxgmms2!VidSchiVerifyDriverReportedFenceId+0xe803
dxgmms2!VidSchDdiNotifyInterruptWorker+0x291
dxgmms2!VidSchDdiNotifyInterrupt+0xd1
dxgkrnl!DxgNotifyInterruptCB+0x94
atikmpag+0x52960
atikmdag+0x4e0ba8
atikmdag+0x9607d
0x1
0xffffad0f`6a7ac000

 

In all cases, I don't see any reasonable hints from validation layer and debug output to help with vkGetImageMemoryRequirements2 and BSOD. That is, it brings me into situation where I am not sure what I should do to troubleshoot this further.

 

I would appreciate help in setting the interop up correctly or possibly an example of image/texture sharing.

Attachments

Outcomes