OROCHI
 
Loading...
Searching...
No Matches
GxRenderVertexDeclaration.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_CORE_NAMESPACE_BEGIN()
14
16
17//===========================================================================
20//===========================================================================
22{
23 //-------------------------------------------------------------
25 //-------------------------------------------------------------
27public:
29 // ClassBaseReference継承クラス用禁止宣言
31
32 friend class GxRenderDevice;
33
35 //-------------------------------------------------------------
37 //-------------------------------------------------------------
39public:
41 void cleanup(void) override;
42
43protected:
45 virtual b32 initialize(const GxRenderVertexElement* pElements);
46
49
51 //-------------------------------------------------------------
53 //-------------------------------------------------------------
55public:
57 GX_FORCE_INLINE void onLostDevice(void) override {}
58
60 GX_FORCE_INLINE b32 onResetDevice(void) override { return true; }
61
63 GX_FORCE_INLINE void onRender(void) override {}
64
66 //-------------------------------------------------------------
68 //-------------------------------------------------------------
70public:
71#if GX_USE_DX11
73 D3D11_INPUT_ELEMENT_DESC* getD3D11InputElementDescs(void) const { return _pD3DInputElementDescs; }
75 u32 getD3D11InputElementDescsCount(void) const { return _d3dInputElementDescsCount; }
76#elif GX_USE_DX12
78 constexpr D3D12_INPUT_ELEMENT_DESC* getD3D12InputElementDescs(void) const { return _pD3DInputElementDescs; }
80 constexpr u32 getD3D12InputElementDescsCount(void) const { return _d3dInputElementDescsCount; }
81#elif defined(_NX64)
83 constexpr u32 getNumLocations(void) const { return _numLocations; }
85 constexpr GxNativeVertexAttributeState* getVertexAttributeState(void) const { return _pAttributeState; }
86#endif // _NX64
87#if GX_USE_OPENGL
89 static u32 getLocationGLSL(RENDER_SEMANTICS semantics);
91 // glslLoation = getLocationGLSL() + getStreamLocationOffsetGLSL(n)
92 static u32 getStreamLocationOffsetGLSL(u32 slot);
93#endif //GX_USE_OPENGL
94
96 constexpr GxRenderVertexElement* getVertexElements(void) const { return _pVertexElements; }
98 constexpr u32 getVertexElementCount(void) const { return _vertexElementCount; }
99
101 //-------------------------------------------------------------
103 //-------------------------------------------------------------
105private:
106 GxRenderVertexElement* _pVertexElements;
107 u32 _vertexElementCount;
108
109#if GX_USE_DX11 || GX_USE_DX12
110 D3D_INPUT_ELEMENT_DESC* _pD3DInputElementDescs;
111 u32 _d3dInputElementDescsCount;
112#elif defined(_NX64)
113 u32 _numLocations;
114 GxNativeVertexAttributeState* _pAttributeState;
115#endif // _NX64
116
118};
119
120//===========================================================================
123//===========================================================================
125{
126 //-------------------------------------------------------------
128 //-------------------------------------------------------------
130public:
131 GX_RTTI_STRUCT(GxRenderVertexElement)
132
133
135
137 //-------------------------------------------------------------
139 //-------------------------------------------------------------
141
144
146 GxRenderVertexElement(u16 stream, u16 offset, u16 type, u16 semantics);
147
149 //-----------------------------------------------------------
151 //-----------------------------------------------------------
153#if GX_DEVELOP
154 // 書き込み
155 b32 write(GxStreamWriter& writer);
156#endif //GX_DEVELOP
157
159 //-------------------------------------------------------------
161 //-------------------------------------------------------------
163
166 u16 _type;
168
170};
171
172GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
RENDER_SEMANTICS
セマンティックス
Definition GxRender.h:234
描画関連の依存をこのクラスで吸収します
Definition GxRenderDevice.h:450
b32 initialize(const GxRenderDeviceInitialInformation *pInitialInformation)
初期化関数
Definition GxRenderDevice.cpp:1017
GPUリソースを管理する
Definition GxRenderResource.h:20
頂点シェーダに渡す頂点の宣言を管理する
Definition GxRenderVertexDeclaration.h:22
constexpr u32 getVertexElementCount(void) const
頂点要素数を取得
Definition GxRenderVertexDeclaration.h:98
constexpr GxRenderVertexElement * getVertexElements(void) const
頂点要素を取得
Definition GxRenderVertexDeclaration.h:96
GX_FORCE_INLINE b32 onResetDevice(void) override
デバイスのリセット後に通知
Definition GxRenderVertexDeclaration.h:60
GX_FORCE_INLINE void onLostDevice(void) override
デバイスが消失した時点で通知
Definition GxRenderVertexDeclaration.h:57
GX_FORCE_INLINE void onRender(void) override
描画通知
Definition GxRenderVertexDeclaration.h:63
ストリーム書き込みクラス
Definition GxStreamWriter.h:19
頂点宣言に使用する、頂点要素を定義するための構造体
Definition GxRenderVertexDeclaration.h:125
static const GxRenderVertexElement END
< 終了定義
Definition GxRenderVertexDeclaration.h:134
u16 _offset
オフセット
Definition GxRenderVertexDeclaration.h:165
u16 _stream
ストリーム
Definition GxRenderVertexDeclaration.h:164
u16 _semantics
セマンティクス
Definition GxRenderVertexDeclaration.h:167
u16 _type
タイプ
Definition GxRenderVertexDeclaration.h:166
Definition GxBase.h:24
32bitブーリアン
Definition GxDefine.h:173