2021-05-06 17:02:10 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "MinimalEngine.h"
|
|
|
|
|
#include "Math/Math.h"
|
2021-11-18 12:48:21 +01:00
|
|
|
#include "RenderGraph.h"
|
2021-11-24 12:10:23 +01:00
|
|
|
#include "ThreadPool.h"
|
2021-05-06 17:02:10 +02:00
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
2021-09-23 10:10:39 +02:00
|
|
|
DECLARE_NAME_REF(Gfx, Viewport)
|
|
|
|
|
DECLARE_NAME_REF(Gfx, Graphics)
|
2021-05-06 17:02:10 +02:00
|
|
|
DECLARE_NAME_REF(Gfx, RenderPass)
|
2021-10-01 19:55:04 +02:00
|
|
|
template<typename RenderPassDataType>
|
2021-05-06 17:02:10 +02:00
|
|
|
class RenderPass
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-10-01 19:55:04 +02:00
|
|
|
RenderPass(Gfx::PGraphics graphics, Gfx::PViewport viewport)
|
|
|
|
|
: graphics(graphics)
|
|
|
|
|
, viewport(viewport)
|
|
|
|
|
{}
|
|
|
|
|
virtual ~RenderPass()
|
|
|
|
|
{}
|
|
|
|
|
void updateViewFrame(RenderPassDataType viewFrame) {
|
|
|
|
|
passData = std::move(viewFrame);
|
|
|
|
|
}
|
2021-11-24 12:10:23 +01:00
|
|
|
virtual Job beginFrame() = 0;
|
|
|
|
|
virtual Job render() = 0;
|
|
|
|
|
virtual Job endFrame() = 0;
|
2021-05-06 17:02:10 +02:00
|
|
|
virtual void publishOutputs() = 0;
|
|
|
|
|
virtual void createRenderPass() = 0;
|
2021-10-01 19:55:04 +02:00
|
|
|
void setResources(PRenderGraphResources resources) { this->resources = resources; }
|
2021-05-06 17:02:10 +02:00
|
|
|
protected:
|
2021-10-13 15:20:30 +02:00
|
|
|
struct ViewParameter
|
2021-05-06 17:02:10 +02:00
|
|
|
{
|
|
|
|
|
Matrix4 viewMatrix;
|
|
|
|
|
Matrix4 projectionMatrix;
|
|
|
|
|
Matrix4 inverseProjectionMatrix;
|
2021-05-10 23:57:55 +02:00
|
|
|
Vector4 cameraPosition;
|
2021-06-04 18:27:49 +02:00
|
|
|
Vector2 screenDimensions;
|
2021-05-10 23:57:55 +02:00
|
|
|
} viewParams;
|
2021-10-01 19:55:04 +02:00
|
|
|
PRenderGraphResources resources;
|
|
|
|
|
RenderPassDataType passData;
|
2021-05-06 17:02:10 +02:00
|
|
|
Gfx::PRenderPass renderPass;
|
2021-09-23 10:10:39 +02:00
|
|
|
Gfx::PGraphics graphics;
|
|
|
|
|
Gfx::PViewport viewport;
|
2021-05-06 17:02:10 +02:00
|
|
|
};
|
2021-10-01 19:55:04 +02:00
|
|
|
template<typename T>
|
|
|
|
|
concept RenderPassType = true;
|
|
|
|
|
|
2021-05-06 17:02:10 +02:00
|
|
|
} // namespace Seele
|