All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
d3d11ComputeContext.h
Go to the documentation of this file.
1 //
2 // Copyright 2013 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 
25 #ifndef OSD_D3D11_COMPUTE_CONTEXT_H
26 #define OSD_D3D11_COMPUTE_CONTEXT_H
27 
28 #include "../version.h"
29 
30 #include "../osd/nonCopyable.h"
31 
32 struct ID3D11DeviceContext;
33 
34 namespace OpenSubdiv {
35 namespace OPENSUBDIV_VERSION {
36 
37 namespace Far{ class StencilTables; }
38 
39 namespace Osd {
40 
50 class D3D11ComputeContext : public NonCopyable<D3D11ComputeContext> {
51 public:
52 
63  static D3D11ComputeContext * Create(ID3D11DeviceContext *deviceContext,
64  Far::StencilTables const * vertexStencilTables,
65  Far::StencilTables const * varyingStencilTables=0);
66 
68  virtual ~D3D11ComputeContext();
69 
71  bool HasVertexStencilTables() const;
72 
74  bool HasVaryingStencilTables() const;
75 
77  int GetNumControlVertices() const {
78  return _numControlVertices;
79  }
80 
85  void BindVertexStencilTables(ID3D11DeviceContext *deviceContext) const;
86 
91  void BindVaryingStencilTables(ID3D11DeviceContext *deviceContext) const;
92 
97  void UnbindStencilTables(ID3D11DeviceContext *deviceContext) const;
98 
99 protected:
100 
101  explicit D3D11ComputeContext(ID3D11DeviceContext *deviceContext,
102  Far::StencilTables const * vertexStencilTables,
103  Far::StencilTables const * varyingStencilTables);
104 
105 private:
106 
107  class D3D11StencilTables;
108 
109  D3D11StencilTables * _vertexStencilTables,
110  * _varyingStencilTables;
111 
112  int _numControlVertices;
113 };
114 
115 } // end namespace Osd
116 
117 } // end namespace OPENSUBDIV_VERSION
118 using namespace OPENSUBDIV_VERSION;
119 
120 } // end namespace OpenSubdiv
121 
122 #endif // OSD_D3D11_COMPUTE_CONTEXT_H
123 
static D3D11ComputeContext * Create(ID3D11DeviceContext *deviceContext, Far::StencilTables const *vertexStencilTables, Far::StencilTables const *varyingStencilTables=0)
D3D11ComputeContext(ID3D11DeviceContext *deviceContext, Far::StencilTables const *vertexStencilTables, Far::StencilTables const *varyingStencilTables)
void BindVaryingStencilTables(ID3D11DeviceContext *deviceContext) const
int GetNumControlVertices() const
Returns the number of control vertices.
bool HasVertexStencilTables() const
Returns true if the Context has a &#39;vertex&#39; interpolation stencil table.
void BindVertexStencilTables(ID3D11DeviceContext *deviceContext) const
void UnbindStencilTables(ID3D11DeviceContext *deviceContext) const
bool HasVaryingStencilTables() const
Returns true if the Context has a &#39;varying&#39; interpolation stencil table.