62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
// Copyright (C) 2020 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Graphics module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#pragma once
|
|
|
|
#ifndef NAZARA_GRAPHICS_HPP
|
|
#define NAZARA_GRAPHICS_HPP
|
|
|
|
#include <Nazara/Prerequisites.hpp>
|
|
#include <Nazara/Graphics/Config.hpp>
|
|
#include <Nazara/Graphics/TextureSamplerCache.hpp>
|
|
#include <Nazara/Renderer/Renderer.hpp>
|
|
#include <Nazara/Renderer/RenderDevice.hpp>
|
|
#include <Nazara/Renderer/RenderPipelineLayout.hpp>
|
|
#include <optional>
|
|
|
|
namespace Nz
|
|
{
|
|
class AbstractBuffer;
|
|
|
|
class NAZARA_GRAPHICS_API Graphics : public ModuleBase<Graphics>
|
|
{
|
|
friend ModuleBase;
|
|
|
|
public:
|
|
using Dependencies = TypeList<Renderer>;
|
|
|
|
struct Config;
|
|
|
|
Graphics(Config config);
|
|
~Graphics();
|
|
|
|
inline const std::shared_ptr<RenderPipelineLayout>& GetReferencePipelineLayout() const;
|
|
inline const std::shared_ptr<RenderDevice>& GetRenderDevice() const;
|
|
inline TextureSamplerCache& GetSamplerCache();
|
|
|
|
struct Config
|
|
{
|
|
bool useDedicatedRenderDevice = true;
|
|
};
|
|
|
|
static constexpr UInt32 MaterialBindingSet = 2;
|
|
static constexpr UInt32 ViewerBindingSet = 0;
|
|
static constexpr UInt32 WorldBindingSet = 1;
|
|
|
|
static void FillViewerPipelineLayout(RenderPipelineLayoutInfo& layoutInfo, UInt32 set = ViewerBindingSet);
|
|
static void FillWorldPipelineLayout(RenderPipelineLayoutInfo& layoutInfo, UInt32 set = WorldBindingSet);
|
|
|
|
private:
|
|
std::optional<TextureSamplerCache> m_samplerCache;
|
|
std::shared_ptr<RenderDevice> m_renderDevice;
|
|
std::shared_ptr<RenderPipelineLayout> m_referencePipelineLayout;
|
|
|
|
static Graphics* s_instance;
|
|
};
|
|
}
|
|
|
|
#include <Nazara/Graphics/Graphics.inl>
|
|
|
|
#endif
|