Cogs.Core
EffectDefinition.h
1#pragma once
2
3#include "Rendering/IEffects.h"
4
5#include "MaterialTypes.h"
6#include "MeshStreamsLayout.h"
7#include "Utilities/Strings.h"
8#include "Rendering/IBindGroups.h"
9
10namespace Cogs::Core
11{
13 {
14 enum InterpolationModifiers
15 {
16 NoModifier = 0,
17 LinearModifier = (1 << 0),
18 CentroidModifier = (1 << 1),
19 NointerpolationModifier = (1 << 2),
20 NoperspectiveModifier = (1 << 3),
21 SampleModifier = (1 << 4)
22 } modifiers = NoModifier;
23
24 enum struct SemanticName : uint8_t {
25 None,
26 Position,
27 Normal,
28 Color,
29 Texcoord,
30 Tangent,
31 InstanceVector,
32 InstanceMatrix,
33 FirstSystemValueSemantic,
34 SV_Position = FirstSystemValueSemantic,
35 SV_VertexID,
36 SV_InstanceID,
37 SV_ClipDistance,
38 SV_VFace,
39 SV_IsFrontFace,
40 Count
41 };
42
43 struct {
44 SemanticName name = SemanticName::None;
45 uint8_t slot = 0; // No explicit slot implies slot 0.
46 } semantic;
47
48 // Used
49
50 uint8_t inheritanceLevel = 0;
51
52 static StringView semanticNameString(const SemanticName name);
53 };
54
56 {
57 std::vector<ShaderInterfaceMemberDefinition> members;
58 };
59
61 {
62 std::string key;
63 std::string value;
64 };
65
67 {
68 std::string customSourcePath;
69 std::string loadPath;
70
71 std::string entryPoint;
72
73 std::vector<AttributeDefinition> attributes;
74
75 ShaderInterfaceDefinition shaderInterface;
76 };
77
78 enum EffectDefinitionFlags
79 {
80 None = 0,
81 Custom = 0x0001,
82 };
83
85 {
86 std::string name;
87 MaterialDataType dataType;
88 uint8_t target;
89 };
90
92 {
93 std::vector<EffectOutputMemberDefinition> members;
94 };
95
96
101 {
103 std::string name;
104
107
108 ShaderDefinition vertexShader;
109
110 ShaderDefinition hullShader;
111
112 ShaderDefinition domainShader;
113
114 ShaderDefinition geometryShader;
115
116 ShaderDefinition pixelShader;
117
118 ShaderDefinition computeShader;
119
123 std::vector<std::string> dependencies;
124
127
130
131 EffectDefinitionFlags flags = EffectDefinitionFlags::None;
132
133 };
134}
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:50
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
@ Normal
Regular shaded rendering.
MaterialDataType
Defines available data types for material properties.
Definition: MaterialTypes.h:20
std::vector< PreprocessorDefinition > PreprocessorDefinitions
A set of preprocessor definitions.
Definition: IEffects.h:20
Defines a loadable effect.
std::string name
Name of the effect.
std::vector< std::string > dependencies
MeshStreamsLayout streamsLayout
The vertex layout this effect expects.
PreprocessorDefinitions definitions
Preprocessor definitions.
BindGroupSetDescription bindGroupLayouts
Optional backend-neutral bind-group layout metadata, typically emitted by shader builders.