Debian Codegraph @

Source/Core/VideoCommon/AbstractShader.h

raw symbols SCIP
1 // Copyright 2017 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <cstddef>
7 #include <string>
8 #include <vector>
9
10 #include "Common/CommonTypes.h"
11
12 // Note: not directly used in this file
13 // but done here to avoid specifying in
14 // every derived class that needs it
15 namespace VideoCommon
16 {
17 class ShaderIncluder;
18 }
19
20 enum class ShaderStage
21 {
22 Vertex,
23 Geometry,
24 Pixel,
25 Compute
26 };
27
28 class AbstractShader
29 {
30 public:
31 explicit AbstractShader(ShaderStage stage) : m_stage(stage) {}
32 virtual ~AbstractShader() = default;
33
34 ShaderStage GetStage() const { return m_stage; }
35
36 // Shader binaries represent the input source code in a lower-level form. e.g. SPIR-V or DXBC.
37 // The shader source code is not required to create a shader object from the binary.
38 using BinaryData = std::vector<u8>;
39 virtual BinaryData GetBinary() const { return {}; }
40
41 protected:
42 ShaderStage m_stage;
43 };