First working effects with new pipeline

This commit is contained in:
Simon Lübeß
2024-08-22 00:34:20 +02:00
parent 7b7a3dc645
commit 66e62f42ec
20 changed files with 652 additions and 43 deletions
+17 -2
View File
@@ -74,13 +74,28 @@ namespace GlitchyEngine.Renderer
public BufferVariableCollection Variables => _variables;
/// Gets a span to the rawData held on the CPU.
public Span<uint8> RawData => rawData;
protected this() {}
public this(StringView name, int64 size)
{
_name = new String(name);
rawData = new uint8[size];
ConstructBuffer();
}
protected internal void AddVariable(BufferVariable ownVariable)
{
_variables.Add(ownVariable);
}
public void AddVariable(StringView name, uint64 offset, uint64 sizeInBytes, bool isUsed, ShaderVariableType type, uint8 rows, uint8 columns, uint64 arraySize)
{
_variables.Add(new BufferVariable(name, this, type, columns, rows, (uint32)offset, (uint32)sizeInBytes, (uint32)arraySize, isUsed));
}
/**
* Construct the buffer description.
*/
@@ -96,9 +111,9 @@ namespace GlitchyEngine.Renderer
/**
* Uploads the date to the GPU.
*/
public void Update()
public Result<void> Update()
{
PlatformSetData(rawData.CArray(), (uint32)rawData.Count, 0, .WriteDiscard);
return PlatformSetData(rawData.CArray(), (uint32)rawData.Count, 0, .WriteDiscard);
}
}