The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
shader_resource.h
Go to the documentation of this file.
1 /*
2  * Dune D3D library - Tobias Alexander Franke 2012
3  * For copyright and license see LICENSE
4  * http://www.tobias-franke.eu
5  */
6 
9 #ifndef DUNE_SHADER_RESOURCE
10 #define DUNE_SHADER_RESOURCE
11 
12 #include <D3D11.h>
13 #include "unicode.h"
14 
15 namespace dune
16 {
25  {
26  tstring name;
27 
29  virtual void to_vs(ID3D11DeviceContext* context, UINT slot);
30 
32  virtual void to_gs(ID3D11DeviceContext* context, UINT slot);
33 
35  virtual void to_ps(ID3D11DeviceContext* context, UINT slot);
36 
38  virtual void to_cs(ID3D11DeviceContext* context, UINT slot);
39 
41  virtual void destroy() = 0;
42  };
43 
50  {
51  ID3D11SamplerState* state;
52 
53  void create(ID3D11Device* device, const D3D11_SAMPLER_DESC& desc);
54  void destroy();
55 
56  void to_vs(ID3D11DeviceContext* context, UINT slot);
57  void to_ps(ID3D11DeviceContext* context, UINT slot);
58  };
59 }
60 
61 #endif
virtual void to_vs(ID3D11DeviceContext *context, UINT slot)
Upload the shader resource to register slot of a vertex shader.
Definition: shader_resource.cpp:14
virtual void to_ps(ID3D11DeviceContext *context, UINT slot)
Upload the shader resource to register slot of a pixel shader.
Definition: shader_resource.cpp:24
void to_vs(ID3D11DeviceContext *context, UINT slot)
Upload the shader resource to register slot of a vertex shader.
Definition: shader_resource.cpp:44
A shader resource wrapper.
Definition: shader_resource.h:24
virtual void destroy()=0
Destroy the shader_resource and free all memory.
A wrapper class for a sampler state.
Definition: shader_resource.h:49
virtual void to_cs(ID3D11DeviceContext *context, UINT slot)
Upload the shader resource to register slot of a compute shader.
Definition: shader_resource.cpp:29
void to_ps(ID3D11DeviceContext *context, UINT slot)
Upload the shader resource to register slot of a pixel shader.
Definition: shader_resource.cpp:49
void destroy()
Destroy the shader_resource and free all memory.
Definition: shader_resource.cpp:39
virtual void to_gs(ID3D11DeviceContext *context, UINT slot)
Upload the shader resource to register slot of a geometry shader.
Definition: shader_resource.cpp:19