Pyrogenesis  trunk
IShaderProgram.h
Go to the documentation of this file.
1 /* Copyright (C) 2023 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_RENDERER_BACKEND_ISHADERPROGRAM
19 #define INCLUDED_RENDERER_BACKEND_ISHADERPROGRAM
20 
21 #include "lib/file/vfs/vfs_path.h"
22 #include "ps/CStrIntern.h"
25 
26 namespace Renderer
27 {
28 
29 namespace Backend
30 {
31 
33 {
34  POSITION,
35  NORMAL,
36  COLOR,
37  UV0,
38  UV1,
39  UV2,
40  UV3,
41  UV4,
42  UV5,
43  UV6,
44  UV7,
45 };
46 
48 {
49  PER_VERTEX,
51 };
52 
54 {
61 
62  constexpr bool operator==(const SVertexAttributeFormat& other) const noexcept
63  {
64  return stream == other.stream && format == other.format &&
65  offset == other.offset && stride == other.stride &&
66  rate == other.rate && bindingSlot == other.bindingSlot;
67  }
68 };
69 
70 /**
71  * IVertexInputLayout stores precompiled list of vertex attributes.
72  */
73 class IVertexInputLayout : public IDeviceObject<IVertexInputLayout>
74 {
75 };
76 
77 /**
78  * IShaderProgram is a container for multiple shaders of different types.
79  */
80 class IShaderProgram : public IDeviceObject<IShaderProgram>
81 {
82 public:
83  virtual int32_t GetBindingSlot(const CStrIntern name) const = 0;
84 
85  virtual std::vector<VfsPath> GetFileDependencies() const = 0;
86 };
87 
88 } // namespace Backend
89 
90 } // namespace Renderer
91 
92 #endif // INCLUDED_RENDERER_BACKEND_ISHADERPROGRAM
VertexAttributeRate rate
Definition: IShaderProgram.h:59
VertexAttributeRate
Definition: IShaderProgram.h:47
uint32_t offset
Definition: IShaderProgram.h:57
VertexAttributeStream stream
Definition: IShaderProgram.h:55
uint32_t stride
Definition: IShaderProgram.h:58
IVertexInputLayout stores precompiled list of vertex attributes.
Definition: IShaderProgram.h:73
uint32_t bindingSlot
Definition: IShaderProgram.h:60
Format
Definition: Format.h:27
VertexAttributeStream
Definition: IShaderProgram.h:32
Interned 8-bit strings.
Definition: CStrIntern.h:37
Format format
Definition: IShaderProgram.h:56
constexpr bool operator==(const SVertexAttributeFormat &other) const noexcept
Definition: IShaderProgram.h:62
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:80
Backend
Definition: Backend.h:27
unsigned int uint32_t
Definition: wposix_types.h:53
Definition: VideoMode.h:28
Definition: IShaderProgram.h:53
Definition: IDeviceObject.h:32