Renderer: Add ShaderStage class

This commit is contained in:
Lynix
2020-02-29 23:28:21 +01:00
parent 798425ce10
commit 5d449095bf
13 changed files with 190 additions and 39 deletions

View File

@@ -25,6 +25,7 @@ namespace Nz
std::unique_ptr<AbstractBuffer> InstantiateBuffer(Buffer* parent, BufferType type) override;
std::unique_ptr<RenderPipeline> InstantiateRenderPipeline(RenderPipelineInfo pipelineInfo) override;
std::shared_ptr<ShaderStageImpl> InstantiateShaderStage(ShaderStageType type, ShaderLanguage lang, const void* source, std::size_t sourceSize) override;
VulkanDevice& operator=(const VulkanDevice&) = delete;
VulkanDevice& operator=(VulkanDevice&&) = delete; ///TODO?

View File

@@ -0,0 +1,41 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan Renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_VULKANRENDERER_VULKANSHADERSTAGE_HPP
#define NAZARA_VULKANRENDERER_VULKANSHADERSTAGE_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Renderer/Enums.hpp>
#include <Nazara/Renderer/ShaderStageImpl.hpp>
#include <Nazara/VulkanRenderer/Wrapper/ShaderModule.hpp>
#include <vector>
namespace Nz
{
class NAZARA_VULKANRENDERER_API VulkanShaderStage : public ShaderStageImpl
{
public:
VulkanShaderStage() = default;
VulkanShaderStage(const VulkanShaderStage&) = delete;
VulkanShaderStage(VulkanShaderStage&&) noexcept = default;
~VulkanShaderStage() = default;
bool Create(const Vk::DeviceHandle& device, ShaderStageType type, ShaderLanguage lang, const void* source, std::size_t sourceSize);
inline const Vk::ShaderModule& GetHandle() const;
VulkanShaderStage& operator=(const VulkanShaderStage&) = delete;
VulkanShaderStage& operator=(VulkanShaderStage&&) noexcept = default;
private:
Vk::ShaderModule m_shaderModule;
ShaderStageType m_stage;
};
}
#include <Nazara/VulkanRenderer/VulkanShaderStage.inl>
#endif // NAZARA_VULKANRENDERER_VULKANSHADERSTAGE_HPP

View File

@@ -0,0 +1,16 @@
// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan Renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/VulkanRenderer/VulkanShaderStage.hpp>
#include <Nazara/VulkanRenderer/Debug.hpp>
namespace Nz
{
inline const Vk::ShaderModule& VulkanShaderStage::GetHandle() const
{
return m_shaderModule;
}
}
#include <Nazara/VulkanRenderer/DebugOff.hpp>