daily update on 20240419 by nitload youmu, SSD merged into main stream

This commit is contained in:
YoumuLiu
2024-04-20 02:36:36 +08:00
parent efeb4ba058
commit 7b67eb2f4d
81 changed files with 4568 additions and 33 deletions
@@ -29,6 +29,7 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp;
using StgSharp.Data;
using System;
using System.Collections.Generic;
@@ -56,13 +57,15 @@ namespace StgSharp.Graphics
}
}
public class Shader
public class Shader : SSDSerializable
{
private readonly IntPtr context;
internal readonly glHandleSet handle;
public readonly ShaderType type;
public override byte SSDTypeCode => SerializableTypeCode.Shader;
internal unsafe Shader(glHandleSet handle, ShaderType usage)
{
this.handle = handle;
@@ -97,6 +100,21 @@ namespace StgSharp.Graphics
return $"This is a {type} shader, its shader handles are {handle.ToString()}.";
}
//TODO shader 的序列化究极麻烦,原因是shader的架构问题
public override byte[] GetBytes()
{
throw new NotImplementedException();
}
public override byte[] GetBytes(out int length)
{
throw new NotImplementedException();
}
internal override void BuildFromByteStream(byte[] stream)
{
throw new NotImplementedException();
}
}
public class ShaderProgram