Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
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
22#include "ps/CStrIntern.h"
25
26namespace Renderer
27{
28
29namespace Backend
30{
31
33{
35 NORMAL,
36 COLOR,
37 UV0,
38 UV1,
39 UV2,
40 UV3,
41 UV4,
42 UV5,
43 UV6,
44 UV7,
45};
46
48{
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 */
73class IVertexInputLayout : public IDeviceObject<IVertexInputLayout>
74{
75};
76
77/**
78 * IShaderProgram is a container for multiple shaders of different types.
79 */
80class IShaderProgram : public IDeviceObject<IShaderProgram>
81{
82public:
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
Interned 8-bit strings.
Definition: CStrIntern.h:38
Definition: IDeviceObject.h:33
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:81
virtual int32_t GetBindingSlot(const CStrIntern name) const =0
virtual std::vector< VfsPath > GetFileDependencies() const =0
IVertexInputLayout stores precompiled list of vertex attributes.
Definition: IShaderProgram.h:74
Format
Definition: Format.h:28
VertexAttributeStream
Definition: IShaderProgram.h:33
Backend
Definition: Backend.h:28
VertexAttributeRate
Definition: IShaderProgram.h:48
Definition: VideoMode.h:29
Definition: IShaderProgram.h:54
uint32_t stride
Definition: IShaderProgram.h:58
VertexAttributeRate rate
Definition: IShaderProgram.h:59
uint32_t offset
Definition: IShaderProgram.h:57
uint32_t bindingSlot
Definition: IShaderProgram.h:60
Format format
Definition: IShaderProgram.h:56
VertexAttributeStream stream
Definition: IShaderProgram.h:55
constexpr bool operator==(const SVertexAttributeFormat &other) const noexcept
Definition: IShaderProgram.h:62
unsigned int uint32_t
Definition: wposix_types.h:53