Varjo Native SDK
Varjo_d3d11.h File Reference

Go to the source code of this file.

Functions

VARJO_DEPRECATED_API struct varjo_GraphicsInfo * varjo_D3D11Init (struct varjo_Session *session, struct ID3D11Device *dev, varjo_TextureFormat format, struct varjo_SwapChainConfig *config)
 Sets up the Direct3D device that the SDK will use for texture communication. More...
 
struct varjo_Texture varjo_FromD3D11Texture (struct ID3D11Texture2D *texture)
 Converts a Direct3D 11 texture to varjo_Texture. More...
 
VARJO_DEPRECATED_API struct ID3D11Texture2D * varjo_ToD3D11texture (struct varjo_Texture texture)
 Converts a Varjo texture to Direct3D 11 texture. More...
 
struct ID3D11Texture2D * varjo_ToD3D11Texture (struct varjo_Texture texture)
 Converts a Varjo texture to Direct3D 11 texture. More...
 
VARJO_DEPRECATED_API void varjo_D3D11ShutDown (struct varjo_Session *session)
 Closes the Direct3D connection. More...
 
struct varjo_Luid varjo_D3D11GetLuid (struct varjo_Session *session)
 Retrieves LUID of the device which is used by compositor. More...
 

Function Documentation

◆ varjo_D3D11GetLuid()

struct varjo_Luid varjo_D3D11GetLuid ( struct varjo_Session *  session)

Retrieves LUID of the device which is used by compositor.

Application has to use the same device to work correctly.

Parameters
sessionVarjo session handle.
Returns
LUID of DirectX device which compositor is using.

◆ varjo_D3D11Init()

VARJO_DEPRECATED_API struct varjo_GraphicsInfo* varjo_D3D11Init ( struct varjo_Session *  session,
struct ID3D11Device *  dev,
varjo_TextureFormat  format,
struct varjo_SwapChainConfig *  config 
)

Sets up the Direct3D device that the SDK will use for texture communication.

If the application is submitting manually created swapchains using varjo_EndFrameWithLayers, calling this function (or varjo_GLInit) is not necessary and is not recommended.

All varjo_D3D* functions may use D3D immediate device context and should thus be either invoked from the rendering thread or synchronized otherwise. The D3D device may be switched to another one once the old one has been shut down.

Varjo system automatically frees the returned varjo_GraphicsInfo struct when varjo_D3D11ShutDown or varjo_SessionShutDown is called.

Parameters
sessionVarjo session handle.
devD3D11 device.
formatTexture format.
configSwap chain config. If null, uses the default config.
Returns
Information required to setup rendering and per-frame data. Instance of varjo_GraphicsInfo is owned by runtime and doesn't have to be freed.
Deprecated:
use varjo_D3D11CreateSwapChain()

◆ varjo_D3D11ShutDown()

VARJO_DEPRECATED_API void varjo_D3D11ShutDown ( struct varjo_Session *  session)

Closes the Direct3D connection.

Frees the memory allocated for varjo_D3D11Init graphics info. This function should only be called if the application has previously called varjo_D3D11Init on this varjo_Session.

Parameters
sessionVarjo session handle.
Deprecated:
use varjo_FreeSwapChain()

◆ varjo_FromD3D11Texture()

struct varjo_Texture varjo_FromD3D11Texture ( struct ID3D11Texture2D *  texture)

Converts a Direct3D 11 texture to varjo_Texture.

◆ varjo_ToD3D11texture()

VARJO_DEPRECATED_API struct ID3D11Texture2D* varjo_ToD3D11texture ( struct varjo_Texture  texture)

Converts a Varjo texture to Direct3D 11 texture.

This is a deprecated version of varjo_ToD3D11Texture.

◆ varjo_ToD3D11Texture()

struct ID3D11Texture2D* varjo_ToD3D11Texture ( struct varjo_Texture  texture)

Converts a Varjo texture to Direct3D 11 texture.