Files
Seele/src/Engine/Material/ShaderExpression.h
T

65 lines
1.9 KiB
C++
Raw Normal View History

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
{
2020-10-03 11:00:10 +02:00
Vector data;
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)
2020-06-02 11:46:18 +02:00
} // namespace Seele