25 #ifndef OSD_D3D11_DRAW_REGISTRY_H
26 #define OSD_D3D11_DRAW_REGISTRY_H
28 #include "../version.h"
30 #include "../far/patchTables.h"
31 #include "../osd/drawRegistry.h"
32 #include "../osd/vertex.h"
36 struct ID3D11VertexShader;
37 struct ID3D11HullShader;
38 struct ID3D11DomainShader;
39 struct ID3D11GeometryShader;
40 struct ID3D11PixelShader;
43 struct ID3D11ShaderResourceView;
46 struct ID3D11InputLayout;
47 struct D3D11_INPUT_ELEMENT_DESC;
49 namespace OpenSubdiv {
50 namespace OPENSUBDIV_VERSION {
105 ID3D11Device * pd3dDevice,
106 ID3D11InputLayout ** ppInputLayout,
107 D3D11_INPUT_ELEMENT_DESC
const * pInputElementDescs,
108 int numInputElements);
120 template <
class DESC_TYPE = DrawContext::PatchDescriptor,
121 class CONFIG_TYPE = D3D11DrawConfig,
122 class SOURCE_CONFIG_TYPE = D3D11DrawSourceConfig>
140 for (
typename ConfigMap::iterator
141 i = _configMap.begin(); i != _configMap.end(); ++i) {
150 ID3D11Device * pd3dDevice,
151 ID3D11InputLayout ** ppInputLayout = NULL,
152 D3D11_INPUT_ELEMENT_DESC
const * pInputElementDescs = NULL,
153 int numInputElements = 0) {
154 typename ConfigMap::iterator it = _configMap.find(desc);
155 if (it != _configMap.end()) {
163 pInputElementDescs, numInputElements);
164 _configMap[desc] = config;
176 ID3D11Device * pd3dDevice,
177 ID3D11InputLayout ** ppInputLayout,
178 D3D11_INPUT_ELEMENT_DESC
const * pInputElementDescs,
179 int numInputElements) {
188 ID3D11Device * pd3dDevice) {
199 using namespace OPENSUBDIV_VERSION;
std::map< DescType, ConfigType * > ConfigMap
ID3D11PixelShader * pixelShader
SOURCE_CONFIG_TYPE SourceConfigType
DrawShaderSource pixelShader
void SetPtexEnabled(bool b)
virtual ~D3D11DrawConfig()
virtual ~D3D11DrawRegistryBase()
ID3D11GeometryShader * geometryShader
D3D11DrawRegistryBase BaseRegistry
DrawShaderSource geometryShader
ID3D11DomainShader * domainShader
virtual ConfigType * _CreateDrawConfig(DescType const &desc, SourceConfigType const *sconfig, ID3D11Device *pd3dDevice, ID3D11InputLayout **ppInputLayout, D3D11_INPUT_ELEMENT_DESC const *pInputElementDescs, int numInputElements)
ID3D11HullShader * hullShader
DrawShaderSource vertexShader
DrawShaderSource domainShader
virtual ConfigType * _NewDrawConfig()
virtual ConfigType * _CreateDrawConfig(DescType const &desc, SourceConfigType const *sconfig, ID3D11Device *pd3dDevice, ID3D11InputLayout **ppInputLayout, D3D11_INPUT_ELEMENT_DESC const *pInputElementDescs, int numInputElements)
DrawShaderSource commonShader
D3D11DrawSourceConfig SourceConfigType
D3D11DrawRegistryBase(bool enablePtex=false)
virtual SourceConfigType * _NewDrawSourceConfig()
virtual ConfigType * _NewDrawConfig()
ConfigType * GetDrawConfig(DescType const &desc, ID3D11Device *pd3dDevice, ID3D11InputLayout **ppInputLayout=NULL, D3D11_INPUT_ELEMENT_DESC const *pInputElementDescs=NULL, int numInputElements=0)
virtual ~D3D11DrawRegistry()
ID3D11VertexShader * vertexShader
DrawContext::PatchDescriptor DescType
D3D11DrawConfig ConfigType
DrawShaderSource hullShader
virtual SourceConfigType * _CreateDrawSourceConfig(DescType const &desc, ID3D11Device *pd3dDevice)
virtual SourceConfigType * _NewDrawSourceConfig()
bool IsPtexEnabled() const
virtual SourceConfigType * _CreateDrawSourceConfig(DescType const &desc, ID3D11Device *pd3dDevice)