The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
Public Member Functions | List of all members
dune::cbuffer< T > Class Template Reference

A wrapper for constant buffers. More...

#include <cbuffer.h>

Inheritance diagram for dune::cbuffer< T >:
dune::shader_resource

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.
 

Detailed Description

template<typename T>
class dune::cbuffer< T >

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.


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