Trying to fix invalid descriptorlayout

This commit is contained in:
Dynamitos
2020-10-03 11:00:10 +02:00
parent 79388bf41a
commit ceee96b462
69 changed files with 1087 additions and 393 deletions
+24 -39
View File
@@ -14,65 +14,50 @@ struct ExpressionOutput
struct ShaderExpression
{
};
DECLARE_NAME_REF(Gfx, DescriptorSet);
struct ShaderParameter : public ShaderExpression
{
std::string name;
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;
};
DEFINE_REF(ShaderParameter);
struct FloatParameter : public ShaderParameter
{
float defaultValue;
bool setParameter(const std::string& paramName, float newDefault)
{
if(name.compare(paramName) == 0)
{
defaultValue = newDefault;
return true;
}
return false;
}
float data;
FloatParameter(std::string name, uint32 byteOffset, uint32 binding);
virtual ~FloatParameter();
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
};
DEFINE_REF(FloatParameter);
struct VectorParameter : public ShaderParameter
{
Vector defaultValue;
bool setParameter(const std::string& paramName, Vector newDefault)
{
if(name.compare(paramName) == 0)
{
defaultValue = newDefault;
return true;
}
return false;
}
Vector data;
VectorParameter(std::string name, uint32 byteOffset, uint32 binding);
virtual ~VectorParameter();
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
};
DEFINE_REF(VectorParameter);
DECLARE_NAME_REF(Gfx, Texture2D);
DECLARE_REF(TextureAsset);
struct TextureParameter : public ShaderParameter
{
Gfx::PTexture2D defaultValue;
bool setParameter(const std::string& paramName, Gfx::PTexture2D newDefault)
{
if(name.compare(paramName) == 0)
{
return true;
}
return false;
}
PTextureAsset data;
TextureParameter(std::string name, uint32 byteOffset, uint32 binding);
virtual ~TextureParameter();
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
};
DEFINE_REF(TextureParameter);
DECLARE_NAME_REF(Gfx, SamplerState);
struct SamplerParameter : public ShaderParameter
{
Gfx::PSamplerState defaultValue;
bool setParameter(const std::string& paramName, Gfx::PSamplerState newDefault)
{
if(name.compare(paramName) == 0)
{
return true;
}
return false;
}
Gfx::PSamplerState data;
SamplerParameter(std::string name, uint32 byteOffset, uint32 binding);
virtual ~SamplerParameter();
virtual void updateDescriptorSet(Gfx::PDescriptorSet descriptorSet, uint8* dst) override;
};
DEFINE_REF(SamplerParameter);