Daily update on 20251230-224423 by Nitload Youmu. Additional Message : Adding compute support for mat<double>. Import all opengl core profile fucntions
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StringHashMultiplexer"
|
||||
// Project: StgSharp
|
||||
@@ -71,7 +71,7 @@ namespace StgSharp.Collections
|
||||
{
|
||||
int hash;
|
||||
fixed (char* cPtr = obj.AsSpan()) {
|
||||
hash = NativeIntrinsic.Intrinsic.city_hash_simplify(cPtr, obj.Length);
|
||||
hash = NativeIntrinsic.Context.city_hash_simplify(cPtr, obj.Length);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace StgSharp.Collections
|
||||
{
|
||||
int hash;
|
||||
fixed (char* cPtr = obj.AsSpan()) {
|
||||
hash = NativeIntrinsic.Intrinsic.city_hash_simplify(cPtr, obj.Length);
|
||||
hash = NativeIntrinsic.Context.city_hash_simplify(cPtr, obj.Length);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="TextureGL"
|
||||
// Project: StgSharp
|
||||
@@ -44,14 +44,19 @@ namespace StgSharp.Graphics.OpenGL
|
||||
private OpenGLFunction _gl;
|
||||
internal GlHandle[] _textureHandle;
|
||||
|
||||
internal TextureGL(int count, glRender binding)
|
||||
internal TextureGL(
|
||||
int count,
|
||||
glRender binding
|
||||
)
|
||||
{
|
||||
// sourceList = new Image[count];
|
||||
this._gl = binding.GL;
|
||||
_textureHandle = _gl.GenTextures(count);
|
||||
}
|
||||
|
||||
public GlHandle this[int index]
|
||||
public GlHandle this[
|
||||
int index
|
||||
]
|
||||
{
|
||||
get => _textureHandle[index];
|
||||
}
|
||||
@@ -70,12 +75,16 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal OpenGLFunction GL => _gl;
|
||||
|
||||
public void ActivateAs(TextureUnit unit)
|
||||
public void ActivateAs(
|
||||
TextureUnit unit
|
||||
)
|
||||
{
|
||||
_gl.ActiveTextureUnit((uint)unit);
|
||||
}
|
||||
|
||||
public void Bind2D(int index)
|
||||
public void Bind2D(
|
||||
int index
|
||||
)
|
||||
{
|
||||
currentEditingTextureIndex = index;
|
||||
_gl.BindTexture(glConst.TEXTURE_2D, _textureHandle[index]);
|
||||
@@ -90,19 +99,25 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// <param _label="i">
|
||||
///
|
||||
/// </param>
|
||||
public unsafe void LoadTexture(int index, Image i)
|
||||
public unsafe void LoadTexture(
|
||||
int index,
|
||||
Image i
|
||||
)
|
||||
{
|
||||
byte[] handle = i.PixelBuffer;
|
||||
_gl.TextureImage2d(
|
||||
Texture2DTarget.Texture2D, 0, i.Channel, (uint)i.Width, (uint)i.Height, i.Channel, i.PixelLayout,
|
||||
pixels:handle);
|
||||
_gl.TextureImage2d(Texture2DTarget.Texture2D, 0, i.Channel, i.Width, i.Height,
|
||||
i.Channel, i.PixelLayout, pixels:handle);
|
||||
_gl.GenerateMipmap(Texture2DTarget.Texture2D);
|
||||
}
|
||||
|
||||
#region texture setting
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Set2dFilterProperty(int index, TextureFilter onMinify, TextureFilter onMagnify)
|
||||
public void Set2dFilterProperty(
|
||||
int index,
|
||||
TextureFilter onMinify,
|
||||
TextureFilter onMagnify
|
||||
)
|
||||
{
|
||||
#if DEBUG
|
||||
if (index != currentEditingTextureIndex)
|
||||
@@ -117,7 +132,11 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Set2dWrapProperty(int index, TextureWrap onHorizontial, TextureWrap onVertical)
|
||||
public void Set2dWrapProperty(
|
||||
int index,
|
||||
TextureWrap onHorizontial,
|
||||
TextureWrap onVertical
|
||||
)
|
||||
{
|
||||
#if DEBUG
|
||||
if (index != currentEditingTextureIndex)
|
||||
@@ -132,7 +151,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Set2dProperty(int index, TextureProperty property)
|
||||
public void Set2dProperty(
|
||||
int index,
|
||||
TextureProperty property
|
||||
)
|
||||
{
|
||||
Set2dFilterProperty(index, property.FilterOnMinify, property.FilterOnMagnify);
|
||||
Set2dWrapProperty(index, property.WrapOnHorizontial, property.WrapOnVertical);
|
||||
@@ -156,7 +178,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
TextureFilter onMagnify,
|
||||
TextureFilter onMinify,
|
||||
TextureWrap onHorizontial,
|
||||
TextureWrap onVertical)
|
||||
TextureWrap onVertical
|
||||
)
|
||||
{
|
||||
FilterOnMagnify = onMagnify;
|
||||
FilterOnMinify = onMinify;
|
||||
@@ -188,15 +211,17 @@ namespace StgSharp.Graphics.OpenGL
|
||||
set => vert = value;
|
||||
}
|
||||
|
||||
public override bool Equals([NotNullWhen(true)] object obj)
|
||||
public override bool Equals(
|
||||
[NotNullWhen(true)] object obj
|
||||
)
|
||||
{
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(
|
||||
FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, WrapOnVertical);
|
||||
return HashCode.Combine(FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial,
|
||||
WrapOnVertical);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
@@ -204,12 +229,18 @@ namespace StgSharp.Graphics.OpenGL
|
||||
return $"FilterOnMagnify:{FilterOnMagnify}, " + $"FilterOnMagnify:{FilterOnMagnify}, " + $"WrapOnHorizontial:{WrapOnHorizontial}, " + $"WrapOnVertical:{WrapOnVertical}";
|
||||
}
|
||||
|
||||
public static bool operator !=(TextureProperty left, TextureProperty right)
|
||||
public static bool operator !=(
|
||||
TextureProperty left,
|
||||
TextureProperty right
|
||||
)
|
||||
{
|
||||
return left.mask != right.mask;
|
||||
}
|
||||
|
||||
public static bool operator ==(TextureProperty left, TextureProperty right)
|
||||
public static bool operator ==(
|
||||
TextureProperty left,
|
||||
TextureProperty right
|
||||
)
|
||||
{
|
||||
return left.mask == right.mask;
|
||||
}
|
||||
@@ -218,11 +249,12 @@ namespace StgSharp.Graphics.OpenGL
|
||||
(
|
||||
TextureFilter onMagnify, TextureFilter onMinify,
|
||||
TextureWrap onHorizontial, TextureWrap onVertical
|
||||
) propertyValueTuple)
|
||||
) propertyValueTuple
|
||||
)
|
||||
{
|
||||
return new TextureProperty(
|
||||
propertyValueTuple.onMagnify, propertyValueTuple.onMinify,
|
||||
propertyValueTuple.onHorizontial, propertyValueTuple.onVertical);
|
||||
return new TextureProperty(propertyValueTuple.onMagnify, propertyValueTuple.onMinify,
|
||||
propertyValueTuple.onHorizontial,
|
||||
propertyValueTuple.onVertical);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="VAO"
|
||||
// Project: StgSharp
|
||||
@@ -36,14 +36,19 @@ namespace StgSharp.Graphics.OpenGL
|
||||
public sealed unsafe class VertexArray : GlBufferObjectBase
|
||||
{
|
||||
|
||||
internal VertexArray(int n, glRender binding)
|
||||
internal VertexArray(
|
||||
int n,
|
||||
glRender binding
|
||||
)
|
||||
: base(binding)
|
||||
{
|
||||
_bufferHandle = GL.GenVertexArrays(n);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public sealed override void Bind(int index)
|
||||
public sealed override void Bind(
|
||||
int index
|
||||
)
|
||||
{
|
||||
GL.BindVertexArray(_bufferHandle[index]);
|
||||
}
|
||||
@@ -60,13 +65,17 @@ namespace StgSharp.Graphics.OpenGL
|
||||
int vertexLength,
|
||||
TypeCode dataType,
|
||||
bool isNomalized,
|
||||
uint stride,
|
||||
int pointer)
|
||||
int stride,
|
||||
int pointer
|
||||
)
|
||||
{
|
||||
GL.SetVertexAttribute(attributeIndex, vertexLength, dataType, isNomalized, stride, pointer);
|
||||
GL.SetVertexAttribute(attributeIndex, vertexLength, dataType, isNomalized, stride,
|
||||
pointer);
|
||||
}
|
||||
|
||||
protected sealed override void Dispose(bool disposing)
|
||||
protected sealed override void Dispose(
|
||||
bool disposing
|
||||
)
|
||||
{
|
||||
if (disposing) {
|
||||
GL.DeleteVertexArrays(_bufferHandle);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Shader"
|
||||
// Project: StgSharp
|
||||
@@ -56,7 +56,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected sealed override Shader CreateShaderSegment(ShaderType type, int count)
|
||||
protected sealed override Shader CreateShaderSegment(
|
||||
ShaderType type,
|
||||
int count
|
||||
)
|
||||
{
|
||||
return new Shader(GL.CreateShaderSet(count, type), type, this);
|
||||
}
|
||||
@@ -70,7 +73,11 @@ namespace StgSharp.Graphics.OpenGL
|
||||
internal readonly GlHandle[] handle;
|
||||
public readonly ShaderType type;
|
||||
|
||||
internal unsafe Shader(GlHandle[] handle, ShaderType usage, glRender stream)
|
||||
internal unsafe Shader(
|
||||
GlHandle[] handle,
|
||||
ShaderType usage,
|
||||
glRender stream
|
||||
)
|
||||
{
|
||||
this.handle = handle;
|
||||
GL = stream.GL;
|
||||
@@ -89,12 +96,18 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// Index of shader code in current shader code set.
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void AttachTo(int index, [NotNull]ShaderProgram target)
|
||||
public void AttachTo(
|
||||
int index,
|
||||
[NotNull]ShaderProgram target
|
||||
)
|
||||
{
|
||||
GL.AttachShader(target.handle, handle[index]);
|
||||
}
|
||||
|
||||
public void CheckStatus(int index, ShaderStatus status)
|
||||
public void CheckStatus(
|
||||
int index,
|
||||
ShaderStatus status
|
||||
)
|
||||
{
|
||||
string log = GL.GetShaderStatus(this, index, (int)status);
|
||||
if (!string.IsNullOrEmpty(log)) {
|
||||
@@ -103,7 +116,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Compile(int index, ReadOnlySpan<byte> codeU8Stream)
|
||||
public unsafe void Compile(
|
||||
int index,
|
||||
ReadOnlySpan<byte> codeU8Stream
|
||||
)
|
||||
{
|
||||
GL.LoadShaderSource(handle[index], codeU8Stream);
|
||||
GL.CompileShader(handle[index]);
|
||||
@@ -111,7 +127,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Compile(int index, byte[] codeStream)
|
||||
public unsafe void Compile(
|
||||
int index,
|
||||
byte[] codeStream
|
||||
)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(codeStream);
|
||||
GL.LoadShaderSource(handle[index], codeStream);
|
||||
@@ -120,7 +139,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Compile(int index, string codeStream)
|
||||
public unsafe void Compile(
|
||||
int index,
|
||||
string codeStream
|
||||
)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(codeStream);
|
||||
GL.LoadShaderSource(handle[index], codeStream.AsSpan());
|
||||
@@ -128,12 +150,16 @@ namespace StgSharp.Graphics.OpenGL
|
||||
CheckStatus(index, ShaderStatus.CompileStatus);
|
||||
}
|
||||
|
||||
public void FromBytes(byte[] stream)
|
||||
public void FromBytes(
|
||||
byte[] stream
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static byte[] FromCodeFile(string fileRoute)
|
||||
public static byte[] FromCodeFile(
|
||||
string fileRoute
|
||||
)
|
||||
{
|
||||
string str = File.ReadAllText(fileRoute);
|
||||
if (string.IsNullOrEmpty(str)) {
|
||||
@@ -147,7 +173,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
return Array.Empty<byte>();
|
||||
}
|
||||
|
||||
public byte[] GetBytes(out int length)
|
||||
public byte[] GetBytes(
|
||||
out int length
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -175,7 +203,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// <summary>
|
||||
/// CustomizeInit a program with no shader attached.
|
||||
/// </summary>
|
||||
internal unsafe ShaderProgram(glRender binding)
|
||||
internal unsafe ShaderProgram(
|
||||
glRender binding
|
||||
)
|
||||
{
|
||||
GL = binding.GL;
|
||||
handle = GL.CreateProgram();
|
||||
@@ -191,7 +221,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
///
|
||||
/// </returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe Uniform<T> GetUniform<T>(string name) where T: unmanaged
|
||||
public unsafe Uniform<T> GetUniform<T>(
|
||||
string name
|
||||
) where T : unmanaged
|
||||
{
|
||||
return new Uniform<T>(GL.GetUniformLocation(this.handle, name));
|
||||
}
|
||||
@@ -205,7 +237,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// <returns>
|
||||
///
|
||||
/// </returns>
|
||||
public unsafe Uniform<T, U> GetUniform<T, U>(string name) where T: unmanaged where U: struct
|
||||
public unsafe Uniform<T, U> GetUniform<T, U>(
|
||||
string name
|
||||
) where T : unmanaged where U : struct
|
||||
{
|
||||
return new Uniform<T, U>(GL.GetUniformLocation(this.handle, name));
|
||||
}
|
||||
@@ -219,8 +253,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// <returns>
|
||||
///
|
||||
/// </returns>
|
||||
public unsafe Uniform<T, U, V> GetUniform<T, U, V>(string name) where T: unmanaged where U: struct
|
||||
where V: struct
|
||||
public unsafe Uniform<T, U, V> GetUniform<T, U, V>(
|
||||
string name
|
||||
) where T : unmanaged where U : struct where V : struct
|
||||
{
|
||||
return new Uniform<T, U, V>(GL.GetUniformLocation(this.handle, name));
|
||||
}
|
||||
@@ -234,9 +269,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// <returns>
|
||||
///
|
||||
/// </returns>
|
||||
public unsafe Uniform<T, U, V, W> GetUniform<T, U, V, W>(string name) where T: unmanaged where U: struct
|
||||
where V: struct
|
||||
where W: struct
|
||||
public unsafe Uniform<T, U, V, W> GetUniform<T, U, V, W>(
|
||||
string name
|
||||
) where T : unmanaged where U : struct where V : struct where W : struct
|
||||
{
|
||||
return new Uniform<T, U, V, W>(GL.GetUniformLocation(this.handle, name));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Uniform"
|
||||
// Project: StgSharp
|
||||
@@ -41,17 +41,21 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
}
|
||||
|
||||
public sealed class Uniform<T> : Uniform where T: unmanaged
|
||||
public sealed class Uniform<T> : Uniform where T : unmanaged
|
||||
{
|
||||
|
||||
internal Uniform() { }
|
||||
|
||||
internal unsafe Uniform(GlHandle id)
|
||||
internal unsafe Uniform(
|
||||
GlHandle id
|
||||
)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
internal static Uniform<T> FromHandle(GlHandle handle)
|
||||
internal static Uniform<T> FromHandle(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
return new Uniform<T>
|
||||
{
|
||||
@@ -61,17 +65,21 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
}
|
||||
|
||||
public sealed class Uniform<T, U> : Uniform where T: unmanaged where U: struct
|
||||
public sealed class Uniform<T, U> : Uniform where T : unmanaged where U : struct
|
||||
{
|
||||
|
||||
internal Uniform() { }
|
||||
|
||||
internal unsafe Uniform(GlHandle id)
|
||||
internal unsafe Uniform(
|
||||
GlHandle id
|
||||
)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
internal static Uniform<T, U> FromHandle(GlHandle handle)
|
||||
internal static Uniform<T, U> FromHandle(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
return new Uniform<T, U>
|
||||
{
|
||||
@@ -81,17 +89,22 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
}
|
||||
|
||||
public sealed class Uniform<T, U, V> : Uniform where T: unmanaged where U: struct where V: struct
|
||||
public sealed class Uniform<T, U, V> : Uniform where T : unmanaged where U : struct
|
||||
where V : struct
|
||||
{
|
||||
|
||||
internal Uniform() { }
|
||||
|
||||
internal unsafe Uniform(GlHandle id)
|
||||
internal unsafe Uniform(
|
||||
GlHandle id
|
||||
)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
internal static Uniform<T, U, V> FromHandle(GlHandle handle)
|
||||
internal static Uniform<T, U, V> FromHandle(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
return new Uniform<T, U, V>
|
||||
{
|
||||
@@ -101,17 +114,23 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
}
|
||||
|
||||
public sealed class Uniform<T, U, V, W> : Uniform where T: unmanaged where U: struct where V: struct where W: struct
|
||||
public sealed class Uniform<T, U, V, W> : Uniform where T : unmanaged where U : struct
|
||||
where V : struct
|
||||
where W : struct
|
||||
{
|
||||
|
||||
internal Uniform() { }
|
||||
|
||||
internal unsafe Uniform(GlHandle id)
|
||||
internal unsafe Uniform(
|
||||
GlHandle id
|
||||
)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
internal static Uniform<T, U, V, W> FromHandle(GlHandle handle)
|
||||
internal static Uniform<T, U, V, W> FromHandle(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
return new Uniform<T, U, V, W>
|
||||
{
|
||||
@@ -125,46 +144,67 @@ namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull] Uniform<Matrix44> uniform, Matrix44 mat)
|
||||
public void SetUniformValue(
|
||||
[NotNull] Uniform<Matrix44> uniform,
|
||||
Matrix44 mat
|
||||
)
|
||||
{
|
||||
Matrix44 temp = mat;
|
||||
Context.glUniformMatrix4fv(uniform.id.SignedValue, 1, false, (float*)&temp);
|
||||
Context.glUniformMatrix4fv(uniform.id.SignedValue, 1, (byte)0, (float*)&mat);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull]Uniform<float, float, float, float> uniform, Vec4 vec)
|
||||
public void SetUniformValue(
|
||||
[NotNull]Uniform<float, float, float, float> uniform,
|
||||
Vec4 vec
|
||||
)
|
||||
{
|
||||
Vec4 temp = vec;
|
||||
Context.glUniform1fv(uniform.id.SignedValue, 4, &temp.reg);
|
||||
Context.glUniform1fv(uniform.id.SignedValue, 4, (float*)&vec);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull]Uniform<Vec4> uniform, Vec4 vec)
|
||||
public void SetUniformValue(
|
||||
[NotNull]Uniform<Vec4> uniform,
|
||||
Vec4 vec
|
||||
)
|
||||
{
|
||||
Vec4 temp = vec;
|
||||
Context.glUniform1fv(uniform.id.SignedValue, 4, &temp.reg);
|
||||
Context.glUniform1fv(uniform.id.SignedValue, 4, (float*)&vec);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull]Uniform<float> uniform, float v0)
|
||||
public void SetUniformValue(
|
||||
[NotNull]Uniform<float> uniform,
|
||||
float v0
|
||||
)
|
||||
{
|
||||
Context.glUniform1f(uniform.id.SignedValue, v0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull]Uniform<int> uniform, int i0)
|
||||
public void SetUniformValue(
|
||||
[NotNull]Uniform<int> uniform,
|
||||
int i0
|
||||
)
|
||||
{
|
||||
Context.glUniform1i(uniform.id.SignedValue, i0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull] Uniform<float, float> uniform, float v0, float v1)
|
||||
public void SetUniformValue(
|
||||
[NotNull] Uniform<float, float> uniform,
|
||||
float v0,
|
||||
float v1
|
||||
)
|
||||
{
|
||||
Context.glUniform2f(uniform.id.SignedValue, v0, v1);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetUniformValue([NotNull] Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
public void SetUniformValue(
|
||||
[NotNull] Uniform<float, float, float> uniform,
|
||||
float v0,
|
||||
float v1,
|
||||
float v2
|
||||
)
|
||||
{
|
||||
Context.glUniform3f(uniform.id.SignedValue, v0, v1, v2);
|
||||
}
|
||||
@@ -175,7 +215,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
float v0,
|
||||
float v1,
|
||||
float v2,
|
||||
float v3)
|
||||
float v3
|
||||
)
|
||||
{
|
||||
Context.glUniform4f(uniform.id.SignedValue, v0, v1, v2, v3);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glApiManager"
|
||||
// Project: StgSharp
|
||||
@@ -54,28 +54,6 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
private static string glExtensionList;
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Get the function pointer of given OpenGL api _label
|
||||
/// </summary>
|
||||
/// <param _label="name">
|
||||
/// ContextName of the OpenGL api
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The funtion pointer of the api in stream of <see cref="IntPtr" />
|
||||
/// </returns>
|
||||
public static IntPtr LoadGLfunc(string name)
|
||||
{
|
||||
IntPtr ret = GraphicFramework.glfwGetProcAddress(Encoding.UTF8.GetBytes(name));
|
||||
if (ret == default)
|
||||
{
|
||||
DefaultLog.InternalAppendLog(
|
||||
$"Cannot load OpenGL api called {name}, this api may not exist or supported.");
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load all supported OpenGL APIs and bind them to given <see cref="ViewPort" />.
|
||||
@@ -83,10 +61,12 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// <param _label="contextHandle">
|
||||
/// The handle to current OpenGL viewPortDisplay
|
||||
/// </param>
|
||||
public static unsafe void LoadOpenGLApiTo(IntPtr contextHandle)
|
||||
public static unsafe void LoadOpenGLApiTo(
|
||||
IntPtr contextHandle
|
||||
)
|
||||
{
|
||||
OpenglContext* context = (OpenglContext*)contextHandle;
|
||||
if ((IntPtr)context->glGetString != IntPtr.Zero) {
|
||||
if (context->glGetString != null) {
|
||||
return;
|
||||
}
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> loader = &GraphicFramework.glfwGetProcAddress;
|
||||
@@ -96,15 +76,16 @@ namespace StgSharp.Graphics.OpenGL
|
||||
#if DEBUG
|
||||
Console.WriteLine("Cannot load GL.");
|
||||
#endif
|
||||
throw new Exception("Cannot load gl");
|
||||
throw new NotSupportedException("Cannot load gl");
|
||||
}
|
||||
context->glGetString = (delegate*<uint, IntPtr>)proc;
|
||||
context->glGetString = (delegate*<uint, byte*>)proc;
|
||||
|
||||
string coreVersion;
|
||||
if (context->glGetString(glVersion) == IntPtr.Zero) {
|
||||
if (context->glGetString(glVersion) == null) {
|
||||
DefaultLog.InternalWriteLog("Failed to call glGetString", LogType.Error);
|
||||
}
|
||||
coreVersion = Marshal.PtrToStringAnsi(context->glGetString(glVersion)) ?? string.Empty;
|
||||
coreVersion = Marshal.PtrToStringAnsi((nint)context->glGetString(glVersion)) ??
|
||||
string.Empty;
|
||||
|
||||
foreach (string branch in glBranch)
|
||||
{
|
||||
@@ -118,25 +99,25 @@ namespace StgSharp.Graphics.OpenGL
|
||||
CheckCoreVersion(majorVersion, minorVersion);
|
||||
|
||||
|
||||
if (LoadGLcore10(context, loader) &&
|
||||
LoadGLcore11(context, loader) &&
|
||||
LoadGLcore12(context, loader) &&
|
||||
LoadGLcore13(context, loader) &&
|
||||
LoadGLcore14(context, loader) &&
|
||||
LoadGLcore15(context, loader) &&
|
||||
LoadGLcore20(context, loader) &&
|
||||
LoadGLcore21(context, loader) &&
|
||||
LoadGLcore30(context, loader) &&
|
||||
LoadGLcore31(context, loader) &&
|
||||
LoadGLcore32(context, loader) &&
|
||||
LoadGLcore33(context, loader) &&
|
||||
LoadGLcore40(context, loader) &&
|
||||
LoadGLcore41(context, loader) &&
|
||||
LoadGLcore42(context, loader) &&
|
||||
LoadGLcore43(context, loader) &&
|
||||
LoadGLcore44(context, loader) &&
|
||||
LoadGLcore45(context, loader) &&
|
||||
LoadGLcore46(context, loader)) { }
|
||||
if (LoadGLcore10((glContextShadow*)context, loader) &&
|
||||
LoadGLcore11((glContextShadow*)context, loader) &&
|
||||
LoadGLcore12((glContextShadow*)context, loader) &&
|
||||
LoadGLcore13((glContextShadow*)context, loader) &&
|
||||
LoadGLcore14((glContextShadow*)context, loader) &&
|
||||
LoadGLcore15((glContextShadow*)context, loader) &&
|
||||
LoadGLcore20((glContextShadow*)context, loader) &&
|
||||
LoadGLcore21((glContextShadow*)context, loader) &&
|
||||
LoadGLcore30((glContextShadow*)context, loader) &&
|
||||
LoadGLcore31((glContextShadow*)context, loader) &&
|
||||
LoadGLcore32((glContextShadow*)context, loader) &&
|
||||
LoadGLcore33((glContextShadow*)context, loader) &&
|
||||
LoadGLcore40((glContextShadow*)context, loader) &&
|
||||
LoadGLcore41((glContextShadow*)context, loader) &&
|
||||
LoadGLcore42((glContextShadow*)context, loader) &&
|
||||
LoadGLcore43((glContextShadow*)context, loader) &&
|
||||
LoadGLcore44((glContextShadow*)context, loader) &&
|
||||
LoadGLcore45((glContextShadow*)context, loader) &&
|
||||
LoadGLcore46((glContextShadow*)context, loader)) { }
|
||||
|
||||
uint code = context->glGetError();
|
||||
if (code != 0)
|
||||
@@ -3267,7 +3248,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
#endregion checkGLextensions
|
||||
}
|
||||
|
||||
internal static void CheckCoreVersion(int majorVersion, int minorVersion)
|
||||
internal static void CheckCoreVersion(
|
||||
int majorVersion,
|
||||
int minorVersion
|
||||
)
|
||||
{
|
||||
if (majorVersion < 3) {
|
||||
throw new InvalidOperationException(
|
||||
@@ -3433,32 +3417,14 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
}
|
||||
|
||||
internal static unsafe string GetExtensions(this OpenglContext context)
|
||||
internal static unsafe string GetExtensions(
|
||||
this OpenglContext context
|
||||
)
|
||||
{
|
||||
if (context.glGetString == null) {
|
||||
return string.Empty;
|
||||
}
|
||||
return Marshal.PtrToStringAnsi(context.glGetString(glExtension))!;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static T internalLoadAPI<T>(IntPtr ptr) where T: Delegate
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ptr == IntPtr.Zero) {
|
||||
return null;
|
||||
}
|
||||
T func = Marshal.GetDelegateForFunctionPointer<T>(ptr);
|
||||
return func;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DefaultLog.InternalWriteLog(
|
||||
$"{$"Failed to convert the api {typeof(T).Name}.\n"}{ex.Message}",
|
||||
LogType.Warning);
|
||||
return default;
|
||||
}
|
||||
return Marshal.PtrToStringAnsi((nint)context.glGetString(glExtension))!;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,698 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glContextShadow"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
internal struct glContextShadow
|
||||
{
|
||||
|
||||
internal IntPtr glActiveShaderProgram;
|
||||
internal IntPtr glActiveTexture;
|
||||
internal IntPtr glAttachShader;
|
||||
internal IntPtr glBeginConditionalRender;
|
||||
internal IntPtr glBeginQuery;
|
||||
internal IntPtr glBeginQueryIndexed;
|
||||
internal IntPtr glBeginTransformFeedback;
|
||||
internal IntPtr glBindAttribLocation;
|
||||
internal IntPtr glBindBuffer;
|
||||
internal IntPtr glBindBufferBase;
|
||||
internal IntPtr glBindBufferRange;
|
||||
internal IntPtr glBindBuffersBase;
|
||||
internal IntPtr glBindBuffersRange;
|
||||
internal IntPtr glBindFragDataLocation;
|
||||
internal IntPtr glBindFragDataLocationIndexed;
|
||||
internal IntPtr glBindFramebuffer;
|
||||
internal IntPtr glBindImageTexture;
|
||||
internal IntPtr glBindImageTextures;
|
||||
internal IntPtr glBindProgramPipeline;
|
||||
internal IntPtr glBindRenderbuffer;
|
||||
internal IntPtr glBindSampler;
|
||||
internal IntPtr glBindSamplers;
|
||||
internal IntPtr glBindTexture;
|
||||
internal IntPtr glBindTextures;
|
||||
internal IntPtr glBindTextureUnit;
|
||||
internal IntPtr glBindTransformFeedback;
|
||||
internal IntPtr glBindVertexArray;
|
||||
internal IntPtr glBindVertexBuffer;
|
||||
internal IntPtr glBindVertexBuffers;
|
||||
internal IntPtr glBlendColor;
|
||||
internal IntPtr glBlendEquation;
|
||||
internal IntPtr glBlendEquationi;
|
||||
internal IntPtr glBlendEquationSeparate;
|
||||
internal IntPtr glBlendEquationSeparatei;
|
||||
internal IntPtr glBlendFunc;
|
||||
internal IntPtr glBlendFunci;
|
||||
internal IntPtr glBlendFuncSeparate;
|
||||
internal IntPtr glBlendFuncSeparatei;
|
||||
internal IntPtr glBlitFramebuffer;
|
||||
internal IntPtr glBlitNamedFramebuffer;
|
||||
internal IntPtr glBufferData;
|
||||
internal IntPtr glBufferStorage;
|
||||
internal IntPtr glBufferSubData;
|
||||
internal IntPtr glCheckFramebufferStatus;
|
||||
internal IntPtr glCheckNamedFramebufferStatus;
|
||||
internal IntPtr glClampColor;
|
||||
internal IntPtr glClear;
|
||||
internal IntPtr glClearBufferData;
|
||||
internal IntPtr glClearBufferfi;
|
||||
internal IntPtr glClearBufferfv;
|
||||
internal IntPtr glClearBufferiv;
|
||||
internal IntPtr glClearBufferSubData;
|
||||
internal IntPtr glClearBufferuiv;
|
||||
internal IntPtr glClearColor;
|
||||
internal IntPtr glClearDepth;
|
||||
internal IntPtr glClearDepthf;
|
||||
internal IntPtr glClearNamedBufferData;
|
||||
internal IntPtr glClearNamedBufferSubData;
|
||||
internal IntPtr glClearNamedFramebufferfi;
|
||||
internal IntPtr glClearNamedFramebufferfv;
|
||||
internal IntPtr glClearNamedFramebufferiv;
|
||||
internal IntPtr glClearNamedFramebufferuiv;
|
||||
internal IntPtr glClearStencil;
|
||||
internal IntPtr glClearTexImage;
|
||||
internal IntPtr glClearTexSubImage;
|
||||
internal IntPtr glClientWaitSync;
|
||||
internal IntPtr glClipControl;
|
||||
internal IntPtr glColorMask;
|
||||
internal IntPtr glColorMaski;
|
||||
internal IntPtr glCompileShader;
|
||||
internal IntPtr glCompressedTexImage1D;
|
||||
internal IntPtr glCompressedTexImage2D;
|
||||
internal IntPtr glCompressedTexImage3D;
|
||||
internal IntPtr glCompressedTexSubImage1D;
|
||||
internal IntPtr glCompressedTexSubImage2D;
|
||||
internal IntPtr glCompressedTexSubImage3D;
|
||||
internal IntPtr glCompressedTextureSubImage1D;
|
||||
internal IntPtr glCompressedTextureSubImage2D;
|
||||
internal IntPtr glCompressedTextureSubImage3D;
|
||||
internal IntPtr glCopyBufferSubData;
|
||||
internal IntPtr glCopyImageSubData;
|
||||
internal IntPtr glCopyNamedBufferSubData;
|
||||
internal IntPtr glCopyTexImage1D;
|
||||
internal IntPtr glCopyTexImage2D;
|
||||
internal IntPtr glCopyTexSubImage1D;
|
||||
internal IntPtr glCopyTexSubImage2D;
|
||||
internal IntPtr glCopyTexSubImage3D;
|
||||
internal IntPtr glCopyTextureSubImage1D;
|
||||
internal IntPtr glCopyTextureSubImage2D;
|
||||
internal IntPtr glCopyTextureSubImage3D;
|
||||
internal IntPtr glCreateBuffers;
|
||||
internal IntPtr glCreateFramebuffers;
|
||||
internal IntPtr glCreateProgram;
|
||||
internal IntPtr glCreateProgramPipelines;
|
||||
internal IntPtr glCreateQueries;
|
||||
internal IntPtr glCreateRenderbuffers;
|
||||
internal IntPtr glCreateSamplers;
|
||||
internal IntPtr glCreateShader;
|
||||
internal IntPtr glCreateShaderProgramv;
|
||||
internal IntPtr glCreateTextures;
|
||||
internal IntPtr glCreateTransformFeedbacks;
|
||||
internal IntPtr glCreateVertexArrays;
|
||||
internal IntPtr glCullFace;
|
||||
internal IntPtr glDebugMessageCallback;
|
||||
internal IntPtr glDebugMessageControl;
|
||||
internal IntPtr glDebugMessageInsert;
|
||||
internal IntPtr glDeleteBuffers;
|
||||
internal IntPtr glDeleteFramebuffers;
|
||||
internal IntPtr glDeleteProgram;
|
||||
internal IntPtr glDeleteProgramPipelines;
|
||||
internal IntPtr glDeleteQueries;
|
||||
internal IntPtr glDeleteRenderbuffers;
|
||||
internal IntPtr glDeleteSamplers;
|
||||
internal IntPtr glDeleteShader;
|
||||
internal IntPtr glDeleteSync;
|
||||
internal IntPtr glDeleteTextures;
|
||||
internal IntPtr glDeleteTransformFeedbacks;
|
||||
internal IntPtr glDeleteVertexArrays;
|
||||
internal IntPtr glDepthFunc;
|
||||
internal IntPtr glDepthMask;
|
||||
internal IntPtr glDepthRange;
|
||||
internal IntPtr glDepthRangeArrayv;
|
||||
internal IntPtr glDepthRangef;
|
||||
internal IntPtr glDepthRangeIndexed;
|
||||
internal IntPtr glDetachShader;
|
||||
internal IntPtr glDisable;
|
||||
internal IntPtr glDisablei;
|
||||
internal IntPtr glDisableVertexArrayAttrib;
|
||||
internal IntPtr glDisableVertexAttribArray;
|
||||
internal IntPtr glDispatchCompute;
|
||||
internal IntPtr glDispatchComputeIndirect;
|
||||
internal IntPtr glDrawArrays;
|
||||
internal IntPtr glDrawArraysIndirect;
|
||||
internal IntPtr glDrawArraysInstanced;
|
||||
internal IntPtr glDrawArraysInstancedBaseInstance;
|
||||
internal IntPtr glDrawBuffer;
|
||||
internal IntPtr glDrawBuffers;
|
||||
internal IntPtr glDrawElements;
|
||||
internal IntPtr glDrawElementsBaseVertex;
|
||||
internal IntPtr glDrawElementsIndirect;
|
||||
internal IntPtr glDrawElementsInstanced;
|
||||
internal IntPtr glDrawElementsInstancedBaseInstance;
|
||||
internal IntPtr glDrawElementsInstancedBaseVertex;
|
||||
internal IntPtr glDrawElementsInstancedBaseVertexBaseInstance;
|
||||
internal IntPtr glDrawRangeElements;
|
||||
internal IntPtr glDrawRangeElementsBaseVertex;
|
||||
internal IntPtr glDrawTransformFeedback;
|
||||
internal IntPtr glDrawTransformFeedbackInstanced;
|
||||
internal IntPtr glDrawTransformFeedbackStream;
|
||||
internal IntPtr glDrawTransformFeedbackStreamInstanced;
|
||||
internal IntPtr glEnable;
|
||||
internal IntPtr glEnablei;
|
||||
internal IntPtr glEnableVertexArrayAttrib;
|
||||
internal IntPtr glEnableVertexAttribArray;
|
||||
internal IntPtr glEndConditionalRender;
|
||||
internal IntPtr glEndQuery;
|
||||
internal IntPtr glEndQueryIndexed;
|
||||
internal IntPtr glEndTransformFeedback;
|
||||
internal IntPtr glFenceSync;
|
||||
internal IntPtr glFinish;
|
||||
internal IntPtr glFlush;
|
||||
internal IntPtr glFlushMappedBufferRange;
|
||||
internal IntPtr glFlushMappedNamedBufferRange;
|
||||
internal IntPtr glFramebufferParameteri;
|
||||
internal IntPtr glFramebufferRenderbuffer;
|
||||
internal IntPtr glFramebufferTexture;
|
||||
internal IntPtr glFramebufferTexture1D;
|
||||
internal IntPtr glFramebufferTexture2D;
|
||||
internal IntPtr glFramebufferTexture3D;
|
||||
internal IntPtr glFramebufferTextureLayer;
|
||||
internal IntPtr glFrontFace;
|
||||
internal IntPtr glGenBuffers;
|
||||
internal IntPtr glGenerateMipmap;
|
||||
internal IntPtr glGenerateTextureMipmap;
|
||||
internal IntPtr glGenFramebuffers;
|
||||
internal IntPtr glGenProgramPipelines;
|
||||
internal IntPtr glGenQueries;
|
||||
internal IntPtr glGenRenderbuffers;
|
||||
internal IntPtr glGenSamplers;
|
||||
internal IntPtr glGenTextures;
|
||||
internal IntPtr glGenTransformFeedbacks;
|
||||
internal IntPtr glGenVertexArrays;
|
||||
internal IntPtr glGetActiveAtomicCounterBufferiv;
|
||||
internal IntPtr glGetActiveAttrib;
|
||||
internal IntPtr glGetActiveSubroutineName;
|
||||
internal IntPtr glGetActiveSubroutineUniformiv;
|
||||
internal IntPtr glGetActiveSubroutineUniformName;
|
||||
internal IntPtr glGetActiveUniform;
|
||||
internal IntPtr glGetActiveUniformBlockiv;
|
||||
internal IntPtr glGetActiveUniformBlockName;
|
||||
internal IntPtr glGetActiveUniformName;
|
||||
internal IntPtr glGetActiveUniformsiv;
|
||||
internal IntPtr glGetAttachedShaders;
|
||||
internal IntPtr glGetAttribLocation;
|
||||
internal IntPtr glGetBooleani_v;
|
||||
internal IntPtr glGetBooleanv;
|
||||
internal IntPtr glGetBufferParameteri64v;
|
||||
internal IntPtr glGetBufferParameteriv;
|
||||
internal IntPtr glGetBufferPointerv;
|
||||
internal IntPtr glGetBufferSubData;
|
||||
internal IntPtr glGetCompressedTexImage;
|
||||
internal IntPtr glGetCompressedTextureImage;
|
||||
internal IntPtr glGetCompressedTextureSubImage;
|
||||
internal IntPtr glGetDebugMessageLog;
|
||||
internal IntPtr glGetDoublei_v;
|
||||
internal IntPtr glGetDoublev;
|
||||
internal IntPtr glGetError;
|
||||
internal IntPtr glGetFloati_v;
|
||||
internal IntPtr glGetFloatv;
|
||||
internal IntPtr glGetFragDataIndex;
|
||||
internal IntPtr glGetFragDataLocation;
|
||||
internal IntPtr glGetFramebufferAttachmentParameteriv;
|
||||
internal IntPtr glGetFramebufferParameteriv;
|
||||
internal IntPtr glGetGraphicsResetStatus;
|
||||
internal IntPtr glGetInteger64i_v;
|
||||
internal IntPtr glGetInteger64v;
|
||||
internal IntPtr glGetIntegeri_v;
|
||||
internal IntPtr glGetIntegerv;
|
||||
internal IntPtr glGetInternalformati64v;
|
||||
internal IntPtr glGetInternalformativ;
|
||||
internal IntPtr glGetMultisamplefv;
|
||||
internal IntPtr glGetNamedBufferParameteri64v;
|
||||
internal IntPtr glGetNamedBufferParameteriv;
|
||||
internal IntPtr glGetNamedBufferPointerv;
|
||||
internal IntPtr glGetNamedBufferSubData;
|
||||
internal IntPtr glGetNamedFramebufferAttachmentParameteriv;
|
||||
internal IntPtr glGetNamedFramebufferParameteriv;
|
||||
internal IntPtr glGetNamedRenderbufferParameteriv;
|
||||
internal IntPtr glGetnCompressedTexImage;
|
||||
internal IntPtr glGetnTexImage;
|
||||
internal IntPtr glGetnUniformdv;
|
||||
internal IntPtr glGetnUniformfv;
|
||||
internal IntPtr glGetnUniformiv;
|
||||
internal IntPtr glGetnUniformuiv;
|
||||
internal IntPtr glGetObjectLabel;
|
||||
internal IntPtr glGetObjectPtrLabel;
|
||||
internal IntPtr glGetPointerv;
|
||||
internal IntPtr glGetProgramBinary;
|
||||
internal IntPtr glGetProgramInfoLog;
|
||||
internal IntPtr glGetProgramInterfaceiv;
|
||||
internal IntPtr glGetProgramiv;
|
||||
internal IntPtr glGetProgramPipelineInfoLog;
|
||||
internal IntPtr glGetProgramPipelineiv;
|
||||
internal IntPtr glGetProgramResourceIndex;
|
||||
internal IntPtr glGetProgramResourceiv;
|
||||
internal IntPtr glGetProgramResourceLocation;
|
||||
internal IntPtr glGetProgramResourceLocationIndex;
|
||||
internal IntPtr glGetProgramResourceName;
|
||||
internal IntPtr glGetProgramStageiv;
|
||||
internal IntPtr glGetQueryBufferObjecti64v;
|
||||
internal IntPtr glGetQueryBufferObjectiv;
|
||||
internal IntPtr glGetQueryBufferObjectui64v;
|
||||
internal IntPtr glGetQueryBufferObjectuiv;
|
||||
internal IntPtr glGetQueryIndexediv;
|
||||
internal IntPtr glGetQueryiv;
|
||||
internal IntPtr glGetQueryObjecti64v;
|
||||
internal IntPtr glGetQueryObjectiv;
|
||||
internal IntPtr glGetQueryObjectui64v;
|
||||
internal IntPtr glGetQueryObjectuiv;
|
||||
internal IntPtr glGetRenderbufferParameteriv;
|
||||
internal IntPtr glGetSamplerParameterfv;
|
||||
internal IntPtr glGetSamplerParameterIiv;
|
||||
internal IntPtr glGetSamplerParameterIuiv;
|
||||
internal IntPtr glGetSamplerParameteriv;
|
||||
internal IntPtr glGetShaderInfoLog;
|
||||
internal IntPtr glGetShaderiv;
|
||||
internal IntPtr glGetShaderPrecisionFormat;
|
||||
internal IntPtr glGetShaderSource;
|
||||
internal IntPtr glGetString;
|
||||
internal IntPtr glGetStringi;
|
||||
internal IntPtr glGetSubroutineIndex;
|
||||
internal IntPtr glGetSubroutineUniformLocation;
|
||||
internal IntPtr glGetSynciv;
|
||||
internal IntPtr glGetTexImage;
|
||||
internal IntPtr glGetTexLevelParameterfv;
|
||||
internal IntPtr glGetTexLevelParameteriv;
|
||||
internal IntPtr glGetTexParameterfv;
|
||||
internal IntPtr glGetTexParameterIiv;
|
||||
internal IntPtr glGetTexParameterIuiv;
|
||||
internal IntPtr glGetTexParameteriv;
|
||||
internal IntPtr glGetTextureImage;
|
||||
internal IntPtr glGetTextureLevelParameterfv;
|
||||
internal IntPtr glGetTextureLevelParameteriv;
|
||||
internal IntPtr glGetTextureParameterfv;
|
||||
internal IntPtr glGetTextureParameterIiv;
|
||||
internal IntPtr glGetTextureParameterIuiv;
|
||||
internal IntPtr glGetTextureParameteriv;
|
||||
internal IntPtr glGetTextureSubImage;
|
||||
internal IntPtr glGetTransformFeedbacki_v;
|
||||
internal IntPtr glGetTransformFeedbacki64_v;
|
||||
internal IntPtr glGetTransformFeedbackiv;
|
||||
internal IntPtr glGetTransformFeedbackVarying;
|
||||
internal IntPtr glGetUniformBlockIndex;
|
||||
internal IntPtr glGetUniformdv;
|
||||
internal IntPtr glGetUniformfv;
|
||||
internal IntPtr glGetUniformIndices;
|
||||
internal IntPtr glGetUniformiv;
|
||||
internal IntPtr glGetUniformLocation;
|
||||
internal IntPtr glGetUniformSubroutineuiv;
|
||||
internal IntPtr glGetUniformuiv;
|
||||
internal IntPtr glGetVertexArrayIndexed64iv;
|
||||
internal IntPtr glGetVertexArrayIndexediv;
|
||||
internal IntPtr glGetVertexArrayiv;
|
||||
internal IntPtr glGetVertexAttribdv;
|
||||
internal IntPtr glGetVertexAttribfv;
|
||||
internal IntPtr glGetVertexAttribIiv;
|
||||
internal IntPtr glGetVertexAttribIuiv;
|
||||
internal IntPtr glGetVertexAttribiv;
|
||||
internal IntPtr glGetVertexAttribLdv;
|
||||
internal IntPtr glGetVertexAttribPointerv;
|
||||
internal IntPtr glHint;
|
||||
internal IntPtr glInvalidateBufferData;
|
||||
internal IntPtr glInvalidateBufferSubData;
|
||||
internal IntPtr glInvalidateFramebuffer;
|
||||
internal IntPtr glInvalidateNamedFramebufferData;
|
||||
internal IntPtr glInvalidateNamedFramebufferSubData;
|
||||
internal IntPtr glInvalidateSubFramebuffer;
|
||||
internal IntPtr glInvalidateTexImage;
|
||||
internal IntPtr glInvalidateTexSubImage;
|
||||
internal IntPtr glIsBuffer;
|
||||
internal IntPtr glIsEnabled;
|
||||
internal IntPtr glIsEnabledi;
|
||||
internal IntPtr glIsFramebuffer;
|
||||
internal IntPtr glIsProgram;
|
||||
internal IntPtr glIsProgramPipeline;
|
||||
internal IntPtr glIsQuery;
|
||||
internal IntPtr glIsRenderbuffer;
|
||||
internal IntPtr glIsSampler;
|
||||
internal IntPtr glIsShader;
|
||||
internal IntPtr glIsSync;
|
||||
internal IntPtr glIsTexture;
|
||||
internal IntPtr glIsTransformFeedback;
|
||||
internal IntPtr glIsVertexArray;
|
||||
internal IntPtr glLineWidth;
|
||||
internal IntPtr glLinkProgram;
|
||||
internal IntPtr glLogicOp;
|
||||
internal IntPtr glMapBuffer;
|
||||
internal IntPtr glMapBufferRange;
|
||||
internal IntPtr glMapNamedBuffer;
|
||||
internal IntPtr glMapNamedBufferRange;
|
||||
internal IntPtr glMemoryBarrier;
|
||||
internal IntPtr glMemoryBarrierByRegion;
|
||||
internal IntPtr glMinSampleShading;
|
||||
internal IntPtr glMultiDrawArrays;
|
||||
internal IntPtr glMultiDrawArraysIndirect;
|
||||
internal IntPtr glMultiDrawArraysIndirectCount;
|
||||
internal IntPtr glMultiDrawElements;
|
||||
internal IntPtr glMultiDrawElementsBaseVertex;
|
||||
internal IntPtr glMultiDrawElementsIndirect;
|
||||
internal IntPtr glMultiDrawElementsIndirectCount;
|
||||
internal IntPtr glNamedBufferData;
|
||||
internal IntPtr glNamedBufferStorage;
|
||||
internal IntPtr glNamedBufferSubData;
|
||||
internal IntPtr glNamedFramebufferDrawBuffer;
|
||||
internal IntPtr glNamedFramebufferDrawBuffers;
|
||||
internal IntPtr glNamedFramebufferParameteri;
|
||||
internal IntPtr glNamedFramebufferReadBuffer;
|
||||
internal IntPtr glNamedFramebufferRenderbuffer;
|
||||
internal IntPtr glNamedFramebufferTexture;
|
||||
internal IntPtr glNamedFramebufferTextureLayer;
|
||||
internal IntPtr glNamedRenderbufferStorage;
|
||||
internal IntPtr glNamedRenderbufferStorageMultisample;
|
||||
internal IntPtr glObjectLabel;
|
||||
internal IntPtr glObjectPtrLabel;
|
||||
internal IntPtr glPatchParameterfv;
|
||||
internal IntPtr glPatchParameteri;
|
||||
internal IntPtr glPauseTransformFeedback;
|
||||
internal IntPtr glPixelStoref;
|
||||
internal IntPtr glPixelStorei;
|
||||
internal IntPtr glPointParameterf;
|
||||
internal IntPtr glPointParameterfv;
|
||||
internal IntPtr glPointParameteri;
|
||||
internal IntPtr glPointParameteriv;
|
||||
internal IntPtr glPointSize;
|
||||
internal IntPtr glPolygonMode;
|
||||
internal IntPtr glPolygonOffset;
|
||||
internal IntPtr glPolygonOffsetClamp;
|
||||
internal IntPtr glPopDebugGroup;
|
||||
internal IntPtr glPrimitiveRestartIndex;
|
||||
internal IntPtr glProgramBinary;
|
||||
internal IntPtr glProgramParameteri;
|
||||
internal IntPtr glProgramUniform1d;
|
||||
internal IntPtr glProgramUniform1dv;
|
||||
internal IntPtr glProgramUniform1f;
|
||||
internal IntPtr glProgramUniform1fv;
|
||||
internal IntPtr glProgramUniform1i;
|
||||
internal IntPtr glProgramUniform1iv;
|
||||
internal IntPtr glProgramUniform1ui;
|
||||
internal IntPtr glProgramUniform1uiv;
|
||||
internal IntPtr glProgramUniform2d;
|
||||
internal IntPtr glProgramUniform2dv;
|
||||
internal IntPtr glProgramUniform2f;
|
||||
internal IntPtr glProgramUniform2fv;
|
||||
internal IntPtr glProgramUniform2i;
|
||||
internal IntPtr glProgramUniform2iv;
|
||||
internal IntPtr glProgramUniform2ui;
|
||||
internal IntPtr glProgramUniform2uiv;
|
||||
internal IntPtr glProgramUniform3d;
|
||||
internal IntPtr glProgramUniform3dv;
|
||||
internal IntPtr glProgramUniform3f;
|
||||
internal IntPtr glProgramUniform3fv;
|
||||
internal IntPtr glProgramUniform3i;
|
||||
internal IntPtr glProgramUniform3iv;
|
||||
internal IntPtr glProgramUniform3ui;
|
||||
internal IntPtr glProgramUniform3uiv;
|
||||
internal IntPtr glProgramUniform4d;
|
||||
internal IntPtr glProgramUniform4dv;
|
||||
internal IntPtr glProgramUniform4f;
|
||||
internal IntPtr glProgramUniform4fv;
|
||||
internal IntPtr glProgramUniform4i;
|
||||
internal IntPtr glProgramUniform4iv;
|
||||
internal IntPtr glProgramUniform4ui;
|
||||
internal IntPtr glProgramUniform4uiv;
|
||||
internal IntPtr glProgramUniformMatrix2dv;
|
||||
internal IntPtr glProgramUniformMatrix2fv;
|
||||
internal IntPtr glProgramUniformMatrix2x3dv;
|
||||
internal IntPtr glProgramUniformMatrix2x3fv;
|
||||
internal IntPtr glProgramUniformMatrix2x4dv;
|
||||
internal IntPtr glProgramUniformMatrix2x4fv;
|
||||
internal IntPtr glProgramUniformMatrix3dv;
|
||||
internal IntPtr glProgramUniformMatrix3fv;
|
||||
internal IntPtr glProgramUniformMatrix3x2dv;
|
||||
internal IntPtr glProgramUniformMatrix3x2fv;
|
||||
internal IntPtr glProgramUniformMatrix3x4dv;
|
||||
internal IntPtr glProgramUniformMatrix3x4fv;
|
||||
internal IntPtr glProgramUniformMatrix4dv;
|
||||
internal IntPtr glProgramUniformMatrix4fv;
|
||||
internal IntPtr glProgramUniformMatrix4x2dv;
|
||||
internal IntPtr glProgramUniformMatrix4x2fv;
|
||||
internal IntPtr glProgramUniformMatrix4x3dv;
|
||||
internal IntPtr glProgramUniformMatrix4x3fv;
|
||||
internal IntPtr glProvokingVertex;
|
||||
internal IntPtr glPushDebugGroup;
|
||||
internal IntPtr glQueryCounter;
|
||||
internal IntPtr glReadBuffer;
|
||||
internal IntPtr glReadnPixels;
|
||||
internal IntPtr glReadPixels;
|
||||
internal IntPtr glReleaseShaderCompiler;
|
||||
internal IntPtr glRenderbufferStorage;
|
||||
internal IntPtr glRenderbufferStorageMultisample;
|
||||
internal IntPtr glResumeTransformFeedback;
|
||||
internal IntPtr glSampleCoverage;
|
||||
internal IntPtr glSampleMaski;
|
||||
internal IntPtr glSamplerParameterf;
|
||||
internal IntPtr glSamplerParameterfv;
|
||||
internal IntPtr glSamplerParameteri;
|
||||
internal IntPtr glSamplerParameterIiv;
|
||||
internal IntPtr glSamplerParameterIuiv;
|
||||
internal IntPtr glSamplerParameteriv;
|
||||
internal IntPtr glScissor;
|
||||
internal IntPtr glScissorArrayv;
|
||||
internal IntPtr glScissorIndexed;
|
||||
internal IntPtr glScissorIndexedv;
|
||||
internal IntPtr glShaderBinary;
|
||||
internal IntPtr glShaderSource;
|
||||
internal IntPtr glShaderStorageBlockBinding;
|
||||
internal IntPtr glSpecializeShader;
|
||||
internal IntPtr glStencilFunc;
|
||||
internal IntPtr glStencilFuncSeparate;
|
||||
internal IntPtr glStencilMask;
|
||||
internal IntPtr glStencilMaskSeparate;
|
||||
internal IntPtr glStencilOp;
|
||||
internal IntPtr glStencilOpSeparate;
|
||||
internal IntPtr glTexBuffer;
|
||||
internal IntPtr glTexBufferRange;
|
||||
internal IntPtr glTexImage1D;
|
||||
internal IntPtr glTexImage2D;
|
||||
internal IntPtr glTexImage2DMultisample;
|
||||
internal IntPtr glTexImage3D;
|
||||
internal IntPtr glTexImage3DMultisample;
|
||||
internal IntPtr glTexParameterf;
|
||||
internal IntPtr glTexParameterfv;
|
||||
internal IntPtr glTexParameteri;
|
||||
internal IntPtr glTexParameterIiv;
|
||||
internal IntPtr glTexParameterIuiv;
|
||||
internal IntPtr glTexParameteriv;
|
||||
internal IntPtr glTexStorage1D;
|
||||
internal IntPtr glTexStorage2D;
|
||||
internal IntPtr glTexStorage2DMultisample;
|
||||
internal IntPtr glTexStorage3D;
|
||||
internal IntPtr glTexStorage3DMultisample;
|
||||
internal IntPtr glTexSubImage1D;
|
||||
internal IntPtr glTexSubImage2D;
|
||||
internal IntPtr glTexSubImage3D;
|
||||
internal IntPtr glTextureBarrier;
|
||||
internal IntPtr glTextureBuffer;
|
||||
internal IntPtr glTextureBufferRange;
|
||||
internal IntPtr glTextureParameterf;
|
||||
internal IntPtr glTextureParameterfv;
|
||||
internal IntPtr glTextureParameteri;
|
||||
internal IntPtr glTextureParameterIiv;
|
||||
internal IntPtr glTextureParameterIuiv;
|
||||
internal IntPtr glTextureParameteriv;
|
||||
internal IntPtr glTextureStorage1D;
|
||||
internal IntPtr glTextureStorage2D;
|
||||
internal IntPtr glTextureStorage2DMultisample;
|
||||
internal IntPtr glTextureStorage3D;
|
||||
internal IntPtr glTextureStorage3DMultisample;
|
||||
internal IntPtr glTextureSubImage1D;
|
||||
internal IntPtr glTextureSubImage2D;
|
||||
internal IntPtr glTextureSubImage3D;
|
||||
internal IntPtr glTextureView;
|
||||
internal IntPtr glTransformFeedbackBufferBase;
|
||||
internal IntPtr glTransformFeedbackBufferRange;
|
||||
internal IntPtr glTransformFeedbackVaryings;
|
||||
internal IntPtr glUniform1d;
|
||||
internal IntPtr glUniform1dv;
|
||||
internal IntPtr glUniform1f;
|
||||
internal IntPtr glUniform1fv;
|
||||
internal IntPtr glUniform1i;
|
||||
internal IntPtr glUniform1iv;
|
||||
internal IntPtr glUniform1ui;
|
||||
internal IntPtr glUniform1uiv;
|
||||
internal IntPtr glUniform2d;
|
||||
internal IntPtr glUniform2dv;
|
||||
internal IntPtr glUniform2f;
|
||||
internal IntPtr glUniform2fv;
|
||||
internal IntPtr glUniform2i;
|
||||
internal IntPtr glUniform2iv;
|
||||
internal IntPtr glUniform2ui;
|
||||
internal IntPtr glUniform2uiv;
|
||||
internal IntPtr glUniform3d;
|
||||
internal IntPtr glUniform3dv;
|
||||
internal IntPtr glUniform3f;
|
||||
internal IntPtr glUniform3fv;
|
||||
internal IntPtr glUniform3i;
|
||||
internal IntPtr glUniform3iv;
|
||||
internal IntPtr glUniform3ui;
|
||||
internal IntPtr glUniform3uiv;
|
||||
internal IntPtr glUniform4d;
|
||||
internal IntPtr glUniform4dv;
|
||||
internal IntPtr glUniform4f;
|
||||
internal IntPtr glUniform4fv;
|
||||
internal IntPtr glUniform4i;
|
||||
internal IntPtr glUniform4iv;
|
||||
internal IntPtr glUniform4ui;
|
||||
internal IntPtr glUniform4uiv;
|
||||
internal IntPtr glUniformBlockBinding;
|
||||
internal IntPtr glUniformMatrix2dv;
|
||||
internal IntPtr glUniformMatrix2fv;
|
||||
internal IntPtr glUniformMatrix2x3dv;
|
||||
internal IntPtr glUniformMatrix2x3fv;
|
||||
internal IntPtr glUniformMatrix2x4dv;
|
||||
internal IntPtr glUniformMatrix2x4fv;
|
||||
internal IntPtr glUniformMatrix3dv;
|
||||
internal IntPtr glUniformMatrix3fv;
|
||||
internal IntPtr glUniformMatrix3x2dv;
|
||||
internal IntPtr glUniformMatrix3x2fv;
|
||||
internal IntPtr glUniformMatrix3x4dv;
|
||||
internal IntPtr glUniformMatrix3x4fv;
|
||||
internal IntPtr glUniformMatrix4dv;
|
||||
internal IntPtr glUniformMatrix4fv;
|
||||
internal IntPtr glUniformMatrix4x2dv;
|
||||
internal IntPtr glUniformMatrix4x2fv;
|
||||
internal IntPtr glUniformMatrix4x3dv;
|
||||
internal IntPtr glUniformMatrix4x3fv;
|
||||
internal IntPtr glUniformSubroutinesuiv;
|
||||
internal IntPtr glUnmapBuffer;
|
||||
internal IntPtr glUnmapNamedBuffer;
|
||||
internal IntPtr glUseProgram;
|
||||
internal IntPtr glUseProgramStages;
|
||||
internal IntPtr glValidateProgram;
|
||||
internal IntPtr glValidateProgramPipeline;
|
||||
internal IntPtr glVertexArrayAttribBinding;
|
||||
internal IntPtr glVertexArrayAttribFormat;
|
||||
internal IntPtr glVertexArrayAttribIFormat;
|
||||
internal IntPtr glVertexArrayAttribLFormat;
|
||||
internal IntPtr glVertexArrayBindingDivisor;
|
||||
internal IntPtr glVertexArrayElementBuffer;
|
||||
internal IntPtr glVertexArrayVertexBuffer;
|
||||
internal IntPtr glVertexArrayVertexBuffers;
|
||||
internal IntPtr glVertexAttrib1d;
|
||||
internal IntPtr glVertexAttrib1dv;
|
||||
internal IntPtr glVertexAttrib1f;
|
||||
internal IntPtr glVertexAttrib1fv;
|
||||
internal IntPtr glVertexAttrib1s;
|
||||
internal IntPtr glVertexAttrib1sv;
|
||||
internal IntPtr glVertexAttrib2d;
|
||||
internal IntPtr glVertexAttrib2dv;
|
||||
internal IntPtr glVertexAttrib2f;
|
||||
internal IntPtr glVertexAttrib2fv;
|
||||
internal IntPtr glVertexAttrib2s;
|
||||
internal IntPtr glVertexAttrib2sv;
|
||||
internal IntPtr glVertexAttrib3d;
|
||||
internal IntPtr glVertexAttrib3dv;
|
||||
internal IntPtr glVertexAttrib3f;
|
||||
internal IntPtr glVertexAttrib3fv;
|
||||
internal IntPtr glVertexAttrib3s;
|
||||
internal IntPtr glVertexAttrib3sv;
|
||||
internal IntPtr glVertexAttrib4bv;
|
||||
internal IntPtr glVertexAttrib4d;
|
||||
internal IntPtr glVertexAttrib4dv;
|
||||
internal IntPtr glVertexAttrib4f;
|
||||
internal IntPtr glVertexAttrib4fv;
|
||||
internal IntPtr glVertexAttrib4iv;
|
||||
internal IntPtr glVertexAttrib4Nbv;
|
||||
internal IntPtr glVertexAttrib4Niv;
|
||||
internal IntPtr glVertexAttrib4Nsv;
|
||||
internal IntPtr glVertexAttrib4Nub;
|
||||
internal IntPtr glVertexAttrib4Nubv;
|
||||
internal IntPtr glVertexAttrib4Nuiv;
|
||||
internal IntPtr glVertexAttrib4Nusv;
|
||||
internal IntPtr glVertexAttrib4s;
|
||||
internal IntPtr glVertexAttrib4sv;
|
||||
internal IntPtr glVertexAttrib4ubv;
|
||||
internal IntPtr glVertexAttrib4uiv;
|
||||
internal IntPtr glVertexAttrib4usv;
|
||||
internal IntPtr glVertexAttribBinding;
|
||||
internal IntPtr glVertexAttribDivisor;
|
||||
internal IntPtr glVertexAttribFormat;
|
||||
internal IntPtr glVertexAttribI1i;
|
||||
internal IntPtr glVertexAttribI1iv;
|
||||
internal IntPtr glVertexAttribI1ui;
|
||||
internal IntPtr glVertexAttribI1uiv;
|
||||
internal IntPtr glVertexAttribI2i;
|
||||
internal IntPtr glVertexAttribI2iv;
|
||||
internal IntPtr glVertexAttribI2ui;
|
||||
internal IntPtr glVertexAttribI2uiv;
|
||||
internal IntPtr glVertexAttribI3i;
|
||||
internal IntPtr glVertexAttribI3iv;
|
||||
internal IntPtr glVertexAttribI3ui;
|
||||
internal IntPtr glVertexAttribI3uiv;
|
||||
internal IntPtr glVertexAttribI4bv;
|
||||
internal IntPtr glVertexAttribI4i;
|
||||
internal IntPtr glVertexAttribI4iv;
|
||||
internal IntPtr glVertexAttribI4sv;
|
||||
internal IntPtr glVertexAttribI4ubv;
|
||||
internal IntPtr glVertexAttribI4ui;
|
||||
internal IntPtr glVertexAttribI4uiv;
|
||||
internal IntPtr glVertexAttribI4usv;
|
||||
internal IntPtr glVertexAttribIFormat;
|
||||
internal IntPtr glVertexAttribIPointer;
|
||||
internal IntPtr glVertexAttribL1d;
|
||||
internal IntPtr glVertexAttribL1dv;
|
||||
internal IntPtr glVertexAttribL2d;
|
||||
internal IntPtr glVertexAttribL2dv;
|
||||
internal IntPtr glVertexAttribL3d;
|
||||
internal IntPtr glVertexAttribL3dv;
|
||||
internal IntPtr glVertexAttribL4d;
|
||||
internal IntPtr glVertexAttribL4dv;
|
||||
internal IntPtr glVertexAttribLFormat;
|
||||
internal IntPtr glVertexAttribLPointer;
|
||||
internal IntPtr glVertexAttribP1ui;
|
||||
internal IntPtr glVertexAttribP1uiv;
|
||||
internal IntPtr glVertexAttribP2ui;
|
||||
internal IntPtr glVertexAttribP2uiv;
|
||||
internal IntPtr glVertexAttribP3ui;
|
||||
internal IntPtr glVertexAttribP3uiv;
|
||||
internal IntPtr glVertexAttribP4ui;
|
||||
internal IntPtr glVertexAttribP4uiv;
|
||||
internal IntPtr glVertexAttribPointer;
|
||||
internal IntPtr glVertexBindingDivisor;
|
||||
internal IntPtr glViewport;
|
||||
internal IntPtr glViewportArrayv;
|
||||
internal IntPtr glViewportIndexedf;
|
||||
internal IntPtr glViewportIndexedfv;
|
||||
internal IntPtr glWaitSync;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glFunction"
|
||||
// Project: StgSharp
|
||||
@@ -92,13 +92,17 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ActiveTextureUnit(uint type)
|
||||
public void ActiveTextureUnit(
|
||||
uint type
|
||||
)
|
||||
{
|
||||
Context.glActiveTexture(type);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
public void Assert(bool shouldReportWhenNormal)
|
||||
public void Assert(
|
||||
bool shouldReportWhenNormal
|
||||
)
|
||||
{
|
||||
uint code = Context.glGetError();
|
||||
if (code != glConst.NO_ERROR) {
|
||||
@@ -110,20 +114,17 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void AttachShader(GlHandle program, GlHandle shader)
|
||||
{
|
||||
Context.glAttachShader(program.Value, shader.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindBuffer(BufferType bufferType, GlHandle handle)
|
||||
public void BindBuffer(
|
||||
BufferType bufferType,
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
Context.glBindBuffer((uint)bufferType, handle.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bind a frame BufferHandle to a frame BufferHandle target Same function as <see ///
|
||||
/// href="https://docs._gl/gl3/glBindFramebuffer">glBindFramebuffer</see>.
|
||||
/// href="https://docs._gl/gl3/glBindFramebuffer"> glBindFramebuffer </see>.
|
||||
/// </summary>
|
||||
/// <param _label="target">
|
||||
/// The frame BufferHandle target of the binding operation.
|
||||
@@ -132,47 +133,46 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// The handle of the frame BufferHandle object to bind.
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindFrameBuffer(FrameBufferTarget target, GlHandle handle)
|
||||
public void BindFrameBuffer(
|
||||
FrameBufferTarget target,
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
Context.glBindFramebuffer((uint)target, handle.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindRenderBuffer(GlHandle handle)
|
||||
public void BindRenderBuffer(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
Context.glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindTexture(uint type, GlHandle texture)
|
||||
{
|
||||
Context.glBindTexture(type, texture.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindVertexArray(GlHandle handle)
|
||||
public void BindVertexArray(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
Context.glBindVertexArray(handle.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public FrameBufferStatus CheckFrameBufferStatus(FrameBufferTarget target)
|
||||
public FrameBufferStatus CheckFrameBufferStatus(
|
||||
FrameBufferTarget target
|
||||
)
|
||||
{
|
||||
return (FrameBufferStatus)Context.glCheckFramebufferStatus((uint)target);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Clear(MaskBufferBit mask)
|
||||
public void Clear(
|
||||
MaskBufferBit mask
|
||||
)
|
||||
{
|
||||
Context.glClear((uint)mask);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
Context.glClearColor(R, G, B, A);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ClearError()
|
||||
{
|
||||
@@ -199,16 +199,13 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CombineFrameBufferRenderBuffer(FrameBufferAttachment attachment, GlHandle rboHandle)
|
||||
public void CombineFrameBufferRenderBuffer(
|
||||
FrameBufferAttachment attachment,
|
||||
GlHandle rboHandle
|
||||
)
|
||||
{
|
||||
Context.glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment, glConst.RENDERBUFFER,
|
||||
rboHandle.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CompileShader(GlHandle shaderhandle)
|
||||
{
|
||||
Context.glCompileShader(shaderhandle.Value);
|
||||
Context.glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment,
|
||||
glConst.RENDERBUFFER, rboHandle.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -218,13 +215,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public GlHandle CreateProgram()
|
||||
{
|
||||
return GlHandle.Create(Context.glCreateProgram());
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe GlHandle[] CreateProgram(int count)
|
||||
public unsafe GlHandle[] CreateProgram(
|
||||
int count
|
||||
)
|
||||
{
|
||||
GlHandle[] h = new GlHandle[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
@@ -234,7 +227,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public GlHandle[] CreateShaderSet(int count, ShaderType type)
|
||||
public GlHandle[] CreateShaderSet(
|
||||
int count,
|
||||
ShaderType type
|
||||
)
|
||||
{
|
||||
GlHandle[] ret = new GlHandle[count];
|
||||
uint t = (uint)type;
|
||||
@@ -252,13 +248,17 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void DeleteBuffer(GlHandle handle)
|
||||
public unsafe void DeleteBuffer(
|
||||
GlHandle handle
|
||||
)
|
||||
{
|
||||
Context.glDeleteBuffers(1, (uint*)&handle);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void DeleteBuffers(GlHandle[] handle)
|
||||
public unsafe void DeleteBuffers(
|
||||
GlHandle[] handle
|
||||
)
|
||||
{
|
||||
if ((handle == null) || (handle.Length == 0)) {
|
||||
throw new ArgumentNullException(nameof(handle));
|
||||
@@ -274,19 +274,24 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
/// <summary>
|
||||
/// Delete a render BufferHandle object Very simlilar function as <see ///
|
||||
/// href="https://docs.gl/gl3/glDeleteRenderbuffers">glDeleteRenderbuffers</see>. The only
|
||||
/// deifference is that this mehtod can only delete one renderbuffer at the same time.
|
||||
/// href="https://docs.gl/gl3/glDeleteRenderbuffers"> glDeleteRenderbuffers </see>. The
|
||||
/// only deifference is that this mehtod can only delete one renderbuffer at the same
|
||||
/// time.
|
||||
/// </summary>
|
||||
/// <param _label="bufferHandle">
|
||||
/// Handle to BufferHandle to delete.
|
||||
/// </param>
|
||||
public unsafe void DeleteRenderBuffer(GlHandle bufferHandle)
|
||||
public unsafe void DeleteRenderBuffer(
|
||||
GlHandle bufferHandle
|
||||
)
|
||||
{
|
||||
Context.glDeleteRenderbuffers(1, &bufferHandle.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void DeleteVertexArrays(GlHandle[] arrays)
|
||||
public unsafe void DeleteVertexArrays(
|
||||
GlHandle[] arrays
|
||||
)
|
||||
{
|
||||
fixed (GlHandle* hptr = arrays)
|
||||
{
|
||||
@@ -297,25 +302,38 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
}
|
||||
|
||||
public void DepthMaskAccess(bool isWrite)
|
||||
public void DepthMaskAccess(
|
||||
bool isWrite
|
||||
)
|
||||
{
|
||||
Context.glDepthMask(isWrite);
|
||||
Context.glDepthMask(isWrite ? (byte)1 : (byte)0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Disable(glOperation operation)
|
||||
public void Disable(
|
||||
glOperation operation
|
||||
)
|
||||
{
|
||||
Context.glDisable((uint)operation);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void DrawArrays(GeometryType mode, int first, uint count)
|
||||
public unsafe void DrawArrays(
|
||||
GeometryType mode,
|
||||
int first,
|
||||
int count
|
||||
)
|
||||
{
|
||||
Context.glDrawArrays((uint)mode, first, count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void DrawElements(GeometryType mode, uint count, TypeCode type, IntPtr ptr)
|
||||
public unsafe void DrawElements(
|
||||
GeometryType mode,
|
||||
int count,
|
||||
TypeCode type,
|
||||
IntPtr ptr
|
||||
)
|
||||
{
|
||||
uint a;
|
||||
a = type switch
|
||||
@@ -326,37 +344,34 @@ namespace StgSharp.Graphics.OpenGL
|
||||
_ => throw new ArgumentException(
|
||||
$"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}")
|
||||
};
|
||||
Context.glDrawElements((uint)mode, count, a, (void*)ptr);
|
||||
Context.glDrawElements((uint)mode, count, a, (nint*)ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawElementsInstanced(GeometryType mode, uint count, TypeCode type, IntPtr ptr, uint amount)
|
||||
public void DrawElementsInstanced(
|
||||
GeometryType mode,
|
||||
int count,
|
||||
TypeCode type,
|
||||
IntPtr ptr,
|
||||
int amount
|
||||
)
|
||||
{
|
||||
uint a;
|
||||
switch (type)
|
||||
a = type switch
|
||||
{
|
||||
case TypeCode.UInt32:
|
||||
a = glConst.UNSIGNED_INT;
|
||||
break;
|
||||
|
||||
case TypeCode.UInt16:
|
||||
a = glConst.UNSIGNED_SHORT;
|
||||
break;
|
||||
|
||||
case TypeCode.Byte:
|
||||
a = glConst.UNSIGNED_BYTE;
|
||||
break;
|
||||
default:
|
||||
DefaultLog.InternalWriteLog(
|
||||
$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}",
|
||||
LogType.Error);
|
||||
return;
|
||||
}
|
||||
Context.glDrawElementsInstanced((uint)mode, count, a, (void*)ptr, amount);
|
||||
TypeCode.UInt32 => glConst.UNSIGNED_INT,
|
||||
TypeCode.UInt16 => glConst.UNSIGNED_SHORT,
|
||||
TypeCode.Byte => glConst.UNSIGNED_BYTE,
|
||||
_ => throw new ArgumentException(
|
||||
$"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}")
|
||||
};
|
||||
Context.glDrawElementsInstanced((uint)mode, count, a, (nint*)ptr, amount);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enable(glOperation operation)
|
||||
public void Enable(
|
||||
glOperation operation
|
||||
)
|
||||
{
|
||||
Context.glEnable((uint)operation);
|
||||
}
|
||||
@@ -367,13 +382,17 @@ namespace StgSharp.Graphics.OpenGL
|
||||
uint attachment,
|
||||
Texture2DTarget texTarget,
|
||||
GlHandle textureHandle,
|
||||
int level)
|
||||
int level
|
||||
)
|
||||
{
|
||||
Context.glFramebufferTexture2D((uint)target, attachment, (uint)texTarget, textureHandle.Value, level);
|
||||
Context.glFramebufferTexture2D((uint)target, attachment, (uint)texTarget,
|
||||
textureHandle.Value, level);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe GlHandle[] GenBuffers(int count)
|
||||
public unsafe GlHandle[] GenBuffers(
|
||||
int count
|
||||
)
|
||||
{
|
||||
GlHandle[] h = new GlHandle[count];
|
||||
fixed (GlHandle* hptr = h)
|
||||
@@ -386,12 +405,16 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GenerateMipmap(Texture2DTarget target)
|
||||
public void GenerateMipmap(
|
||||
Texture2DTarget target
|
||||
)
|
||||
{
|
||||
Context.glGenerateMipmap((uint)target);
|
||||
}
|
||||
|
||||
public unsafe GlHandle[] GenFrameBuffers(int count)
|
||||
public unsafe GlHandle[] GenFrameBuffers(
|
||||
int count
|
||||
)
|
||||
{
|
||||
GlHandle[] h = new GlHandle[count];
|
||||
fixed (GlHandle* hptr = h) {
|
||||
@@ -401,7 +424,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe GlHandle[] GenRenderBuffer(int count)
|
||||
public unsafe GlHandle[] GenRenderBuffer(
|
||||
int count
|
||||
)
|
||||
{
|
||||
GlHandle[] h = new GlHandle[count];
|
||||
fixed (GlHandle* hptr = h) {
|
||||
@@ -411,7 +436,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe GlHandle[] GenTextures(int count)
|
||||
public unsafe GlHandle[] GenTextures(
|
||||
int count
|
||||
)
|
||||
{
|
||||
GlHandle[] h = new GlHandle[count];
|
||||
fixed (GlHandle* hptr = h) {
|
||||
@@ -420,7 +447,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
return h;
|
||||
}
|
||||
|
||||
public unsafe GlHandle[] GenVertexArrays(int count)
|
||||
public unsafe GlHandle[] GenVertexArrays(
|
||||
int count
|
||||
)
|
||||
{
|
||||
GlHandle[] h = new GlHandle[count];
|
||||
fixed (GlHandle* hptr = h) {
|
||||
@@ -429,23 +458,24 @@ namespace StgSharp.Graphics.OpenGL
|
||||
return h;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint GetError()
|
||||
{
|
||||
return Context.glGetError();
|
||||
}
|
||||
|
||||
public unsafe int GetMaskInteger(uint statusCode)
|
||||
public unsafe int GetMaskInteger(
|
||||
uint statusCode
|
||||
)
|
||||
{
|
||||
int ret = 0;
|
||||
Context.glGetIntegerv(statusCode, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string GetShaderStatus(Shader s, int index, int key)
|
||||
public string GetShaderStatus(
|
||||
Shader s,
|
||||
int index,
|
||||
int key
|
||||
)
|
||||
{
|
||||
IntPtr sptr = IntPtr.Zero;
|
||||
if (GraphicFramework.glCheckShaderStatus(ref Context, s.handle[index].Value, key, ref sptr) == 0) {
|
||||
if (GraphicFramework.glCheckShaderStatus(ref Context, s.handle[index].Value, key,
|
||||
ref sptr) == 0) {
|
||||
return Marshal.PtrToStringAnsi(sptr);
|
||||
}
|
||||
return string.Empty;
|
||||
@@ -457,16 +487,22 @@ namespace StgSharp.Graphics.OpenGL
|
||||
int level,
|
||||
ImageChannel channel,
|
||||
PixelChannelLayout channelLayout,
|
||||
T[] dataStream)
|
||||
where T: unmanaged,INumber<T>
|
||||
T[] dataStream
|
||||
) where T : unmanaged,INumber<T>
|
||||
{
|
||||
fixed (T* tptr = dataStream) {
|
||||
Context.glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, tptr);
|
||||
Context.glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout,
|
||||
(nint*)tptr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetTextureLevelProperty(uint textureTypeMask, int level, uint propertyMask, out int propertyValue)
|
||||
public void GetTextureLevelProperty(
|
||||
uint textureTypeMask,
|
||||
int level,
|
||||
uint propertyMask,
|
||||
out int propertyValue
|
||||
)
|
||||
{
|
||||
fixed (int* iptr = &propertyValue) {
|
||||
Context.glGetTexLevelParameteriv(textureTypeMask, level, propertyMask, iptr);
|
||||
@@ -474,7 +510,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe GlHandle GetUniformLocation(GlHandle program, string name)
|
||||
public unsafe GlHandle GetUniformLocation(
|
||||
GlHandle program,
|
||||
string name
|
||||
)
|
||||
{
|
||||
byte[] code = Encoding.UTF8.GetBytes(name);
|
||||
fixed (byte* ptr = code)
|
||||
@@ -494,54 +533,59 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void LoadShaderSource(GlHandle shaderHandle, byte[] codeStream)
|
||||
public unsafe void LoadShaderSource(
|
||||
GlHandle shaderHandle,
|
||||
byte[] codeStream
|
||||
)
|
||||
{
|
||||
fixed (byte* streamPtr = codeStream) {
|
||||
Context.glShaderSource(shaderHandle.Value, 1, &streamPtr, (void*)0);
|
||||
Context.glShaderSource(shaderHandle.Value, 1, &streamPtr, (int*)0);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void LoadShaderSource(GlHandle shaderHandle, ReadOnlySpan<char> codeStream)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void LoadShaderSource(
|
||||
GlHandle shaderHandle,
|
||||
ReadOnlySpan<char> codeStream
|
||||
)
|
||||
{
|
||||
fixed (char* streamPtr = codeStream)
|
||||
{
|
||||
byte* bptr = (byte*)streamPtr;
|
||||
Context.glShaderSource(shaderHandle.Value, 1, &bptr, (void*)0);
|
||||
fixed (char* streamPtr = codeStream) {
|
||||
Context.glShaderSource(shaderHandle.Value, 1, (byte**)&streamPtr, (int*)0);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void LoadShaderSource(GlHandle shaderHandle, ReadOnlySpan<byte> codeStream)
|
||||
public unsafe void LoadShaderSource(
|
||||
GlHandle shaderHandle,
|
||||
ReadOnlySpan<byte> codeStream
|
||||
)
|
||||
{
|
||||
fixed (byte* streamPtr = codeStream)
|
||||
{
|
||||
byte* bptr = streamPtr;
|
||||
Context.glShaderSource(shaderHandle.Value, 1, &bptr, (void*)0);
|
||||
Context.glShaderSource(shaderHandle.Value, 1, &bptr, (int*)0);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PolygonMode(FaceMode mode)
|
||||
public void PolygonMode(
|
||||
FaceMode mode
|
||||
)
|
||||
{
|
||||
Context.glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PolygonOffset(float factor, float unit)
|
||||
{
|
||||
Context.glPolygonOffset(factor, unit);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ReadPixels(
|
||||
(int X, int Y) beginPosition,
|
||||
(int width, int height) size,
|
||||
FrameBufferChannel format,
|
||||
PixelChannelLayout dataType,
|
||||
ref byte[] stream)
|
||||
ref byte[] stream
|
||||
)
|
||||
{
|
||||
fixed (byte* bptr = stream) {
|
||||
Context.glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height, (uint)format,
|
||||
(uint)dataType, bptr);
|
||||
Context.glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height,
|
||||
(uint)format, (uint)dataType, (nint*)bptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,33 +593,40 @@ namespace StgSharp.Graphics.OpenGL
|
||||
in Image i,
|
||||
(int X, int Y) beginPosition,
|
||||
FrameBufferChannel format,
|
||||
PixelChannelLayout dataType)
|
||||
PixelChannelLayout dataType
|
||||
)
|
||||
{
|
||||
byte[] pixels = i.PixelBuffer;
|
||||
if (!pixels.CheckArrayFormat(dataType)) {
|
||||
throw new GlArrayFormatException(dataType, "i.PixelArray");
|
||||
}
|
||||
fixed (byte* bptr = pixels) {
|
||||
Context.glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height, (uint)format, (uint)dataType,
|
||||
bptr);
|
||||
Context.glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height,
|
||||
(uint)format, (uint)dataType, (nint*)bptr);
|
||||
}
|
||||
i.PixelUpdateCount++;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
|
||||
where T: unmanaged,INumber<T>
|
||||
public unsafe void SetBufferData<T>(
|
||||
BufferType bufferType,
|
||||
T bufferData,
|
||||
BufferUsage usage
|
||||
) where T : unmanaged,INumber<T>
|
||||
{
|
||||
int size = Marshal.SizeOf<T>();
|
||||
|
||||
T* p = &bufferData;
|
||||
|
||||
Context.glBufferData((uint)bufferType, (IntPtr)size, (IntPtr)p, (uint)usage);
|
||||
Context.glBufferData((uint)bufferType, (nuint)size, (nint*)p, (uint)usage);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
where T: unmanaged,INumber<T>
|
||||
public unsafe void SetBufferData<T>(
|
||||
BufferType bufferType,
|
||||
T[] bufferArray,
|
||||
BufferUsage usage
|
||||
) where T : unmanaged,INumber<T>
|
||||
{
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
if (bufferArray == null) {
|
||||
@@ -583,85 +634,112 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
fixed (void* bufferPtr = bufferArray) {
|
||||
Context.glBufferData((uint)bufferType, (IntPtr)size, (IntPtr)bufferPtr, (uint)usage);
|
||||
Context.glBufferData((uint)bufferType, (nuint)size, (nint*)bufferPtr, (uint)usage);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetBufferData<T>(BufferType bufferType, ReadOnlySpan<T> bufferSpan, BufferUsage usage)
|
||||
where T: unmanaged,INumber<T>
|
||||
public unsafe void SetBufferData<T>(
|
||||
BufferType bufferType,
|
||||
ReadOnlySpan<T> bufferSpan,
|
||||
BufferUsage usage
|
||||
) where T : unmanaged,INumber<T>
|
||||
{
|
||||
int size = bufferSpan.Length * Marshal.SizeOf(typeof(T));
|
||||
if (bufferSpan == null) {
|
||||
int size = bufferSpan.Length * Marshal.SizeOf<T>();
|
||||
if (bufferSpan.IsEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
fixed (void* bufferPtr = bufferSpan) {
|
||||
Context.glBufferData((uint)bufferType, (IntPtr)size, (IntPtr)bufferPtr, (uint)usage);
|
||||
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
|
||||
(uint)usage);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetBufferData<T>(BufferType bufferType, Span<T> bufferArray, BufferUsage usage)
|
||||
where T: unmanaged, INumber<T>
|
||||
public unsafe void SetBufferData<T>(
|
||||
BufferType bufferType,
|
||||
Span<T> bufferArray,
|
||||
BufferUsage usage
|
||||
) where T : unmanaged, INumber<T>
|
||||
{
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
if (bufferArray == null) {
|
||||
int size = bufferArray.Length * Marshal.SizeOf<T>();
|
||||
if (bufferArray.IsEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
fixed (void* bufferPtr = bufferArray) {
|
||||
Context.glBufferData((uint)bufferType, (IntPtr)size, (IntPtr)bufferPtr, (uint)usage);
|
||||
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
|
||||
(uint)usage);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetBufferVectorData<T>(BufferType bufferType, ReadOnlySpan<T> bufferSpan, BufferUsage usage)
|
||||
where T: unmanaged, IUnmanagedVector<T>
|
||||
public unsafe void SetBufferVectorData<T>(
|
||||
BufferType bufferType,
|
||||
ReadOnlySpan<T> bufferSpan,
|
||||
BufferUsage usage
|
||||
) where T : unmanaged, IUnmanagedVector<T>
|
||||
{
|
||||
int size = bufferSpan.Length * Marshal.SizeOf(typeof(T));
|
||||
int size = bufferSpan.Length * Marshal.SizeOf<T>();
|
||||
|
||||
fixed (void* bufferPtr = bufferSpan) {
|
||||
Context.glBufferData((uint)bufferType, (IntPtr)size, (IntPtr)bufferPtr, (uint)usage);
|
||||
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
|
||||
(uint)usage);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetBufferVectorData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
where T: unmanaged, IUnmanagedVector<T>
|
||||
public unsafe void SetBufferVectorData<T>(
|
||||
BufferType bufferType,
|
||||
T[] bufferArray,
|
||||
BufferUsage usage
|
||||
) where T : unmanaged, IUnmanagedVector<T>
|
||||
{
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
if (bufferArray == null) {
|
||||
return;
|
||||
}
|
||||
fixed (void* bufferPtr = bufferArray) {
|
||||
Context.glBufferData((uint)bufferType, (IntPtr)size, (IntPtr)bufferPtr, (uint)usage);
|
||||
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
|
||||
(uint)usage);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetRenderBufferStorage(
|
||||
RenderBufferInternalFormat internalFormat,
|
||||
(int width, int height) size)
|
||||
(int width, int height) size
|
||||
)
|
||||
{
|
||||
Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width, size.height);
|
||||
Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width,
|
||||
size.height);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetRenderBufferStorage(
|
||||
RenderBufferInternalFormat internalFormat,
|
||||
(uint width, uint height) size)
|
||||
(uint width, uint height) size
|
||||
)
|
||||
{
|
||||
Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, (int)size.width,
|
||||
(int)size.height);
|
||||
Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat,
|
||||
(int)size.width, (int)size.height);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer)
|
||||
public void SetVertexAttribute(
|
||||
uint index,
|
||||
int size,
|
||||
TypeCode t,
|
||||
bool normalized,
|
||||
int stride,
|
||||
int pointer
|
||||
)
|
||||
{
|
||||
uint type = GraphicFramework.GLtype[(int)t];
|
||||
Context.glVertexAttribPointer(index, size, type, normalized ? 1 : 0, stride, (void*)pointer);
|
||||
Context.glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride,
|
||||
(nint*)pointer);
|
||||
Context.glEnableVertexAttribArray(index);
|
||||
}
|
||||
|
||||
@@ -670,18 +748,18 @@ namespace StgSharp.Graphics.OpenGL
|
||||
Texture2DTarget target,
|
||||
int level,
|
||||
ImageChannel sourceChannel,
|
||||
uint width,
|
||||
uint height,
|
||||
int width,
|
||||
int height,
|
||||
ImageChannel targetChannel,
|
||||
PixelChannelLayout type,
|
||||
T[] pixels)
|
||||
where T: unmanaged, INumber<T>
|
||||
T[] pixels
|
||||
) where T : unmanaged, INumber<T>
|
||||
{
|
||||
fixed (T* tptr = pixels)
|
||||
{
|
||||
T* ptr = ((pixels == null) || (pixels.Length == 0)) ? (T*)IntPtr.Zero : tptr;
|
||||
Context.glTexImage2D((uint)target, level, (uint)sourceChannel, width, height, 0, (uint)targetChannel,
|
||||
(uint)type, tptr);
|
||||
Context.glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0,
|
||||
(uint)targetChannel, (uint)type, (nint*)tptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,55 +768,55 @@ namespace StgSharp.Graphics.OpenGL
|
||||
Texture2DTarget target,
|
||||
int level,
|
||||
ImageChannel sourceChannel,
|
||||
uint width,
|
||||
uint height,
|
||||
int width,
|
||||
int height,
|
||||
ImageChannel targetChannel,
|
||||
PixelChannelLayout type,
|
||||
Span<T> pixelSpan)
|
||||
where T: unmanaged, INumber<T>
|
||||
Span<T> pixelSpan
|
||||
) where T : unmanaged, INumber<T>
|
||||
{
|
||||
fixed (T* tPtr = pixelSpan) {
|
||||
Context.glTexImage2D((uint)target, level, (uint)sourceChannel, width, height, 0, (uint)targetChannel,
|
||||
(uint)type, tPtr);
|
||||
Context.glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0,
|
||||
(uint)targetChannel, (uint)type, (nint*)tPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TextureParameter(int target, uint pname, int param)
|
||||
public void TextureParameter(
|
||||
int target,
|
||||
uint pname,
|
||||
int param
|
||||
)
|
||||
{
|
||||
Context.glTexParameteri((uint)target, pname, param);
|
||||
}
|
||||
|
||||
public static bool TryGetFunctionPackage(IntPtr handle, out OpenGLFunction functionPackage)
|
||||
public static bool TryGetFunctionPackage(
|
||||
IntPtr handle,
|
||||
out OpenGLFunction functionPackage
|
||||
)
|
||||
{
|
||||
return contextToGLMap.TryGetValue(handle, out functionPackage);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UseProgram(GlHandle program)
|
||||
{
|
||||
Context.glUseProgram(program.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void VertexAttributeDivisor(uint layoutIndex, uint divisor)
|
||||
public void VertexAttributeDivisor(
|
||||
uint layoutIndex,
|
||||
uint divisor
|
||||
)
|
||||
{
|
||||
Context.glVertexAttribDivisor(layoutIndex, divisor);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Viewport(int x, int y, uint width, uint height)
|
||||
{
|
||||
Context.glViewport(x, y, width, height);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void WaitAccomplishment()
|
||||
{
|
||||
Context.glFinish();
|
||||
}
|
||||
|
||||
internal static OpenGLFunction BuildGlFunctionPackage(IntPtr handle)
|
||||
internal static OpenGLFunction BuildGlFunctionPackage(
|
||||
IntPtr handle
|
||||
)
|
||||
{
|
||||
if (contextToGLMap.TryGetValue(handle, out OpenGLFunction pack)) {
|
||||
return pack;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,544 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glFunction.v4_0"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
public unsafe partial class OpenGLFunction
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BeginQueryIndexed(
|
||||
uint target,
|
||||
uint index,
|
||||
uint id
|
||||
)
|
||||
{
|
||||
Context.glBeginQueryIndexed(target, index, id);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindTransformFeedback(
|
||||
uint target,
|
||||
uint id
|
||||
)
|
||||
{
|
||||
Context.glBindTransformFeedback(target, id);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BlendEquationi(
|
||||
uint buf,
|
||||
uint mode
|
||||
)
|
||||
{
|
||||
Context.glBlendEquationi(buf, mode);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BlendEquationSeparatei(
|
||||
uint buf,
|
||||
uint modeRGB,
|
||||
uint modeAlpha
|
||||
)
|
||||
{
|
||||
Context.glBlendEquationSeparatei(buf, modeRGB, modeAlpha);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BlendFunci(
|
||||
uint buf,
|
||||
uint src,
|
||||
uint dst
|
||||
)
|
||||
{
|
||||
Context.glBlendFunci(buf, src, dst);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BlendFuncSeparatei(
|
||||
uint buf,
|
||||
uint srcRGB,
|
||||
uint dstRGB,
|
||||
uint srcAlpha,
|
||||
uint dstAlpha
|
||||
)
|
||||
{
|
||||
Context.glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DeleteTransformFeedbacks(
|
||||
int n,
|
||||
ReadOnlySpan<uint> ids
|
||||
)
|
||||
{
|
||||
fixed (uint* idsPtr = ids) {
|
||||
Context.glDeleteTransformFeedbacks(n, idsPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawArraysIndirect(
|
||||
uint mode,
|
||||
ReadOnlySpan<IntPtr> indirect
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indirectPtr = indirect) {
|
||||
Context.glDrawArraysIndirect(mode, indirectPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawElementsIndirect(
|
||||
uint mode,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> indirect
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indirectPtr = indirect) {
|
||||
Context.glDrawElementsIndirect(mode, (uint)type, indirectPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawTransformFeedback(
|
||||
uint mode,
|
||||
uint id
|
||||
)
|
||||
{
|
||||
Context.glDrawTransformFeedback(mode, id);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawTransformFeedbackStream(
|
||||
uint mode,
|
||||
uint id,
|
||||
uint stream
|
||||
)
|
||||
{
|
||||
Context.glDrawTransformFeedbackStream(mode, id, stream);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void EndQueryIndexed(
|
||||
uint target,
|
||||
uint index
|
||||
)
|
||||
{
|
||||
Context.glEndQueryIndexed(target, index);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GenTransformFeedbacks(
|
||||
int n,
|
||||
uint* ids
|
||||
)
|
||||
{
|
||||
Context.glGenTransformFeedbacks(n, ids);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetActiveSubroutineName(
|
||||
GlHandle program,
|
||||
ShaderType shaderType,
|
||||
uint index,
|
||||
int bufSize,
|
||||
int* length,
|
||||
byte* name
|
||||
)
|
||||
{
|
||||
Context.glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize,
|
||||
length, name);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetActiveSubroutineUniformiv(
|
||||
GlHandle program,
|
||||
ShaderType shaderType,
|
||||
uint index,
|
||||
uint pName,
|
||||
int* values
|
||||
)
|
||||
{
|
||||
Context.glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName,
|
||||
values);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetActiveSubroutineUniformName(
|
||||
GlHandle program,
|
||||
ShaderType shaderType,
|
||||
uint index,
|
||||
int bufSize,
|
||||
int* length,
|
||||
byte* name
|
||||
)
|
||||
{
|
||||
Context.glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index,
|
||||
bufSize, length, name);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetProgramStageiv(
|
||||
GlHandle program,
|
||||
ShaderType shaderType,
|
||||
uint pName,
|
||||
int* values
|
||||
)
|
||||
{
|
||||
Context.glGetProgramStageiv(program.Value, (uint)shaderType, pName, values);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetQueryIndexediv(
|
||||
uint target,
|
||||
uint index,
|
||||
uint pName,
|
||||
int* @params
|
||||
)
|
||||
{
|
||||
Context.glGetQueryIndexediv(target, index, pName, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint GetSubroutineIndex(
|
||||
GlHandle program,
|
||||
ShaderType shaderType,
|
||||
ReadOnlySpan<byte> name
|
||||
)
|
||||
{
|
||||
fixed (byte* namePtr = name) {
|
||||
return Context.glGetSubroutineIndex(program.Value, (uint)shaderType, namePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int GetSubroutineUniformLocation(
|
||||
GlHandle program,
|
||||
ShaderType shaderType,
|
||||
ReadOnlySpan<byte> name
|
||||
)
|
||||
{
|
||||
fixed (byte* namePtr = name) {
|
||||
return Context.glGetSubroutineUniformLocation(program.Value, (uint)shaderType, namePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetUniformdv(
|
||||
GlHandle program,
|
||||
int location,
|
||||
double* @params
|
||||
)
|
||||
{
|
||||
Context.glGetUniformdv(program.Value, location, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetUniformSubroutineuiv(
|
||||
ShaderType shaderType,
|
||||
int location,
|
||||
uint* @params
|
||||
)
|
||||
{
|
||||
Context.glGetUniformSubroutineuiv((uint)shaderType, location, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public byte IsTransformFeedback(
|
||||
uint id
|
||||
)
|
||||
{
|
||||
return Context.glIsTransformFeedback(id);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MinSampleShading(
|
||||
float value
|
||||
)
|
||||
{
|
||||
Context.glMinSampleShading(value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PatchParameterfv(
|
||||
uint pName,
|
||||
ReadOnlySpan<float> values
|
||||
)
|
||||
{
|
||||
fixed (float* valuesPtr = values) {
|
||||
Context.glPatchParameterfv(pName, valuesPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PatchParameteri(
|
||||
uint pName,
|
||||
int value
|
||||
)
|
||||
{
|
||||
Context.glPatchParameteri(pName, value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PauseTransformFeedback()
|
||||
{
|
||||
Context.glPauseTransformFeedback();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ResumeTransformFeedback()
|
||||
{
|
||||
Context.glResumeTransformFeedback();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform1d(
|
||||
int location,
|
||||
double x
|
||||
)
|
||||
{
|
||||
Context.glUniform1d(location, x);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform1dv(
|
||||
int location,
|
||||
int count,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniform1dv(location, count, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform2d(
|
||||
int location,
|
||||
double x,
|
||||
double y
|
||||
)
|
||||
{
|
||||
Context.glUniform2d(location, x, y);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform2dv(
|
||||
int location,
|
||||
int count,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniform2dv(location, count, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform3d(
|
||||
int location,
|
||||
double x,
|
||||
double y,
|
||||
double z
|
||||
)
|
||||
{
|
||||
Context.glUniform3d(location, x, y, z);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform3dv(
|
||||
int location,
|
||||
int count,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniform3dv(location, count, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform4d(
|
||||
int location,
|
||||
double x,
|
||||
double y,
|
||||
double z,
|
||||
double w
|
||||
)
|
||||
{
|
||||
Context.glUniform4d(location, x, y, z, w);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Uniform4dv(
|
||||
int location,
|
||||
int count,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniform4dv(location, count, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix2dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix2dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix2x3dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix2x3dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix2x4dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix2x4dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix3dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix3dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix3x2dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix3x2dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix3x4dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix3x4dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix4dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix4dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix4x2dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix4x2dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformMatrix4x3dv(
|
||||
int location,
|
||||
int count,
|
||||
byte transpose,
|
||||
ReadOnlySpan<double> value
|
||||
)
|
||||
{
|
||||
fixed (double* valuePtr = value) {
|
||||
Context.glUniformMatrix4x3dv(location, count, transpose, valuePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void UniformSubroutinesuiv(
|
||||
ShaderType shaderType,
|
||||
int count,
|
||||
ReadOnlySpan<uint> indices
|
||||
)
|
||||
{
|
||||
fixed (uint* indicesPtr = indices) {
|
||||
Context.glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,193 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glFunction.v4_2"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.2
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
public unsafe partial class OpenGLFunction
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindImageTexture(
|
||||
uint unit,
|
||||
GlHandle texture,
|
||||
int level,
|
||||
byte layered,
|
||||
int layer,
|
||||
uint access,
|
||||
uint format
|
||||
)
|
||||
{
|
||||
Context.glBindImageTexture(unit, texture.Value, level, layered, layer, access, format);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawArraysInstancedBaseInstance(
|
||||
uint mode,
|
||||
int first,
|
||||
int count,
|
||||
int instancecount,
|
||||
uint baseinstance
|
||||
)
|
||||
{
|
||||
Context.glDrawArraysInstancedBaseInstance(mode, first, count, instancecount,
|
||||
baseinstance);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawElementsInstancedBaseInstance(
|
||||
uint mode,
|
||||
int count,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> indices,
|
||||
int instancecount,
|
||||
uint baseinstance
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indicesPtr = indices) {
|
||||
Context.glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr,
|
||||
instancecount, baseinstance);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawElementsInstancedBaseVertexBaseInstance(
|
||||
uint mode,
|
||||
int count,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> indices,
|
||||
int instancecount,
|
||||
int basevertex,
|
||||
uint baseinstance
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indicesPtr = indices) {
|
||||
Context.glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type,
|
||||
indicesPtr, instancecount,
|
||||
basevertex, baseinstance);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawTransformFeedbackInstanced(
|
||||
uint mode,
|
||||
uint id,
|
||||
int instancecount
|
||||
)
|
||||
{
|
||||
Context.glDrawTransformFeedbackInstanced(mode, id, instancecount);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DrawTransformFeedbackStreamInstanced(
|
||||
uint mode,
|
||||
uint id,
|
||||
uint stream,
|
||||
int instancecount
|
||||
)
|
||||
{
|
||||
Context.glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetActiveAtomicCounterBufferiv(
|
||||
GlHandle program,
|
||||
GlHandle bufferIndex,
|
||||
uint pname,
|
||||
int* @params
|
||||
)
|
||||
{
|
||||
Context.glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname,
|
||||
@params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetInternalformativ(
|
||||
uint target,
|
||||
uint internalformat,
|
||||
uint pname,
|
||||
int count,
|
||||
int* @params
|
||||
)
|
||||
{
|
||||
Context.glGetInternalformativ(target, internalformat, pname, count, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MemoryBarrier(
|
||||
uint barriers
|
||||
)
|
||||
{
|
||||
Context.glMemoryBarrier(barriers);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TexStorage1D(
|
||||
uint target,
|
||||
int levels,
|
||||
uint internalformat,
|
||||
int width
|
||||
)
|
||||
{
|
||||
Context.glTexStorage1D(target, levels, internalformat, width);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TexStorage2D(
|
||||
uint target,
|
||||
int levels,
|
||||
uint internalformat,
|
||||
int width,
|
||||
int height
|
||||
)
|
||||
{
|
||||
Context.glTexStorage2D(target, levels, internalformat, width, height);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TexStorage3D(
|
||||
uint target,
|
||||
int levels,
|
||||
uint internalformat,
|
||||
int width,
|
||||
int height,
|
||||
int depth
|
||||
)
|
||||
{
|
||||
Context.glTexStorage3D(target, levels, internalformat, width, height, depth);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,586 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glFunction.v4_3"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.3
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
public unsafe partial class OpenGLFunction
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindVertexBuffer(
|
||||
uint bindingindex,
|
||||
GlHandle buffer,
|
||||
nint offset,
|
||||
int stride
|
||||
)
|
||||
{
|
||||
Context.glBindVertexBuffer(bindingindex, buffer.Value, offset, stride);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ClearBufferData(
|
||||
uint target,
|
||||
uint internalformat,
|
||||
uint format,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> data
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* dataPtr = data) {
|
||||
Context.glClearBufferData(target, internalformat, format, (uint)type, dataPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ClearBufferSubData(
|
||||
uint target,
|
||||
uint internalformat,
|
||||
nint offset,
|
||||
nuint size,
|
||||
uint format,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> data
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* dataPtr = data) {
|
||||
Context.glClearBufferSubData(target, internalformat, offset, size, format,
|
||||
(uint)type, dataPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CopyImageSubData(
|
||||
uint srcName,
|
||||
uint srcTarget,
|
||||
int srcLevel,
|
||||
int srcX,
|
||||
int srcY,
|
||||
int srcZ,
|
||||
uint dstName,
|
||||
uint dstTarget,
|
||||
int dstLevel,
|
||||
int dstX,
|
||||
int dstY,
|
||||
int dstZ,
|
||||
int srcWidth,
|
||||
int srcHeight,
|
||||
int srcDepth
|
||||
)
|
||||
{
|
||||
Context.glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName,
|
||||
dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
|
||||
srcDepth);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DebugMessageCallback(
|
||||
IntPtr callback,
|
||||
ReadOnlySpan<IntPtr> userParam
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* userParamPtr = userParam) {
|
||||
Context.glDebugMessageCallback(callback, userParamPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DebugMessageControl(
|
||||
uint source,
|
||||
ShaderType type,
|
||||
uint severity,
|
||||
int count,
|
||||
ReadOnlySpan<uint> ids,
|
||||
byte enabled
|
||||
)
|
||||
{
|
||||
fixed (uint* idsPtr = ids) {
|
||||
Context.glDebugMessageControl(source, (uint)type, severity, count, idsPtr, enabled);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DebugMessageInsert(
|
||||
uint source,
|
||||
ShaderType type,
|
||||
uint id,
|
||||
uint severity,
|
||||
int length,
|
||||
ReadOnlySpan<byte> buf
|
||||
)
|
||||
{
|
||||
fixed (byte* bufPtr = buf) {
|
||||
Context.glDebugMessageInsert(source, (uint)type, id, severity, length, bufPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DispatchCompute(
|
||||
uint num_groups_x,
|
||||
uint num_groups_y,
|
||||
uint num_groups_z
|
||||
)
|
||||
{
|
||||
Context.glDispatchCompute(num_groups_x, num_groups_y, num_groups_z);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void DispatchComputeIndirect(
|
||||
nint indirect
|
||||
)
|
||||
{
|
||||
Context.glDispatchComputeIndirect(indirect);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void FramebufferParameteri(
|
||||
uint target,
|
||||
uint pname,
|
||||
int param
|
||||
)
|
||||
{
|
||||
Context.glFramebufferParameteri(target, pname, param);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint GetDebugMessageLog(
|
||||
uint count,
|
||||
int bufSize,
|
||||
uint* sources,
|
||||
uint* types,
|
||||
uint* ids,
|
||||
uint* severities,
|
||||
int* lengths,
|
||||
byte* messageLog
|
||||
)
|
||||
{
|
||||
return Context.glGetDebugMessageLog(count, bufSize, sources, types, ids, severities,
|
||||
lengths, messageLog);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetFramebufferParameteriv(
|
||||
uint target,
|
||||
uint pname,
|
||||
int* @params
|
||||
)
|
||||
{
|
||||
Context.glGetFramebufferParameteriv(target, pname, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetInternalformati64v(
|
||||
uint target,
|
||||
uint internalformat,
|
||||
uint pname,
|
||||
int count,
|
||||
IntPtr* @params
|
||||
)
|
||||
{
|
||||
Context.glGetInternalformati64v(target, internalformat, pname, count, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetObjectLabel(
|
||||
uint identifier,
|
||||
uint name,
|
||||
int bufSize,
|
||||
int* length,
|
||||
byte* label
|
||||
)
|
||||
{
|
||||
Context.glGetObjectLabel(identifier, name, bufSize, length, label);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetObjectPtrLabel(
|
||||
ReadOnlySpan<IntPtr> ptr,
|
||||
int bufSize,
|
||||
int* length,
|
||||
byte* label
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* ptrPtr = ptr) {
|
||||
Context.glGetObjectPtrLabel(ptrPtr, bufSize, length, label);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetProgramInterfaceiv(
|
||||
GlHandle program,
|
||||
uint programInterface,
|
||||
uint pname,
|
||||
int* @params
|
||||
)
|
||||
{
|
||||
Context.glGetProgramInterfaceiv(program.Value, programInterface, pname, @params);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint GetProgramResourceIndex(
|
||||
GlHandle program,
|
||||
uint programInterface,
|
||||
ReadOnlySpan<byte> name
|
||||
)
|
||||
{
|
||||
fixed (byte* namePtr = name) {
|
||||
return Context.glGetProgramResourceIndex(program.Value, programInterface, namePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetProgramResourceiv(
|
||||
GlHandle program,
|
||||
uint programInterface,
|
||||
uint index,
|
||||
int propCount,
|
||||
ReadOnlySpan<uint> props,
|
||||
int count,
|
||||
int* length,
|
||||
int* @params
|
||||
)
|
||||
{
|
||||
fixed (uint* propsPtr = props) {
|
||||
Context.glGetProgramResourceiv(program.Value, programInterface, index, propCount,
|
||||
propsPtr, count, length, @params);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int GetProgramResourceLocation(
|
||||
GlHandle program,
|
||||
uint programInterface,
|
||||
ReadOnlySpan<byte> name
|
||||
)
|
||||
{
|
||||
fixed (byte* namePtr = name) {
|
||||
return Context.glGetProgramResourceLocation(program.Value, programInterface, namePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int GetProgramResourceLocationIndex(
|
||||
GlHandle program,
|
||||
uint programInterface,
|
||||
ReadOnlySpan<byte> name
|
||||
)
|
||||
{
|
||||
fixed (byte* namePtr = name) {
|
||||
return Context.glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void GetProgramResourceName(
|
||||
GlHandle program,
|
||||
uint programInterface,
|
||||
uint index,
|
||||
int bufSize,
|
||||
int* length,
|
||||
byte* name
|
||||
)
|
||||
{
|
||||
Context.glGetProgramResourceName(program.Value, programInterface, index, bufSize,
|
||||
length, name);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void InvalidateBufferData(
|
||||
GlHandle buffer
|
||||
)
|
||||
{
|
||||
Context.glInvalidateBufferData(buffer.Value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void InvalidateBufferSubData(
|
||||
GlHandle buffer,
|
||||
nint offset,
|
||||
nuint length
|
||||
)
|
||||
{
|
||||
Context.glInvalidateBufferSubData(buffer.Value, offset, length);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void InvalidateFramebuffer(
|
||||
uint target,
|
||||
int numAttachments,
|
||||
ReadOnlySpan<uint> attachments
|
||||
)
|
||||
{
|
||||
fixed (uint* attachmentsPtr = attachments) {
|
||||
Context.glInvalidateFramebuffer(target, numAttachments, attachmentsPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void InvalidateSubFramebuffer(
|
||||
uint target,
|
||||
int numAttachments,
|
||||
ReadOnlySpan<uint> attachments,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height
|
||||
)
|
||||
{
|
||||
fixed (uint* attachmentsPtr = attachments) {
|
||||
Context.glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y,
|
||||
width, height);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void InvalidateTexImage(
|
||||
GlHandle texture,
|
||||
int level
|
||||
)
|
||||
{
|
||||
Context.glInvalidateTexImage(texture.Value, level);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void InvalidateTexSubImage(
|
||||
GlHandle texture,
|
||||
int level,
|
||||
int xoffset,
|
||||
int yoffset,
|
||||
int zoffset,
|
||||
int width,
|
||||
int height,
|
||||
int depth
|
||||
)
|
||||
{
|
||||
Context.glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width,
|
||||
height, depth);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MultiDrawArraysIndirect(
|
||||
uint mode,
|
||||
ReadOnlySpan<IntPtr> indirect,
|
||||
int drawcount,
|
||||
int stride
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indirectPtr = indirect) {
|
||||
Context.glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MultiDrawElementsIndirect(
|
||||
uint mode,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> indirect,
|
||||
int drawcount,
|
||||
int stride
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indirectPtr = indirect) {
|
||||
Context.glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount,
|
||||
stride);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ObjectLabel(
|
||||
uint identifier,
|
||||
uint name,
|
||||
int length,
|
||||
ReadOnlySpan<byte> label
|
||||
)
|
||||
{
|
||||
fixed (byte* labelPtr = label) {
|
||||
Context.glObjectLabel(identifier, name, length, labelPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ObjectPtrLabel(
|
||||
ReadOnlySpan<IntPtr> ptr,
|
||||
int length,
|
||||
ReadOnlySpan<byte> label
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* ptrPtr = ptr)
|
||||
{
|
||||
fixed (byte* labelPtr = label) {
|
||||
Context.glObjectPtrLabel(ptrPtr, length, labelPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PopDebugGroup()
|
||||
{
|
||||
Context.glPopDebugGroup();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PushDebugGroup(
|
||||
uint source,
|
||||
uint id,
|
||||
int length,
|
||||
ReadOnlySpan<byte> message
|
||||
)
|
||||
{
|
||||
fixed (byte* messagePtr = message) {
|
||||
Context.glPushDebugGroup(source, id, length, messagePtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ShaderStorageBlockBinding(
|
||||
GlHandle program,
|
||||
uint storageBlockIndex,
|
||||
uint storageBlockBinding
|
||||
)
|
||||
{
|
||||
Context.glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TexBufferRange(
|
||||
uint target,
|
||||
uint internalformat,
|
||||
GlHandle buffer,
|
||||
nint offset,
|
||||
nuint size
|
||||
)
|
||||
{
|
||||
Context.glTexBufferRange(target, internalformat, buffer.Value, offset, size);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TexStorage2DMultisample(
|
||||
uint target,
|
||||
int samples,
|
||||
uint internalformat,
|
||||
int width,
|
||||
int height,
|
||||
byte fixedsamplelocations
|
||||
)
|
||||
{
|
||||
Context.glTexStorage2DMultisample(target, samples, internalformat, width, height,
|
||||
fixedsamplelocations);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TexStorage3DMultisample(
|
||||
uint target,
|
||||
int samples,
|
||||
uint internalformat,
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
byte fixedsamplelocations
|
||||
)
|
||||
{
|
||||
Context.glTexStorage3DMultisample(target, samples, internalformat, width, height, depth,
|
||||
fixedsamplelocations);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TextureView(
|
||||
GlHandle texture,
|
||||
uint target,
|
||||
GlHandle origtexture,
|
||||
uint internalformat,
|
||||
uint minlevel,
|
||||
uint numlevels,
|
||||
uint minlayer,
|
||||
uint numlayers
|
||||
)
|
||||
{
|
||||
Context.glTextureView(texture.Value, target, origtexture.Value, internalformat,
|
||||
minlevel, numlevels, minlayer, numlayers);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void VertexAttribBinding(
|
||||
uint attribindex,
|
||||
uint bindingindex
|
||||
)
|
||||
{
|
||||
Context.glVertexAttribBinding(attribindex, bindingindex);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void VertexAttribFormat(
|
||||
uint attribindex,
|
||||
int size,
|
||||
ShaderType type,
|
||||
byte normalized,
|
||||
uint relativeoffset
|
||||
)
|
||||
{
|
||||
Context.glVertexAttribFormat(attribindex, size, (uint)type, normalized, relativeoffset);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void VertexAttribIFormat(
|
||||
uint attribindex,
|
||||
int size,
|
||||
ShaderType type,
|
||||
uint relativeoffset
|
||||
)
|
||||
{
|
||||
Context.glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void VertexAttribLFormat(
|
||||
uint attribindex,
|
||||
int size,
|
||||
ShaderType type,
|
||||
uint relativeoffset
|
||||
)
|
||||
{
|
||||
Context.glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void VertexBindingDivisor(
|
||||
uint bindingindex,
|
||||
uint divisor
|
||||
)
|
||||
{
|
||||
Context.glVertexBindingDivisor(bindingindex, divisor);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glFunction.v4_4"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.4
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
public unsafe partial class OpenGLFunction
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindBuffersBase(
|
||||
uint target,
|
||||
uint first,
|
||||
int count,
|
||||
ReadOnlySpan<uint> buffers
|
||||
)
|
||||
{
|
||||
fixed (uint* buffersPtr = buffers) {
|
||||
Context.glBindBuffersBase(target, first, count, buffersPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindBuffersRange(
|
||||
uint target,
|
||||
uint first,
|
||||
int count,
|
||||
ReadOnlySpan<uint> buffers,
|
||||
ReadOnlySpan<nint> offsets,
|
||||
ReadOnlySpan<nuint> sizes
|
||||
)
|
||||
{
|
||||
fixed (uint* buffersPtr = buffers)
|
||||
{
|
||||
fixed (nint* offsetsPtr = offsets)
|
||||
{
|
||||
fixed (nuint* sizesPtr = sizes) {
|
||||
Context.glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr,
|
||||
sizesPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindImageTextures(
|
||||
uint first,
|
||||
int count,
|
||||
ReadOnlySpan<uint> textures
|
||||
)
|
||||
{
|
||||
fixed (uint* texturesPtr = textures) {
|
||||
Context.glBindImageTextures(first, count, texturesPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindSamplers(
|
||||
uint first,
|
||||
int count,
|
||||
ReadOnlySpan<uint> samplers
|
||||
)
|
||||
{
|
||||
fixed (uint* samplersPtr = samplers) {
|
||||
Context.glBindSamplers(first, count, samplersPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindTextures(
|
||||
uint first,
|
||||
int count,
|
||||
ReadOnlySpan<uint> textures
|
||||
)
|
||||
{
|
||||
fixed (uint* texturesPtr = textures) {
|
||||
Context.glBindTextures(first, count, texturesPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindVertexBuffers(
|
||||
uint first,
|
||||
int count,
|
||||
ReadOnlySpan<uint> buffers,
|
||||
ReadOnlySpan<nint> offsets,
|
||||
ReadOnlySpan<int> strides
|
||||
)
|
||||
{
|
||||
fixed (uint* buffersPtr = buffers)
|
||||
{
|
||||
fixed (nint* offsetsPtr = offsets)
|
||||
{
|
||||
fixed (int* stridesPtr = strides) {
|
||||
Context.glBindVertexBuffers(first, count, buffersPtr, offsetsPtr,
|
||||
stridesPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BufferStorage(
|
||||
uint target,
|
||||
nuint size,
|
||||
ReadOnlySpan<IntPtr> data,
|
||||
uint flags
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* dataPtr = data) {
|
||||
Context.glBufferStorage(target, size, dataPtr, flags);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ClearTexImage(
|
||||
GlHandle texture,
|
||||
int level,
|
||||
uint format,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> data
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* dataPtr = data) {
|
||||
Context.glClearTexImage(texture.Value, level, format, (uint)type, dataPtr);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void ClearTexSubImage(
|
||||
GlHandle texture,
|
||||
int level,
|
||||
int xoffset,
|
||||
int yoffset,
|
||||
int zoffset,
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
uint format,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> data
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* dataPtr = data) {
|
||||
Context.glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width,
|
||||
height, depth, format, (uint)type, dataPtr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glFunction.v4_6"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.6
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
public unsafe partial class OpenGLFunction
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MultiDrawArraysIndirectCount(
|
||||
uint mode,
|
||||
ReadOnlySpan<IntPtr> indirect,
|
||||
nint drawcount,
|
||||
int maxdrawcount,
|
||||
int stride
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indirectPtr = indirect) {
|
||||
Context.glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount,
|
||||
stride);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MultiDrawElementsIndirectCount(
|
||||
uint mode,
|
||||
ShaderType type,
|
||||
ReadOnlySpan<IntPtr> indirect,
|
||||
nint drawcount,
|
||||
int maxdrawcount,
|
||||
int stride
|
||||
)
|
||||
{
|
||||
fixed (IntPtr* indirectPtr = indirect) {
|
||||
Context.glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount,
|
||||
maxdrawcount, stride);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void PolygonOffsetClamp(
|
||||
float factor,
|
||||
float units,
|
||||
float clamp
|
||||
)
|
||||
{
|
||||
Context.glPolygonOffsetClamp(factor, units, clamp);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SpecializeShader(
|
||||
GlHandle shader,
|
||||
ReadOnlySpan<byte> pEntryPoint,
|
||||
uint numSpecializationConstants,
|
||||
ReadOnlySpan<uint> pConstantIndex,
|
||||
ReadOnlySpan<uint> pConstantValue
|
||||
)
|
||||
{
|
||||
fixed (byte* pEntryPointPtr = pEntryPoint)
|
||||
{
|
||||
fixed (uint* pConstantIndexPtr = pConstantIndex)
|
||||
{
|
||||
fixed (uint* pConstantValuePtr = pConstantValue) {
|
||||
Context.glSpecializeShader(shader.Value, pEntryPointPtr,
|
||||
numSpecializationConstants, pConstantIndexPtr,
|
||||
pConstantValuePtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glRenderStream"
|
||||
// Project: StgSharp
|
||||
@@ -62,9 +62,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
if (ContextHandle == default)
|
||||
{
|
||||
ContextHandle = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(OpenglContext)));
|
||||
ContextHandle = Marshal.AllocHGlobal(Marshal.SizeOf<OpenglContext>());
|
||||
OpenglContext* contextID = (OpenglContext*)ContextHandle;
|
||||
contextID->glGetString = (delegate*<uint, IntPtr>)IntPtr.Zero;
|
||||
contextID->glGetString = (delegate*<uint,byte*>)IntPtr.Zero;
|
||||
}
|
||||
if (GL == null) {
|
||||
_context = OpenGLFunction.BuildGlFunctionPackage(ContextHandle);
|
||||
@@ -115,10 +115,15 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight)
|
||||
public override void SetSizeLimit(
|
||||
int minWidth,
|
||||
int minHeight,
|
||||
int maxWidth,
|
||||
int maxHeight
|
||||
)
|
||||
{
|
||||
GraphicFramework.glfwSetWindowSizeLimits(
|
||||
this.CanvasHandle, minWidth, minHeight, maxWidth, maxHeight);
|
||||
GraphicFramework.glfwSetWindowSizeLimits(this.CanvasHandle, minWidth, minHeight,
|
||||
maxWidth, maxHeight);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -135,7 +140,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
CustomizeDeinit();
|
||||
}
|
||||
|
||||
protected sealed override Uniform<Matrix44> NativeCameraUniform(ShaderProgram source, string name)
|
||||
protected sealed override Uniform<Matrix44> NativeCameraUniform(
|
||||
ShaderProgram source,
|
||||
string name
|
||||
)
|
||||
{
|
||||
NativeCamera.GainAllUniforms(source, name);
|
||||
return NativeCamera.convertedUniform;
|
||||
@@ -145,30 +153,41 @@ namespace StgSharp.Graphics.OpenGL
|
||||
protected sealed override void NativeCameraViewRange(
|
||||
Radius fieldOfRange,
|
||||
Vec2 offset,
|
||||
(float frontDepth, float backDepth) viewDepth)
|
||||
(float frontDepth, float backDepth) viewDepth
|
||||
)
|
||||
{
|
||||
NativeCamera.SetViewRange(fieldOfRange, this.Size, offset, viewDepth);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected sealed override void NativeCameraViewTarget(Vec3 position, Vec3 direction, Vec3 up)
|
||||
protected sealed override void NativeCameraViewTarget(
|
||||
Vec3 position,
|
||||
Vec3 direction,
|
||||
Vec3 up
|
||||
)
|
||||
{
|
||||
NativeCamera.SetViewDirection(position, direction, up);
|
||||
}
|
||||
|
||||
#region Key Control
|
||||
|
||||
protected KeyStatus CheckKey(KeyboardKey key)
|
||||
protected KeyStatus CheckKey(
|
||||
KeyboardKey key
|
||||
)
|
||||
{
|
||||
return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key);
|
||||
}
|
||||
|
||||
protected KeyStatus CheckKey(Mouse key)
|
||||
protected KeyStatus CheckKey(
|
||||
Mouse key
|
||||
)
|
||||
{
|
||||
return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key);
|
||||
}
|
||||
|
||||
protected KeyStatus CheckKey(Joystick key)
|
||||
protected KeyStatus CheckKey(
|
||||
Joystick key
|
||||
)
|
||||
{
|
||||
return GraphicFramework.glfwGetKey(this.CanvasHandle, (int)key);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="glType"
|
||||
// Project: StgSharp
|
||||
@@ -35,7 +35,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
{
|
||||
internal delegate void GLVULKANPROCNV();
|
||||
|
||||
public unsafe struct glHandleARB(IntPtr value) { }
|
||||
public unsafe struct glHandleARB(
|
||||
IntPtr value
|
||||
) { }
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL numeric type. An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
@@ -46,7 +48,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
public float value;
|
||||
|
||||
public GlClampF(float a)
|
||||
public GlClampF(
|
||||
float a
|
||||
)
|
||||
{
|
||||
value = a;
|
||||
}
|
||||
@@ -54,7 +58,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
public struct glHalfNv(Half bin)
|
||||
public struct glHalfNv(
|
||||
Half bin
|
||||
)
|
||||
{
|
||||
|
||||
[FieldOffset(0)] public Half binary = bin;
|
||||
@@ -66,6 +72,14 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct glSync
|
||||
{
|
||||
|
||||
public IntPtr Handle;
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
public struct GlFixed
|
||||
{
|
||||
@@ -86,7 +100,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
public double value;
|
||||
|
||||
public GlClampD(double a)
|
||||
public GlClampD(
|
||||
double a
|
||||
)
|
||||
{
|
||||
value = a;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="framework"
|
||||
// Project: StgSharp
|
||||
@@ -43,15 +43,25 @@ namespace StgSharp.Graphics
|
||||
/// <returns>
|
||||
/// An Intptr value representing the pointer to the function
|
||||
/// </returns>
|
||||
public delegate IntPtr glLoader(string name);
|
||||
public delegate IntPtr glLoader(
|
||||
string name
|
||||
);
|
||||
|
||||
#region StgSharpDele
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void FrameBufferSizeHandler(IntPtr window, int width, int height);
|
||||
public unsafe delegate void FrameBufferSizeHandler(
|
||||
IntPtr window,
|
||||
int width,
|
||||
int height
|
||||
);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void FramePositionHandler(IntPtr window, float width, float height);
|
||||
public unsafe delegate void FramePositionHandler(
|
||||
IntPtr window,
|
||||
float width,
|
||||
float height
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -65,7 +75,8 @@ namespace StgSharp.Graphics
|
||||
int severity,
|
||||
int length,
|
||||
sbyte* message,
|
||||
void* userParam);
|
||||
void* userParam
|
||||
);
|
||||
internal unsafe delegate void GLDEBUGPROCARB(
|
||||
int source,
|
||||
int type,
|
||||
@@ -73,7 +84,8 @@ namespace StgSharp.Graphics
|
||||
int severity,
|
||||
int length,
|
||||
sbyte* message,
|
||||
void* userParam);
|
||||
void* userParam
|
||||
);
|
||||
internal unsafe delegate void GLDEBUGPROCKHR(
|
||||
int source,
|
||||
int type,
|
||||
@@ -81,14 +93,16 @@ namespace StgSharp.Graphics
|
||||
int severity,
|
||||
int length,
|
||||
sbyte* message,
|
||||
void* userParam);
|
||||
void* userParam
|
||||
);
|
||||
internal unsafe delegate void GLDEBUGPROCAMD(
|
||||
uint id,
|
||||
int category,
|
||||
int severity,
|
||||
int length,
|
||||
sbyte* message,
|
||||
void* userParam);
|
||||
void* userParam
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace StgSharp.HighPerformance
|
||||
{
|
||||
ReadOnlySpan<char> nameSpan = Name.AsSpan();
|
||||
fixed (char* cptr = nameSpan) {
|
||||
return NativeIntrinsic.Intrinsic.city_hash_simplify(cptr, Name.Length);
|
||||
return NativeIntrinsic.Context.city_hash_simplify(cptr, Name.Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,17 +61,9 @@ namespace StgSharp.HighPerformance
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int ElementSideLength<T>() where T : unmanaged, INumber<T>
|
||||
{
|
||||
return Math.Max(8, AlignmentBytes / sizeof(T));
|
||||
return PanelSideLength<T>();
|
||||
}
|
||||
|
||||
// View an existing pointer; caller guarantees lifetime/alignment.
|
||||
public static unsafe MatrixPanel<T>* FromPointer<T>(void* ptr)
|
||||
where T : unmanaged, INumber<T>
|
||||
{
|
||||
return (MatrixPanel<T>*)Align64(ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int MaxElementCount<T>() where T : unmanaged, INumber<T>
|
||||
{
|
||||
int side = ElementSideLength<T>();
|
||||
@@ -115,28 +107,43 @@ namespace StgSharp.HighPerformance
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static int KernelSideCountAvx2<T>() where T : unmanaged, INumber<T>
|
||||
{
|
||||
const int minQ = 8;
|
||||
int lanes = 32 / sizeof(T);
|
||||
int side = Math.Max(lanes, minQ);
|
||||
return side / 4;
|
||||
return PanelSideFromBits<T>(256) / 4;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static int KernelSideCountAvx512<T>() where T : unmanaged, INumber<T>
|
||||
{
|
||||
const int minQ = 8;
|
||||
int lanes = 64 / sizeof(T);
|
||||
int side = Math.Max(lanes, minQ);
|
||||
return side / 4;
|
||||
return PanelSideFromBits<T>(512) / 4;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static int KernelSideCountSse<T>() where T : unmanaged, INumber<T>
|
||||
{
|
||||
const int minQ = 4;
|
||||
int lanes = 16 / sizeof(T);
|
||||
int side = Math.Max(lanes, minQ);
|
||||
return side / 4;
|
||||
return PanelSideFromBits<T>(128) / 4;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static int PanelSideFromBits<T>(int vectorBits) where T : unmanaged, INumber<T>
|
||||
{
|
||||
int elemBits = sizeof(T) * 8;
|
||||
|
||||
// Q = max(4, vectorBits/64, vectorBits/elemBits)
|
||||
int by64 = vectorBits / 64;
|
||||
int byElem = vectorBits / elemBits;
|
||||
int side = Math.Max(4, Math.Max(by64, byElem));
|
||||
return side;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static int PanelSideLength<T>() where T : unmanaged, INumber<T>
|
||||
{
|
||||
return NativeIntrinsic.IntrinsicLevel switch
|
||||
{
|
||||
IntrinsicLevel.SSE => PanelSideFromBits<T>(128),
|
||||
IntrinsicLevel.AVX2 => PanelSideFromBits<T>(256),
|
||||
IntrinsicLevel.AVX512 => PanelSideFromBits<T>(512),
|
||||
_ => 0
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="UnsafeCompute"
|
||||
// Project: StgSharp
|
||||
@@ -35,19 +35,19 @@ namespace StgSharp.HighPerformance
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe int CityHashSimplify(char* span, int length)
|
||||
{
|
||||
return NativeIntrinsic.Intrinsic.city_hash_simplify(span, length);
|
||||
return NativeIntrinsic.Context.city_hash_simplify(span, length);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe int CityHashSimplify(char* span, int begin, int length)
|
||||
{
|
||||
return NativeIntrinsic.Intrinsic.city_hash_simplify(span + begin, length);
|
||||
return NativeIntrinsic.Context.city_hash_simplify(span + begin, length);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe int IndexOfCharPair(char* source, int pairValue, int length)
|
||||
{
|
||||
return NativeIntrinsic.Intrinsic.index_pair(source, pairValue, length);
|
||||
return NativeIntrinsic.Context.index_pair(source, pairValue, length);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,24 +34,40 @@ using System.Runtime.InteropServices.Marshalling;
|
||||
|
||||
namespace StgSharp.Internal.Intrinsic
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct MatrixIntrinsic
|
||||
{
|
||||
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, long, void> buffer_add; //f32_buffer_add
|
||||
public delegate* unmanaged[Cdecl]<void*, ScalarPacket*, long, void> buffer_fill; //f32_buffer_fill
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, ScalarPacket*, long, void> buffer_scalar_mul; //f32_buffer_s_m
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, long, void> buffer_sub; //f32_kernel_sub
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void> buffer_transpose; //f32_kernel_transpose
|
||||
public delegate* unmanaged[Cdecl]<MatrixPanel*, MatrixKernel*, int, int, int, int, void> build_panel; //f32_build_panel
|
||||
public delegate* unmanaged[Cdecl]<MatrixPanel*, void> clear_panel; //f32_clear_panel
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, void> panel_fma; //f32_panel_fma
|
||||
public delegate* unmanaged[Cdecl]<void*, ulong, ulong, ulong, void> pivot; //f32_panel_mul
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, int, int, int, int, void> store_panel; //f32_store_panel
|
||||
|
||||
}
|
||||
|
||||
[InlineArray(4)]
|
||||
internal unsafe struct MatrixIntrinsicArray
|
||||
{
|
||||
|
||||
private MatrixIntrinsic e0;
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct IntrinsicContext
|
||||
{
|
||||
|
||||
public delegate* unmanaged[Cdecl]<char*, int, int> city_hash_simplify; //city_hash_simplify
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, long, void> f32_buffer_add; //f32_buffer_add
|
||||
public delegate* unmanaged[Cdecl]<void*, ScalarPacket*,long, void> f32_buffer_fill; //f32_buffer_fill
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, ScalarPacket*, long, void> f32_buffer_scalar_mul; //f32_buffer_s_m
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, long, void> f32_buffer_sub; //f32_kernel_sub
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void> f32_buffer_transpose; //f32_kernel_transpose
|
||||
public delegate* unmanaged[Cdecl]<MatrixPanel*, MatrixKernel*, int, int, int, int, void> f32_build_panel; //f32_build_panel
|
||||
public delegate* unmanaged[Cdecl]<MatrixPanel*, void> f32_clear_panel;
|
||||
public delegate* unmanaged[Cdecl]<Vector4*, Vector4*, void> f32_normalize_3; //f32_normalize_3
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, void> f32_panel_fma; //f32_panel_fma
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, int, int, int, int, void> f32_store_panel; //f32_store_panel
|
||||
public delegate* unmanaged[Cdecl]<int, ulong> factorial_simd; //factorial_simd
|
||||
public delegate* unmanaged[Cdecl]<char*, int, int, int> index_pair; //index_pair
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, ScalarPacket*, long, void> variant ; //variant
|
||||
public delegate* unmanaged[Cdecl]<char*, int, int> city_hash_simplify; // city_hash_simplify
|
||||
public delegate* unmanaged[Cdecl]<int, ulong> factorial_simd; // factorial_simd
|
||||
public delegate* unmanaged[Cdecl]<char*, int, int, int> index_pair; // index_pair
|
||||
public delegate* unmanaged[Cdecl]<Vector4*, Vector4*, void> vec_f32_normalize_3; // f32_normalize_3
|
||||
public MatrixIntrinsicArray mat; // mat[4] in native order
|
||||
|
||||
public IntrinsicContext()
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace StgSharp.Internal
|
||||
|
||||
public static IntrinsicLevel IntrinsicLevel { get; set; }
|
||||
|
||||
internal static IntrinsicContext Intrinsic
|
||||
internal static IntrinsicContext Context
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => _intrinsicContext;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StructDefine"
|
||||
// Project: StgSharp
|
||||
@@ -39,18 +39,6 @@ namespace StgSharp.Internal
|
||||
|
||||
using GLFWbool = Boolean;
|
||||
|
||||
#region glad struct
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct GLsync
|
||||
{
|
||||
|
||||
public IntPtr Handle;
|
||||
|
||||
}
|
||||
|
||||
#endregion glad struct
|
||||
|
||||
// strucs defined in GLFW3.h
|
||||
|
||||
#region GLFW3 struct
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="ShowViewPort"
|
||||
// Project: StgSharp
|
||||
@@ -53,7 +53,9 @@ namespace StgSharp.MVVM.ViewModel
|
||||
/// <summary>
|
||||
/// CustomizeInit this form and render it on screen, and respond with operation
|
||||
/// </summary>
|
||||
public unsafe void UseViewModel(string viewEntryName)
|
||||
public unsafe void UseViewModel(
|
||||
string viewEntryName
|
||||
)
|
||||
{
|
||||
CustomizeInitialize();
|
||||
UseViewInNextFrame(viewEntryName);
|
||||
@@ -62,7 +64,9 @@ namespace StgSharp.MVVM.ViewModel
|
||||
if (_nextView != _currentView) {
|
||||
_ = Interlocked.Exchange(ref _currentView, _nextView);
|
||||
}
|
||||
Thread renderThread = new Thread((token) => {
|
||||
Thread renderThread = new Thread((
|
||||
token
|
||||
) => {
|
||||
try
|
||||
{
|
||||
ProcessFrameWithoutEvent();
|
||||
@@ -92,7 +96,9 @@ namespace StgSharp.MVVM.ViewModel
|
||||
frameTimeProvider.Dispose();
|
||||
}
|
||||
|
||||
protected void UseViewInNextFrame(string name)
|
||||
protected void UseViewInNextFrame(
|
||||
string name
|
||||
)
|
||||
{
|
||||
if (!allView.TryGetValue(name, out ViewBase v)) {
|
||||
throw new KeyNotFoundException(
|
||||
@@ -101,7 +107,10 @@ namespace StgSharp.MVVM.ViewModel
|
||||
CurrentView = v;
|
||||
}
|
||||
|
||||
private void CountFps(object sender, EventArgs e)
|
||||
private void CountFps(
|
||||
object sender,
|
||||
EventArgs e
|
||||
)
|
||||
{
|
||||
Interlocked.Exchange(ref _frameSpeed, _frameCount);
|
||||
Interlocked.Exchange(ref _frameCount, 0);
|
||||
@@ -118,7 +127,10 @@ namespace StgSharp.MVVM.ViewModel
|
||||
|
||||
private void ProcessFrameWithoutEvent()
|
||||
{
|
||||
frameTimeProvider.TimeSpanRefreshed += (_, _) => { };
|
||||
frameTimeProvider.TimeSpanRefreshed += (
|
||||
_,
|
||||
_
|
||||
) => { };
|
||||
while (_closed)
|
||||
{
|
||||
foreach (ViewPort context in CurrentView.Render) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="ViewModel"
|
||||
// Project: StgSharp
|
||||
@@ -62,55 +62,67 @@ namespace StgSharp.MVVM.ViewModel
|
||||
internal TimeSpanProvider frameTimeProvider;
|
||||
internal Vector4 backgroundColor;
|
||||
|
||||
protected ViewModelBase(int frameSpeed)
|
||||
protected ViewModelBase(
|
||||
int frameSpeed
|
||||
)
|
||||
{
|
||||
viewPortDisplay = new ViewPort();
|
||||
allView = [];
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, 1.0 / frameSpeed), TimeSpanProvider.DefaultProvider);
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, 1.0 / frameSpeed), TimeSpanProvider.DefaultProvider);
|
||||
_frameSpeed = 0;
|
||||
_frameCount = 0;
|
||||
long frameLength = (FrameSpeed > 0) ? (1000L * 1000L / FrameSpeed) : 0;
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, 1.0 / frameSpeed), TimeSpanProvider.DefaultProvider);
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, 1.0 / frameSpeed), TimeSpanProvider.DefaultProvider);
|
||||
SetFrameSizeCallback(DefaultFrameResizeCallback);
|
||||
}
|
||||
|
||||
protected ViewModelBase(double frameLength)
|
||||
protected ViewModelBase(
|
||||
double frameLength
|
||||
)
|
||||
{
|
||||
viewPortDisplay = new ViewPort();
|
||||
allView = [];
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, frameLength), TimeSpanProvider.DefaultProvider);
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, frameLength), TimeSpanProvider.DefaultProvider);
|
||||
_frameSpeed = 0;
|
||||
_frameCount = 0;
|
||||
long _frameLength = (FrameSpeed > 0) ? ((long)(1000 * frameLength)) : 0;
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, frameLength), TimeSpanProvider.DefaultProvider);
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, frameLength), TimeSpanProvider.DefaultProvider);
|
||||
SetFrameSizeCallback(DefaultFrameResizeCallback);
|
||||
}
|
||||
|
||||
public ViewModelBase(ViewPort vBinding, int frameSpeed)
|
||||
public ViewModelBase(
|
||||
ViewPort vBinding,
|
||||
int frameSpeed
|
||||
)
|
||||
{
|
||||
viewPortDisplay = vBinding;
|
||||
allView = [];
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, 1.0), TimeSpanProvider.DefaultProvider);
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, 1.0), TimeSpanProvider.DefaultProvider);
|
||||
_frameSpeed = 0;
|
||||
_frameCount = 0;
|
||||
long frameLength = (frameSpeed > 0) ? (1000L * 1000L / frameSpeed) : 0;
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, 1.0 / frameSpeed), TimeSpanProvider.DefaultProvider);
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, 1.0 / frameSpeed), TimeSpanProvider.DefaultProvider);
|
||||
SetFrameSizeCallback(DefaultFrameResizeCallback);
|
||||
}
|
||||
|
||||
public ViewModelBase(ViewPort vBinding, double frameLength)
|
||||
public ViewModelBase(
|
||||
ViewPort vBinding,
|
||||
double frameLength
|
||||
)
|
||||
{
|
||||
viewPortDisplay = vBinding;
|
||||
allView = [];
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, 1.0), TimeSpanProvider.DefaultProvider);
|
||||
fpsCountProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, 1.0), TimeSpanProvider.DefaultProvider);
|
||||
_frameSpeed = 0;
|
||||
_frameCount = 0;
|
||||
long _frameLength = (FrameSpeed > 0) ? ((long)(1000 * frameLength)) : 0;
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.MaxValue, frameLength), TimeSpanProvider.DefaultProvider);
|
||||
frameTimeProvider = new TimeSpanProvider(TimeSequence.CreateLinear(double.PositiveInfinity, frameLength), TimeSpanProvider.DefaultProvider);
|
||||
SetFrameSizeCallback(DefaultFrameResizeCallback);
|
||||
}
|
||||
|
||||
public DataBindingEntry this[string name]
|
||||
public DataBindingEntry this[
|
||||
string name
|
||||
]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -189,11 +201,15 @@ namespace StgSharp.MVVM.ViewModel
|
||||
/// Maximum Size of current form. In form of a <see cref="Vec2" /> of (width,height)
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetSizeLimit(Vec2 minSize, Vec2 maxSize)
|
||||
public void SetSizeLimit(
|
||||
Vec2 minSize,
|
||||
Vec2 maxSize
|
||||
)
|
||||
{
|
||||
ThreadHelper.MainThreadAssert();
|
||||
GraphicFramework.glfwSetWindowSizeLimits(this.viewPortDisplay.ViewPortHandle, (int)minSize.X,
|
||||
(int)minSize.Y, (int)maxSize.X, (int)maxSize.Y);
|
||||
GraphicFramework.glfwSetWindowSizeLimits(this.viewPortDisplay.ViewPortHandle,
|
||||
(int)minSize.X, (int)minSize.Y, (int)maxSize.X,
|
||||
(int)maxSize.Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -212,16 +228,26 @@ namespace StgSharp.MVVM.ViewModel
|
||||
/// Maximum height of current form
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight)
|
||||
public void SetSizeLimit(
|
||||
int minWidth,
|
||||
int minHeight,
|
||||
int maxWidth,
|
||||
int maxHeight
|
||||
)
|
||||
{
|
||||
ThreadHelper.MainThreadAssert();
|
||||
GraphicFramework.glfwSetWindowSizeLimits(this.viewPortDisplay.ViewPortHandle, minWidth, minHeight, maxWidth,
|
||||
maxHeight);
|
||||
GraphicFramework.glfwSetWindowSizeLimits(this.viewPortDisplay.ViewPortHandle, minWidth,
|
||||
minHeight, maxWidth, maxHeight);
|
||||
}
|
||||
|
||||
public abstract bool TryGetObjectReference(string name, out DataBindingEntry entry);
|
||||
public abstract bool TryGetObjectReference(
|
||||
string name,
|
||||
out DataBindingEntry entry
|
||||
);
|
||||
|
||||
protected unsafe void SetFrameSizeCallback(FrameBufferSizeHandler callback)
|
||||
protected unsafe void SetFrameSizeCallback(
|
||||
FrameBufferSizeHandler callback
|
||||
)
|
||||
{
|
||||
_resizeCallback = callback;
|
||||
IntPtr handlerPtr = Marshal.GetFunctionPointerForDelegate(callback);
|
||||
@@ -229,7 +255,11 @@ namespace StgSharp.MVVM.ViewModel
|
||||
viewPortDisplay.ViewPortHandle, (delegate* unmanaged[Cdecl]<IntPtr, int, int, void>)handlerPtr);
|
||||
}
|
||||
|
||||
private void DefaultFrameResizeCallback(IntPtr windowHandle, int width, int height)
|
||||
private void DefaultFrameResizeCallback(
|
||||
IntPtr windowHandle,
|
||||
int width,
|
||||
int height
|
||||
)
|
||||
{
|
||||
ViewPort.GetExistedViewPort(windowHandle, out ViewPort vp);
|
||||
vp.RequestFlushSizeInNextFrame(width, height);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Matrix44"
|
||||
// Project: StgSharp
|
||||
@@ -45,13 +45,20 @@ namespace StgSharp.Mathematics.Graphic
|
||||
[FieldOffset(0)] internal ColumnSet4 mat;
|
||||
[FieldOffset(0)] internal MatrixKernel<float> kernel;
|
||||
|
||||
internal Matrix44(ColumnSet4 mat)
|
||||
internal Matrix44(
|
||||
ColumnSet4 mat
|
||||
)
|
||||
{
|
||||
Unsafe.SkipInit(out this);
|
||||
this.mat = mat;
|
||||
}
|
||||
|
||||
internal Matrix44(Vector4 vec0, Vector4 vec1, Vector4 vec2, Vector4 vec3)
|
||||
internal Matrix44(
|
||||
Vector4 vec0,
|
||||
Vector4 vec1,
|
||||
Vector4 vec2,
|
||||
Vector4 vec3
|
||||
)
|
||||
{
|
||||
Unsafe.SkipInit(out this);
|
||||
mat.colum0 = vec0;
|
||||
@@ -81,7 +88,8 @@ namespace StgSharp.Mathematics.Graphic
|
||||
float a30,
|
||||
float a31,
|
||||
float a32,
|
||||
float a33)
|
||||
float a33
|
||||
)
|
||||
{
|
||||
Unsafe.SkipInit(out this);
|
||||
mat.colum0 = new Vector4(a00, a10, a20, a30);
|
||||
@@ -90,7 +98,10 @@ namespace StgSharp.Mathematics.Graphic
|
||||
mat.colum3 = new Vector4(a03, a13, a23, a33);
|
||||
}
|
||||
|
||||
public unsafe float this[int rowNum, int columNum]
|
||||
public unsafe float this[
|
||||
int rowNum,
|
||||
int columNum
|
||||
]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -132,29 +143,29 @@ namespace StgSharp.Mathematics.Graphic
|
||||
|
||||
public static Matrix44 Unit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
public static Matrix44 WNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, -1);
|
||||
public static Matrix44 WNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1);
|
||||
|
||||
public static Matrix44 XNegativeUnit => new Matrix44(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, 1);
|
||||
public static Matrix44 XNegativeUnit => new Matrix44(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
public static Matrix44 YNegativeUnit => new Matrix44(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, 1);
|
||||
public static Matrix44 YNegativeUnit => new Matrix44(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
|
||||
public static Matrix44 ZNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0,
|
||||
0, 0, 1);
|
||||
public static Matrix44 ZNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1);
|
||||
|
||||
public ReadOnlySpan<float> AsSpan()
|
||||
{
|
||||
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<ColumnSet4, float>(ref mat), 16);
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
public override bool Equals(
|
||||
object? obj
|
||||
)
|
||||
{
|
||||
return obj is Matrix44 x && Equals(x);
|
||||
}
|
||||
|
||||
public bool Equals(Matrix44 other)
|
||||
public bool Equals(
|
||||
Matrix44 other
|
||||
)
|
||||
{
|
||||
return mat.Equals(other.mat);
|
||||
}
|
||||
@@ -166,64 +177,72 @@ namespace StgSharp.Mathematics.Graphic
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal unsafe void InternalTranspose(ref Matrix44 transpose)
|
||||
internal unsafe void InternalTranspose(
|
||||
ref Matrix44 transpose
|
||||
)
|
||||
{
|
||||
const int f32 = 0;
|
||||
fixed (MatrixKernel<float>* source = &this.kernel, target = &transpose.kernel) {
|
||||
NativeIntrinsic.Intrinsic.f32_buffer_transpose(source, target);
|
||||
NativeIntrinsic.Context.mat[f32].buffer_transpose(source, target);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe Matrix44 operator -(Matrix44 left, Matrix44 right)
|
||||
public static unsafe Matrix44 operator -(
|
||||
Matrix44 left,
|
||||
Matrix44 right
|
||||
)
|
||||
{
|
||||
Matrix44 ret = new();
|
||||
NativeIntrinsic.Intrinsic.f32_buffer_sub(&left, &right, &ret, 1);
|
||||
const int f32 = 0;
|
||||
NativeIntrinsic.Context.mat[f32].buffer_sub(&left, &right, &ret, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool operator !=(Matrix44 left, Matrix44 right)
|
||||
public static bool operator !=(
|
||||
Matrix44 left,
|
||||
Matrix44 right
|
||||
)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe Matrix44 operator *(Matrix44 mat, float value)
|
||||
public static unsafe Matrix44 operator *(
|
||||
Matrix44 mat,
|
||||
float value
|
||||
)
|
||||
{
|
||||
return new Matrix44(mat.mat.colum0 * value, mat.mat.colum1 * value,
|
||||
mat.mat.colum2 * value, mat.mat.colum3 * value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Matrix44 operator *(Matrix44 left, Matrix44 right)
|
||||
public static Matrix44 operator *(
|
||||
Matrix44 left,
|
||||
Matrix44 right
|
||||
)
|
||||
{
|
||||
Matrix44 transpose = left.Transpose;
|
||||
return new Matrix44(Vector4.Dot(transpose.mat.colum0, right.mat.colum0),
|
||||
Vector4.Dot(transpose.mat.colum0, right.mat.colum1),
|
||||
Vector4.Dot(transpose.mat.colum0, right.mat.colum2),
|
||||
Vector4.Dot(transpose.mat.colum0, right.mat.colum3),
|
||||
Vector4.Dot(transpose.mat.colum1, right.mat.colum0),
|
||||
Vector4.Dot(transpose.mat.colum1, right.mat.colum1),
|
||||
Vector4.Dot(transpose.mat.colum1, right.mat.colum2),
|
||||
Vector4.Dot(transpose.mat.colum1, right.mat.colum3),
|
||||
Vector4.Dot(transpose.mat.colum2, right.mat.colum0),
|
||||
Vector4.Dot(transpose.mat.colum2, right.mat.colum1),
|
||||
Vector4.Dot(transpose.mat.colum2, right.mat.colum2),
|
||||
Vector4.Dot(transpose.mat.colum2, right.mat.colum3),
|
||||
Vector4.Dot(transpose.mat.colum3, right.mat.colum0),
|
||||
Vector4.Dot(transpose.mat.colum3, right.mat.colum1),
|
||||
Vector4.Dot(transpose.mat.colum3, right.mat.colum2),
|
||||
Vector4.Dot(transpose.mat.colum3, right.mat.colum3));
|
||||
return new Matrix44(Vector4.Dot(transpose.mat.colum0, right.mat.colum0), Vector4.Dot(transpose.mat.colum0, right.mat.colum1), Vector4.Dot(transpose.mat.colum0, right.mat.colum2), Vector4.Dot(transpose.mat.colum0, right.mat.colum3), Vector4.Dot(transpose.mat.colum1, right.mat.colum0), Vector4.Dot(transpose.mat.colum1, right.mat.colum1), Vector4.Dot(transpose.mat.colum1, right.mat.colum2), Vector4.Dot(transpose.mat.colum1, right.mat.colum3), Vector4.Dot(transpose.mat.colum2, right.mat.colum0), Vector4.Dot(transpose.mat.colum2, right.mat.colum1), Vector4.Dot(transpose.mat.colum2, right.mat.colum2), Vector4.Dot(transpose.mat.colum2, right.mat.colum3), Vector4.Dot(transpose.mat.colum3, right.mat.colum0), Vector4.Dot(transpose.mat.colum3, right.mat.colum1), Vector4.Dot(transpose.mat.colum3, right.mat.colum2), Vector4.Dot(transpose.mat.colum3, right.mat.colum3));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe Matrix44 operator +(Matrix44 left, Matrix44 right)
|
||||
public static unsafe Matrix44 operator +(
|
||||
Matrix44 left,
|
||||
Matrix44 right
|
||||
)
|
||||
{
|
||||
Matrix44 ret = new();
|
||||
NativeIntrinsic.Intrinsic.f32_buffer_add(&left, &right, &ret, 1);
|
||||
const int f32 = 0;
|
||||
NativeIntrinsic.Context.mat[f32].buffer_add(&left, &right, &ret, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool operator ==(Matrix44 left, Matrix44 right)
|
||||
public static bool operator ==(
|
||||
Matrix44 left,
|
||||
Matrix44 right
|
||||
)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
@@ -50,14 +50,17 @@ namespace StgSharp.Mathematics.Numeric
|
||||
MatrixSize size,
|
||||
MatrixStorage<T> buffer
|
||||
|
||||
)
|
||||
)
|
||||
{
|
||||
_boarder = boarder;
|
||||
_size = size;
|
||||
_buffer = buffer;
|
||||
}
|
||||
|
||||
public T this[int x, int y]
|
||||
public T this[
|
||||
int x,
|
||||
int y
|
||||
]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -108,7 +111,8 @@ namespace StgSharp.Mathematics.Numeric
|
||||
/// </exception>
|
||||
public unsafe Matrix<T> this[
|
||||
ReadOnlySpan<MatrixIndex> column,
|
||||
ReadOnlySpan<MatrixIndex> row]
|
||||
ReadOnlySpan<MatrixIndex> row
|
||||
]
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
set { throw new NotImplementedException(); }
|
||||
@@ -137,7 +141,10 @@ namespace StgSharp.Mathematics.Numeric
|
||||
protected internal int KernelRowLength => _size.KernelRowLength;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe ref MatrixKernel<T> GetMatrixKernel(int x, int y)
|
||||
public unsafe ref MatrixKernel<T> GetMatrixKernel(
|
||||
int x,
|
||||
int y
|
||||
)
|
||||
{
|
||||
MatrixKernelEnumerator enumerator = new(_size.KernelColumnLength, _size.KernelRowLength,
|
||||
x, y);
|
||||
@@ -147,7 +154,10 @@ namespace StgSharp.Mathematics.Numeric
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal unsafe ref T GetElementUnsafe(int x, int y)
|
||||
internal unsafe ref T GetElementUnsafe(
|
||||
int x,
|
||||
int y
|
||||
)
|
||||
{
|
||||
// Caller guarantees: indices in range, layout is dense square.
|
||||
int k_c = y >> 2;
|
||||
@@ -161,5 +171,37 @@ namespace StgSharp.Mathematics.Numeric
|
||||
return ref kernel[c, r];
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal unsafe MatrixKernel<T>* GetKernelAddressUnsafe(
|
||||
int x,
|
||||
int y
|
||||
)
|
||||
{
|
||||
// Caller guarantees: indices in range, layout is dense square.
|
||||
int k_c = y >> 2;
|
||||
int k_r = x >> 2;
|
||||
|
||||
MatrixKernelEnumerator enumerator = new(_size.KernelColumnLength, _size.KernelRowLength,
|
||||
k_c, k_r);
|
||||
return Buffer + _boarder.GetIndexOffset(k_c, k_r, in enumerator);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal unsafe ref MatrixKernel<T> GetKernelUnsafe(
|
||||
int x,
|
||||
int y
|
||||
)
|
||||
{
|
||||
// Caller guarantees: indices in range, layout is dense square.
|
||||
int k_c = y >> 2;
|
||||
int k_r = x >> 2;
|
||||
int c = y & 3;
|
||||
int r = x & 3;
|
||||
|
||||
MatrixKernelEnumerator enumerator = new(_size.KernelColumnLength, _size.KernelRowLength,
|
||||
k_c, k_r);
|
||||
return ref _buffer[_boarder.GetIndexOffset(k_c, k_r, in enumerator)];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Factorial"
|
||||
// Project: StgSharp
|
||||
@@ -55,7 +55,7 @@ namespace StgSharp.Mathematics
|
||||
return factorialResult[n];
|
||||
}
|
||||
if (n < 30) {
|
||||
return NativeIntrinsic.Intrinsic.factorial_simd(n);
|
||||
return NativeIntrinsic.Context.factorial_simd(n);
|
||||
}
|
||||
double
|
||||
dn = n,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="CollisionTexture"
|
||||
// Project: StgSharp
|
||||
@@ -47,7 +47,10 @@ namespace StgSharp.Stg
|
||||
public interface IOneDimensionalCollisionTexture2D
|
||||
{
|
||||
|
||||
public void Init(Radius angleStride, string name);
|
||||
public void Init(
|
||||
Radius angleStride,
|
||||
string name
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +73,9 @@ namespace StgSharp.Stg
|
||||
|
||||
public override bool IsContextSharable => false;
|
||||
|
||||
public void GenerateCollisionTexture(IEnumerable<IInstancingBuffer> bufferEnumeration)
|
||||
public void GenerateCollisionTexture(
|
||||
IEnumerable<IInstancingBuffer> bufferEnumeration
|
||||
)
|
||||
{
|
||||
fbo.Bind(0);
|
||||
GL.ClearColor(0, 0, 0, 1);
|
||||
@@ -92,7 +97,8 @@ namespace StgSharp.Stg
|
||||
|
||||
vbo.WriteVectorData<Vec4>(0, item.CoordAndRotationSpan, BufferUsage.StreamDraw);
|
||||
vao.SetVertexAttribute(1, 3, TypeCode.Single, false, 4 * sizeof(float), 0);
|
||||
vao.SetVertexAttribute(2, 1, TypeCode.Single, false, 4 * sizeof(float), 3 * sizeof(float));
|
||||
vao.SetVertexAttribute(2, 1, TypeCode.Single, false, 4 * sizeof(float),
|
||||
3 * sizeof(float));
|
||||
|
||||
vbo.WriteScalerData<float>(2, item.ScalingSpan, BufferUsage.StreamDraw);
|
||||
vao.SetVertexAttribute(3, 1, TypeCode.Single, false, sizeof(float), 0);
|
||||
@@ -100,22 +106,23 @@ namespace StgSharp.Stg
|
||||
vbo.WriteVectorData(1, g.VertexStream, BufferUsage.StreamDraw);
|
||||
vao.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0);
|
||||
|
||||
GL.DrawElementsInstanced(
|
||||
GeometryType.TRIANGLES, ((uint)g.VertexIndices.Length) / 3, TypeCode.UInt32,
|
||||
IntPtr.Zero, (uint)item.ScalingSpan.Length);
|
||||
GL.DrawElementsInstanced(GeometryType.TRIANGLES, (g.VertexIndices.Length) / 3,
|
||||
TypeCode.UInt32, IntPtr.Zero, item.ScalingSpan.Length);
|
||||
}
|
||||
|
||||
t.Bind2D(0);
|
||||
GL.GetTextureImage(
|
||||
Texture2DTarget.Texture2D, 0, ImageChannel.SingleColor, PixelChannelLayout.Float,
|
||||
textureOutput);
|
||||
GL.GetTextureImage(Texture2DTarget.Texture2D, 0, ImageChannel.SingleColor,
|
||||
PixelChannelLayout.Float, textureOutput);
|
||||
VertexArray.BindNull();
|
||||
}
|
||||
|
||||
public void Init(Radius angleStride, string name)
|
||||
public void Init(
|
||||
Radius angleStride,
|
||||
string name
|
||||
)
|
||||
{
|
||||
primeArgs = new ViewPort(
|
||||
1, (int)((new Radius(Scalar.Pi)) / angleStride), name, IntPtr.Zero);
|
||||
primeArgs = new ViewPort(1, (int)((new Radius(Scalar.Pi)) / angleStride), name,
|
||||
IntPtr.Zero);
|
||||
|
||||
PlatformSpecifiedInitialize();
|
||||
CustomizeInit();
|
||||
@@ -155,15 +162,15 @@ namespace StgSharp.Stg
|
||||
|
||||
t = CreateTexture(1);
|
||||
t.Bind2D(0);
|
||||
GL.TextureImage2d<byte>
|
||||
(Texture2DTarget.Texture2D, 0, ImageChannel.WithAlphaChannel, (uint)Width, (uint)Height
|
||||
, ImageChannel.WithAlphaChannel, PixelChannelLayout.Byte, Array.Empty<byte>());
|
||||
GL.TextureImage2d<byte>(Texture2DTarget.Texture2D, 0, ImageChannel.WithAlphaChannel,
|
||||
Width, Height, ImageChannel.WithAlphaChannel,
|
||||
PixelChannelLayout.Byte, Array.Empty<byte>());
|
||||
|
||||
t.Set2dWrapProperty(0, TextureWrap.Repeat, TextureWrap.Repeat);
|
||||
t.Set2dFilterProperty(0, TextureFilter.Nearest, TextureFilter.Nearest);
|
||||
|
||||
GL.FrameBufferTexture2d(
|
||||
FrameBufferTarget.All, glAttachment.Color(0), Texture2DTarget.Texture2D, t[0], 0);
|
||||
GL.FrameBufferTexture2d(FrameBufferTarget.All, glAttachment.Color(0),
|
||||
Texture2DTarget.Texture2D, t[0], 0);
|
||||
|
||||
GL.CombineFrameBufferRenderBuffer(FrameBufferAttachment.Color, rbo[0]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user