2017-09-08 03:42:56 -06:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-09-08 03:42:56 -06:00
|
|
|
|
|
|
|
#pragma once
|
2021-08-27 23:30:05 -06:00
|
|
|
|
2017-09-08 03:42:56 -06:00
|
|
|
#include <memory>
|
2021-08-27 23:30:05 -06:00
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
2017-09-08 03:42:56 -06:00
|
|
|
|
2019-03-09 06:31:37 -07:00
|
|
|
#include "VideoBackends/D3D/D3DBase.h"
|
2019-03-09 06:31:36 -07:00
|
|
|
#include "VideoBackends/D3DCommon/Shader.h"
|
2017-09-08 03:42:56 -06:00
|
|
|
|
|
|
|
namespace DX11
|
|
|
|
{
|
2019-03-09 06:31:36 -07:00
|
|
|
class DXShader final : public D3DCommon::Shader
|
2017-09-08 03:42:56 -06:00
|
|
|
{
|
|
|
|
public:
|
2021-08-27 23:30:05 -06:00
|
|
|
DXShader(ShaderStage stage, BinaryData bytecode, ID3D11DeviceChild* shader,
|
|
|
|
std::string_view name);
|
2017-09-08 03:42:56 -06:00
|
|
|
~DXShader() override;
|
|
|
|
|
|
|
|
ID3D11VertexShader* GetD3DVertexShader() const;
|
|
|
|
ID3D11GeometryShader* GetD3DGeometryShader() const;
|
|
|
|
ID3D11PixelShader* GetD3DPixelShader() const;
|
|
|
|
ID3D11ComputeShader* GetD3DComputeShader() const;
|
|
|
|
|
2021-08-27 23:30:05 -06:00
|
|
|
static std::unique_ptr<DXShader> CreateFromBytecode(ShaderStage stage, BinaryData bytecode,
|
|
|
|
std::string_view name);
|
2017-09-08 03:42:56 -06:00
|
|
|
|
|
|
|
private:
|
2019-03-09 06:31:37 -07:00
|
|
|
ComPtr<ID3D11DeviceChild> m_shader;
|
2021-08-27 23:30:05 -06:00
|
|
|
std::string m_name;
|
2017-09-08 03:42:56 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DX11
|