Divide Framework
0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ShaderProgramFwd.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2018 DIVIDE-Studio
3
Copyright (c) 2009 Ionut Cava
4
5
This file is part of DIVIDE Framework.
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software
9
and associated documentation files (the "Software"), to deal in the Software
10
without restriction,
11
including without limitation the rights to use, copy, modify, merge, publish,
12
distribute, sublicense,
13
and/or sell copies of the Software, and to permit persons to whom the
14
Software is furnished to do so,
15
subject to the following conditions:
16
17
The above copyright notice and this permission notice shall be included in
18
all copies or substantial portions of the Software.
19
20
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
IMPLIED,
22
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23
PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25
DAMAGES OR OTHER LIABILITY,
26
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27
IN CONNECTION WITH THE SOFTWARE
28
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30
*/
31
32
#pragma once
33
#ifndef DVD_SHADER_PROGRAM_FWD_H_
34
#define DVD_SHADER_PROGRAM_FWD_H_
35
36
#include "
Core/Resources/Headers/Resource.h
"
37
#include "
Core/Headers/PoolHandle.h
"
38
39
namespace
Divide
{
40
class
ShaderProgram;
41
struct
PerFileShaderData;
42
43
enum class
ShaderResult
:
U8
44
{
45
Failed
= 0,
46
OK
,
47
COUNT
48
};
49
50
struct
ModuleDefine
51
{
52
ModuleDefine
() =
default
;
53
ModuleDefine
(
const
char
* define,
const
bool
addPrefix =
true
);
54
ModuleDefine
(
const
string
& define,
const
bool
addPrefix =
true
);
55
56
string
_define
;
57
bool
_addPrefix
=
true
;
58
};
59
60
using
ModuleDefines
=
vector<ModuleDefine>
;
61
62
struct
ShaderModuleDescriptor
63
{
64
ShaderModuleDescriptor
() =
default
;
65
explicit
ShaderModuleDescriptor
(
ShaderType
type,
const
Str<64>
& file,
const
Str<64>
& variant =
""
);
66
67
ModuleDefines
_defines
;
68
Str<64>
_sourceFile
;
69
Str<64>
_variant
;
70
ShaderType
_moduleType
=
ShaderType::COUNT
;
71
};
72
73
template
<>
74
struct
PropertyDescriptor
<
ShaderProgram
>
75
{
76
Str<256>
_name
;
77
ModuleDefines
_globalDefines
;
78
vector<ShaderModuleDescriptor>
_modules
;
79
bool
_useShaderCache{
true
};
80
};
81
82
using
ShaderProgramDescriptor
=
PropertyDescriptor<ShaderProgram>
;
83
84
template
<>
85
inline
size_t
GetHash
(
const
PropertyDescriptor<ShaderProgram>
& descriptor )
noexcept
;
86
87
struct
ShaderProgramMapEntry
88
{
89
Handle<ShaderProgram>
_program
= INVALID_HANDLE<ShaderProgram>;
90
U8
_generation
= 0u;
91
};
92
93
bool
operator==
(
const
ShaderProgramMapEntry
& lhs,
const
ShaderProgramMapEntry
& rhs)
noexcept
;
94
bool
operator!=
(
const
ShaderProgramMapEntry
& lhs,
const
ShaderProgramMapEntry
& rhs)
noexcept
;
95
96
};
//namespace Divide
97
98
#endif
//DVD_SHADER_PROGRAM_FWD_H_
99
100
#include "
ShaderProgramFwd.inl
"
PoolHandle.h
Resource.h
ShaderProgramFwd.inl
Divide::ShaderProgram
Definition:
ShaderProgram.h:119
Divide::Str
Definition:
String.h:44
Divide
Handle console commands that start with a forward slash.
Definition:
AIProcessor.cpp:7
Divide::operator!=
FORCE_INLINE bool operator!=(const GUIDWrapper &lhs, const GUIDWrapper &rhs) noexcept
Definition:
GUIDWrapper.h:67
Divide::AppStepResult::COUNT
@ COUNT
Divide::AppStepResult::OK
@ OK
Divide::ShaderResult
ShaderResult
Definition:
ShaderProgramFwd.h:44
Divide::ShaderResult::Failed
@ Failed
Divide::U8
uint8_t U8
Definition:
PlatformDataTypes.h:44
Divide::ModuleDefines
vector< ModuleDefine > ModuleDefines
Definition:
ShaderProgramFwd.h:60
Divide::GetHash
size_t GetHash(const PropertyDescriptor< T > &descriptor) noexcept
Definition:
Resource.inl:40
Divide::vector
eastl::vector< Type > vector
Definition:
Vector.h:42
Divide::ShaderType
ShaderType
Available shader stages.
Definition:
RenderAPIEnums.h:425
Divide::ShaderType::COUNT
@ COUNT
Divide::operator==
bool operator==(const DisplayManager::OutputDisplayProperties &lhs, const DisplayManager::OutputDisplayProperties &rhs) noexcept
Definition:
Application.inl:37
Divide::Handle
Definition:
PlatformDefines.h:519
Divide::ModuleDefine
Definition:
ShaderProgramFwd.h:51
Divide::ModuleDefine::_define
string _define
Definition:
ShaderProgramFwd.h:56
Divide::ModuleDefine::_addPrefix
bool _addPrefix
Definition:
ShaderProgramFwd.h:57
Divide::ModuleDefine::ModuleDefine
ModuleDefine()=default
Divide::PropertyDescriptor< ShaderProgram >
Definition:
ShaderProgramFwd.h:75
Divide::PropertyDescriptor< ShaderProgram >::_name
Str< 256 > _name
Definition:
ShaderProgramFwd.h:76
Divide::PropertyDescriptor< ShaderProgram >::_modules
vector< ShaderModuleDescriptor > _modules
Definition:
ShaderProgramFwd.h:78
Divide::PropertyDescriptor< ShaderProgram >::_globalDefines
ModuleDefines _globalDefines
Definition:
ShaderProgramFwd.h:77
Divide::PropertyDescriptor
Definition:
Resource.h:116
Divide::ShaderModuleDescriptor
Definition:
ShaderProgramFwd.h:63
Divide::ShaderModuleDescriptor::_variant
Str< 64 > _variant
Definition:
ShaderProgramFwd.h:69
Divide::ShaderModuleDescriptor::ShaderModuleDescriptor
ShaderModuleDescriptor()=default
Divide::ShaderModuleDescriptor::_defines
ModuleDefines _defines
Definition:
ShaderProgramFwd.h:67
Divide::ShaderModuleDescriptor::_sourceFile
Str< 64 > _sourceFile
Definition:
ShaderProgramFwd.h:68
Divide::ShaderModuleDescriptor::_moduleType
ShaderType _moduleType
Definition:
ShaderProgramFwd.h:70
Divide::ShaderProgramMapEntry
Definition:
ShaderProgramFwd.h:88
Divide::ShaderProgramMapEntry::_program
Handle< ShaderProgram > _program
Definition:
ShaderProgramFwd.h:89
Divide::ShaderProgramMapEntry::_generation
U8 _generation
Definition:
ShaderProgramFwd.h:90
Source
Platform
Video
Shaders
Headers
ShaderProgramFwd.h
Generated on Fri May 17 2024 16:59:55 for Divide Framework by
1.9.6