Daily update on 20250618-051714 by Nitload Youmu. Additional Message : Brief support to collection operation in EXPRESS. A collection type added in core lib and compilestack.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-06-18 05:17:14 +08:00
parent 74c01effe4
commit c624a8ca38
300 changed files with 12227 additions and 4303 deletions
+45 -75
View File
@@ -73,17 +73,9 @@ namespace StgSharp
public override bool IsContextSharable => true;
public Rectangle ButtonBounding
{
get;
private set;
}
public Rectangle ButtonBounding { get; private set; }
public TextureProvider ButtonTextureProvider
{
get;
private set;
}
public TextureProvider ButtonTextureProvider { get; private set; }
//render a controlling item
public void ButtonMain( IEnumerable<PlainGeometryMesh> items )
@@ -96,7 +88,8 @@ namespace StgSharp
f_vao.Bind( 0 ); //GL.Assert(true);
foreach( PlainGeometryMesh mesh in items ) {
foreach( PlainGeometryMesh mesh in items )
{
//autoT.SelectTextureAndBind(mesh.TextureImage);
f_t.LoadTexture( 0, mesh.TextureImage );
@@ -104,8 +97,7 @@ namespace StgSharp
frameMainShader.Use(); //GL.Assert(true);
GL.DrawElements(
GeometryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero );
GL.DrawElements( GeometryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero );
}
//GL.ClearError();
@@ -133,15 +125,15 @@ namespace StgSharp
/**/
GL.TextureImage2d<byte>(
Texture2DTarget.Texture2D, 0, ImageChannel.WithAlphaChannel,
( uint )Width, ( uint )Height, ImageChannel.WithAlphaChannel,
PixelChannelLayout.Byte, null );
Texture2DTarget.Texture2D, 0, ImageChannel.WithAlphaChannel, ( uint )Width,
( uint )Height, ImageChannel.WithAlphaChannel, PixelChannelLayout.Byte, null );
/**/
//GL.Assert(false);
//Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.All));
GL.ClearColor( ( 0.6f + TimePassed ) % 1.0f, 0.1f, 0.3f, 1 );
//GL.Assert( false );
//Console.WriteLine(GL.CheckFrameBufferStatus(FrameBufferTarget.All));
@@ -151,16 +143,15 @@ namespace StgSharp
//GL.Assert(false);
vbo.Bind( 1 );
vbo.WriteVectorData<Vec4>(
1, buffer.CoordAndRotationSpan, BufferUsage.StreamDraw );
vbo.WriteVectorData<Vec4>( 1, buffer.CoordAndRotationSpan, BufferUsage.StreamDraw );
s.Use();
NativeCamera.SetAllUniforms();
GL.SetUniformValue( time, TimePassed );
GL.DrawElementsInstanced(
GeometryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero, 100 );
GL.DrawElementsInstanced( GeometryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero,
100 );
//Console.WriteLine(TimePassed);
//GL.Assert(true);
@@ -205,16 +196,14 @@ namespace StgSharp
}
public void RenderButton(
ButtonStatus status,
float statusBegin,
in TextureProvider provider )
ButtonStatus status,
float statusBegin,
in TextureProvider provider )
{
provider.UpdateFromImage( i );
}
internal static Vec3 DefaultRotation(
TimeSpanProvider provider,
out float rotation )
internal static Vec3 DefaultRotation( TimeSpanProvider provider, out float rotation )
{
rotation = provider.SpanLengthLowPrecession;
float angle = provider.CurrentSecond * 2;
@@ -230,15 +219,16 @@ namespace StgSharp
//GL.Assert(true);
buffer = new PlainInstancingBuffer<ParticleOnPlain>();
for( int i = 0; i < 10; i++ ) {
for( int i = 0; i < 10; i++ )
{
float ai = Scaler.Abs( i - 5.0f );
for( int t = 0; t < 10; t++ ) {
for( int t = 0; t < 10; t++ )
{
float at = Scaler.Abs( t - 5.0f );
ParticleOnPlain p = new ParticleOnPlain( buffer );
( ( IInstancing )p ).Coord = new Vec3(
( ( ( -5 ) + i ) * 0.2f ) + 0.1f,
( ( ( -5 ) + t ) * 0.2f ) + 0.1f, 0 );
( ( ( -5 ) + i ) * 0.2f ) + 0.1f, ( ( ( -5 ) + t ) * 0.2f ) + 0.1f, 0 );
( ( IInstancing )p ).Scale =
Scaler.MinOf( i, t ) * 0.15f;
( ( IInstancing )p ).Motion = new GeometryMotion(
@@ -287,24 +277,18 @@ namespace StgSharp
vao.Bind( 0 );
vbo.WriteVectorData( 0, rec.VertexStream, BufferUsage.StaticDraw );
ebo.SetValue( 0, rec.VertexIndices, BufferUsage.StaticDraw );
vao.SetVertexAttribute(
0, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
vao.SetVertexAttribute( 0, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
vbo.WriteVectorData<Vec4>(
1, buffer.CoordAndRotationSpan, BufferUsage.StreamDraw );
vbo.WriteVectorData<Vec4>( 1, buffer.CoordAndRotationSpan, BufferUsage.StreamDraw );
vao.SetVertexAttribute( 1, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
vao.SetVertexAttribute(
1, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
vao.SetVertexAttribute(
2, 1, TypeCode.Single, false, 4 * sizeof( float ),
3 * sizeof( float ) );
2, 1, TypeCode.Single, false, 4 * sizeof( float ), 3 * sizeof( float ) );
GL.VertexAttributeDivisor( 1, 1 );
GL.VertexAttributeDivisor( 2, 1 );
vbo.WriteScalerData<float>(
2, buffer.ScalingSpan, BufferUsage.StaticDraw );
vao.SetVertexAttribute(
3, 1, TypeCode.Single, false, sizeof( float ), 0 );
vbo.WriteScalerData<float>( 2, buffer.ScalingSpan, BufferUsage.StaticDraw );
vao.SetVertexAttribute( 3, 1, TypeCode.Single, false, sizeof( float ), 0 );
GL.VertexAttributeDivisor( 3, 1 );
@@ -326,33 +310,27 @@ namespace StgSharp
t = CreateTexture( 1 );
t.Bind2D( 0 );
GL.TextureImage2d<byte>(
Texture2DTarget.Texture2D, 0, ImageChannel.WithAlphaChannel,
( uint )Width, ( uint )Height, ImageChannel.WithAlphaChannel,
PixelChannelLayout.Byte, null! );
Texture2DTarget.Texture2D, 0, ImageChannel.WithAlphaChannel, ( uint )Width,
( uint )Height, ImageChannel.WithAlphaChannel, PixelChannelLayout.Byte, null! );
t.Set2dWrapProperty( 0, TextureWrap.Repeat, TextureWrap.Repeat );
t.Set2dFilterProperty(
0, TextureFilter.Linear, TextureFilter.Linear );
t.Set2dFilterProperty( 0, TextureFilter.Linear, TextureFilter.Linear );
//GL.Assert(true);
GL.FrameBufferTexture2d(
FrameBufferTarget.All, glAttachment.Color( 0 ),
Texture2DTarget.Texture2D, t[ 0 ], 0 );
FrameBufferTarget.All, glAttachment.Color( 0 ), Texture2DTarget.Texture2D, t[ 0 ],
0 );
GL.SetRenderBufferStorage(
RenderBufferInternalFormat.Depth24_Stencil8, this.Size );
GL.CombineFrameBufferRenderBuffer(
FrameBufferAttachment.DepthAndStencil, rbo[ 0 ] );
GL.SetRenderBufferStorage( RenderBufferInternalFormat.Depth24_Stencil8, this.Size );
GL.CombineFrameBufferRenderBuffer( FrameBufferAttachment.DepthAndStencil, rbo[ 0 ] );
Console.WriteLine(
GL.CheckFrameBufferStatus( FrameBufferTarget.All ) );
Console.WriteLine( GL.CheckFrameBufferStatus( FrameBufferTarget.All ) );
FrameBuffer.BindNull();
//GL.Assert(true);
int streamLength = this.Width * this.Height * 4;
byte[] imageStream = new byte[streamLength];
i = Image.FromMemory(
this.Size, ImageChannel.WithAlphaChannel, imageStream );
i = Image.FromMemory( this.Size, ImageChannel.WithAlphaChannel, imageStream );
time = s.GetUniform<float>( "time" );
@@ -363,12 +341,10 @@ namespace StgSharp
(1f, 0f),
(0f, 0f)
};
ButtonBounding = new Rectangle(
-0.9f, 0.9f, 0.9f, 0.9f, 0.9f, -0.9f, -0.9f, -0.9f );
ButtonBounding = new Rectangle( -0.9f, 0.9f, 0.9f, 0.9f, 0.9f, -0.9f, -0.9f, -0.9f );
//GL.Assert(true);
ButtonTextureProvider = new TextureProvider(
i, buttonTextureCoordArray );
ButtonTextureProvider = new TextureProvider( i, buttonTextureCoordArray );
f_vao = CreateVertexArray( 1 );
f_vbo = CreateVertexBuffer( 2 );
@@ -378,35 +354,29 @@ namespace StgSharp
f_vao.Bind( 0 );
f_ebo.Bind( 0 );
f_ebo.SetValue(
0, ButtonBounding.VertexIndices, BufferUsage.StaticDraw );
f_ebo.SetValue( 0, ButtonBounding.VertexIndices, BufferUsage.StaticDraw );
//GL.Assert(true);
f_vbo.Bind( 0 );
f_vbo.WriteVectorData(
0, ButtonBounding.VertexStream, BufferUsage.StaticDraw );
f_vao.SetVertexAttribute(
0, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
f_vbo.WriteVectorData( 0, ButtonBounding.VertexStream, BufferUsage.StaticDraw );
f_vao.SetVertexAttribute( 0, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
//GL.Assert(true);
f_vbo.Bind( 1 );
f_vbo.WriteVectorData(
1, buttonTextureCoordArray, BufferUsage.StaticDraw );
f_vao.SetVertexAttribute(
1, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
f_vbo.WriteVectorData( 1, buttonTextureCoordArray, BufferUsage.StaticDraw );
f_vao.SetVertexAttribute( 1, 3, TypeCode.Single, false, 4 * sizeof( float ), 0 );
//GL.Assert(true);
autoT = CreateAutoTexture( 4 );
autoT.DefaultTextureProperty = new TextureProperty(
TextureFilter.Nearest, TextureFilter.Nearest,
TextureWrap.Repeat, TextureWrap.Repeat );
TextureFilter.Nearest, TextureFilter.Nearest, TextureWrap.Repeat,
TextureWrap.Repeat );
f_t = CreateTexture( 1 );
f_t.Bind2D( 0 );
f_t.Set2dWrapProperty( 0, TextureWrap.Repeat, TextureWrap.Repeat );
f_t.Set2dFilterProperty(
0, TextureFilter.Nearest, TextureFilter.Nearest );
f_t.Set2dFilterProperty( 0, TextureFilter.Nearest, TextureFilter.Nearest );
//GL.Assert(true);
f_t.ActivateAs( TextureUnit.Unit1 );