Nui Engine
A game engine framework
Loading...
Searching...
No Matches
Nui::Graphics::ConstantBuffer< T > Class Template Reference

Represents a constant buffer. More...

#include <ConstantBuffer.h>

Public Member Functions

void ApplyChanges (ID3D11DeviceContext1 *ctx)
 Applies the changes made to the constant buffer.
 
void SetVS (ID3D11DeviceContext1 *ctx, U32 slot)
 Sets the constant buffer for the vertex shader.
 
void SetPS (ID3D11DeviceContext1 *ctx, U32 slot)
 Sets the constant buffer for the pixel shader.
 
void SetCS (ID3D11DeviceContext1 *ctx, U32 slot)
 Sets the constant buffer for the compute shader.
 
void SetGS (ID3D11DeviceContext1 *ctx, U32 slot)
 Sets the constant buffer for the geometry shader.
 
void SetHS (ID3D11DeviceContext1 *ctx, U32 slot)
 Sets the constant buffer for the hull shader.
 
void SetDS (ID3D11DeviceContext1 *ctx, U32 slot)
 Sets the constant buffer for the domain shader.
 

Static Public Member Functions

static ConstantBuffer< T > Create (ID3D11Device1 *device, bool gpuWritable=false)
 Creates a constant buffer.
 

Public Attributes

Data
 
ComPtr< ID3D11Buffer > Buffer
 
bool GPUWritable
 

Detailed Description

template<typename T>
class Nui::Graphics::ConstantBuffer< T >

Represents a constant buffer.

Template Parameters
TThe data type of the constant buffer

Member Function Documentation

◆ ApplyChanges()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::ApplyChanges ( ID3D11DeviceContext1 * ctx)
inline

Applies the changes made to the constant buffer.

Parameters
ctxDX11 device context

◆ Create()

template<typename T >
static ConstantBuffer< T > Nui::Graphics::ConstantBuffer< T >::Create ( ID3D11Device1 * device,
bool gpuWritable = false )
inlinestatic

Creates a constant buffer.

Parameters
deviceDX11 device
gpuWritableIf the constant buffer can be written to by the GPU
Returns
The constant buffer of type T

◆ SetCS()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::SetCS ( ID3D11DeviceContext1 * ctx,
U32 slot )
inline

Sets the constant buffer for the compute shader.

Parameters
ctxDX11 device context
slotShader slot for the constant buffer

◆ SetDS()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::SetDS ( ID3D11DeviceContext1 * ctx,
U32 slot )
inline

Sets the constant buffer for the domain shader.

Parameters
ctxDX11 device context
slotShader slot for the constant buffer

◆ SetGS()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::SetGS ( ID3D11DeviceContext1 * ctx,
U32 slot )
inline

Sets the constant buffer for the geometry shader.

Parameters
ctxDX11 device context
slotShader slot for the constant buffer

◆ SetHS()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::SetHS ( ID3D11DeviceContext1 * ctx,
U32 slot )
inline

Sets the constant buffer for the hull shader.

Parameters
ctxDX11 device context
slotShader slot for the constant buffer

◆ SetPS()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::SetPS ( ID3D11DeviceContext1 * ctx,
U32 slot )
inline

Sets the constant buffer for the pixel shader.

Parameters
ctxDX11 device context
slotShader slot for the constant buffer

◆ SetVS()

template<typename T >
void Nui::Graphics::ConstantBuffer< T >::SetVS ( ID3D11DeviceContext1 * ctx,
U32 slot )
inline

Sets the constant buffer for the vertex shader.

Parameters
ctxDX11 device context
slotShader slot for the constant buffer

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