Render to the OpenXR created swapchain textures

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
pkovacs86
Gnoblar
Posts: 24
Joined: Mon May 27, 2013 3:09 pm
x 4

Render to the OpenXR created swapchain textures

Post by pkovacs86 »

Dear All,

Are there any chances to render to the OpenXR created swapchain textures?
I mean the workflow of the OpenXR is that the swapchain images
are created by the OpenXR run-time and have to render to that textures.
So for example in the case of DX11:
Is there any chance to use the OpenXR created ID3D11Texture2D* as a Ogre::RenderTexture*?

In that threadviewtopic.php?f=5&t=95781
I was able to use the Ogre created textures as OpenXR swapchain textures but I had to use CopyResources

Code: Select all

Microsoft::WRL::ComPtr<ID3D11Device> dev11;
				Microsoft::WRL::ComPtr<ID3D11DeviceContext> devcon11;
				mOpenXRSwapchainTextures[textureID].texture->GetDevice(&dev11);
				dev11->GetImmediateContext(&devcon11);
				devcon11->CopyResource(mOpenXRSwapchainTextures[textureID].texture, (ID3D11Texture2D*)manualTextureRightEye->getGraphicsApiID());
source code:https://github.com/MTASZTAKI/ApertusVR/ ... Plugin.cpp

Thank you,
Peter
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Render to the OpenXR created swapchain textures

Post by paroj »

not that I would be aware of. However, you could abuse the getCustomAttribute API to pass through the ID3D11Texture2D*
https://ogrecave.github.io/ogre/api/lat ... 4101f8f532

and if it works well, introduce a setCustomAttribute method.
pkovacs86
Gnoblar
Posts: 24
Joined: Mon May 27, 2013 3:09 pm
x 4

Re: Render to the OpenXR created swapchain textures

Post by pkovacs86 »

thank you so much, I'll try it ASAP

BR
Peter
Post Reply