25 #ifndef OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
26 #define OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H
28 #include "../version.h"
30 struct ID3D11DeviceContext;
32 struct ID3D11ComputeShader;
33 struct ID3D11ClassLinkage;
34 struct ID3D11ClassInstance;
35 struct ID3D11ShaderResourceView;
36 struct ID3D11UnorderedAccessView;
38 #include "../osd/bufferDescriptor.h"
41 namespace OPENSUBDIV_VERSION {
58 template <
typename DEVICE_CONTEXT>
60 DEVICE_CONTEXT context) {
65 ID3D11DeviceContext *deviceContext) {
70 ID3D11DeviceContext *deviceContext);
75 ID3D11ShaderResourceView *
GetSizesSRV()
const {
return _sizes; }
82 ID3D11ShaderResourceView *_sizes;
83 ID3D11ShaderResourceView *_offsets;
84 ID3D11ShaderResourceView *_indices;
85 ID3D11ShaderResourceView *_weights;
86 ID3D11Buffer *_sizesBuffer;
87 ID3D11Buffer *_offsetsBuffer;
88 ID3D11Buffer *_indicesBuffer;
89 ID3D11Buffer *_weightsBuffer;
103 ID3D11DeviceContext *deviceContext);
112 ID3D11DeviceContext *deviceContext);
147 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
151 STENCIL_TABLE
const *stencilTable,
153 ID3D11DeviceContext * deviceContext) {
162 instance =
Create(srcDesc, dstDesc,
180 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
184 STENCIL_TABLE
const *stencilTable,
185 ID3D11DeviceContext *deviceContext)
const {
186 return EvalStencils(srcBuffer->BindD3D11UAV(deviceContext), srcDesc,
187 dstBuffer->BindD3D11UAV(deviceContext), dstDesc,
188 stencilTable->GetSizesSRV(),
189 stencilTable->GetOffsetsSRV(),
190 stencilTable->GetIndicesSRV(),
191 stencilTable->GetWeightsSRV(),
193 stencilTable->GetNumStencils(),
201 ID3D11UnorderedAccessView *dstUAV,
203 ID3D11ShaderResourceView *sizesSRV,
204 ID3D11ShaderResourceView *offsetsSRV,
205 ID3D11ShaderResourceView *indicesSRV,
206 ID3D11ShaderResourceView *weightsSRV,
209 ID3D11DeviceContext *deviceContext)
const;
214 ID3D11DeviceContext *deviceContext);
220 ID3D11ComputeShader * _computeShader;
221 ID3D11ClassLinkage * _classLinkage;
222 ID3D11ClassInstance * _singleBufferKernel;
223 ID3D11ClassInstance * _separateBufferKernel;
224 ID3D11Buffer * _uniformArgs;
232 using namespace OPENSUBDIV_VERSION;
237 #endif // OPENSUBDIV3_OSD_D3D11_COMPUTE_EVALUATOR_H