2019-03-09 13:31:35 +00:00
|
|
|
// Copyright 2019 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
2019-05-30 07:07:40 +00:00
|
|
|
|
2019-07-26 23:34:27 +00:00
|
|
|
#include <optional>
|
2019-05-30 07:07:40 +00:00
|
|
|
#include <string_view>
|
2020-09-15 13:07:22 +00:00
|
|
|
#include "VideoBackends/D3DCommon/D3DCommon.h"
|
2019-03-09 13:31:35 +00:00
|
|
|
#include "VideoCommon/AbstractShader.h"
|
|
|
|
|
|
|
|
namespace D3DCommon
|
|
|
|
{
|
|
|
|
class Shader : public AbstractShader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~Shader() override;
|
|
|
|
|
|
|
|
const BinaryData& GetByteCode() const { return m_bytecode; }
|
|
|
|
|
|
|
|
BinaryData GetBinary() const override;
|
|
|
|
|
2019-07-26 23:34:27 +00:00
|
|
|
static std::optional<BinaryData> CompileShader(D3D_FEATURE_LEVEL feature_level, ShaderStage stage,
|
|
|
|
std::string_view source);
|
2019-03-09 13:31:35 +00:00
|
|
|
|
|
|
|
static BinaryData CreateByteCode(const void* data, size_t length);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Shader(ShaderStage stage, BinaryData bytecode);
|
|
|
|
|
|
|
|
BinaryData m_bytecode;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace D3DCommon
|