Ritchie's Abstractions 0.2
Platform abstractions that make Toolbox work
Loading...
Searching...
No Matches
ConstantBuffer Class Referencesealed

An area of GPU memory to store shader constants (in other words, material parameters). More...

Inheritance diagram for ConstantBuffer:
GraphicsObject

Public Member Functions

 ConstantBuffer (string name, int size, BufferUsage usage)
 Creates a new instance of the ConstantBuffer class.
 
void SetData (in ReadOnlySpan< byte > data)
 Upload new data to this constant buffer.
 
- Public Member Functions inherited from GraphicsObject
void Dispose ()
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from GraphicsObject
 GraphicsObject ()
 Creates a new GraphicsObject instance.
 

Additional Inherited Members

- Properties inherited from GraphicsObject
GraphicsDevice GraphicsDevice [get]
 Gets the GraphicsDevice instance this GraphicsObject belongs to.
 

Detailed Description

An area of GPU memory to store shader constants (in other words, material parameters).

Constructor & Destructor Documentation

◆ ConstantBuffer()

ConstantBuffer ( string name,
int size,
BufferUsage usage )
inline

Creates a new instance of the ConstantBuffer class.

Parameters
nameThe name of the constant buffer. Should match what's in the shader code.
sizeThe size, in bytes, of the buffer.
usageA BufferUsage value indicating how the graphics backend should treat this buffer.

Member Function Documentation

◆ Dispose()

override void Dispose ( bool disposing)
inlineprotectedvirtual

Called when it's time to throw out the trash.

Parameters
disposingIf true, please throw away your trash. Skunks!
Called when it's time to throw out the trash.
Parameters
disposingIf true, please throw away your trash. Skunks!

Reimplemented from GraphicsObject.

◆ SetData()

void SetData ( in ReadOnlySpan< byte > data)
inline

Upload new data to this constant buffer.

Parameters
dataA slice of memory to copy into the buffer. Must be the same size as the buffer itself.

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