mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
VideoBackends: Add AbstractShader and AbstractPipeline classes
This commit is contained in:
40
Source/Core/VideoBackends/Vulkan/VKShader.h
Normal file
40
Source/Core/VideoBackends/Vulkan/VKShader.h
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "VideoBackends/Vulkan/VulkanLoader.h"
|
||||
#include "VideoCommon/AbstractShader.h"
|
||||
|
||||
namespace Vulkan
|
||||
{
|
||||
class VKShader final : public AbstractShader
|
||||
{
|
||||
public:
|
||||
VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod);
|
||||
VKShader(std::vector<u32> spv, VkPipeline compute_pipeline);
|
||||
~VKShader() override;
|
||||
|
||||
VkShaderModule GetShaderModule() const { return m_module; }
|
||||
VkPipeline GetComputePipeline() const { return m_compute_pipeline; }
|
||||
bool HasBinary() const override;
|
||||
BinaryData GetBinary() const override;
|
||||
|
||||
static std::unique_ptr<VKShader> CreateFromSource(ShaderStage stage, const char* source,
|
||||
size_t length);
|
||||
static std::unique_ptr<VKShader> CreateFromBinary(ShaderStage stage, const void* data,
|
||||
size_t length);
|
||||
|
||||
private:
|
||||
std::vector<u32> m_spv;
|
||||
VkShaderModule m_module;
|
||||
VkPipeline m_compute_pipeline;
|
||||
};
|
||||
|
||||
} // namespace Vulkan
|
Reference in New Issue
Block a user