Bullet Collision Detection & Physics Library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btDX11Buffer< ElementType > Class Template Reference

DX11 Buffer that tracks a host buffer on use to ensure size-correctness. More...

#include <btSoftBodySolverBuffer_DX11.h>

Collaboration diagram for btDX11Buffer< ElementType >:
Collaboration graph
[legend]

Public Member Functions

 btDX11Buffer (ID3D11Device *d3dDevice, ID3D11DeviceContext *d3dDeviceContext, btAlignedObjectArray< ElementType > *CPUBuffer, bool readOnly)
 
virtual ~btDX11Buffer ()
 
ID3D11ShaderResourceView *& getSRV ()
 
ID3D11UnorderedAccessView *& getUAV ()
 
ID3D11Buffer *& getBuffer ()
 
bool moveToGPU ()
 Move the data to the GPU if it is not there already. More...
 
bool moveFromGPU ()
 Move the data back from the GPU if it is on there and isn't read only. More...
 
bool copyFromGPU ()
 Copy the data back from the GPU without changing its state to be CPU-side. More...
 
virtual void changedOnCPU ()
 Call if data has changed on the CPU. More...
 

Protected Member Functions

bool createBuffer (ID3D11Buffer *preexistingBuffer=0)
 

Protected Attributes

ID3D11Device * m_d3dDevice
 
ID3D11DeviceContext * m_d3dDeviceContext
 
ID3D11Buffer * m_Buffer
 
ID3D11ShaderResourceView * m_SRV
 
ID3D11UnorderedAccessView * m_UAV
 
btAlignedObjectArray
< ElementType > * 
m_CPUBuffer
 
ID3D11Buffer * m_readBackBuffer
 
int m_gpuSize
 
bool m_onGPU
 
bool m_readOnlyOnGPU
 

Detailed Description

template<typename ElementType>
class btDX11Buffer< ElementType >

DX11 Buffer that tracks a host buffer on use to ensure size-correctness.

Definition at line 32 of file btSoftBodySolverBuffer_DX11.h.

Constructor & Destructor Documentation

template<typename ElementType>
btDX11Buffer< ElementType >::btDX11Buffer ( ID3D11Device *  d3dDevice,
ID3D11DeviceContext *  d3dDeviceContext,
btAlignedObjectArray< ElementType > *  CPUBuffer,
bool  readOnly 
)
inline

Definition at line 140 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
virtual btDX11Buffer< ElementType >::~btDX11Buffer ( )
inlinevirtual

Definition at line 157 of file btSoftBodySolverBuffer_DX11.h.

Member Function Documentation

template<typename ElementType>
virtual void btDX11Buffer< ElementType >::changedOnCPU ( )
inlinevirtual

Call if data has changed on the CPU.

Can then trigger a move to the GPU as necessary.

Definition at line 315 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
bool btDX11Buffer< ElementType >::copyFromGPU ( )
inline

Copy the data back from the GPU without changing its state to be CPU-side.

Useful if we just want to view it on the host for visualization.

Definition at line 273 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
bool btDX11Buffer< ElementType >::createBuffer ( ID3D11Buffer *  preexistingBuffer = 0)
inlineprotected

Definition at line 52 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11Buffer* & btDX11Buffer< ElementType >::getBuffer ( )
inline

Definition at line 175 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11ShaderResourceView* & btDX11Buffer< ElementType >::getSRV ( )
inline

Definition at line 165 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11UnorderedAccessView* & btDX11Buffer< ElementType >::getUAV ( )
inline

Definition at line 170 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
bool btDX11Buffer< ElementType >::moveFromGPU ( )
inline

Move the data back from the GPU if it is on there and isn't read only.

Definition at line 227 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
bool btDX11Buffer< ElementType >::moveToGPU ( )
inline

Move the data to the GPU if it is not there already.

Definition at line 183 of file btSoftBodySolverBuffer_DX11.h.

Member Data Documentation

template<typename ElementType>
ID3D11Buffer* btDX11Buffer< ElementType >::m_Buffer
protected

Definition at line 38 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
btAlignedObjectArray< ElementType >* btDX11Buffer< ElementType >::m_CPUBuffer
protected

Definition at line 41 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11Device* btDX11Buffer< ElementType >::m_d3dDevice
protected

Definition at line 35 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11DeviceContext* btDX11Buffer< ElementType >::m_d3dDeviceContext
protected

Definition at line 36 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
int btDX11Buffer< ElementType >::m_gpuSize
protected

Definition at line 47 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
bool btDX11Buffer< ElementType >::m_onGPU
protected

Definition at line 48 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11Buffer* btDX11Buffer< ElementType >::m_readBackBuffer
protected

Definition at line 45 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
bool btDX11Buffer< ElementType >::m_readOnlyOnGPU
protected

Definition at line 50 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11ShaderResourceView* btDX11Buffer< ElementType >::m_SRV
protected

Definition at line 39 of file btSoftBodySolverBuffer_DX11.h.

template<typename ElementType>
ID3D11UnorderedAccessView* btDX11Buffer< ElementType >::m_UAV
protected

Definition at line 40 of file btSoftBodySolverBuffer_DX11.h.


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