Added SetData for single struct

This commit is contained in:
Simon Lübeß
2020-12-30 18:52:06 +01:00
parent a02b781347
commit d0c8685ce7
+11
View File
@@ -144,6 +144,17 @@ namespace GlitchyEngine.Renderer
_description = description;
}
/**
* @param data The struct containing the data that will be copied into the buffer.
* @param destinationByteOffset The offset in bytes form the start of the destination buffer.
* @param mapType Only relevant for dynamic buffers...
*/
public Result<void> SetData<T>(T data, uint32 destinationByteOffset = 0, MapType mapType = .Write) where T : struct
{
var data;
return PlatformSetData(&data, (uint32)(sizeof(T)), destinationByteOffset, mapType);
}
/**
* @param data The span containing the data that will be copied into the buffer.
* @param destinationByteOffset The offset in bytes form the start of the destination buffer.