LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
Public Member Functions | Protected Attributes | List of all members
SR::DX12WeaverBase Class Reference

#include <dx12weaver.h>

Inheritance diagram for SR::DX12WeaverBase:
[legend]

Public Member Functions

 DX12WeaverBase ()
 
 ~DX12WeaverBase ()
 
ID3D12Resource * getFrameBuffer ()
 Returns the input buffer of the weaver. When weave(...) is called on this object, this buffer should contain a side-by-side view that will be used as input for the weaver. More...
 
void setInputFrameBuffer (ID3D12Resource *frameBuffer)
 Sets the input buffer of the weaver. When weave(...) is called on this object, this buffer should contain a side-by-side view that will be used as input for the weaver. More...
 
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 fully qualified format via bufferViewFormat when the framebuffer is a texture created with a typeless format When weave(...) is called on this object, this buffer should contain a side-by-side view that will be used as input for the weaver. More...
 
void setOutputFrameBuffer (ID3D12Resource *frameBuffer)
 Sets the output buffer of the weaver. After weave(...) has been called on this object, the weaved image will be written to this buffer. More...
 
void setCommandList (ID3D12GraphicsCommandList *commandList)
 Sets the command list for the weaver to use. Must be set before the weave() function can be called. More...
 
void setWindowHandle (HWND handle)
 Sets the window handle of the application window. If the weaver was created using a deprecated constructor, setting window handle has no effect. More...
 
void setContrast (float contrast)
 Sets the weaving contrast. More...
 
float getContrast () const
 Gets the current weaving contrast. More...
 
void setShaderSRGBConversion (bool read, bool write)
 Sets whether to apply shader sRGB<->Linear color space conversions to the input framebuffer during weaving. More...
 
void setACTMode (WeaverACTMode mode)
 Sets the anti-crosstalk mode. More...
 
WeaverACTMode getACTMode () const
 Gets the anti-crosstalk mode. More...
 
void setCrosstalkStaticFactor (float factor)
 Sets the anti-crosstalk factor. More...
 
float getCrosstalkStaticFactor () const
 Gets the anti-crosstalk factor. More...
 
void setCrosstalkDynamicFactor (float factor)
 Sets the anti-crosstalk dynamic factor. More...
 
float getCrosstalkDynamicFactor () const
 Gets the anti-crosstalk dynamic factor. More...
 
bool canWeave ()
 Used to determine if software weaving is possible on this device. Always returns false if the input or output buffer is not set. More...
 
bool canWeave (unsigned int width, unsigned int height)
 Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer. Always returns false if the input or output buffer is not set. More...
 
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 bound framebuffer. Always returns false if the input or output buffer is not set. More...
 
void weave (unsigned int width, unsigned int height)
 Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET) A commandlist must be set before calling this function or weaving will not be executed. More...
 
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(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET) A commandlist must be set before calling this function or weaving will not be executed. More...
 
void weave (ID3D12GraphicsCommandList *commandList, unsigned int width, unsigned int height)
 Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET) More...
 
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(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET) More...
 

Protected Attributes

std::unique_ptr< Impl > pimpl
 

Constructor & Destructor Documentation

◆ DX12WeaverBase()

SR::DX12WeaverBase::DX12WeaverBase ( )

◆ ~DX12WeaverBase()

SR::DX12WeaverBase::~DX12WeaverBase ( )

Member Function Documentation

◆ canWeave() [1/3]

bool SR::DX12WeaverBase::canWeave ( )

Used to determine if software weaving is possible on this device. Always returns false if the input or output buffer is not set.

Deprecated:
Returns
bool indicating whether weaving can be done. Returns true when software weaving can be performed by DX12Weaver. When false is returned, you can output side-by-side manually or let DX12Weaver handle this if the input and output buffers are set.

◆ canWeave() [2/3]

bool SR::DX12WeaverBase::canWeave ( unsigned int  width,
unsigned int  height 
)

Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer. Always returns false if the input or output buffer is not set.

Parameters
widthof the image to be rendered to the bound framebuffer
heightof the image to be rendered to the bound framebuffer
Exceptions
std::runtime_errorif the window handle (HWND) becomes invalid during the execution of canWeave
Returns
bool indicating whether weaving can be done. Returns true when software weaving can be performed by DX12Weaver. When false is returned, you can output side-by-side manually or let DX12Weaver handle this if the input and output buffers are set.

◆ canWeave() [3/3]

bool SR::DX12WeaverBase::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 bound framebuffer. Always returns false if the input or output buffer is not set.

Parameters
widthof the image to be rendered to the bound framebuffer
heightof the image to be rendered to the bound framebuffer
xOffsetof the image to be rendered to the bound framebuffer
yOffsetof the image to be rendered to the bound framebuffer
Exceptions
std::runtime_errorif the window handle (HWND) becomes invalid during the execution of canWeave
Returns
bool indicating whether weaving can be done. Returns true when software weaving can be performed by DX12Weaver. When false is returned, you can output side-by-side manually or let DX12Weaver handle this if the input and output buffers are set.

◆ getACTMode()

WeaverACTMode SR::DX12WeaverBase::getACTMode ( ) const

Gets the anti-crosstalk mode.

◆ getContrast()

float SR::DX12WeaverBase::getContrast ( ) const

Gets the current weaving contrast.

◆ getCrosstalkDynamicFactor()

float SR::DX12WeaverBase::getCrosstalkDynamicFactor ( ) const

Gets the anti-crosstalk dynamic factor.

◆ getCrosstalkStaticFactor()

float SR::DX12WeaverBase::getCrosstalkStaticFactor ( ) const

Gets the anti-crosstalk factor.

◆ getFrameBuffer()

ID3D12Resource * SR::DX12WeaverBase::getFrameBuffer ( )

