How to Use Pixel Shader on ovrTextureSwapChain?
Maybe someone is kind enough to point me into the right direction.
I have a HUD layer (ovrLayerQuad) which is represented by a ovrTextureSwapChain. Now I need to apply a pixel shader but I don't know if there is a predestined way of doing this, provided by Oculus, or if I have to handle it like a regular ID3D11Texture2D which would be a lot to code (e.g. having a pass-through vertex shader and another dozen of DX11 objects to setup and deal with...). My best guess would be something like this:
I have a HUD layer (ovrLayerQuad) which is represented by a ovrTextureSwapChain. Now I need to apply a pixel shader but I don't know if there is a predestined way of doing this, provided by Oculus, or if I have to handle it like a regular ID3D11Texture2D which would be a lot to code (e.g. having a pass-through vertex shader and another dozen of DX11 objects to setup and deal with...). My best guess would be something like this:
int currentIndex = 0;
ovr_GetTextureSwapChainCurrentIndex(m_session, m_HudRenderTexture, ¤tIndex);
ID3D11Texture2D* tex = nullptr;
ovr_GetTextureSwapChainBufferDX(m_session, m_HudRenderTexture, currentIndex, IID_PPV_ARGS(&tex));
//SOMEHOW APPLY PIXEL SHADER TO tex
ovr_CommitTextureSwapChain(m_session, m_HudRenderTexture);
...
// Initialize the HUD layer, fixed to the player's head
ovrLayerQuad hudLayer;
hudLayer.Header.Type = ovrLayerType_Quad;
hudLayer.Header.Flags = ovrLayerFlag_HeadLocked;
hudLayer.ColorTexture = m_HudRenderTexture;
...