OROCHI
 
Loading...
Searching...
No Matches
GxResShaderPackage.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_CORE_NAMESPACE_BEGIN()
14
15//===========================================================================
17//===========================================================================
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
26 // ClassBaseReference継承クラス用禁止宣言
28
29
30 //-----------------------------------------------------------
32 //-----------------------------------------------------------
34protected:
37public:
39 void cleanup(void) override;
40
42 //-----------------------------------------------------------
44 //-----------------------------------------------------------
46public:
48 b32 load(GxStream& stream, u32 dataSize);
49#if GX_DEVELOP
51 b32 save(GxStream& stream);
53 static b32 isModified(GxStream& in, u64 lastWriteTime, GX_CSTR resourcePath);
55 static b32 mergeConfigFiles(GX_CSTR resourcePath, GX_CSTR* pShaderFolders);
56#endif // GX_DEVELOP
57
59 GX_FORCE_INLINE GxShaderPackage::GxShaderCode* allocateShaderCode(void) { return _shaderPackage.allocateShaderCode(); }
60
61protected:
62#if GX_DEVELOP
64 s32 includeCallback(void* pSource, void* pArgument);
66 s32 saveResourceCallback(void* pSource, void* pArgument);
67#endif // GX_DEVELOP
68
70 //-------------------------------------------------------------
72 //-------------------------------------------------------------
74public:
76 GX_FORCE_INLINE GxRenderVertexShader* getVertexShader(GxShaderPackage::GxShaderCode* pShaderCode) { return _shaderPackage.getVertexShader(pShaderCode); }
78 GX_FORCE_INLINE GxRenderPixelShader* getPixelShader(GxShaderPackage::GxShaderCode* pShaderCode) { return _shaderPackage.getPixelShader(pShaderCode); }
80 GX_FORCE_INLINE b32 getShader(GxShaderPackage::GxShaderCode* pShaderCode, GxRenderVertexShader*& pVertexShader, GxRenderPixelShader*& pPixelShader)
81 {
82#if GX_ENABLE_TESSELLATION
83 GxRenderHullShader* pHullShader;
84 GxRenderDomainShader* pDomainShader;
85 return _shaderPackage.getShader(pShaderCode, pVertexShader, pPixelShader, pHullShader, pDomainShader);
86#else //GX_ENABLE_TESSELLATION
87 return _shaderPackage.getShader(pShaderCode, pVertexShader, pPixelShader);
88#endif // !GX_ENABLE_TESSELLATION
89 }
90
92 constexpr u32 getProgramFunctionsCount(void) const { return _shaderPackage.getProgramFunctionsCount(); }
94 constexpr u32 getMaterialFunctionsCount(void) const { return _shaderPackage.getMaterialFunctionsCount(); }
95
97 constexpr u32 getProgramParameterCount(void) const { return _shaderPackage.getProgramParameterCount(); }
99 constexpr u32 getMaterialParameterCount(void) const { return _shaderPackage.getMaterialParameterCount(); }
100
102 GX_FORCE_INLINE GX_HANDLE getProgramFunctionsHandleByName(GX_CSTR name) const { return _shaderPackage.getProgramFunctionsHandleByName(name); }
104 GX_FORCE_INLINE GX_HANDLE getMaterialFunctionsHandleByName(GX_CSTR name) const { return _shaderPackage.getMaterialFunctionsHandleByName(name); }
105
107 GX_FORCE_INLINE GX_HANDLE getProgramFunctionsHandleByVirtualName(GX_CSTR name) const { return _shaderPackage.getProgramFunctionsHandleByVirtualName(name); }
109 GX_FORCE_INLINE GX_HANDLE getMaterialFunctionsHandleByVirtualName(GX_CSTR name) const { return _shaderPackage.getMaterialFunctionsHandleByVirtualName(name); }
110
112 GX_FORCE_INLINE GX_CSTR getProgramFunctionsName(GX_HANDLE handle) const { return _shaderPackage.getProgramFunctionsName(handle); }
114 GX_FORCE_INLINE GX_CSTR getMaterialFunctionsName(GX_HANDLE handle) const { return _shaderPackage.getMaterialFunctionsName(handle); }
115
117 GX_FORCE_INLINE GX_CSTR getProgramFunctionsVirtualName(GX_HANDLE handle) const { return _shaderPackage.getProgramFunctionsVirtualName(handle); }
119 GX_FORCE_INLINE GX_CSTR getMaterialFunctionsVirtualName(GX_HANDLE handle) const { return _shaderPackage.getMaterialFunctionsVirtualName(handle); }
120
122 GX_FORCE_INLINE GX_CSTR getProgramFunctionsValueName(GX_HANDLE handle, u32 value) const { return _shaderPackage.getProgramFunctionsValueName(handle, value); }
124 GX_FORCE_INLINE GX_CSTR getMaterialFunctionsValueName(GX_HANDLE handle, u32 value) const { return _shaderPackage.getMaterialFunctionsValueName(handle, value); }
125
127 GX_FORCE_INLINE GX_CSTR getProgramFunctionsValueVirtualName(GX_HANDLE handle, u32 value) const { return _shaderPackage.getProgramFunctionsValueVirtualName(handle, value); }
129 GX_FORCE_INLINE GX_CSTR getMaterialFunctionsValueVirtualName(GX_HANDLE handle, u32 value) const { return _shaderPackage.getMaterialFunctionsValueVirtualName(handle, value); }
130
132 GX_FORCE_INLINE u32 getProgramFunctionsValueByName(GX_HANDLE handle, GX_CSTR name) const { return _shaderPackage.getProgramFunctionsValueByName(handle, name); }
134 GX_FORCE_INLINE u32 getMaterialFunctionsValueByName(GX_HANDLE handle, GX_CSTR name) const { return _shaderPackage.getMaterialFunctionsValueByName(handle, name); }
135
137 GX_FORCE_INLINE u32 getProgramFunctionsValueByVirtualName(GX_HANDLE handle, GX_CSTR name) const { return _shaderPackage.getProgramFunctionsValueByVirtualName(handle, name); }
139 GX_FORCE_INLINE u32 getMaterialFunctionsValueByVirtualName(GX_HANDLE handle, GX_CSTR name) const { return _shaderPackage.getMaterialFunctionsValueByVirtualName(handle, name); }
140
141#if GX_DEVELOP
143 GX_FORCE_INLINE const GX_ENUM* getProgramFunctionsValueGxEnum(GX_HANDLE handle) const { return _shaderPackage.getProgramFunctionsValueGxEnum(handle); }
145 GX_FORCE_INLINE const GX_ENUM* getMaterialFunctionsValueGxEnum(GX_HANDLE handle) const { return _shaderPackage.getMaterialFunctionsValueGxEnum(handle); }
146#endif //GX_DEVELOP
147
149 GX_FORCE_INLINE u32 getProgramFunctionsValueCount(GX_HANDLE handle) const { return _shaderPackage.getProgramFunctionsValueCount(handle); }
151 GX_FORCE_INLINE u32 getMaterialFunctionsValueCount(GX_HANDLE handle) const { return _shaderPackage.getMaterialFunctionsValueCount(handle); }
152
154 GX_FORCE_INLINE GX_HANDLE getProgramParameterHandleByName(GX_CSTR name) const { return _shaderPackage.getProgramParameterHandleByName(name); }
156 GX_FORCE_INLINE GX_HANDLE getMaterialParameterHandleByName(GX_CSTR name) const { return _shaderPackage.getMaterialParameterHandleByName(name); }
157
159 GX_FORCE_INLINE GX_HANDLE getProgramParameterHandleByVirtualName(GX_CSTR name) const { return _shaderPackage.getProgramParameterHandleByVirtualName(name); }
161 GX_FORCE_INLINE GX_HANDLE getMaterialParameterHandleByVirtualName(GX_CSTR name) const { return _shaderPackage.getMaterialParameterHandleByVirtualName(name); }
162
164 GX_FORCE_INLINE GX_CSTR getProgramParameterName(GX_HANDLE handle) const { return _shaderPackage.getProgramParameterName(handle); }
166 GX_FORCE_INLINE GX_CSTR getMaterialParameterName(GX_HANDLE handle) const { return _shaderPackage.getMaterialParameterName(handle); }
167
169 GX_FORCE_INLINE GX_CSTR getProgramParameterVirtualName(GX_HANDLE handle) const { return _shaderPackage.getProgramParameterVirtualName(handle); }
171 GX_FORCE_INLINE GX_CSTR getMaterialParameterVirtualName(GX_HANDLE handle) const { return _shaderPackage.getMaterialParameterVirtualName(handle); }
172
174 GX_FORCE_INLINE GxShaderLanguage::PARAMETER_TYPE getProgramParameterType(GX_HANDLE handle) const { return _shaderPackage.getProgramParameterType(handle); }
176 GX_FORCE_INLINE GxShaderLanguage::PARAMETER_TYPE getMaterialParameterType(GX_HANDLE handle) const { return _shaderPackage.getMaterialParameterType(handle); }
177
178#if GX_DEVELOP
180 GX_FORCE_INLINE GxShaderLanguage::GxParameterAnnotation getMaterialParameterAnnotation(GX_HANDLE handle) const { return _shaderPackage.getMaterialParameterAnnotation(handle); }
181#endif //GX_DEVELOP
182
184 GX_FORCE_INLINE GxShaderPackage& getShaderPackage(void) { return _shaderPackage; }
185
187 //-----------------------------------------------------------
189 //-----------------------------------------------------------
191protected:
193#if GX_DEVELOP
194 GX_CSTR _shaderSource;
195 GxArray _includeFileNameArray;
196#endif // GX_DEVELOP
197
199};
200
201//===========================================================================
203//===========================================================================
205{
206 //-----------------------------------------------------------
208 //-----------------------------------------------------------
210public:
212 // ClassBaseReference継承クラス用禁止宣言
214
215
216 //-----------------------------------------------------------
218 //-----------------------------------------------------------
220protected:
223
225 //-----------------------------------------------------------
227 //-----------------------------------------------------------
229public:
231 b32 load(GxStream& stream, u32 dataSize);
232
234};
235
236GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
u32 GX_HANDLE
ハンドル
Definition GxDefine.h:214
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
配列クラス
Definition GxArray.h:18
ピクセルシェーダを管理する
Definition GxRenderPixelShader.h:20
頂点シェーダを管理する
Definition GxRenderVertexShader.h:22
リソース基底クラス
Definition GxResBase.h:23
シェーダパッケージオリジナルリソースクラス
Definition GxResShaderPackage.h:205
GxResShaderPackageGxsl(void)
デフォルトコンストラクタ
Definition GxResShaderPackage.h:222
b32 load(GxStream &stream, u32 dataSize)
リソース読み込み
Definition GxResShaderPackage.cpp:480
シェーダパッケージリソースクラス
Definition GxResShaderPackage.h:19
GX_FORCE_INLINE GX_CSTR getMaterialParameterVirtualName(GX_HANDLE handle) const
マテリアルで設定するパラメータの仮想名を取得
Definition GxResShaderPackage.h:171
GX_FORCE_INLINE GX_CSTR getMaterialParameterName(GX_HANDLE handle) const
マテリアルで設定するパラメータの名前を取得
Definition GxResShaderPackage.h:166
GX_FORCE_INLINE GxShaderLanguage::PARAMETER_TYPE getMaterialParameterType(GX_HANDLE handle) const
マテリアルで設定するパラメータのタイプを取得
Definition GxResShaderPackage.h:176
GX_FORCE_INLINE GX_CSTR getMaterialFunctionsValueName(GX_HANDLE handle, u32 value) const
マテリアルで設定する関数の値の名前を取得
Definition GxResShaderPackage.h:124
GX_FORCE_INLINE u32 getProgramFunctionsValueCount(GX_HANDLE handle) const
プログラムで設定する関数の値数
Definition GxResShaderPackage.h:149
GX_FORCE_INLINE GX_CSTR getMaterialFunctionsValueVirtualName(GX_HANDLE handle, u32 value) const
マテリアルで設定する関数の値の仮想名を取得
Definition GxResShaderPackage.h:129
GX_FORCE_INLINE b32 getShader(GxShaderPackage::GxShaderCode *pShaderCode, GxRenderVertexShader *&pVertexShader, GxRenderPixelShader *&pPixelShader)
シェーダ取得
Definition GxResShaderPackage.h:80
constexpr u32 getMaterialFunctionsCount(void) const
マテリアルで設定する関数の数
Definition GxResShaderPackage.h:94
GX_FORCE_INLINE GX_CSTR getMaterialFunctionsVirtualName(GX_HANDLE handle) const
マテリアルで設定する関数の仮想名を取得
Definition GxResShaderPackage.h:119
GX_FORCE_INLINE GX_HANDLE getMaterialParameterHandleByName(GX_CSTR name) const
マテリアルで設定するパラメータのハンドルを名前から取得
Definition GxResShaderPackage.h:156
constexpr u32 getMaterialParameterCount(void) const
マテリアルで設定するパラメータの数
Definition GxResShaderPackage.h:99
GX_FORCE_INLINE GxShaderLanguage::PARAMETER_TYPE getProgramParameterType(GX_HANDLE handle) const
プログラムで設定するパラメータのタイプを取得
Definition GxResShaderPackage.h:174
GX_FORCE_INLINE u32 getMaterialFunctionsValueCount(GX_HANDLE handle) const
マテリアルで設定する関数の値数
Definition GxResShaderPackage.h:151
GxShaderPackage _shaderPackage
シェーダパッケージ
Definition GxResShaderPackage.h:192
GX_FORCE_INLINE GX_CSTR getProgramFunctionsValueName(GX_HANDLE handle, u32 value) const
プログラムで設定する関数の値の名前を取得
Definition GxResShaderPackage.h:122
GX_FORCE_INLINE u32 getMaterialFunctionsValueByVirtualName(GX_HANDLE handle, GX_CSTR name) const
マテリアルで設定する関数の値を仮想名から取得
Definition GxResShaderPackage.h:139
GX_FORCE_INLINE GxShaderPackage & getShaderPackage(void)
シェーダーパッケージを取得
Definition GxResShaderPackage.h:184
GX_FORCE_INLINE GX_CSTR getProgramParameterName(GX_HANDLE handle) const
プログラムで設定するパラメータの名前を取得
Definition GxResShaderPackage.h:164
GX_FORCE_INLINE GxRenderVertexShader * getVertexShader(GxShaderPackage::GxShaderCode *pShaderCode)
頂点シェーダ取得
Definition GxResShaderPackage.h:76
constexpr u32 getProgramFunctionsCount(void) const
プログラムで設定する関数の数
Definition GxResShaderPackage.h:92
GX_FORCE_INLINE GxShaderPackage::GxShaderCode * allocateShaderCode(void)
シェーダコード作成
Definition GxResShaderPackage.h:59
GX_FORCE_INLINE u32 getMaterialFunctionsValueByName(GX_HANDLE handle, GX_CSTR name) const
マテリアルで設定する関数の値を名前から取得
Definition GxResShaderPackage.h:134
GX_FORCE_INLINE GX_CSTR getProgramFunctionsName(GX_HANDLE handle) const
プログラムで設定する関数の名前を取得
Definition GxResShaderPackage.h:112
GX_FORCE_INLINE GX_CSTR getProgramFunctionsVirtualName(GX_HANDLE handle) const
プログラムで設定する関数の仮想名を取得
Definition GxResShaderPackage.h:117
constexpr u32 getProgramParameterCount(void) const
プログラムで設定するパラメータの数
Definition GxResShaderPackage.h:97
GX_FORCE_INLINE GX_HANDLE getProgramParameterHandleByName(GX_CSTR name) const
プログラムで設定するパラメータのハンドルを名前から取得
Definition GxResShaderPackage.h:154
GX_FORCE_INLINE u32 getProgramFunctionsValueByName(GX_HANDLE handle, GX_CSTR name) const
プログラムで設定する関数の値を名前から取得
Definition GxResShaderPackage.h:132
GX_FORCE_INLINE GX_HANDLE getProgramFunctionsHandleByName(GX_CSTR name) const
プログラムで設定する関数のハンドルを名前から取得
Definition GxResShaderPackage.h:102
GX_FORCE_INLINE GX_CSTR getMaterialFunctionsName(GX_HANDLE handle) const
マテリアルで設定する関数の名前を取得
Definition GxResShaderPackage.h:114
GX_FORCE_INLINE GX_CSTR getProgramFunctionsValueVirtualName(GX_HANDLE handle, u32 value) const
プログラムで設定する関数の値の仮想名を取得
Definition GxResShaderPackage.h:127
GX_FORCE_INLINE GX_HANDLE getMaterialFunctionsHandleByVirtualName(GX_CSTR name) const
マテリアルで設定する関数のハンドルを仮想名から取得
Definition GxResShaderPackage.h:109
GX_FORCE_INLINE u32 getProgramFunctionsValueByVirtualName(GX_HANDLE handle, GX_CSTR name) const
プログラムで設定する関数の値を仮想名から取得
Definition GxResShaderPackage.h:137
GX_FORCE_INLINE GX_HANDLE getProgramFunctionsHandleByVirtualName(GX_CSTR name) const
プログラムで設定する関数のハンドルを仮想名から取得
Definition GxResShaderPackage.h:107
GX_FORCE_INLINE GxRenderPixelShader * getPixelShader(GxShaderPackage::GxShaderCode *pShaderCode)
ピクセルシェーダ取得
Definition GxResShaderPackage.h:78
GX_FORCE_INLINE GX_HANDLE getMaterialFunctionsHandleByName(GX_CSTR name) const
マテリアルで設定する関数のハンドルを名前から取得
Definition GxResShaderPackage.h:104
GX_FORCE_INLINE GX_HANDLE getProgramParameterHandleByVirtualName(GX_CSTR name) const
プログラムで設定する関数のハンドルを仮想名から取得
Definition GxResShaderPackage.h:159
GX_FORCE_INLINE GX_HANDLE getMaterialParameterHandleByVirtualName(GX_CSTR name) const
マテリアルで設定する関数のハンドルを仮想名から取得
Definition GxResShaderPackage.h:161
GX_FORCE_INLINE GX_CSTR getProgramParameterVirtualName(GX_HANDLE handle) const
プログラムで設定するパラメータの仮想名を取得
Definition GxResShaderPackage.h:169
PARAMETER_TYPE
パラメータの種類
Definition GxShaderLanguage.h:35
シェーダパッケージクラス
Definition GxShaderPackage.h:28
ストリーム基礎クラス
Definition GxStream.h:20
GUI用
Definition GxDefine.h:194
シェーダコード
Definition GxShaderPackage.h:52
32bitブーリアン
Definition GxDefine.h:173