2020-06-02 11:46:18 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "MinimalEngine.h"
|
|
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
|
|
|
|
struct ExpressionInput
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
struct ExpressionOutput
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
struct ShaderExpression
|
|
|
|
|
{
|
|
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DECLARE_NAME_REF(Gfx, DescriptorSet)
|
2020-06-02 11:46:18 +02:00
|
|
|
struct ShaderParameter : public ShaderExpression
|
|
|
|
|
{
|
|
|
|
|
std::string name;
|
2020-10-03 11:00:10 +02:00
|
|
|
uint32 byteOffset;
|
|
|
|
|
uint32 binding;
|
|
|
|
|
ShaderParameter(std::string name, uint32 byteOffset, uint32 binding);
|
|
|
|
|
virtual ~ShaderParameter();
|
|
|
|
|
// update a descriptorset, in case of a uniform buffer, copy the data to the dst + byteOffset
|
|
|
|
|
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) = 0;
|
2020-06-02 11:46:18 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(ShaderParameter)
|
2020-06-02 11:46:18 +02:00
|
|
|
struct FloatParameter : public ShaderParameter
|
|
|
|
|
{
|
2020-10-03 11:00:10 +02:00
|
|
|
float data;
|
|
|
|
|
FloatParameter(std::string name, uint32 byteOffset, uint32 binding);
|
|
|
|
|
virtual ~FloatParameter();
|
|
|
|
|
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
|
2020-06-02 11:46:18 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(FloatParameter)
|
2020-06-02 11:46:18 +02:00
|
|
|
struct VectorParameter : public ShaderParameter
|
|
|
|
|
{
|
2023-01-21 18:43:21 +01:00
|
|
|
Vector data;
|
2020-10-03 11:00:10 +02:00
|
|
|
VectorParameter(std::string name, uint32 byteOffset, uint32 binding);
|
|
|
|
|
virtual ~VectorParameter();
|
|
|
|
|
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
|
2020-06-02 11:46:18 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(VectorParameter)
|
|
|
|
|
DECLARE_REF(TextureAsset)
|
2020-06-02 11:46:18 +02:00
|
|
|
struct TextureParameter : public ShaderParameter
|
|
|
|
|
{
|
2020-10-03 11:00:10 +02:00
|
|
|
PTextureAsset data;
|
|
|
|
|
TextureParameter(std::string name, uint32 byteOffset, uint32 binding);
|
|
|
|
|
virtual ~TextureParameter();
|
|
|
|
|
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
|
2020-06-02 11:46:18 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(TextureParameter)
|
|
|
|
|
DECLARE_NAME_REF(Gfx, SamplerState)
|
2020-06-02 11:46:18 +02:00
|
|
|
struct SamplerParameter : public ShaderParameter
|
|
|
|
|
{
|
2020-10-03 11:00:10 +02:00
|
|
|
Gfx::PSamplerState data;
|
|
|
|
|
SamplerParameter(std::string name, uint32 byteOffset, uint32 binding);
|
|
|
|
|
virtual ~SamplerParameter();
|
|
|
|
|
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
|
2020-06-02 11:46:18 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(SamplerParameter)
|
2021-05-10 23:57:55 +02:00
|
|
|
struct CombinedTextureParameter : public ShaderParameter
|
|
|
|
|
{
|
|
|
|
|
PTextureAsset data;
|
|
|
|
|
Gfx::PSamplerState sampler;
|
|
|
|
|
CombinedTextureParameter(std::string name, uint32 byteOffset, uint32 binding);
|
|
|
|
|
virtual ~CombinedTextureParameter();
|
|
|
|
|
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
|
|
|
|
|
};
|
|
|
|
|
DEFINE_REF(CombinedTextureParameter)
|
2020-06-02 11:46:18 +02:00
|
|
|
} // namespace Seele
|