OpenSubdiv
Loading...
Searching...
No Matches
d3d11LegacyGregoryPatchTable.h
Go to the documentation of this file.
1//
2// Copyright 2015 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7
8#ifndef OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
9#define OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
10
11#include "../version.h"
12
13#include "../far/patchTable.h"
14#include "../osd/nonCopyable.h"
15
16struct ID3D11Buffer;
17struct ID3D11ShaderResourceView;
18struct ID3D11Device;
19struct ID3D11DeviceContext;
20
21namespace OpenSubdiv {
22namespace OPENSUBDIV_VERSION {
23
24namespace Osd {
25
27 : private NonCopyable<D3D11LegacyGregoryPatchTable> {
28public:
30
31 template<typename DEVICE_CONTEXT>
33 Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context) {
34 return Create(farPatchTable, context->GetDeviceContext());
35 }
36
38 Far::PatchTable const *farPatchTable,
39 ID3D11DeviceContext *deviceContext);
40
41 void UpdateVertexBuffer(ID3D11Buffer *vbo,
42 int numVertices, int numVertexElements,
43 ID3D11DeviceContext *pd3d11DeviceContext);
44
45 ID3D11ShaderResourceView* GetVertexSRV() const {
46 return _vertexSRV;
47 }
48
49 ID3D11ShaderResourceView* GetVertexValenceSRV() const {
50 return _vertexValenceSRV;
51 }
52
53 ID3D11ShaderResourceView* GetQuadOffsetsSRV() const {
54 return _quadOffsetsSRV;
55 }
56
59 return _quadOffsetsBase[1];
60 }
61 return _quadOffsetsBase[0];
62 }
63
64protected:
66
67private:
68 ID3D11Buffer* _vertexValenceBuffer;
69 ID3D11Buffer* _quadOffsetsBuffer;
70 ID3D11ShaderResourceView* _vertexSRV;
71 ID3D11ShaderResourceView* _vertexValenceSRV;
72 ID3D11ShaderResourceView* _quadOffsetsSRV;
73 int _quadOffsetsBase[2]; // gregory, boundaryGregory
74};
75
76
77
78} // end namespace Osd
79
80} // end namespace OPENSUBDIV_VERSION
81using namespace OPENSUBDIV_VERSION;
82
83} // end namespace OpenSubdiv
84
85#endif // OPENSUBDIV3_OSD_D3D11_LEGACY_GREGORY_PATCH_TABLE_H
Container for arrays of parametric patches.
Definition patchTable.h:38
void UpdateVertexBuffer(ID3D11Buffer *vbo, int numVertices, int numVertexElements, ID3D11DeviceContext *pd3d11DeviceContext)
static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, ID3D11DeviceContext *deviceContext)
static D3D11LegacyGregoryPatchTable * Create(Far::PatchTable const *farPatchTable, DEVICE_CONTEXT context)