Interact with Materials from scripts

This commit is contained in:
Simon Lübeß
2025-02-14 11:54:07 +01:00
parent e5437c6ff6
commit aaed4199d3
24 changed files with 739 additions and 64 deletions
@@ -109,6 +109,26 @@ namespace GlitchyEngine.Renderer
#endif
}
public enum TypematchResult
{
Ok,
MatrixDimensionMismatch,
ElementTypeMismatch,
}
public TypematchResult CheckTypematch(int rows, int cols, ShaderVariableType type)
{
Debug.Profiler.ProfileRendererFunction!();
if (rows != _rows || cols != _columns)
return .MatrixDimensionMismatch;
if (type != _elementType)
return .ElementTypeMismatch;
return .Ok;
}
public void EnsureTypeMatch<T>()
{
switch(typeof(T))