Returns the input buffer of the weaver. When weave(...) is called on this object, this buffer should contain a side-by-side view that will be used as input for the weaver.

The buffer identifier can be bound using OMSetRenderTargets to start rendering to it. Rendering to the buffer is identical to normal rendering and often starts with calling ClearRenderTargetView.

Returns
Pointer to the frame buffer resource that is currently set as input buffer.

◆ setACTMode()

void SR::DX12WeaverBase::setACTMode ( WeaverACTMode  mode)

Sets the anti-crosstalk mode.

◆ setCommandList()

void SR::DX12WeaverBase::setCommandList ( ID3D12GraphicsCommandList *  commandList)

Sets the command list for the weaver to use. Must be set before the weave() function can be called.

Parameters
commandListTo add the weaver rendering commands to

◆ setContrast()

void SR::DX12WeaverBase::setContrast ( float  contrast)

Sets the weaving contrast.

◆ setCrosstalkDynamicFactor()

void SR::DX12WeaverBase::setCrosstalkDynamicFactor ( float  factor)

Sets the anti-crosstalk dynamic factor.

◆ setCrosstalkStaticFactor()

void SR::DX12WeaverBase::setCrosstalkStaticFactor ( float  factor)

Sets the anti-crosstalk factor.

◆ setInputFrameBuffer() [1/2]

void SR::DX12WeaverBase::setInputFrameBuffer ( ID3D12Resource *  frameBuffer)

Sets the input buffer of the weaver. When weave(...) is called on this object, this buffer should contain a side-by-side view that will be used as input for the weaver.

Parameters
frameBufferThe frame buffer resource that will be used as input buffer after this function call. A reference to this resource will be maintained by the object until this function is called again or until the object is destroyed.
Exceptions
std::exceptionif framebuffer is a texture resource created with a typeless format

◆ setInputFrameBuffer() [2/2]

void SR::DX12WeaverBase::setInputFrameBuffer ( ID3D12Resource *  frameBuffer,
DXGI_FORMAT  bufferViewFormat 
)

Sets the input buffer of the weaver. This overload of the function should be used to specify the fully qualified format via bufferViewFormat when the framebuffer is a texture created with a typeless format When weave(...) is called on this object, this buffer should contain a side-by-side view that will be used as input for the weaver.

Parameters
frameBufferThe frame buffer resource that will be used as input buffer after this function call. A reference to this resource will be maintained by the object until this function is called again or until the object is destroyed.
bufferViewFormatThe fully qualified shader resource view format for the input frame buffer. This specification is required for textures created with typeless format. It can also be used to cast an already specified fully qualified format to another.
Exceptions
std::exceptionif framebuffer is a texture resource created with a typeless format and bufferViewFormat's value is DXGI_FORMAT_UNKNOWN

◆ setOutputFrameBuffer()

void SR::DX12WeaverBase::setOutputFrameBuffer ( ID3D12Resource *  frameBuffer)

Sets the output buffer of the weaver. After weave(...) has been called on this object, the weaved image will be written to this buffer.

Parameters
frameBufferThe frame buffer resource that will be used as output buffer after this function call. No reference to the output framebuffer is kept by the weaver object.

◆ setShaderSRGBConversion()

void SR::DX12WeaverBase::setShaderSRGBConversion ( bool  read,
bool  write 
)

Sets whether to apply shader sRGB<->Linear color space conversions to the input framebuffer during weaving.

Parameters
readConvert from sRGB to Linear color space before weaving.
writeConvert from Linear to sRGB color space after weaving.

◆ setWindowHandle()

void SR::DX12WeaverBase::setWindowHandle ( HWND  handle)

Sets the window handle of the application window. If the weaver was created using a deprecated constructor, setting window handle has no effect.

Parameters
windowHandle of the application window

◆ weave() [1/4]

void SR::DX12WeaverBase::weave ( ID3D12GraphicsCommandList *  commandList,
unsigned int  width,
unsigned int  height 
)

Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET)

Deprecated:
Parameters
commandListto add the weaver rendering commands to
widthof the image to be rendered to the bound rendertarget
heightof the image to be rendered to the bound rendertarget

◆ weave() [2/4]

void SR::DX12WeaverBase::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(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET)

Deprecated:
Parameters
commandListto add the weaver rendering commands to
widthof the image to be rendered to the bound rendertarget
heightof the image to be rendered to the bound rendertarget
xOffsetof the image to be rendered to the bound rendertarget
yOffsetof the image to be rendered to the bound rendertarget

◆ weave() [3/4]

void SR::DX12WeaverBase::weave ( unsigned int  width,
unsigned int  height 
)

Can be called to render a weaved image of inputFramebuffer provided to DX12Weaver::DX12Weaver(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET) A commandlist must be set before calling this function or weaving will not be executed.

Parameters
widthof the image to be rendered to the bound rendertarget
heightof the image to be rendered to the bound rendertarget

◆ weave() [4/4]

void SR::DX12WeaverBase::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(...) (Must be D3D12_RESOURCE_STATE_UNORDERED_ACCESS) to the currently bound rendertarget (Must be D3D12_RESOURCE_STATE_RENDER_TARGET) A commandlist must be set before calling this function or weaving will not be executed.

Parameters
widthof the image to be rendered to the bound rendertarget
heightof the image to be rendered to the bound rendertarget
xOffsetof the image to be rendered to the bound rendertarget
yOffsetof the image to be rendered to the bound rendertarget

Member Data Documentation

◆ pimpl

std::unique_ptr<Impl> SR::DX12WeaverBase::pimpl
protected

Suppressing warning because if we don't want to export everything then solving the underlying problem requires modification of the API Warning Description: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2' Candidate for deprecation


The documentation for this class was generated from the following file: