33 typedef std::vector<render_target> targets_vec;
34 typedef std::vector<ID3D11ShaderResourceView*> srv_vec;
38 ID3D11Device* device_;
48 void srvs(srv_vec& srv_array);
54 void create(ID3D11Device* device,
const tstring& name);
60 void add_target(
const tstring& name,
const D3D11_TEXTURE2D_DESC& desc,
bool cached =
false);
61 void add_target(
const tstring& name,
const DXGI_SURFACE_DESC& desc, UINT num_mipmaps = 1);
62 void add_depth(
const tstring& name, DXGI_SURFACE_DESC desc);
75 void resize(UINT width, UINT height);
77 void to_ps(ID3D11DeviceContext* context, UINT start_slot);
78 void to_gs(ID3D11DeviceContext* context, UINT start_slot);
79 void to_vs(ID3D11DeviceContext* context, UINT start_slot);
void add_target(const tstring &name, render_target &target)
Create a new render_target in the gbuffer. These functions basically forward parameters to the render...
Definition: gbuffer.cpp:79
A shader resource wrapper.
Definition: shader_resource.h:24
void to_ps(ID3D11DeviceContext *context, UINT start_slot)
Upload the shader resource to register slot of a pixel shader.
Definition: gbuffer.cpp:134
void add_depth(const tstring &name, DXGI_SURFACE_DESC desc)
Create a new render_target in the gbuffer. These functions basically forward parameters to the render...
Definition: gbuffer.cpp:113
render_target * operator[](const tstring &name)
Fetch a render_target with its name.
Definition: gbuffer.cpp:32
render_target * target(const tstring &name)
Return a named target.
Definition: gbuffer.cpp:53
void to_gs(ID3D11DeviceContext *context, UINT start_slot)
Upload the shader resource to register slot of a geometry shader.
Definition: gbuffer.cpp:139
void srvs(srv_vec &srv_array)
Fill up a vector of ID3D11ShaderResourceView with the SRVs of all render_target objects in this gbuff...
A render target wrapper.
Definition: render_target.h:30
void to_vs(ID3D11DeviceContext *context, UINT start_slot)
Upload the shader resource to register slot of a vertex shader.
Definition: gbuffer.cpp:144
void resize(UINT width, UINT height)
Resize all render_target objects in this gbuffer to a new width and height.
Definition: gbuffer.cpp:47
A geometry buffer (collection of render_target objects).
Definition: gbuffer.h:30
targets_vec & targets()
Returns all render_target objects in this gbuffer.
Definition: gbuffer.cpp:42
virtual void destroy()
Destroy the shader_resource and free all memory.
Definition: gbuffer.cpp:24