LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
dx11weaver.h
Go to the documentation of this file.
1
5#pragma once
6#include <memory>
7#include <d3d11.h>
9#include "sr/weaver/Weaver.h"
10
11#ifdef WIN32
12# ifdef COMPILING_DLL_SimulatedRealityDirectX
13# define DIMENCOSR_API __declspec(dllexport)
14# else
15# define DIMENCOSR_API __declspec(dllimport)
16# endif
17#else
18# define DIMENCOSR_API
19#endif
20
26namespace SR
27{
28 class Screen;
29
31 protected:
32 class Impl;
38#pragma warning(suppress: 4251)
39 std::unique_ptr<Impl> pimpl;
40
41 public:
44
53 ID3D11RenderTargetView* getFrameBuffer();
54
59 void setInputFrameBuffer(ID3D11ShaderResourceView* frameBuffer);
60
65 void setContext(ID3D11DeviceContext* context);
66
71 void setWindowHandle(HWND handle);
72
76 void enableLateLatching(bool enable);
77
82
86 void setContrast(float contrast);
87
91 float getContrast() const;
92
99 void setShaderSRGBConversion(bool read, bool write);
100
105
110
114 void setCrosstalkStaticFactor(float factor);
115
120
124 void setCrosstalkDynamicFactor(float factor);
125
130
136 [[deprecated("Use the canWeave(...) functions that accept parameters")]]
137 bool canWeave();
138
146 bool canWeave(unsigned int width, unsigned int height);
147
157 bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
158
165 void weave(unsigned int width, unsigned int height);
166
175 void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
176 };
177
179 public:
189 [[deprecated("For best performance use the PredictingDX11Weaver interface")]]
190 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height);
191
201 [[deprecated("For best performance use the PredictingDX11Weaver interface")]]
202 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, HWND window);
203
214 [[deprecated("For best performance use the PredictingDX11Weaver interface")]]
215 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format);
216
228 [[deprecated("For best performance use the PredictingDX11Weaver interface")]]
229 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window);
230
235 };
236
238 public:
248 [[deprecated("Use non-deprecated constructors")]]
249 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height);
250
260 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, HWND window);
261
272 [[deprecated("Use non-deprecated constructors")]]
273 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format);
274
286 [[deprecated("Use non-deprecated constructors")]]
287 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window);
288
293
305 void setLatency(uint64_t latency);
306
315 uint64_t getLatency();
316
329 void setLatencyInFrames(uint64_t latencyInFrames);
330 };
331}
332
333#undef DIMENCOSR_API
enum DIMENCOSR_API WeaverACTMode
Definition: WeaverTypes.h:29
Definition: dx11weaver.h:30
ID3D11RenderTargetView * getFrameBuffer()
Returns the buffer that will be used to create a weaved image. This buffer expects a side-by-side ima...
void enableLateLatching(bool enable)
Enables late latching. Note that late latching requires applications to call weave() once per frame,...
void weave(unsigned int width, unsigned int height)
Can be called to render a weaved image of a certain size to the currently bound framebuffer A framebu...
float getCrosstalkStaticFactor() const
Gets the anti-crosstalk factor.
void setInputFrameBuffer(ID3D11ShaderResourceView *frameBuffer)
Sets the buffer that will be used to create a weaved image. This will release the internally created ...
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 a certain size to the currently bound framebuffer A framebu...
void setContext(ID3D11DeviceContext *context)
Sets the device context for the weaver to use.
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 setCrosstalkDynamicFactor(float factor)
Sets the anti-crosstalk dynamic factor.
bool isLateLatchingEnabled() const
Determines if late latching is enabled.
void setContrast(float contrast)
Sets the weaving contrast.
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...
float getContrast() const
Gets the current weaving contrast.
WeaverACTMode getACTMode() const
Gets the anti-crosstalk mode.
std::unique_ptr< Impl > pimpl
Definition: dx11weaver.h:32
void setACTMode(WeaverACTMode mode)
Sets the anti-crosstalk mode.
float getCrosstalkDynamicFactor() const
Gets the anti-crosstalk dynamic factor.
void setShaderSRGBConversion(bool read, bool write)
Sets whether to apply shader sRGB<->Linear color space conversions to the input framebuffer during we...
bool canWeave()
Used to determine if software weaving is possible on this device.
void setCrosstalkStaticFactor(float factor)
Sets the anti-crosstalk factor.
Definition: dx11weaver.h:178
~DX11Weaver()
Handles proper destruction of all weaver related classes and buffers.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format)
Constructs a class to be used for weaving an input image of a certain size and format.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window)
Constructs a class to be used for weaving an input image of a certain size and format.
Definition: dx11weaver.h:237
void setLatencyInFrames(uint64_t latencyInFrames)
Set the latency to match the expected duration of the full rendering pipeline in number of frames....
void setLatency(uint64_t latency)
Set the latency to match the expected duration of the full rendering pipeline.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
uint64_t getLatency()
Get the latency that is used by the weaver. If setLatency has been called, the value set by that func...
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window)
Constructs a class to be used for weaving an input image of a certain size and format.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format)
Constructs a class to be used for weaving an input image of a certain size and format.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
~PredictingDX11Weaver()
Handles proper destruction of all weaver related classes and buffers.
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:75
#define DIMENCOSR_API
Definition: dx11weaver.h:18
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20