mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Add D3DCommon (shared code between D3D11 and D3D12)
This commit is contained in:
33
Source/Core/VideoBackends/D3DCommon/Shader.h
Normal file
33
Source/Core/VideoBackends/D3DCommon/Shader.h
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2019 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include "VideoBackends/D3DCommon/Common.h"
|
||||
#include "VideoCommon/AbstractShader.h"
|
||||
|
||||
namespace D3DCommon
|
||||
{
|
||||
class Shader : public AbstractShader
|
||||
{
|
||||
public:
|
||||
virtual ~Shader() override;
|
||||
|
||||
const BinaryData& GetByteCode() const { return m_bytecode; }
|
||||
|
||||
bool HasBinary() const override;
|
||||
BinaryData GetBinary() const override;
|
||||
|
||||
static bool CompileShader(D3D_FEATURE_LEVEL feature_level, BinaryData* out_bytecode,
|
||||
ShaderStage stage, const char* source, size_t length);
|
||||
|
||||
static BinaryData CreateByteCode(const void* data, size_t length);
|
||||
|
||||
protected:
|
||||
Shader(ShaderStage stage, BinaryData bytecode);
|
||||
|
||||
BinaryData m_bytecode;
|
||||
};
|
||||
|
||||
} // namespace D3DCommon
|
Reference in New Issue
Block a user