VTK  9.4.20241016
vtkOpenXRManagerD3DGraphics.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11#ifndef vtkOpenXRManagerD3DGraphics_h
12#define vtkOpenXRManagerD3DGraphics_h
13
15#include "vtkRenderingOpenXRRemotingModule.h" // For export macro
16
17#include "vtkOpenXR.h" // For extension name
18
19#include <memory> // For shared_ptr
20#include <vector> // For std::vector
21
22struct XrGraphicsBindingD3D11KHR;
23struct XrSwapchainImageD3D11KHR;
24
25VTK_ABI_NAMESPACE_BEGIN
26class VTKRENDERINGOPENXRREMOTING_EXPORT vtkOpenXRManagerD3DGraphics
28{
29public:
32
36 void SetNumberOfSwapchains(uint32_t viewCount) override;
37
39
43 void GetColorSwapchainImage(uint32_t scIndex, uint32_t imgIndex, void* texture) override;
44 void GetDepthSwapchainImage(uint32_t scIndex, uint32_t imgIndex, void* texture) override;
46
48
51 void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t scIndex) override;
52 void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t scIndex) override;
54
56
60 const std::vector<int64_t>& GetSupportedColorFormats() override;
61 const std::vector<int64_t>& GetSupportedDepthFormats() override;
63
67 bool CreateGraphicsBinding(vtkOpenGLRenderWindow* helperWindow) override;
68
72 const void* GetGraphicsBinding() override { return this->GraphicsBinding.get(); };
73
78 bool CheckGraphicsRequirements(XrInstance instance, XrSystemId id) override;
79
83 const char* GetBackendExtensionName() override;
84
85protected:
88
93 {
94 std::vector<XrSwapchainImageD3D11KHR> Images;
95 };
96
100 void EnumerateSwapchainImages(XrSwapchain swapchain, SwapchainImagesD3D& swapchainImages);
101
102 std::shared_ptr<XrGraphicsBindingD3D11KHR> GraphicsBinding;
103
104private:
106 void operator=(const vtkOpenXRManagerD3DGraphics&) = delete;
107
108 class PIMPL;
109 PIMPL* Private;
110};
111
112VTK_ABI_NAMESPACE_END
113#endif
OpenGL rendering window.
OpenXR manager D3D graphics implementation.
const void * GetGraphicsBinding() override
Return pointer to the XrGraphicsBindingD3D11 structure required to create the OpenXR session.
void GetColorSwapchainImage(uint32_t scIndex, uint32_t imgIndex, void *texture) override
Fill texture with the D3D Texture2D for the specified eye scIndex.
const std::vector< int64_t > & GetSupportedDepthFormats() override
Return the list of DXGI_FORMAT supported by vtkWin32OpenGLDXRenderWindow.
std::shared_ptr< XrGraphicsBindingD3D11KHR > GraphicsBinding
void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t scIndex) override
Acquire D3D swapchain images for the specified eye index.
bool CreateGraphicsBinding(vtkOpenGLRenderWindow *helperWindow) override
Fill the pointer to the XrGraphicsBindingD3D11 structure.
void EnumerateSwapchainImages(XrSwapchain swapchain, SwapchainImagesD3D &swapchainImages)
Acquire D3D swapchain images an store them in swapchainImages.
const std::vector< int64_t > & GetSupportedColorFormats() override
Return the list of DXGI_FORMAT supported by vtkWin32OpenGLDXRenderWindow.
static vtkOpenXRManagerD3DGraphics * New()
bool CheckGraphicsRequirements(XrInstance instance, XrSystemId id) override
Verify that the D3D feature levels supported by the runtime match the ones supported by vtkWin32OpenG...
void GetDepthSwapchainImage(uint32_t scIndex, uint32_t imgIndex, void *texture) override
Fill texture with the D3D Texture2D for the specified eye scIndex.
~vtkOpenXRManagerD3DGraphics() override
void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t scIndex) override
Acquire D3D swapchain images for the specified eye index.
const char * GetBackendExtensionName() override
Return the extension name corresponding to the D3D11 rendering backend.
void SetNumberOfSwapchains(uint32_t viewCount) override
Resize the internal vectors storing the color and depth swapchains.
OpenXR manager graphics implementation.
Defines the OpenXR types and extensions common to all platforms.