AbstractShader.h 764 B

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