Has something changed in Direct3D backend?

28 views
Skip to first unread message

Mark Sibly

unread,
Jan 2, 2024, 7:55:41 AMJan 2
to Dawn Graphics
Hi,

I am working on an OpenXR compatible branch of dawn in my spare time which I merged with upstream (main branch) this morning and have found the Direct3D12 backend no longer works with OpenXR (works OK without), although the Vulkan one still does so I can just use that for now.

Things are failing in the OpenXR backend (which I assume is closed source in steamvr?) when it tries to create an 'XrSwapChain' with the d3d12 device and command queue I give it, which I have obtained from dawn via some APIs I added. I assume all it's trying to do is create a texture so I'm not sure how that could start failing, but then I know little about D3D12.

As far as I can tell, not that much has changed (where I'm poking around anyway) since my last merge a few months ago, although I did have to change the GetD3D12CommandQueue code - does this look OK?


I had to change CreateSwapchainWGPUTexture() too, but it's not even getting that far...to that...

Also, I remember a few versions ago there was a 'compatiblity' mode flag somewhere that needed to be removed before some feature was restored - is there anything like that I need to be wary of?

Bye!
Mark

Corentin Wallez

unread,
Jan 3, 2024, 10:26:06 AMJan 3
to Mark Sibly, Dawn Graphics
Hey Mark,

The code you pointed at looks correct so I'm not sure what could be going wrong. Do you have any debug messages from the OpenXR runtime? AFAIK we didn't change much in device / queue creation recently, just moved some code around.

Cheers,

Corentin

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dawn-graphics/e0e207af-7490-4a8e-a29b-ba339880c076n%40googlegroups.com.

Mark Sibly

unread,
Jan 3, 2024, 10:50:16 PMJan 3
to Corentin Wallez, Dawn Graphics
Yay, sorted!

For reference (if anyone's doing openxr)...

When you create an openxr swapchain, the XrSwapchainCreateInfo struct usageFlags MUST include  XR_SWAPCHAIN_USAGE_SAMPLED_BIT, eg:

swapchainInfo.usageFlags = XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT | XR_SWAPCHAIN_USAGE_SAMPLED_BIT;

Not sure what changed when, but this didn't used to be necessary. I actually suspect steamvr here, it updates itself a lot and I didn't test with dawn-openxr *before* I merged latest version, only after, so it was probably broken before too. Lesson to be learned here I guess...

Bye,
Mark

Corentin Wallez

unread,
Jan 4, 2024, 2:24:45 AMJan 4
to Mark Sibly, Dawn Graphics
Thanks for the update, I'm glad you were able to find what changed!
Reply all
Reply to author
Forward
0 new messages