Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
dx12weaver.h
Go to the documentation of this file.
1
10#pragma once
11#include <memory>
12#include <d3d12.h>
14#include "sr/weaver/Weaver.h"
15
16#ifdef WIN32
17# ifdef COMPILING_DLL_SimulatedRealityDirectX
18# define DIMENCOSR_API __declspec(dllexport)
19# else
20# define DIMENCOSR_API __declspec(dllimport)
21# endif
22#else
23# define DIMENCOSR_API
24#endif
25
31namespace SR
32{
34 protected:
35 class Impl;
41#pragma warning(suppress: 4251)
42 std::unique_ptr<Impl> pimpl;
43 public:
46
55 ID3D12Resource* getFrameBuffer();
56
64 void setInputFrameBuffer(ID3D12Resource* frameBuffer);
65
75 void setInputFrameBuffer(ID3D12Resource* frameBuffer, DXGI_FORMAT bufferViewFormat);
76
83 void setOutputFrameBuffer(ID3D12Resource* frameBuffer);
84
89 void setCommandList(ID3D12GraphicsCommandList* commandList);
90
95 void setWindowHandle(HWND handle);
96
103 [[deprecated("Use the canWeave(...) functions that accept parameters")]]
104 bool canWeave();
105
114 bool canWeave(unsigned int width, unsigned int height);
115
126 bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
127
134 void weave(unsigned int width, unsigned int height);
135
144 void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
145
153 [[deprecated("Please set the commandlist with setCommandList() and use non-deprecated weave function")]]
154 void weave(ID3D12GraphicsCommandList* commandList, unsigned int width, unsigned int height);
155
165 [[deprecated("Please set the commandlist with setCommandList() and use non-deprecated weave function")]]
166 void weave(ID3D12GraphicsCommandList* commandList, unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
167 };
168
170 public:
182 [[deprecated("Use non-deprecated constructors")]]
183 DX12Weaver(SR::SRContext& context, ID3D12Device* device, ID3D12CommandAllocator* commandAllocator, ID3D12CommandQueue* commandQueue, ID3D12Resource* inputFramebuffer, ID3D12Resource* outputFramebuffer);
184
196 DX12Weaver(SR::SRContext& context, ID3D12Device* device, ID3D12CommandAllocator* commandAllocator, ID3D12CommandQueue* commandQueue, ID3D12Resource* inputFramebuffer, ID3D12Resource* outputFramebuffer, HWND window);
197
211 DX12Weaver(SR::SRContext& context, ID3D12Device* device, ID3D12CommandAllocator* commandAllocator, ID3D12CommandQueue* commandQueue, ID3D12Resource* inputFramebuffer, ID3D12Resource* outputFramebuffer, HWND window, DXGI_FORMAT inputBufferViewFormat);
212
217 };
218
220 public:
232 [[deprecated("Use non-deprecated constructors")]]
233 PredictingDX12Weaver(SR::SRContext& context, ID3D12Device* device, ID3D12CommandAllocator* commandAllocator, ID3D12CommandQueue* commandQueue, ID3D12Resource* inputFramebuffer, ID3D12Resource* outputFramebuffer);
234
246 PredictingDX12Weaver(SR::SRContext& context, ID3D12Device* device, ID3D12CommandAllocator* commandAllocator, ID3D12CommandQueue* commandQueue, ID3D12Resource* inputFramebuffer, ID3D12Resource* outputFramebuffer, HWND window);
247
261 PredictingDX12Weaver(SR::SRContext& context, ID3D12Device* device, ID3D12CommandAllocator* commandAllocator, ID3D12CommandQueue* commandQueue, ID3D12Resource* inputFramebuffer, ID3D12Resource* outputFramebuffer, HWND window, DXGI_FORMAT inputBufferViewFormat);
262
267
279 void setLatency(uint64_t latency);
280
293 void setLatencyInFrames(uint64_t latencyInFrames);
294 };
295}
296
297#undef DIMENCOSR_API
Definition: dx12weaver.h:33
void setInputFrameBuffer(ID3D12Resource *frameBuffer, DXGI_FORMAT bufferViewFormat)
Sets the input buffer of the weaver. This overload of the function should be used to specify the full...
bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
Used to determine if software weaving is possible for certain size and visibility to the currently bo...
bool canWeave(unsigned int width, unsigned int height)
Used to determine if software weaving is possible for certain size and visibility to the currently bo...
void weave(ID3D12GraphicsCommandList *commandList, unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(....
ID3D12Resource * getFrameBuffer()
Returns the input buffer of the weaver. When weave(...) is called on this object, this buffer should ...
bool canWeave()
Used to determine if software weaving is possible on this device. Always returns false if the input o...
std::unique_ptr< Impl > pimpl
Definition: dx12weaver.h:35
void setInputFrameBuffer(ID3D12Resource *frameBuffer)
Sets the input buffer of the weaver. When weave(...) is called on this object, this buffer should con...
void setCommandList(ID3D12GraphicsCommandList *commandList)
Sets the command list for the weaver to use. Must be set before the weave() function can be called.
void setOutputFrameBuffer(ID3D12Resource *frameBuffer)
Sets the output buffer of the weaver. After weave(...) has been called on this object,...
void setWindowHandle(HWND handle)
Sets the window handle of the application window. If the weaver was created using a deprecated constr...
void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(....
void weave(ID3D12GraphicsCommandList *commandList, unsigned int width, unsigned int height)
Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(....
void weave(unsigned int width, unsigned int height)
Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(....
Definition: dx12weaver.h:169
DX12Weaver(SR::SRContext &context, ID3D12Device *device, ID3D12CommandAllocator *commandAllocator, ID3D12CommandQueue *commandQueue, ID3D12Resource *inputFramebuffer, ID3D12Resource *outputFramebuffer, HWND window, DXGI_FORMAT inputBufferViewFormat)
Constructs a class to be used for weaving an input image of a certain size This constructor should be...
DX12Weaver(SR::SRContext &context, ID3D12Device *device, ID3D12CommandAllocator *commandAllocator, ID3D12CommandQueue *commandQueue, ID3D12Resource *inputFramebuffer, ID3D12Resource *outputFramebuffer, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
DX12Weaver(SR::SRContext &context, ID3D12Device *device, ID3D12CommandAllocator *commandAllocator, ID3D12CommandQueue *commandQueue, ID3D12Resource *inputFramebuffer, ID3D12Resource *outputFramebuffer)
Constructs a class to be used for weaving an input image of a certain size.
~DX12Weaver()
Handles proper destruction of all weaver related classes, buffers and references.
Definition: dx12weaver.h:219
void setLatencyInFrames(uint64_t latencyInFrames)
Set the latency to match the expected duration of the full rendering pipeline in number of frames....
~PredictingDX12Weaver()
Handles proper destruction of all weaver related classes, buffers and references.
PredictingDX12Weaver(SR::SRContext &context, ID3D12Device *device, ID3D12CommandAllocator *commandAllocator, ID3D12CommandQueue *commandQueue, ID3D12Resource *inputFramebuffer, ID3D12Resource *outputFramebuffer)
Constructs a class to be used for weaving an input image of a certain size.
void setLatency(uint64_t latency)
Set the latency to match the expected duration of the full rendering pipeline.
PredictingDX12Weaver(SR::SRContext &context, ID3D12Device *device, ID3D12CommandAllocator *commandAllocator, ID3D12CommandQueue *commandQueue, ID3D12Resource *inputFramebuffer, ID3D12Resource *outputFramebuffer, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
PredictingDX12Weaver(SR::SRContext &context, ID3D12Device *device, ID3D12CommandAllocator *commandAllocator, ID3D12CommandQueue *commandQueue, ID3D12Resource *inputFramebuffer, ID3D12Resource *outputFramebuffer, HWND window, DXGI_FORMAT inputBufferViewFormat)
Constructs a class to be used for weaving an input image of a certain size This constructor should be...
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:80
#define DIMENCOSR_API
Definition: dx12weaver.h:23
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25