1 // Copyright 2017 Dolphin Emulator Project
2 // Licensed under GPLv2+
3 // Refer to the license.txt file included.
4 
5 #pragma once
6 
7 #include <cstddef>
8 #include <string>
9 #include <vector>
10 
11 #include "Common/CommonTypes.h"
12 
13 enum class ShaderStage
14 {
15   Vertex,
16   Geometry,
17   Pixel,
18   Compute
19 };
20 
21 class AbstractShader
22 {
23 public:
AbstractShader(ShaderStage stage)24   explicit AbstractShader(ShaderStage stage) : m_stage(stage) {}
25   virtual ~AbstractShader() = default;
26 
GetStage()27   ShaderStage GetStage() const { return m_stage; }
28 
29   // Shader binaries represent the input source code in a lower-level form. e.g. SPIR-V or DXBC.
30   // The shader source code is not required to create a shader object from the binary.
31   using BinaryData = std::vector<u8>;
GetBinary()32   virtual BinaryData GetBinary() const { return {}; }
33 
34 protected:
35   ShaderStage m_stage;
36 };
37