The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
|
A wrapper for constant buffers. More...
#include <cbuffer.h>
Public Member Functions | |
const T & | data () const |
Returns a reference to the local copy of the constant buffer. | |
void | to_vs (ID3D11DeviceContext *context, UINT start_slot) |
Upload the shader resource to register slot of a vertex shader. | |
void | to_gs (ID3D11DeviceContext *context, UINT start_slot) |
Upload the shader resource to register slot of a geometry shader. | |
void | to_ps (ID3D11DeviceContext *context, UINT start_slot) |
Upload the shader resource to register slot of a pixel shader. | |
void | to_cs (ID3D11DeviceContext *context, UINT start_slot) |
Upload the shader resource to register slot of a compute shader. | |
void | update (ID3D11DeviceContext *context) |
Copy over the local buffer into the mapped resource. | |
void | destroy () |
Destroy the shader_resource and free all memory. | |
A wrapper for constant buffers.
cbuffer is a wrapping class managing a constant buffer. It does so by taking a struct of the constant buffer layout as parameter T, keeping a local copy which can always be accessed and modified. A call to the member update() will copy the local version into the mapped resource. Every call to upload the constant buffer to a shader will automatically update it first.