Skylicht Engine
Loading...
Searching...
No Matches
IGPUProgrammingServices.h
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__
6#define __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__
7
8#include "EShaderTypes.h"
9#include "EMaterialTypes.h"
10#include "EPrimitiveTypes.h"
11#include "path.h"
12
13#include "IGPUCompute.h"
14
15namespace irr
16{
17
18namespace io
19{
20 class IReadFile;
21} // end namespace io
22
23namespace video
24{
25
26class IVideoDriver;
28class IGPUCompute;
29
39
42{
43public:
44
47
49
91 const c8* vertexShaderProgram,
92 const c8* vertexShaderEntryPointName,
93 E_VERTEX_SHADER_TYPE vsCompileTarget,
94 const c8* pixelShaderProgram,
95 const c8* pixelShaderEntryPointName,
96 E_PIXEL_SHADER_TYPE psCompileTarget,
97 const c8* geometryShaderProgram,
98 const c8* geometryShaderEntryPointName = "main",
99 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
102 u32 verticesOut = 0,
103 IShaderConstantSetCallBack* callback = 0,
104 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
105 s32 userData = 0,
106 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0;
107
110 const c8* vertexShaderProgram,
111 const c8* vertexShaderEntryPointName="main",
112 E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1,
113 const c8* pixelShaderProgram=0,
114 const c8* pixelShaderEntryPointName="main",
115 E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1,
116 IShaderConstantSetCallBack* callback=0,
118 s32 userData=0,
120 {
122 vertexShaderProgram, vertexShaderEntryPointName,
123 vsCompileTarget, pixelShaderProgram,
124 pixelShaderEntryPointName, psCompileTarget,
125 0, "main", EGST_GS_4_0,
127 callback, baseMaterial, userData, shadingLang);
128 }
129
130 virtual IGPUCompute* createComputeProgram(const c8* computeShaderProgram,
131 const c8* computeShaderEntryPointName = "main",
132 E_COMPUTE_SHADER_TYPE csCompileTarget = ECST_CS_5_0) = 0;
133
134 virtual IGPUCompute* createComputeProgramFromFile(const io::path& computeShaderFileName,
135 const c8* computeShaderEntryPointName = "main",
136 E_COMPUTE_SHADER_TYPE csCompileTarget = ECST_CS_5_0) = 0;
137
139
143 const c8* vertexShaderProgram,
144 const c8* pixelShaderProgram=0,
145 IShaderConstantSetCallBack* callback=0,
146 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
147 s32 userData=0)
148 {
150 vertexShaderProgram, "main",
151 EVST_VS_1_1, pixelShaderProgram,
152 "main", EPST_PS_1_1,
153 0, "main", EGST_GS_4_0,
155 callback, baseMaterial, userData);
156 }
157
159
163 const c8* vertexShaderProgram,
164 const c8* pixelShaderProgram = 0,
165 const c8* geometryShaderProgram = 0,
168 u32 verticesOut = 0,
169 IShaderConstantSetCallBack* callback = 0,
170 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
171 s32 userData = 0 )
172 {
174 vertexShaderProgram, "main",
175 EVST_VS_1_1, pixelShaderProgram,
176 "main", EPST_PS_1_1,
177 geometryShaderProgram, "main", EGST_GS_4_0,
178 inType, outType, verticesOut,
179 callback, baseMaterial, userData);
180 }
181
183
226 const io::path& vertexShaderProgramFileName,
227 const c8* vertexShaderEntryPointName,
228 E_VERTEX_SHADER_TYPE vsCompileTarget,
229 const io::path& pixelShaderProgramFileName,
230 const c8* pixelShaderEntryPointName,
231 E_PIXEL_SHADER_TYPE psCompileTarget,
232 const io::path& geometryShaderProgramFileName,
233 const c8* geometryShaderEntryPointName = "main",
234 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
237 u32 verticesOut = 0,
238 IShaderConstantSetCallBack* callback = 0,
239 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
240 s32 userData = 0,
241 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0;
242
245 const io::path& vertexShaderProgramFileName,
246 const c8* vertexShaderEntryPointName = "main",
247 E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
248 const io::path& pixelShaderProgramFileName = "",
249 const c8* pixelShaderEntryPointName = "main",
250 E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
251 IShaderConstantSetCallBack* callback = 0,
252 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
253 s32 userData = 0,
255 {
257 vertexShaderProgramFileName, vertexShaderEntryPointName,
258 vsCompileTarget, pixelShaderProgramFileName,
259 pixelShaderEntryPointName, psCompileTarget,
260 "", "main", EGST_GS_4_0,
262 callback, baseMaterial, userData, shadingLang);
263 }
264
266
270 const io::path& vertexShaderProgramFileName,
271 const io::path& pixelShaderProgramFileName = "",
272 IShaderConstantSetCallBack* callback = 0,
273 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
274 s32 userData = 0 )
275 {
277 vertexShaderProgramFileName, "main",
278 EVST_VS_1_1, pixelShaderProgramFileName,
279 "main", EPST_PS_1_1,
280 "", "main", EGST_GS_4_0,
282 callback, baseMaterial, userData);
283 }
284
286
290 const io::path& vertexShaderProgramFileName,
291 const io::path& pixelShaderProgramFileName = "",
292 const io::path& geometryShaderProgramFileName = "",
295 u32 verticesOut = 0,
296 IShaderConstantSetCallBack* callback = 0,
297 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
298 s32 userData = 0 )
299 {
301 vertexShaderProgramFileName, "main",
302 EVST_VS_1_1, pixelShaderProgramFileName,
303 "main", EPST_PS_1_1,
304 geometryShaderProgramFileName, "main", EGST_GS_4_0,
305 inType, outType, verticesOut,
306 callback, baseMaterial, userData);
307 }
308
310
351 io::IReadFile* vertexShaderProgram,
352 const c8* vertexShaderEntryPointName,
353 E_VERTEX_SHADER_TYPE vsCompileTarget,
354 io::IReadFile* pixelShaderProgram,
355 const c8* pixelShaderEntryPointName,
356 E_PIXEL_SHADER_TYPE psCompileTarget,
357 io::IReadFile* geometryShaderProgram,
358 const c8* geometryShaderEntryPointName = "main",
359 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
362 u32 verticesOut = 0,
363 IShaderConstantSetCallBack* callback = 0,
364 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
365 s32 userData = 0,
366 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0;
367
370 io::IReadFile* vertexShaderProgram,
371 const c8* vertexShaderEntryPointName = "main",
372 E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
373 io::IReadFile* pixelShaderProgram = 0,
374 const c8* pixelShaderEntryPointName = "main",
375 E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
376 IShaderConstantSetCallBack* callback = 0,
377 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
378 s32 userData = 0,
380 {
382 vertexShaderProgram, vertexShaderEntryPointName,
383 vsCompileTarget, pixelShaderProgram,
384 pixelShaderEntryPointName, psCompileTarget,
385 0, "main", EGST_GS_4_0,
387 callback, baseMaterial, userData, shadingLang);
388 }
389
391
424 virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0,
425 const c8* pixelShaderProgram = 0,
426 IShaderConstantSetCallBack* callback = 0,
427 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
428 s32 userData = 0) = 0;
429
431
448 virtual s32 addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram,
449 io::IReadFile* pixelShaderProgram,
450 IShaderConstantSetCallBack* callback = 0,
451 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
452 s32 userData = 0) = 0;
453
455
473 virtual s32 addShaderMaterialFromFiles(const io::path& vertexShaderProgramFileName,
474 const io::path& pixelShaderProgramFileName,
475 IShaderConstantSetCallBack* callback = 0,
476 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
477 s32 userData = 0) = 0;
478};
479
480
481} // end namespace video
482} // end namespace irr
483
484#endif
485
Interface providing read acess to a file.
Definition IReadFile.h:18
Definition IGPUCompute.h:22
Interface making it possible to create and use programs running on the GPU.
Definition IGPUProgrammingServices.h:42
virtual ~IGPUProgrammingServices()
Destructor.
Definition IGPUProgrammingServices.h:46
s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName="main", E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, const io::path &pixelShaderProgramFileName="", const c8 *pixelShaderEntryPointName="main", E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0, E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)
convenience function for use without geometry shaders
Definition IGPUProgrammingServices.h:244
virtual s32 addShaderMaterialFromFiles(io::IReadFile *vertexShaderProgram, io::IReadFile *pixelShaderProgram, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
virtual s32 addShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const io::path &pixelShaderProgramFileName, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
virtual s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const c8 *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const c8 *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0, E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)=0
Adds a new high-level shading material renderer to the VideoDriver.
s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *pixelShaderProgram=0, const c8 *geometryShaderProgram=0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
convenience function for use with many defaults, with geometry shader
Definition IGPUProgrammingServices.h:162
s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const io::path &pixelShaderProgramFileName="", IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
convenience function for use with many defaults, without geometry shader
Definition IGPUProgrammingServices.h:269
virtual s32 addHighLevelShaderMaterialFromFiles(io::IReadFile *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, io::IReadFile *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, io::IReadFile *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0, E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName="main", E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, const c8 *pixelShaderProgram=0, const c8 *pixelShaderEntryPointName="main", E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0, E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)
convenience function for use without geometry shaders
Definition IGPUProgrammingServices.h:109
s32 addHighLevelShaderMaterialFromFiles(io::IReadFile *vertexShaderProgram, const c8 *vertexShaderEntryPointName="main", E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, io::IReadFile *pixelShaderProgram=0, const c8 *pixelShaderEntryPointName="main", E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0, E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)
convenience function for use without geometry shaders
Definition IGPUProgrammingServices.h:369
virtual s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const io::path &pixelShaderProgramFileName, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const io::path &geometryShaderProgramFileName, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0, E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *pixelShaderProgram=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
convenience function for use with many defaults, without geometry shader
Definition IGPUProgrammingServices.h:142
s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const io::path &pixelShaderProgramFileName="", const io::path &geometryShaderProgramFileName="", scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
convenience function for use with many defaults, with geometry shader
Definition IGPUProgrammingServices.h:289
virtual s32 addShaderMaterial(const c8 *vertexShaderProgram=0, const c8 *pixelShaderProgram=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Adds a new ASM shader material renderer to the VideoDriver.
Interface making it possible to set constants for gpu programs every frame.
Definition IShaderConstantSetCallBack.h:22
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.h:388
This namespace provides interfaces for input/output: Reading and writing files, accessing zip archive...
Definition EAttributes.h:11
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.h:17
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
Definition EPrimitiveTypes.h:15
@ EPT_TRIANGLES
Explicitly set all vertices for each triangle.
Definition EPrimitiveTypes.h:37
@ EPT_TRIANGLE_STRIP
Definition EPrimitiveTypes.h:30
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
E_PIXEL_SHADER_TYPE
Compile target enumeration for the addHighLevelShaderMaterial() method.
Definition EShaderTypes.h:51
E_GEOMETRY_SHADER_TYPE
Enum for supported geometry shader types.
Definition EShaderTypes.h:85
E_GPU_SHADING_LANGUAGE
Enumeration for different types of shading languages.
Definition IGPUProgrammingServices.h:32
@ EGSL_CG
Cg shading language.*‍/.
Definition IGPUProgrammingServices.h:37
@ EGSL_DEFAULT
The default language, so HLSL for Direct3D and GLSL for OpenGL.
Definition IGPUProgrammingServices.h:34
E_VERTEX_SHADER_TYPE
Compile target enumeration for the addHighLevelShaderMaterial() method.
Definition EShaderTypes.h:25
E_MATERIAL_TYPE
Abstracted and easy to use fixed function/programmable pipeline material modes.
Definition EMaterialTypes.h:15
@ EMT_SOLID
Standard solid material.
Definition EMaterialTypes.h:19
E_COMPUTE_SHADER_TYPE
Enum for supported compute shader types.
Definition EShaderTypes.h:131
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
char c8
8 bit character variable.
Definition irrTypes.h:31
signed int s32
32 bit signed variable.
Definition irrTypes.h:66