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

@@ -33,6 +33,20 @@ namespace Nz
RenderDeviceType_Max = RenderDeviceType_Unknown
};
enum class ShaderLanguage
{
GLSL,
HLSL,
MSL,
SpirV
};
enum class ShaderStageType
{
Fragment,
Vertex
};
}
#endif // NAZARA_ENUMS_RENDERER_HPP

View File

@@ -9,13 +9,16 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/Enums.hpp>
#include <Nazara/Renderer/RenderPipeline.hpp>
#include <Nazara/Utility/AbstractBuffer.hpp>
#include <memory>
#include <string>
namespace Nz
{
class Buffer;
class ShaderStageImpl;
class NAZARA_RENDERER_API RenderDevice
{
@@ -25,6 +28,8 @@ namespace Nz
virtual std::unique_ptr<AbstractBuffer> InstantiateBuffer(Buffer* parent, BufferType type) = 0;
virtual std::unique_ptr<RenderPipeline> InstantiateRenderPipeline(RenderPipelineInfo pipelineInfo) = 0;
virtual std::shared_ptr<ShaderStageImpl> InstantiateShaderStage(ShaderStageType type, ShaderLanguage lang, const void* source, std::size_t sourceSize) = 0;
std::shared_ptr<ShaderStageImpl> InstantiateShaderStage(ShaderStageType type, ShaderLanguage lang, const std::filesystem::path& sourcePath);
};
}

View File

@@ -0,0 +1,24 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Renderer module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_RENDERER_SHADERSTAGEIMPL_HPP
#define NAZARA_RENDERER_SHADERSTAGEIMPL_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/Enums.hpp>
namespace Nz
{
class NAZARA_RENDERER_API ShaderStageImpl
{
public:
ShaderStageImpl() = default;
virtual ~ShaderStageImpl();
};
}
#endif // NAZARA_RENDERER_SHADERSTAGEIMPL_HPP