DXShader.h 932 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <memory>
  5. #include <string>
  6. #include <string_view>
  7. #include "VideoBackends/D3D/D3DBase.h"
  8. #include "VideoBackends/D3DCommon/Shader.h"
  9. namespace DX11
  10. {
  11. class DXShader final : public D3DCommon::Shader
  12. {
  13. public:
  14. DXShader(ShaderStage stage, BinaryData bytecode, ID3D11DeviceChild* shader,
  15. std::string_view name);
  16. ~DXShader() override;
  17. ID3D11VertexShader* GetD3DVertexShader() const;
  18. ID3D11GeometryShader* GetD3DGeometryShader() const;
  19. ID3D11PixelShader* GetD3DPixelShader() const;
  20. ID3D11ComputeShader* GetD3DComputeShader() const;
  21. static std::unique_ptr<DXShader> CreateFromBytecode(ShaderStage stage, BinaryData bytecode,
  22. std::string_view name);
  23. private:
  24. ComPtr<ID3D11DeviceChild> m_shader;
  25. std::string m_name;
  26. };
  27. } // namespace DX11