Double add sub mul sc-mul ok

This commit is contained in:
Youmu Liu
2025-12-31 18:15:43 +08:00
parent 6484307b8a
commit 0e93787fa2
18 changed files with 1210 additions and 944 deletions
+17 -6
View File
@@ -1,4 +1,4 @@
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// file="FBO" // file="FBO"
// Project: StgSharp // Project: StgSharp
@@ -52,10 +52,14 @@ namespace StgSharp.Graphics.OpenGL
public sealed class FrameBuffer : GlBufferObjectBase public sealed class FrameBuffer : GlBufferObjectBase
{ {
internal unsafe FrameBuffer(int count, glRender binding) internal unsafe FrameBuffer(
int count,
glRender binding
)
: base(binding) : base(binding)
{ {
_bufferHandle = GL.GenFrameBuffers(count); _bufferHandle = new GlHandle[count];
GL.GenFrameBuffers(_bufferHandle);
} }
/// <summary> /// <summary>
@@ -67,7 +71,9 @@ namespace StgSharp.Graphics.OpenGL
/// Index of object to be binded in handle set /// Index of object to be binded in handle set
/// </param> /// </param>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public override unsafe void Bind(int index) public override unsafe void Bind(
int index
)
{ {
GL.BindFrameBuffer(FrameBufferTarget.All, _bufferHandle[index]); GL.BindFrameBuffer(FrameBufferTarget.All, _bufferHandle[index]);
} }
@@ -84,7 +90,10 @@ namespace StgSharp.Graphics.OpenGL
/// Index of object to be binded in handle set /// Index of object to be binded in handle set
/// </param> /// </param>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void Bind(FrameBufferTarget target, int index) public unsafe void Bind(
FrameBufferTarget target,
int index
)
{ {
GL.BindFrameBuffer(target, _bufferHandle[index]); GL.BindFrameBuffer(target, _bufferHandle[index]);
} }
@@ -95,7 +104,9 @@ namespace StgSharp.Graphics.OpenGL
OpenGLFunction.CurrentGL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); OpenGLFunction.CurrentGL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero);
} }
protected override void Dispose(bool disposing) protected override void Dispose(
bool disposing
)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
+60 -82
View File
@@ -82,10 +82,7 @@ namespace StgSharp.Graphics.OpenGL
get get
{ {
#if DEBUG #if DEBUG
if ((IntPtr)_context == IntPtr.Zero) ArgumentNullException.ThrowIfNull(_context, nameof(_context));
{
throw new NullReferenceException();
}
#endif #endif
return ref (*_context); return ref (*_context);
} }
@@ -96,7 +93,7 @@ namespace StgSharp.Graphics.OpenGL
uint type uint type
) )
{ {
Context.glActiveTexture(type); _context->glActiveTexture(type);
} }
[Conditional("DEBUG")] [Conditional("DEBUG")]
@@ -104,7 +101,7 @@ namespace StgSharp.Graphics.OpenGL
bool shouldReportWhenNormal bool shouldReportWhenNormal
) )
{ {
uint code = Context.glGetError(); uint code = _context->glGetError();
if (code != glConst.NO_ERROR) { if (code != glConst.NO_ERROR) {
throw new GlExecutionException(code); throw new GlExecutionException(code);
} }
@@ -119,12 +116,12 @@ namespace StgSharp.Graphics.OpenGL
GlHandle handle GlHandle handle
) )
{ {
Context.glBindBuffer((uint)bufferType, handle.Value); _context->glBindBuffer((uint)bufferType, handle.Value);
} }
/// <summary> /// <summary>
/// Bind a frame BufferHandle to a frame BufferHandle target Same function as <see /// /// 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> /// </summary>
/// <param _label="target"> /// <param _label="target">
/// The frame BufferHandle target of the binding operation. /// The frame BufferHandle target of the binding operation.
@@ -138,7 +135,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle handle GlHandle handle
) )
{ {
Context.glBindFramebuffer((uint)target, handle.Value); _context->glBindFramebuffer((uint)target, handle.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -146,7 +143,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle handle GlHandle handle
) )
{ {
Context.glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value); _context->glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -154,7 +151,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle handle GlHandle handle
) )
{ {
Context.glBindVertexArray(handle.Value); _context->glBindVertexArray(handle.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -162,7 +159,7 @@ namespace StgSharp.Graphics.OpenGL
FrameBufferTarget target FrameBufferTarget target
) )
{ {
return (FrameBufferStatus)Context.glCheckFramebufferStatus((uint)target); return (FrameBufferStatus)_context->glCheckFramebufferStatus((uint)target);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -170,7 +167,7 @@ namespace StgSharp.Graphics.OpenGL
MaskBufferBit mask MaskBufferBit mask
) )
{ {
Context.glClear((uint)mask); _context->glClear((uint)mask);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -179,7 +176,7 @@ namespace StgSharp.Graphics.OpenGL
uint code = 0; uint code = 0;
for (int i = 0; i < 1024; i++) for (int i = 0; i < 1024; i++)
{ {
code = Context.glGetError(); code = _context->glGetError();
if (code == 0) { if (code == 0) {
return; return;
} }
@@ -195,7 +192,7 @@ namespace StgSharp.Graphics.OpenGL
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void ClearGraphicError() public unsafe void ClearGraphicError()
{ {
while (Context.glGetError() != 0) { } while (_context->glGetError() != 0) { }
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -204,14 +201,14 @@ namespace StgSharp.Graphics.OpenGL
GlHandle rboHandle GlHandle rboHandle
) )
{ {
Context.glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment, _context->glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment,
glConst.RENDERBUFFER, rboHandle.Value); glConst.RENDERBUFFER, rboHandle.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe GlHandle CreateGraphicProgram() public unsafe GlHandle CreateGraphicProgram()
{ {
return GlHandle.Create(Context.glCreateProgram()); return GlHandle.Create(_context->glCreateProgram());
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -221,7 +218,7 @@ namespace StgSharp.Graphics.OpenGL
{ {
GlHandle[] h = new GlHandle[count]; GlHandle[] h = new GlHandle[count];
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
h.SetValue(i, Context.glCreateProgram()); h.SetValue(i, _context->glCreateProgram());
} }
return h; return h;
} }
@@ -236,10 +233,10 @@ namespace StgSharp.Graphics.OpenGL
uint t = (uint)type; uint t = (uint)type;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
uint id = Context.glCreateShader(t); uint id = _context->glCreateShader(t);
if (id == 0) if (id == 0)
{ {
uint error = Context.glGetError(); uint error = _context->glGetError();
throw new InvalidOperationException($"Failed in creating shader: {error}"); throw new InvalidOperationException($"Failed in creating shader: {error}");
} }
ret[i] = GlHandle.Create(id); ret[i] = GlHandle.Create(id);
@@ -252,7 +249,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle handle GlHandle handle
) )
{ {
Context.glDeleteBuffers(1, (uint*)&handle); _context->glDeleteBuffers(1, (uint*)&handle);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -267,16 +264,15 @@ namespace StgSharp.Graphics.OpenGL
{ {
uint* iptr = (uint*)hptr; uint* iptr = (uint*)hptr;
for (int i = 0; i < handle.Length; i++) { for (int i = 0; i < handle.Length; i++) {
Context.glDeleteBuffers(1, iptr + i); _context->glDeleteBuffers(1, iptr + i);
} }
} }
} }
/// <summary> /// <summary>
/// Delete a render BufferHandle object Very simlilar function as <see /// /// Delete a render BufferHandle object Very simlilar function as <see ///
/// href="https://docs.gl/gl3/glDeleteRenderbuffers"> glDeleteRenderbuffers </see>. The /// href="https://docs.gl/gl3/glDeleteRenderbuffers">glDeleteRenderbuffers</see>. The only
/// only deifference is that this mehtod can only delete one renderbuffer at the same /// deifference is that this mehtod can only delete one renderbuffer at the same time.
/// time.
/// </summary> /// </summary>
/// <param _label="bufferHandle"> /// <param _label="bufferHandle">
/// Handle to BufferHandle to delete. /// Handle to BufferHandle to delete.
@@ -285,7 +281,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle bufferHandle GlHandle bufferHandle
) )
{ {
Context.glDeleteRenderbuffers(1, &bufferHandle.Value); _context->glDeleteRenderbuffers(1, &bufferHandle.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -297,7 +293,7 @@ namespace StgSharp.Graphics.OpenGL
{ {
uint* iptr = (uint*)hptr; uint* iptr = (uint*)hptr;
for (int i = 0; i < arrays.Length; i++) { for (int i = 0; i < arrays.Length; i++) {
Context.glDeleteVertexArrays(1, iptr + i); _context->glDeleteVertexArrays(1, iptr + i);
} }
} }
} }
@@ -306,7 +302,7 @@ namespace StgSharp.Graphics.OpenGL
bool isWrite bool isWrite
) )
{ {
Context.glDepthMask(isWrite ? (byte)1 : (byte)0); _context->glDepthMask(isWrite ? (byte)1 : (byte)0);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -314,7 +310,7 @@ namespace StgSharp.Graphics.OpenGL
glOperation operation glOperation operation
) )
{ {
Context.glDisable((uint)operation); _context->glDisable((uint)operation);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -324,7 +320,7 @@ namespace StgSharp.Graphics.OpenGL
int count int count
) )
{ {
Context.glDrawArrays((uint)mode, first, count); _context->glDrawArrays((uint)mode, first, count);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -344,7 +340,7 @@ namespace StgSharp.Graphics.OpenGL
_ => throw new ArgumentException( _ => throw new ArgumentException(
$"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") $"{$"{$"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, (nint*)ptr); _context->glDrawElements((uint)mode, count, a, (nint*)ptr);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -365,7 +361,7 @@ namespace StgSharp.Graphics.OpenGL
_ => throw new ArgumentException( _ => throw new ArgumentException(
$"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") $"{$"{$"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); _context->glDrawElementsInstanced((uint)mode, count, a, (nint*)ptr, amount);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -373,7 +369,7 @@ namespace StgSharp.Graphics.OpenGL
glOperation operation glOperation operation
) )
{ {
Context.glEnable((uint)operation); _context->glEnable((uint)operation);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -385,7 +381,7 @@ namespace StgSharp.Graphics.OpenGL
int level int level
) )
{ {
Context.glFramebufferTexture2D((uint)target, attachment, (uint)texTarget, _context->glFramebufferTexture2D((uint)target, attachment, (uint)texTarget,
textureHandle.Value, level); textureHandle.Value, level);
} }
@@ -398,31 +394,12 @@ namespace StgSharp.Graphics.OpenGL
fixed (GlHandle* hptr = h) fixed (GlHandle* hptr = h)
{ {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
Context.glGenBuffers(count, ((uint*)hptr) + i); _context->glGenBuffers(count, ((uint*)hptr) + i);
} }
} }
return h; return h;
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void GenerateMipmap(
Texture2DTarget target
)
{
Context.glGenerateMipmap((uint)target);
}
public unsafe GlHandle[] GenFrameBuffers(
int count
)
{
GlHandle[] h = new GlHandle[count];
fixed (GlHandle* hptr = h) {
Context.glGenFramebuffers(1, (uint*)hptr);
}
return h;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe GlHandle[] GenRenderBuffer( public unsafe GlHandle[] GenRenderBuffer(
int count int count
@@ -430,7 +407,7 @@ namespace StgSharp.Graphics.OpenGL
{ {
GlHandle[] h = new GlHandle[count]; GlHandle[] h = new GlHandle[count];
fixed (GlHandle* hptr = h) { fixed (GlHandle* hptr = h) {
Context.glGenRenderbuffers(count, (uint*)hptr); _context->glGenRenderbuffers(count, (uint*)hptr);
} }
return h; return h;
} }
@@ -442,7 +419,7 @@ namespace StgSharp.Graphics.OpenGL
{ {
GlHandle[] h = new GlHandle[count]; GlHandle[] h = new GlHandle[count];
fixed (GlHandle* hptr = h) { fixed (GlHandle* hptr = h) {
Context.glGenTextures(count, (uint*)hptr); _context->glGenTextures(count, (uint*)hptr);
} }
return h; return h;
} }
@@ -453,7 +430,7 @@ namespace StgSharp.Graphics.OpenGL
{ {
GlHandle[] h = new GlHandle[count]; GlHandle[] h = new GlHandle[count];
fixed (GlHandle* hptr = h) { fixed (GlHandle* hptr = h) {
Context.glGenVertexArrays(count, (uint*)hptr); _context->glGenVertexArrays(count, (uint*)hptr);
} }
return h; return h;
} }
@@ -463,7 +440,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
int ret = 0; int ret = 0;
Context.glGetIntegerv(statusCode, &ret); _context->glGetIntegerv(statusCode, &ret);
return ret; return ret;
} }
@@ -491,7 +468,7 @@ namespace StgSharp.Graphics.OpenGL
) where T : unmanaged,INumber<T> ) where T : unmanaged,INumber<T>
{ {
fixed (T* tptr = dataStream) { fixed (T* tptr = dataStream) {
Context.glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, _context->glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout,
(nint*)tptr); (nint*)tptr);
} }
} }
@@ -505,7 +482,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* iptr = &propertyValue) { fixed (int* iptr = &propertyValue) {
Context.glGetTexLevelParameteriv(textureTypeMask, level, propertyMask, iptr); _context->glGetTexLevelParameteriv(textureTypeMask, level, propertyMask, iptr);
} }
} }
@@ -518,7 +495,7 @@ namespace StgSharp.Graphics.OpenGL
byte[] code = Encoding.UTF8.GetBytes(name); byte[] code = Encoding.UTF8.GetBytes(name);
fixed (byte* ptr = code) fixed (byte* ptr = code)
{ {
int ret = Context.glGetUniformLocation(program.Value, ptr); int ret = _context->glGetUniformLocation(program.Value, ptr);
#if DEBUG #if DEBUG
if ((ret == glConst.INVALID_OPERATION) || (ret == glConst.INVALID_VALUE)) if ((ret == glConst.INVALID_OPERATION) || (ret == glConst.INVALID_VALUE))
{ {
@@ -539,7 +516,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* streamPtr = codeStream) { fixed (byte* streamPtr = codeStream) {
Context.glShaderSource(shaderHandle.Value, 1, &streamPtr, (int*)0); _context->glShaderSource(shaderHandle.Value, 1, &streamPtr, (int*)0);
} }
} }
@@ -550,7 +527,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (char* streamPtr = codeStream) { fixed (char* streamPtr = codeStream) {
Context.glShaderSource(shaderHandle.Value, 1, (byte**)&streamPtr, (int*)0); _context->glShaderSource(shaderHandle.Value, 1, (byte**)&streamPtr, (int*)0);
} }
} }
@@ -562,7 +539,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (byte* streamPtr = codeStream) fixed (byte* streamPtr = codeStream)
{ {
byte* bptr = streamPtr; byte* bptr = streamPtr;
Context.glShaderSource(shaderHandle.Value, 1, &bptr, (int*)0); _context->glShaderSource(shaderHandle.Value, 1, &bptr, (int*)0);
} }
} }
@@ -571,7 +548,7 @@ namespace StgSharp.Graphics.OpenGL
FaceMode mode FaceMode mode
) )
{ {
Context.glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode); _context->glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -584,7 +561,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* bptr = stream) { fixed (byte* bptr = stream) {
Context.glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height, _context->glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height,
(uint)format, (uint)dataType, (nint*)bptr); (uint)format, (uint)dataType, (nint*)bptr);
} }
} }
@@ -601,7 +578,7 @@ namespace StgSharp.Graphics.OpenGL
throw new GlArrayFormatException(dataType, "i.PixelArray"); throw new GlArrayFormatException(dataType, "i.PixelArray");
} }
fixed (byte* bptr = pixels) { fixed (byte* bptr = pixels) {
Context.glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height, _context->glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height,
(uint)format, (uint)dataType, (nint*)bptr); (uint)format, (uint)dataType, (nint*)bptr);
} }
i.PixelUpdateCount++; i.PixelUpdateCount++;
@@ -618,7 +595,7 @@ namespace StgSharp.Graphics.OpenGL
T* p = &bufferData; T* p = &bufferData;
Context.glBufferData((uint)bufferType, (nuint)size, (nint*)p, (uint)usage); _context->glBufferData((uint)bufferType, (nuint)size, (nint*)p, (uint)usage);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -634,7 +611,8 @@ namespace StgSharp.Graphics.OpenGL
} }
fixed (void* bufferPtr = bufferArray) { fixed (void* bufferPtr = bufferArray) {
Context.glBufferData((uint)bufferType, (nuint)size, (nint*)bufferPtr, (uint)usage); _context->glBufferData((uint)bufferType, (nuint)size, (nint*)bufferPtr,
(uint)usage);
} }
} }
@@ -651,7 +629,7 @@ namespace StgSharp.Graphics.OpenGL
} }
fixed (void* bufferPtr = bufferSpan) { fixed (void* bufferPtr = bufferSpan) {
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
(uint)usage); (uint)usage);
} }
} }
@@ -670,7 +648,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (void* bufferPtr = bufferArray) { fixed (void* bufferPtr = bufferArray) {
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
(uint)usage); (uint)usage);
} }
} }
@@ -685,7 +663,7 @@ namespace StgSharp.Graphics.OpenGL
int size = bufferSpan.Length * Marshal.SizeOf<T>(); int size = bufferSpan.Length * Marshal.SizeOf<T>();
fixed (void* bufferPtr = bufferSpan) { fixed (void* bufferPtr = bufferSpan) {
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
(uint)usage); (uint)usage);
} }
} }
@@ -702,7 +680,7 @@ namespace StgSharp.Graphics.OpenGL
return; return;
} }
fixed (void* bufferPtr = bufferArray) { fixed (void* bufferPtr = bufferArray) {
Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr,
(uint)usage); (uint)usage);
} }
} }
@@ -713,7 +691,7 @@ namespace StgSharp.Graphics.OpenGL
(int width, int height) size (int width, int height) size
) )
{ {
Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width, _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width,
size.height); size.height);
} }
@@ -723,7 +701,7 @@ namespace StgSharp.Graphics.OpenGL
(uint width, uint height) size (uint width, uint height) size
) )
{ {
Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat,
(int)size.width, (int)size.height); (int)size.width, (int)size.height);
} }
@@ -738,9 +716,9 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
uint type = GraphicFramework.GLtype[(int)t]; uint type = GraphicFramework.GLtype[(int)t];
Context.glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride, _context->glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride,
(nint*)pointer); (nint*)pointer);
Context.glEnableVertexAttribArray(index); _context->glEnableVertexAttribArray(index);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -758,7 +736,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (T* tptr = pixels) fixed (T* tptr = pixels)
{ {
T* ptr = ((pixels == null) || (pixels.Length == 0)) ? (T*)IntPtr.Zero : tptr; T* ptr = ((pixels == null) || (pixels.Length == 0)) ? (T*)IntPtr.Zero : tptr;
Context.glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0,
(uint)targetChannel, (uint)type, (nint*)tptr); (uint)targetChannel, (uint)type, (nint*)tptr);
} }
} }
@@ -776,7 +754,7 @@ namespace StgSharp.Graphics.OpenGL
) where T : unmanaged, INumber<T> ) where T : unmanaged, INumber<T>
{ {
fixed (T* tPtr = pixelSpan) { fixed (T* tPtr = pixelSpan) {
Context.glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0,
(uint)targetChannel, (uint)type, (nint*)tPtr); (uint)targetChannel, (uint)type, (nint*)tPtr);
} }
} }
@@ -788,7 +766,7 @@ namespace StgSharp.Graphics.OpenGL
int param int param
) )
{ {
Context.glTexParameteri((uint)target, pname, param); _context->glTexParameteri((uint)target, pname, param);
} }
public static bool TryGetFunctionPackage( public static bool TryGetFunctionPackage(
@@ -805,13 +783,13 @@ namespace StgSharp.Graphics.OpenGL
uint divisor uint divisor
) )
{ {
Context.glVertexAttribDivisor(layoutIndex, divisor); _context->glVertexAttribDivisor(layoutIndex, divisor);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void WaitAccomplishment() public void WaitAccomplishment()
{ {
Context.glFinish(); _context->glFinish();
} }
internal static OpenGLFunction BuildGlFunctionPackage( internal static OpenGLFunction BuildGlFunctionPackage(
File diff suppressed because it is too large Load Diff
@@ -42,7 +42,7 @@ namespace StgSharp.Graphics.OpenGL
uint id uint id
) )
{ {
Context.glBeginQueryIndexed(target, index, id); _context->glBeginQueryIndexed(target, index, id);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -51,7 +51,7 @@ namespace StgSharp.Graphics.OpenGL
uint id uint id
) )
{ {
Context.glBindTransformFeedback(target, id); _context->glBindTransformFeedback(target, id);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -60,7 +60,7 @@ namespace StgSharp.Graphics.OpenGL
uint mode uint mode
) )
{ {
Context.glBlendEquationi(buf, mode); _context->glBlendEquationi(buf, mode);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -70,7 +70,7 @@ namespace StgSharp.Graphics.OpenGL
uint modeAlpha uint modeAlpha
) )
{ {
Context.glBlendEquationSeparatei(buf, modeRGB, modeAlpha); _context->glBlendEquationSeparatei(buf, modeRGB, modeAlpha);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -80,7 +80,7 @@ namespace StgSharp.Graphics.OpenGL
uint dst uint dst
) )
{ {
Context.glBlendFunci(buf, src, dst); _context->glBlendFunci(buf, src, dst);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -92,7 +92,7 @@ namespace StgSharp.Graphics.OpenGL
uint dstAlpha uint dstAlpha
) )
{ {
Context.glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); _context->glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -102,7 +102,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* idsPtr = ids) { fixed (uint* idsPtr = ids) {
Context.glDeleteTransformFeedbacks(n, idsPtr); _context->glDeleteTransformFeedbacks(n, idsPtr);
} }
} }
@@ -113,7 +113,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indirectPtr = indirect) { fixed (IntPtr* indirectPtr = indirect) {
Context.glDrawArraysIndirect(mode, indirectPtr); _context->glDrawArraysIndirect(mode, indirectPtr);
} }
} }
@@ -125,7 +125,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indirectPtr = indirect) { fixed (IntPtr* indirectPtr = indirect) {
Context.glDrawElementsIndirect(mode, (uint)type, indirectPtr); _context->glDrawElementsIndirect(mode, (uint)type, indirectPtr);
} }
} }
@@ -135,7 +135,7 @@ namespace StgSharp.Graphics.OpenGL
uint id uint id
) )
{ {
Context.glDrawTransformFeedback(mode, id); _context->glDrawTransformFeedback(mode, id);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -145,7 +145,7 @@ namespace StgSharp.Graphics.OpenGL
uint stream uint stream
) )
{ {
Context.glDrawTransformFeedbackStream(mode, id, stream); _context->glDrawTransformFeedbackStream(mode, id, stream);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -154,7 +154,7 @@ namespace StgSharp.Graphics.OpenGL
uint index uint index
) )
{ {
Context.glEndQueryIndexed(target, index); _context->glEndQueryIndexed(target, index);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -163,7 +163,7 @@ namespace StgSharp.Graphics.OpenGL
uint* ids uint* ids
) )
{ {
Context.glGenTransformFeedbacks(n, ids); _context->glGenTransformFeedbacks(n, ids);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -176,7 +176,7 @@ namespace StgSharp.Graphics.OpenGL
byte* name byte* name
) )
{ {
Context.glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize, _context->glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize,
length, name); length, name);
} }
@@ -189,7 +189,7 @@ namespace StgSharp.Graphics.OpenGL
int* values int* values
) )
{ {
Context.glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName, _context->glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName,
values); values);
} }
@@ -203,7 +203,7 @@ namespace StgSharp.Graphics.OpenGL
byte* name byte* name
) )
{ {
Context.glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index, _context->glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index,
bufSize, length, name); bufSize, length, name);
} }
@@ -215,7 +215,7 @@ namespace StgSharp.Graphics.OpenGL
int* values int* values
) )
{ {
Context.glGetProgramStageiv(program.Value, (uint)shaderType, pName, values); _context->glGetProgramStageiv(program.Value, (uint)shaderType, pName, values);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -226,7 +226,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetQueryIndexediv(target, index, pName, @params); _context->glGetQueryIndexediv(target, index, pName, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -237,7 +237,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* namePtr = name) { fixed (byte* namePtr = name) {
return Context.glGetSubroutineIndex(program.Value, (uint)shaderType, namePtr); return _context->glGetSubroutineIndex(program.Value, (uint)shaderType, namePtr);
} }
} }
@@ -249,7 +249,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* namePtr = name) { fixed (byte* namePtr = name) {
return Context.glGetSubroutineUniformLocation(program.Value, (uint)shaderType, namePtr); return _context->glGetSubroutineUniformLocation(program.Value, (uint)shaderType, namePtr);
} }
} }
@@ -260,7 +260,7 @@ namespace StgSharp.Graphics.OpenGL
double* @params double* @params
) )
{ {
Context.glGetUniformdv(program.Value, location, @params); _context->glGetUniformdv(program.Value, location, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -270,7 +270,7 @@ namespace StgSharp.Graphics.OpenGL
uint* @params uint* @params
) )
{ {
Context.glGetUniformSubroutineuiv((uint)shaderType, location, @params); _context->glGetUniformSubroutineuiv((uint)shaderType, location, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -278,7 +278,7 @@ namespace StgSharp.Graphics.OpenGL
uint id uint id
) )
{ {
return Context.glIsTransformFeedback(id); return _context->glIsTransformFeedback(id);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -286,7 +286,7 @@ namespace StgSharp.Graphics.OpenGL
float value float value
) )
{ {
Context.glMinSampleShading(value); _context->glMinSampleShading(value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -296,7 +296,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuesPtr = values) { fixed (float* valuesPtr = values) {
Context.glPatchParameterfv(pName, valuesPtr); _context->glPatchParameterfv(pName, valuesPtr);
} }
} }
@@ -306,19 +306,19 @@ namespace StgSharp.Graphics.OpenGL
int value int value
) )
{ {
Context.glPatchParameteri(pName, value); _context->glPatchParameteri(pName, value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PauseTransformFeedback() public void PauseTransformFeedback()
{ {
Context.glPauseTransformFeedback(); _context->glPauseTransformFeedback();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ResumeTransformFeedback() public void ResumeTransformFeedback()
{ {
Context.glResumeTransformFeedback(); _context->glResumeTransformFeedback();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -327,7 +327,7 @@ namespace StgSharp.Graphics.OpenGL
double x double x
) )
{ {
Context.glUniform1d(location, x); _context->glUniform1d(location, x);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -338,7 +338,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniform1dv(location, count, valuePtr); _context->glUniform1dv(location, count, valuePtr);
} }
} }
@@ -349,7 +349,7 @@ namespace StgSharp.Graphics.OpenGL
double y double y
) )
{ {
Context.glUniform2d(location, x, y); _context->glUniform2d(location, x, y);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -360,7 +360,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniform2dv(location, count, valuePtr); _context->glUniform2dv(location, count, valuePtr);
} }
} }
@@ -372,7 +372,7 @@ namespace StgSharp.Graphics.OpenGL
double z double z
) )
{ {
Context.glUniform3d(location, x, y, z); _context->glUniform3d(location, x, y, z);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -383,7 +383,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniform3dv(location, count, valuePtr); _context->glUniform3dv(location, count, valuePtr);
} }
} }
@@ -396,7 +396,7 @@ namespace StgSharp.Graphics.OpenGL
double w double w
) )
{ {
Context.glUniform4d(location, x, y, z, w); _context->glUniform4d(location, x, y, z, w);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -407,7 +407,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniform4dv(location, count, valuePtr); _context->glUniform4dv(location, count, valuePtr);
} }
} }
@@ -420,7 +420,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix2dv(location, count, transpose, valuePtr); _context->glUniformMatrix2dv(location, count, transpose, valuePtr);
} }
} }
@@ -433,7 +433,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix2x3dv(location, count, transpose, valuePtr); _context->glUniformMatrix2x3dv(location, count, transpose, valuePtr);
} }
} }
@@ -446,7 +446,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix2x4dv(location, count, transpose, valuePtr); _context->glUniformMatrix2x4dv(location, count, transpose, valuePtr);
} }
} }
@@ -459,7 +459,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix3dv(location, count, transpose, valuePtr); _context->glUniformMatrix3dv(location, count, transpose, valuePtr);
} }
} }
@@ -472,7 +472,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix3x2dv(location, count, transpose, valuePtr); _context->glUniformMatrix3x2dv(location, count, transpose, valuePtr);
} }
} }
@@ -485,7 +485,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix3x4dv(location, count, transpose, valuePtr); _context->glUniformMatrix3x4dv(location, count, transpose, valuePtr);
} }
} }
@@ -498,7 +498,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix4dv(location, count, transpose, valuePtr); _context->glUniformMatrix4dv(location, count, transpose, valuePtr);
} }
} }
@@ -511,7 +511,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix4x2dv(location, count, transpose, valuePtr); _context->glUniformMatrix4x2dv(location, count, transpose, valuePtr);
} }
} }
@@ -524,7 +524,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glUniformMatrix4x3dv(location, count, transpose, valuePtr); _context->glUniformMatrix4x3dv(location, count, transpose, valuePtr);
} }
} }
@@ -536,7 +536,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* indicesPtr = indices) { fixed (uint* indicesPtr = indices) {
Context.glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr); _context->glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr);
} }
} }
@@ -41,7 +41,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle program GlHandle program
) )
{ {
Context.glActiveShaderProgram(pipeline, program.Value); _context->glActiveShaderProgram(pipeline, program.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -49,7 +49,7 @@ namespace StgSharp.Graphics.OpenGL
uint pipeline uint pipeline
) )
{ {
Context.glBindProgramPipeline(pipeline); _context->glBindProgramPipeline(pipeline);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -57,7 +57,7 @@ namespace StgSharp.Graphics.OpenGL
float d float d
) )
{ {
Context.glClearDepthf(d); _context->glClearDepthf(d);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -68,7 +68,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* stringsPtr = strings) { fixed (byte* stringsPtr = strings) {
return Context.glCreateShaderProgramv((uint)type, count, stringsPtr); return _context->glCreateShaderProgramv((uint)type, count, stringsPtr);
} }
} }
@@ -79,7 +79,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* pipelinesPtr = pipelines) { fixed (uint* pipelinesPtr = pipelines) {
Context.glDeleteProgramPipelines(n, pipelinesPtr); _context->glDeleteProgramPipelines(n, pipelinesPtr);
} }
} }
@@ -91,7 +91,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* vPtr = v) { fixed (double* vPtr = v) {
Context.glDepthRangeArrayv(first, count, vPtr); _context->glDepthRangeArrayv(first, count, vPtr);
} }
} }
@@ -101,7 +101,7 @@ namespace StgSharp.Graphics.OpenGL
float f float f
) )
{ {
Context.glDepthRangef(n, f); _context->glDepthRangef(n, f);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -111,7 +111,7 @@ namespace StgSharp.Graphics.OpenGL
double f double f
) )
{ {
Context.glDepthRangeIndexed(index, n, f); _context->glDepthRangeIndexed(index, n, f);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -120,7 +120,7 @@ namespace StgSharp.Graphics.OpenGL
uint* pipelines uint* pipelines
) )
{ {
Context.glGenProgramPipelines(n, pipelines); _context->glGenProgramPipelines(n, pipelines);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -130,7 +130,7 @@ namespace StgSharp.Graphics.OpenGL
double* data double* data
) )
{ {
Context.glGetDoublei_v(target, index, data); _context->glGetDoublei_v(target, index, data);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -140,7 +140,7 @@ namespace StgSharp.Graphics.OpenGL
float* data float* data
) )
{ {
Context.glGetFloati_v(target, index, data); _context->glGetFloati_v(target, index, data);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -152,7 +152,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* binary IntPtr* binary
) )
{ {
Context.glGetProgramBinary(program.Value, bufSize, length, binaryFormat, binary); _context->glGetProgramBinary(program.Value, bufSize, length, binaryFormat, binary);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -163,7 +163,7 @@ namespace StgSharp.Graphics.OpenGL
byte* infoLog byte* infoLog
) )
{ {
Context.glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); _context->glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -173,7 +173,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetProgramPipelineiv(pipeline, pname, @params); _context->glGetProgramPipelineiv(pipeline, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -184,7 +184,7 @@ namespace StgSharp.Graphics.OpenGL
int* precision int* precision
) )
{ {
Context.glGetShaderPrecisionFormat((uint)shaderType, precisiontype, range, precision); _context->glGetShaderPrecisionFormat((uint)shaderType, precisiontype, range, precision);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -194,7 +194,7 @@ namespace StgSharp.Graphics.OpenGL
double* @params double* @params
) )
{ {
Context.glGetVertexAttribLdv(index, pname, @params); _context->glGetVertexAttribLdv(index, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -202,7 +202,7 @@ namespace StgSharp.Graphics.OpenGL
uint pipeline uint pipeline
) )
{ {
return Context.glIsProgramPipeline(pipeline); return _context->glIsProgramPipeline(pipeline);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -214,7 +214,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* binaryPtr = binary) { fixed (IntPtr* binaryPtr = binary) {
Context.glProgramBinary(program.Value, binaryFormat, binaryPtr, length); _context->glProgramBinary(program.Value, binaryFormat, binaryPtr, length);
} }
} }
@@ -225,7 +225,7 @@ namespace StgSharp.Graphics.OpenGL
int value int value
) )
{ {
Context.glProgramParameteri(program.Value, pname, value); _context->glProgramParameteri(program.Value, pname, value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -235,7 +235,7 @@ namespace StgSharp.Graphics.OpenGL
double v0 double v0
) )
{ {
Context.glProgramUniform1d(program.Value, location, v0); _context->glProgramUniform1d(program.Value, location, v0);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -247,7 +247,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniform1dv(program.Value, location, count, valuePtr); _context->glProgramUniform1dv(program.Value, location, count, valuePtr);
} }
} }
@@ -258,7 +258,7 @@ namespace StgSharp.Graphics.OpenGL
float v0 float v0
) )
{ {
Context.glProgramUniform1f(program.Value, location, v0); _context->glProgramUniform1f(program.Value, location, v0);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -270,7 +270,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniform1fv(program.Value, location, count, valuePtr); _context->glProgramUniform1fv(program.Value, location, count, valuePtr);
} }
} }
@@ -281,7 +281,7 @@ namespace StgSharp.Graphics.OpenGL
int v0 int v0
) )
{ {
Context.glProgramUniform1i(program.Value, location, v0); _context->glProgramUniform1i(program.Value, location, v0);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -293,7 +293,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* valuePtr = value) { fixed (int* valuePtr = value) {
Context.glProgramUniform1iv(program.Value, location, count, valuePtr); _context->glProgramUniform1iv(program.Value, location, count, valuePtr);
} }
} }
@@ -304,7 +304,7 @@ namespace StgSharp.Graphics.OpenGL
uint v0 uint v0
) )
{ {
Context.glProgramUniform1ui(program.Value, location, v0); _context->glProgramUniform1ui(program.Value, location, v0);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -316,7 +316,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* valuePtr = value) { fixed (uint* valuePtr = value) {
Context.glProgramUniform1uiv(program.Value, location, count, valuePtr); _context->glProgramUniform1uiv(program.Value, location, count, valuePtr);
} }
} }
@@ -328,7 +328,7 @@ namespace StgSharp.Graphics.OpenGL
double v1 double v1
) )
{ {
Context.glProgramUniform2d(program.Value, location, v0, v1); _context->glProgramUniform2d(program.Value, location, v0, v1);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -340,7 +340,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniform2dv(program.Value, location, count, valuePtr); _context->glProgramUniform2dv(program.Value, location, count, valuePtr);
} }
} }
@@ -352,7 +352,7 @@ namespace StgSharp.Graphics.OpenGL
float v1 float v1
) )
{ {
Context.glProgramUniform2f(program.Value, location, v0, v1); _context->glProgramUniform2f(program.Value, location, v0, v1);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -364,7 +364,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniform2fv(program.Value, location, count, valuePtr); _context->glProgramUniform2fv(program.Value, location, count, valuePtr);
} }
} }
@@ -376,7 +376,7 @@ namespace StgSharp.Graphics.OpenGL
int v1 int v1
) )
{ {
Context.glProgramUniform2i(program.Value, location, v0, v1); _context->glProgramUniform2i(program.Value, location, v0, v1);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -388,7 +388,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* valuePtr = value) { fixed (int* valuePtr = value) {
Context.glProgramUniform2iv(program.Value, location, count, valuePtr); _context->glProgramUniform2iv(program.Value, location, count, valuePtr);
} }
} }
@@ -400,7 +400,7 @@ namespace StgSharp.Graphics.OpenGL
uint v1 uint v1
) )
{ {
Context.glProgramUniform2ui(program.Value, location, v0, v1); _context->glProgramUniform2ui(program.Value, location, v0, v1);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -412,7 +412,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* valuePtr = value) { fixed (uint* valuePtr = value) {
Context.glProgramUniform2uiv(program.Value, location, count, valuePtr); _context->glProgramUniform2uiv(program.Value, location, count, valuePtr);
} }
} }
@@ -425,7 +425,7 @@ namespace StgSharp.Graphics.OpenGL
double v2 double v2
) )
{ {
Context.glProgramUniform3d(program.Value, location, v0, v1, v2); _context->glProgramUniform3d(program.Value, location, v0, v1, v2);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -437,7 +437,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniform3dv(program.Value, location, count, valuePtr); _context->glProgramUniform3dv(program.Value, location, count, valuePtr);
} }
} }
@@ -450,7 +450,7 @@ namespace StgSharp.Graphics.OpenGL
float v2 float v2
) )
{ {
Context.glProgramUniform3f(program.Value, location, v0, v1, v2); _context->glProgramUniform3f(program.Value, location, v0, v1, v2);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -462,7 +462,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniform3fv(program.Value, location, count, valuePtr); _context->glProgramUniform3fv(program.Value, location, count, valuePtr);
} }
} }
@@ -475,7 +475,7 @@ namespace StgSharp.Graphics.OpenGL
int v2 int v2
) )
{ {
Context.glProgramUniform3i(program.Value, location, v0, v1, v2); _context->glProgramUniform3i(program.Value, location, v0, v1, v2);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -487,7 +487,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* valuePtr = value) { fixed (int* valuePtr = value) {
Context.glProgramUniform3iv(program.Value, location, count, valuePtr); _context->glProgramUniform3iv(program.Value, location, count, valuePtr);
} }
} }
@@ -500,7 +500,7 @@ namespace StgSharp.Graphics.OpenGL
uint v2 uint v2
) )
{ {
Context.glProgramUniform3ui(program.Value, location, v0, v1, v2); _context->glProgramUniform3ui(program.Value, location, v0, v1, v2);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -512,7 +512,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* valuePtr = value) { fixed (uint* valuePtr = value) {
Context.glProgramUniform3uiv(program.Value, location, count, valuePtr); _context->glProgramUniform3uiv(program.Value, location, count, valuePtr);
} }
} }
@@ -526,7 +526,7 @@ namespace StgSharp.Graphics.OpenGL
double v3 double v3
) )
{ {
Context.glProgramUniform4d(program.Value, location, v0, v1, v2, v3); _context->glProgramUniform4d(program.Value, location, v0, v1, v2, v3);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -538,7 +538,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniform4dv(program.Value, location, count, valuePtr); _context->glProgramUniform4dv(program.Value, location, count, valuePtr);
} }
} }
@@ -552,7 +552,7 @@ namespace StgSharp.Graphics.OpenGL
float v3 float v3
) )
{ {
Context.glProgramUniform4f(program.Value, location, v0, v1, v2, v3); _context->glProgramUniform4f(program.Value, location, v0, v1, v2, v3);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -564,7 +564,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniform4fv(program.Value, location, count, valuePtr); _context->glProgramUniform4fv(program.Value, location, count, valuePtr);
} }
} }
@@ -578,7 +578,7 @@ namespace StgSharp.Graphics.OpenGL
int v3 int v3
) )
{ {
Context.glProgramUniform4i(program.Value, location, v0, v1, v2, v3); _context->glProgramUniform4i(program.Value, location, v0, v1, v2, v3);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -590,7 +590,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* valuePtr = value) { fixed (int* valuePtr = value) {
Context.glProgramUniform4iv(program.Value, location, count, valuePtr); _context->glProgramUniform4iv(program.Value, location, count, valuePtr);
} }
} }
@@ -604,7 +604,7 @@ namespace StgSharp.Graphics.OpenGL
uint v3 uint v3
) )
{ {
Context.glProgramUniform4ui(program.Value, location, v0, v1, v2, v3); _context->glProgramUniform4ui(program.Value, location, v0, v1, v2, v3);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -616,7 +616,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* valuePtr = value) { fixed (uint* valuePtr = value) {
Context.glProgramUniform4uiv(program.Value, location, count, valuePtr); _context->glProgramUniform4uiv(program.Value, location, count, valuePtr);
} }
} }
@@ -630,7 +630,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix2dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix2dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -645,7 +645,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix2fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix2fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -660,7 +660,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix2x3dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix2x3dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -675,7 +675,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix2x3fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix2x3fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -690,7 +690,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix2x4dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix2x4dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -705,7 +705,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix2x4fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix2x4fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -720,7 +720,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix3dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix3dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -735,7 +735,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix3fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix3fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -750,7 +750,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix3x2dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix3x2dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -765,7 +765,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix3x2fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix3x2fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -780,7 +780,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix3x4dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix3x4dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -795,7 +795,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix3x4fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix3x4fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -810,7 +810,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix4dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix4dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -825,7 +825,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix4fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix4fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -840,7 +840,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix4x2dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix4x2dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -855,7 +855,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix4x2fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix4x2fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -870,7 +870,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* valuePtr = value) { fixed (double* valuePtr = value) {
Context.glProgramUniformMatrix4x3dv(program.Value, location, count, transpose, _context->glProgramUniformMatrix4x3dv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -885,7 +885,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glProgramUniformMatrix4x3fv(program.Value, location, count, transpose, _context->glProgramUniformMatrix4x3fv(program.Value, location, count, transpose,
valuePtr); valuePtr);
} }
} }
@@ -893,7 +893,7 @@ namespace StgSharp.Graphics.OpenGL
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ReleaseShaderCompiler() public void ReleaseShaderCompiler()
{ {
Context.glReleaseShaderCompiler(); _context->glReleaseShaderCompiler();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -904,7 +904,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* vPtr = v) { fixed (int* vPtr = v) {
Context.glScissorArrayv(first, count, vPtr); _context->glScissorArrayv(first, count, vPtr);
} }
} }
@@ -917,7 +917,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glScissorIndexed(index, left, bottom, width, height); _context->glScissorIndexed(index, left, bottom, width, height);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -927,7 +927,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* vPtr = v) { fixed (int* vPtr = v) {
Context.glScissorIndexedv(index, vPtr); _context->glScissorIndexedv(index, vPtr);
} }
} }
@@ -943,7 +943,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (uint* shadersPtr = shaders) fixed (uint* shadersPtr = shaders)
{ {
fixed (IntPtr* binaryPtr = binary) { fixed (IntPtr* binaryPtr = binary) {
Context.glShaderBinary(count, shadersPtr, binaryFormat, binaryPtr, length); _context->glShaderBinary(count, shadersPtr, binaryFormat, binaryPtr, length);
} }
} }
} }
@@ -955,7 +955,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle program GlHandle program
) )
{ {
Context.glUseProgramStages(pipeline, stages, program.Value); _context->glUseProgramStages(pipeline, stages, program.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -963,7 +963,7 @@ namespace StgSharp.Graphics.OpenGL
uint pipeline uint pipeline
) )
{ {
Context.glValidateProgramPipeline(pipeline); _context->glValidateProgramPipeline(pipeline);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -972,7 +972,7 @@ namespace StgSharp.Graphics.OpenGL
double x double x
) )
{ {
Context.glVertexAttribL1d(index, x); _context->glVertexAttribL1d(index, x);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -982,7 +982,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* vPtr = v) { fixed (double* vPtr = v) {
Context.glVertexAttribL1dv(index, vPtr); _context->glVertexAttribL1dv(index, vPtr);
} }
} }
@@ -993,7 +993,7 @@ namespace StgSharp.Graphics.OpenGL
double y double y
) )
{ {
Context.glVertexAttribL2d(index, x, y); _context->glVertexAttribL2d(index, x, y);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1003,7 +1003,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* vPtr = v) { fixed (double* vPtr = v) {
Context.glVertexAttribL2dv(index, vPtr); _context->glVertexAttribL2dv(index, vPtr);
} }
} }
@@ -1015,7 +1015,7 @@ namespace StgSharp.Graphics.OpenGL
double z double z
) )
{ {
Context.glVertexAttribL3d(index, x, y, z); _context->glVertexAttribL3d(index, x, y, z);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1025,7 +1025,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* vPtr = v) { fixed (double* vPtr = v) {
Context.glVertexAttribL3dv(index, vPtr); _context->glVertexAttribL3dv(index, vPtr);
} }
} }
@@ -1038,7 +1038,7 @@ namespace StgSharp.Graphics.OpenGL
double w double w
) )
{ {
Context.glVertexAttribL4d(index, x, y, z, w); _context->glVertexAttribL4d(index, x, y, z, w);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1048,7 +1048,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (double* vPtr = v) { fixed (double* vPtr = v) {
Context.glVertexAttribL4dv(index, vPtr); _context->glVertexAttribL4dv(index, vPtr);
} }
} }
@@ -1062,7 +1062,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* pointerPtr = pointer) { fixed (IntPtr* pointerPtr = pointer) {
Context.glVertexAttribLPointer(index, size, (uint)type, stride, pointerPtr); _context->glVertexAttribLPointer(index, size, (uint)type, stride, pointerPtr);
} }
} }
@@ -1074,7 +1074,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* vPtr = v) { fixed (float* vPtr = v) {
Context.glViewportArrayv(first, count, vPtr); _context->glViewportArrayv(first, count, vPtr);
} }
} }
@@ -1087,7 +1087,7 @@ namespace StgSharp.Graphics.OpenGL
float h float h
) )
{ {
Context.glViewportIndexedf(index, x, y, w, h); _context->glViewportIndexedf(index, x, y, w, h);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1097,7 +1097,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* vPtr = v) { fixed (float* vPtr = v) {
Context.glViewportIndexedfv(index, vPtr); _context->glViewportIndexedfv(index, vPtr);
} }
} }
@@ -25,10 +25,6 @@
// //
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// <auto-generated>
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
// Version: 4.2
// </auto-generated>
using StgSharp.Graphics.OpenGL; using StgSharp.Graphics.OpenGL;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -50,7 +46,8 @@ namespace StgSharp.Graphics.OpenGL
uint format uint format
) )
{ {
Context.glBindImageTexture(unit, texture.Value, level, layered, layer, access, format); _context->glBindImageTexture(unit, texture.Value, level, layered, layer, access,
format);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -62,7 +59,7 @@ namespace StgSharp.Graphics.OpenGL
uint baseinstance uint baseinstance
) )
{ {
Context.glDrawArraysInstancedBaseInstance(mode, first, count, instancecount, _context->glDrawArraysInstancedBaseInstance(mode, first, count, instancecount,
baseinstance); baseinstance);
} }
@@ -77,7 +74,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indicesPtr = indices) { fixed (IntPtr* indicesPtr = indices) {
Context.glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr, _context->glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr,
instancecount, baseinstance); instancecount, baseinstance);
} }
} }
@@ -94,7 +91,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indicesPtr = indices) { fixed (IntPtr* indicesPtr = indices) {
Context.glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type, _context->glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type,
indicesPtr, instancecount, indicesPtr, instancecount,
basevertex, baseinstance); basevertex, baseinstance);
} }
@@ -107,7 +104,7 @@ namespace StgSharp.Graphics.OpenGL
int instancecount int instancecount
) )
{ {
Context.glDrawTransformFeedbackInstanced(mode, id, instancecount); _context->glDrawTransformFeedbackInstanced(mode, id, instancecount);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -118,7 +115,7 @@ namespace StgSharp.Graphics.OpenGL
int instancecount int instancecount
) )
{ {
Context.glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount); _context->glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -129,7 +126,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname, _context->glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname,
@params); @params);
} }
@@ -142,7 +139,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetInternalformativ(target, internalformat, pname, count, @params); _context->glGetInternalformativ(target, internalformat, pname, count, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -150,7 +147,7 @@ namespace StgSharp.Graphics.OpenGL
uint barriers uint barriers
) )
{ {
Context.glMemoryBarrier(barriers); _context->glMemoryBarrier(barriers);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -161,7 +158,7 @@ namespace StgSharp.Graphics.OpenGL
int width int width
) )
{ {
Context.glTexStorage1D(target, levels, internalformat, width); _context->glTexStorage1D(target, levels, internalformat, width);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -173,7 +170,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glTexStorage2D(target, levels, internalformat, width, height); _context->glTexStorage2D(target, levels, internalformat, width, height);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -186,7 +183,7 @@ namespace StgSharp.Graphics.OpenGL
int depth int depth
) )
{ {
Context.glTexStorage3D(target, levels, internalformat, width, height, depth); _context->glTexStorage3D(target, levels, internalformat, width, height, depth);
} }
} }
@@ -25,10 +25,6 @@
// //
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// <auto-generated>
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
// Version: 4.3
// </auto-generated>
using StgSharp.Graphics.OpenGL; using StgSharp.Graphics.OpenGL;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -47,7 +43,7 @@ namespace StgSharp.Graphics.OpenGL
int stride int stride
) )
{ {
Context.glBindVertexBuffer(bindingindex, buffer.Value, offset, stride); _context->glBindVertexBuffer(bindingindex, buffer.Value, offset, stride);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -60,7 +56,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glClearBufferData(target, internalformat, format, (uint)type, dataPtr); _context->glClearBufferData(target, internalformat, format, (uint)type, dataPtr);
} }
} }
@@ -76,7 +72,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glClearBufferSubData(target, internalformat, offset, size, format, _context->glClearBufferSubData(target, internalformat, offset, size, format,
(uint)type, dataPtr); (uint)type, dataPtr);
} }
} }
@@ -100,7 +96,7 @@ namespace StgSharp.Graphics.OpenGL
int srcDepth int srcDepth
) )
{ {
Context.glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, _context->glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName,
dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight,
srcDepth); srcDepth);
} }
@@ -112,7 +108,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* userParamPtr = userParam) { fixed (IntPtr* userParamPtr = userParam) {
Context.glDebugMessageCallback(callback, userParamPtr); _context->glDebugMessageCallback(callback, userParamPtr);
} }
} }
@@ -127,7 +123,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* idsPtr = ids) { fixed (uint* idsPtr = ids) {
Context.glDebugMessageControl(source, (uint)type, severity, count, idsPtr, enabled); _context->glDebugMessageControl(source, (uint)type, severity, count, idsPtr,
enabled);
} }
} }
@@ -142,7 +139,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* bufPtr = buf) { fixed (byte* bufPtr = buf) {
Context.glDebugMessageInsert(source, (uint)type, id, severity, length, bufPtr); _context->glDebugMessageInsert(source, (uint)type, id, severity, length, bufPtr);
} }
} }
@@ -153,7 +150,7 @@ namespace StgSharp.Graphics.OpenGL
uint num_groups_z uint num_groups_z
) )
{ {
Context.glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); _context->glDispatchCompute(num_groups_x, num_groups_y, num_groups_z);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -161,7 +158,7 @@ namespace StgSharp.Graphics.OpenGL
nint indirect nint indirect
) )
{ {
Context.glDispatchComputeIndirect(indirect); _context->glDispatchComputeIndirect(indirect);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -171,7 +168,7 @@ namespace StgSharp.Graphics.OpenGL
int param int param
) )
{ {
Context.glFramebufferParameteri(target, pname, param); _context->glFramebufferParameteri(target, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -186,7 +183,7 @@ namespace StgSharp.Graphics.OpenGL
byte* messageLog byte* messageLog
) )
{ {
return Context.glGetDebugMessageLog(count, bufSize, sources, types, ids, severities, return _context->glGetDebugMessageLog(count, bufSize, sources, types, ids, severities,
lengths, messageLog); lengths, messageLog);
} }
@@ -197,7 +194,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetFramebufferParameteriv(target, pname, @params); _context->glGetFramebufferParameteriv(target, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -209,7 +206,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* @params IntPtr* @params
) )
{ {
Context.glGetInternalformati64v(target, internalformat, pname, count, @params); _context->glGetInternalformati64v(target, internalformat, pname, count, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -221,7 +218,7 @@ namespace StgSharp.Graphics.OpenGL
byte* label byte* label
) )
{ {
Context.glGetObjectLabel(identifier, name, bufSize, length, label); _context->glGetObjectLabel(identifier, name, bufSize, length, label);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -233,7 +230,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* ptrPtr = ptr) { fixed (IntPtr* ptrPtr = ptr) {
Context.glGetObjectPtrLabel(ptrPtr, bufSize, length, label); _context->glGetObjectPtrLabel(ptrPtr, bufSize, length, label);
} }
} }
@@ -245,7 +242,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetProgramInterfaceiv(program.Value, programInterface, pname, @params); _context->glGetProgramInterfaceiv(program.Value, programInterface, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -256,7 +253,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* namePtr = name) { fixed (byte* namePtr = name) {
return Context.glGetProgramResourceIndex(program.Value, programInterface, namePtr); return _context->glGetProgramResourceIndex(program.Value, programInterface, namePtr);
} }
} }
@@ -273,7 +270,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* propsPtr = props) { fixed (uint* propsPtr = props) {
Context.glGetProgramResourceiv(program.Value, programInterface, index, propCount, _context->glGetProgramResourceiv(program.Value, programInterface, index, propCount,
propsPtr, count, length, @params); propsPtr, count, length, @params);
} }
} }
@@ -286,7 +283,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* namePtr = name) { fixed (byte* namePtr = name) {
return Context.glGetProgramResourceLocation(program.Value, programInterface, namePtr); return _context->glGetProgramResourceLocation(program.Value, programInterface, namePtr);
} }
} }
@@ -298,7 +295,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* namePtr = name) { fixed (byte* namePtr = name) {
return Context.glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr); return _context->glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr);
} }
} }
@@ -312,7 +309,7 @@ namespace StgSharp.Graphics.OpenGL
byte* name byte* name
) )
{ {
Context.glGetProgramResourceName(program.Value, programInterface, index, bufSize, _context->glGetProgramResourceName(program.Value, programInterface, index, bufSize,
length, name); length, name);
} }
@@ -321,7 +318,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle buffer GlHandle buffer
) )
{ {
Context.glInvalidateBufferData(buffer.Value); _context->glInvalidateBufferData(buffer.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -331,7 +328,7 @@ namespace StgSharp.Graphics.OpenGL
nuint length nuint length
) )
{ {
Context.glInvalidateBufferSubData(buffer.Value, offset, length); _context->glInvalidateBufferSubData(buffer.Value, offset, length);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -342,7 +339,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* attachmentsPtr = attachments) { fixed (uint* attachmentsPtr = attachments) {
Context.glInvalidateFramebuffer(target, numAttachments, attachmentsPtr); _context->glInvalidateFramebuffer(target, numAttachments, attachmentsPtr);
} }
} }
@@ -358,7 +355,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* attachmentsPtr = attachments) { fixed (uint* attachmentsPtr = attachments) {
Context.glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y, _context->glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y,
width, height); width, height);
} }
} }
@@ -369,7 +366,7 @@ namespace StgSharp.Graphics.OpenGL
int level int level
) )
{ {
Context.glInvalidateTexImage(texture.Value, level); _context->glInvalidateTexImage(texture.Value, level);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -384,8 +381,8 @@ namespace StgSharp.Graphics.OpenGL
int depth int depth
) )
{ {
Context.glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, _context->glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset,
height, depth); width, height, depth);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -397,7 +394,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indirectPtr = indirect) { fixed (IntPtr* indirectPtr = indirect) {
Context.glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride); _context->glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride);
} }
} }
@@ -411,7 +408,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indirectPtr = indirect) { fixed (IntPtr* indirectPtr = indirect) {
Context.glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount, _context->glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount,
stride); stride);
} }
} }
@@ -425,7 +422,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* labelPtr = label) { fixed (byte* labelPtr = label) {
Context.glObjectLabel(identifier, name, length, labelPtr); _context->glObjectLabel(identifier, name, length, labelPtr);
} }
} }
@@ -439,7 +436,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (IntPtr* ptrPtr = ptr) fixed (IntPtr* ptrPtr = ptr)
{ {
fixed (byte* labelPtr = label) { fixed (byte* labelPtr = label) {
Context.glObjectPtrLabel(ptrPtr, length, labelPtr); _context->glObjectPtrLabel(ptrPtr, length, labelPtr);
} }
} }
} }
@@ -447,7 +444,7 @@ namespace StgSharp.Graphics.OpenGL
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void PopDebugGroup() public void PopDebugGroup()
{ {
Context.glPopDebugGroup(); _context->glPopDebugGroup();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -459,7 +456,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (byte* messagePtr = message) { fixed (byte* messagePtr = message) {
Context.glPushDebugGroup(source, id, length, messagePtr); _context->glPushDebugGroup(source, id, length, messagePtr);
} }
} }
@@ -470,7 +467,7 @@ namespace StgSharp.Graphics.OpenGL
uint storageBlockBinding uint storageBlockBinding
) )
{ {
Context.glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding); _context->glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -482,7 +479,7 @@ namespace StgSharp.Graphics.OpenGL
nuint size nuint size
) )
{ {
Context.glTexBufferRange(target, internalformat, buffer.Value, offset, size); _context->glTexBufferRange(target, internalformat, buffer.Value, offset, size);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -495,7 +492,7 @@ namespace StgSharp.Graphics.OpenGL
byte fixedsamplelocations byte fixedsamplelocations
) )
{ {
Context.glTexStorage2DMultisample(target, samples, internalformat, width, height, _context->glTexStorage2DMultisample(target, samples, internalformat, width, height,
fixedsamplelocations); fixedsamplelocations);
} }
@@ -510,8 +507,8 @@ namespace StgSharp.Graphics.OpenGL
byte fixedsamplelocations byte fixedsamplelocations
) )
{ {
Context.glTexStorage3DMultisample(target, samples, internalformat, width, height, depth, _context->glTexStorage3DMultisample(target, samples, internalformat, width, height,
fixedsamplelocations); depth, fixedsamplelocations);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -526,7 +523,7 @@ namespace StgSharp.Graphics.OpenGL
uint numlayers uint numlayers
) )
{ {
Context.glTextureView(texture.Value, target, origtexture.Value, internalformat, _context->glTextureView(texture.Value, target, origtexture.Value, internalformat,
minlevel, numlevels, minlayer, numlayers); minlevel, numlevels, minlayer, numlayers);
} }
@@ -536,7 +533,7 @@ namespace StgSharp.Graphics.OpenGL
uint bindingindex uint bindingindex
) )
{ {
Context.glVertexAttribBinding(attribindex, bindingindex); _context->glVertexAttribBinding(attribindex, bindingindex);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -548,7 +545,8 @@ namespace StgSharp.Graphics.OpenGL
uint relativeoffset uint relativeoffset
) )
{ {
Context.glVertexAttribFormat(attribindex, size, (uint)type, normalized, relativeoffset); _context->glVertexAttribFormat(attribindex, size, (uint)type, normalized,
relativeoffset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -559,7 +557,7 @@ namespace StgSharp.Graphics.OpenGL
uint relativeoffset uint relativeoffset
) )
{ {
Context.glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset); _context->glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -570,7 +568,7 @@ namespace StgSharp.Graphics.OpenGL
uint relativeoffset uint relativeoffset
) )
{ {
Context.glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset); _context->glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -579,7 +577,7 @@ namespace StgSharp.Graphics.OpenGL
uint divisor uint divisor
) )
{ {
Context.glVertexBindingDivisor(bindingindex, divisor); _context->glVertexBindingDivisor(bindingindex, divisor);
} }
} }
@@ -25,10 +25,6 @@
// //
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// <auto-generated>
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
// Version: 4.4
// </auto-generated>
using StgSharp.Graphics.OpenGL; using StgSharp.Graphics.OpenGL;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -48,7 +44,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* buffersPtr = buffers) { fixed (uint* buffersPtr = buffers) {
Context.glBindBuffersBase(target, first, count, buffersPtr); _context->glBindBuffersBase(target, first, count, buffersPtr);
} }
} }
@@ -67,7 +63,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (nint* offsetsPtr = offsets) fixed (nint* offsetsPtr = offsets)
{ {
fixed (nuint* sizesPtr = sizes) { fixed (nuint* sizesPtr = sizes) {
Context.glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr, _context->glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr,
sizesPtr); sizesPtr);
} }
} }
@@ -82,7 +78,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* texturesPtr = textures) { fixed (uint* texturesPtr = textures) {
Context.glBindImageTextures(first, count, texturesPtr); _context->glBindImageTextures(first, count, texturesPtr);
} }
} }
@@ -94,7 +90,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* samplersPtr = samplers) { fixed (uint* samplersPtr = samplers) {
Context.glBindSamplers(first, count, samplersPtr); _context->glBindSamplers(first, count, samplersPtr);
} }
} }
@@ -106,7 +102,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* texturesPtr = textures) { fixed (uint* texturesPtr = textures) {
Context.glBindTextures(first, count, texturesPtr); _context->glBindTextures(first, count, texturesPtr);
} }
} }
@@ -124,7 +120,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (nint* offsetsPtr = offsets) fixed (nint* offsetsPtr = offsets)
{ {
fixed (int* stridesPtr = strides) { fixed (int* stridesPtr = strides) {
Context.glBindVertexBuffers(first, count, buffersPtr, offsetsPtr, _context->glBindVertexBuffers(first, count, buffersPtr, offsetsPtr,
stridesPtr); stridesPtr);
} }
} }
@@ -140,7 +136,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glBufferStorage(target, size, dataPtr, flags); _context->glBufferStorage(target, size, dataPtr, flags);
} }
} }
@@ -154,7 +150,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glClearTexImage(texture.Value, level, format, (uint)type, dataPtr); _context->glClearTexImage(texture.Value, level, format, (uint)type, dataPtr);
} }
} }
@@ -174,7 +170,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, _context->glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width,
height, depth, format, (uint)type, dataPtr); height, depth, format, (uint)type, dataPtr);
} }
} }
+122 -119
View File
@@ -25,10 +25,6 @@
// //
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// <auto-generated>
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
// Version: 4.5
// </auto-generated>
using StgSharp.Graphics.OpenGL; using StgSharp.Graphics.OpenGL;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -45,7 +41,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle texture GlHandle texture
) )
{ {
Context.glBindTextureUnit(unit, texture.Value); _context->glBindTextureUnit(unit, texture.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -64,7 +60,7 @@ namespace StgSharp.Graphics.OpenGL
uint filter uint filter
) )
{ {
Context.glBlitNamedFramebuffer(readFramebuffer.Value, drawFramebuffer.Value, srcX0, _context->glBlitNamedFramebuffer(readFramebuffer.Value, drawFramebuffer.Value, srcX0,
srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
filter); filter);
} }
@@ -75,7 +71,7 @@ namespace StgSharp.Graphics.OpenGL
uint target uint target
) )
{ {
return Context.glCheckNamedFramebufferStatus(framebuffer.Value, target); return _context->glCheckNamedFramebufferStatus(framebuffer.Value, target);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -88,7 +84,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glClearNamedBufferData(buffer.Value, internalformat, format, (uint)type, _context->glClearNamedBufferData(buffer.Value, internalformat, format, (uint)type,
dataPtr); dataPtr);
} }
} }
@@ -105,7 +101,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glClearNamedBufferSubData(buffer.Value, internalformat, offset, size, _context->glClearNamedBufferSubData(buffer.Value, internalformat, offset, size,
format, (uint)type, dataPtr); format, (uint)type, dataPtr);
} }
} }
@@ -119,7 +115,7 @@ namespace StgSharp.Graphics.OpenGL
int stencil int stencil
) )
{ {
Context.glClearNamedFramebufferfi(framebuffer.Value, buffer, drawbuffer, depth, _context->glClearNamedFramebufferfi(framebuffer.Value, buffer, drawbuffer, depth,
stencil); stencil);
} }
@@ -132,7 +128,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* valuePtr = value) { fixed (float* valuePtr = value) {
Context.glClearNamedFramebufferfv(framebuffer.Value, buffer, drawbuffer, valuePtr); _context->glClearNamedFramebufferfv(framebuffer.Value, buffer, drawbuffer,
valuePtr);
} }
} }
@@ -145,7 +142,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* valuePtr = value) { fixed (int* valuePtr = value) {
Context.glClearNamedFramebufferiv(framebuffer.Value, buffer, drawbuffer, valuePtr); _context->glClearNamedFramebufferiv(framebuffer.Value, buffer, drawbuffer,
valuePtr);
} }
} }
@@ -158,7 +156,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* valuePtr = value) { fixed (uint* valuePtr = value) {
Context.glClearNamedFramebufferuiv(framebuffer.Value, buffer, drawbuffer, valuePtr); _context->glClearNamedFramebufferuiv(framebuffer.Value, buffer, drawbuffer,
valuePtr);
} }
} }
@@ -168,7 +167,7 @@ namespace StgSharp.Graphics.OpenGL
uint depth uint depth
) )
{ {
Context.glClipControl(origin, depth); _context->glClipControl(origin, depth);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -183,8 +182,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glCompressedTextureSubImage1D(texture.Value, level, xoffset, width, format, _context->glCompressedTextureSubImage1D(texture.Value, level, xoffset, width,
imageSize, dataPtr); format, imageSize, dataPtr);
} }
} }
@@ -202,8 +201,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glCompressedTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, _context->glCompressedTextureSubImage2D(texture.Value, level, xoffset, yoffset,
height, format, imageSize, dataPtr); width, height, format, imageSize, dataPtr);
} }
} }
@@ -223,7 +222,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glCompressedTextureSubImage3D(texture.Value, level, xoffset, yoffset, _context->glCompressedTextureSubImage3D(texture.Value, level, xoffset, yoffset,
zoffset, width, height, depth, format, zoffset, width, height, depth, format,
imageSize, dataPtr); imageSize, dataPtr);
} }
@@ -238,7 +237,7 @@ namespace StgSharp.Graphics.OpenGL
nuint size nuint size
) )
{ {
Context.glCopyNamedBufferSubData(readBuffer.Value, writeBuffer.Value, readOffset, _context->glCopyNamedBufferSubData(readBuffer.Value, writeBuffer.Value, readOffset,
writeOffset, size); writeOffset, size);
} }
@@ -252,7 +251,7 @@ namespace StgSharp.Graphics.OpenGL
int width int width
) )
{ {
Context.glCopyTextureSubImage1D(texture.Value, level, xoffset, x, y, width); _context->glCopyTextureSubImage1D(texture.Value, level, xoffset, x, y, width);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -267,7 +266,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glCopyTextureSubImage2D(texture.Value, level, xoffset, yoffset, x, y, width, _context->glCopyTextureSubImage2D(texture.Value, level, xoffset, yoffset, x, y, width,
height); height);
} }
@@ -284,7 +283,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glCopyTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, x, y, _context->glCopyTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, x, y,
width, height); width, height);
} }
@@ -294,7 +293,7 @@ namespace StgSharp.Graphics.OpenGL
uint* buffers uint* buffers
) )
{ {
Context.glCreateBuffers(n, buffers); _context->glCreateBuffers(n, buffers);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -303,7 +302,7 @@ namespace StgSharp.Graphics.OpenGL
uint* framebuffers uint* framebuffers
) )
{ {
Context.glCreateFramebuffers(n, framebuffers); _context->glCreateFramebuffers(n, framebuffers);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -312,7 +311,7 @@ namespace StgSharp.Graphics.OpenGL
uint* pipelines uint* pipelines
) )
{ {
Context.glCreateProgramPipelines(n, pipelines); _context->glCreateProgramPipelines(n, pipelines);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -322,7 +321,7 @@ namespace StgSharp.Graphics.OpenGL
uint* ids uint* ids
) )
{ {
Context.glCreateQueries(target, n, ids); _context->glCreateQueries(target, n, ids);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -331,7 +330,7 @@ namespace StgSharp.Graphics.OpenGL
uint* renderbuffers uint* renderbuffers
) )
{ {
Context.glCreateRenderbuffers(n, renderbuffers); _context->glCreateRenderbuffers(n, renderbuffers);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -340,7 +339,7 @@ namespace StgSharp.Graphics.OpenGL
uint* samplers uint* samplers
) )
{ {
Context.glCreateSamplers(n, samplers); _context->glCreateSamplers(n, samplers);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -350,7 +349,7 @@ namespace StgSharp.Graphics.OpenGL
uint* textures uint* textures
) )
{ {
Context.glCreateTextures(target, n, textures); _context->glCreateTextures(target, n, textures);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -359,7 +358,7 @@ namespace StgSharp.Graphics.OpenGL
uint* ids uint* ids
) )
{ {
Context.glCreateTransformFeedbacks(n, ids); _context->glCreateTransformFeedbacks(n, ids);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -368,7 +367,7 @@ namespace StgSharp.Graphics.OpenGL
uint* arrays uint* arrays
) )
{ {
Context.glCreateVertexArrays(n, arrays); _context->glCreateVertexArrays(n, arrays);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -377,7 +376,7 @@ namespace StgSharp.Graphics.OpenGL
uint index uint index
) )
{ {
Context.glDisableVertexArrayAttrib(vaobj, index); _context->glDisableVertexArrayAttrib(vaobj, index);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -386,7 +385,7 @@ namespace StgSharp.Graphics.OpenGL
uint index uint index
) )
{ {
Context.glEnableVertexArrayAttrib(vaobj, index); _context->glEnableVertexArrayAttrib(vaobj, index);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -396,7 +395,7 @@ namespace StgSharp.Graphics.OpenGL
nuint length nuint length
) )
{ {
Context.glFlushMappedNamedBufferRange(buffer.Value, offset, length); _context->glFlushMappedNamedBufferRange(buffer.Value, offset, length);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -404,7 +403,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle texture GlHandle texture
) )
{ {
Context.glGenerateTextureMipmap(texture.Value); _context->glGenerateTextureMipmap(texture.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -415,7 +414,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* pixels IntPtr* pixels
) )
{ {
Context.glGetCompressedTextureImage(texture.Value, level, bufSize, pixels); _context->glGetCompressedTextureImage(texture.Value, level, bufSize, pixels);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -432,14 +431,15 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* pixels IntPtr* pixels
) )
{ {
Context.glGetCompressedTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, _context->glGetCompressedTextureSubImage(texture.Value, level, xoffset, yoffset,
width, height, depth, bufSize, pixels); zoffset, width, height, depth, bufSize,
pixels);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public uint GetGraphicsResetStatus() public uint GetGraphicsResetStatus()
{ {
return Context.glGetGraphicsResetStatus(); return _context->glGetGraphicsResetStatus();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -449,7 +449,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* @params IntPtr* @params
) )
{ {
Context.glGetNamedBufferParameteri64v(buffer.Value, pname, @params); _context->glGetNamedBufferParameteri64v(buffer.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -459,7 +459,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetNamedBufferParameteriv(buffer.Value, pname, @params); _context->glGetNamedBufferParameteriv(buffer.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -469,7 +469,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* @params IntPtr* @params
) )
{ {
Context.glGetNamedBufferPointerv(buffer.Value, pname, @params); _context->glGetNamedBufferPointerv(buffer.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -480,7 +480,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* data IntPtr* data
) )
{ {
Context.glGetNamedBufferSubData(buffer.Value, offset, size, data); _context->glGetNamedBufferSubData(buffer.Value, offset, size, data);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -491,8 +491,8 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetNamedFramebufferAttachmentParameteriv(framebuffer.Value, attachment, pname, _context->glGetNamedFramebufferAttachmentParameteriv(framebuffer.Value, attachment,
@params); pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -502,7 +502,7 @@ namespace StgSharp.Graphics.OpenGL
int* param int* param
) )
{ {
Context.glGetNamedFramebufferParameteriv(framebuffer.Value, pname, param); _context->glGetNamedFramebufferParameteriv(framebuffer.Value, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -512,7 +512,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetNamedRenderbufferParameteriv(renderbuffer.Value, pname, @params); _context->glGetNamedRenderbufferParameteriv(renderbuffer.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -523,7 +523,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* pixels IntPtr* pixels
) )
{ {
Context.glGetnCompressedTexImage(target, lod, bufSize, pixels); _context->glGetnCompressedTexImage(target, lod, bufSize, pixels);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -536,7 +536,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* pixels IntPtr* pixels
) )
{ {
Context.glGetnTexImage(target, level, format, (uint)type, bufSize, pixels); _context->glGetnTexImage(target, level, format, (uint)type, bufSize, pixels);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -547,7 +547,7 @@ namespace StgSharp.Graphics.OpenGL
double* @params double* @params
) )
{ {
Context.glGetnUniformdv(program.Value, location, bufSize, @params); _context->glGetnUniformdv(program.Value, location, bufSize, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -558,7 +558,7 @@ namespace StgSharp.Graphics.OpenGL
float* @params float* @params
) )
{ {
Context.glGetnUniformfv(program.Value, location, bufSize, @params); _context->glGetnUniformfv(program.Value, location, bufSize, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -569,7 +569,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetnUniformiv(program.Value, location, bufSize, @params); _context->glGetnUniformiv(program.Value, location, bufSize, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -580,7 +580,7 @@ namespace StgSharp.Graphics.OpenGL
uint* @params uint* @params
) )
{ {
Context.glGetnUniformuiv(program.Value, location, bufSize, @params); _context->glGetnUniformuiv(program.Value, location, bufSize, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -591,7 +591,7 @@ namespace StgSharp.Graphics.OpenGL
nint offset nint offset
) )
{ {
Context.glGetQueryBufferObjecti64v(id, buffer.Value, pname, offset); _context->glGetQueryBufferObjecti64v(id, buffer.Value, pname, offset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -602,7 +602,7 @@ namespace StgSharp.Graphics.OpenGL
nint offset nint offset
) )
{ {
Context.glGetQueryBufferObjectiv(id, buffer.Value, pname, offset); _context->glGetQueryBufferObjectiv(id, buffer.Value, pname, offset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -613,7 +613,7 @@ namespace StgSharp.Graphics.OpenGL
nint offset nint offset
) )
{ {
Context.glGetQueryBufferObjectui64v(id, buffer.Value, pname, offset); _context->glGetQueryBufferObjectui64v(id, buffer.Value, pname, offset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -624,7 +624,7 @@ namespace StgSharp.Graphics.OpenGL
nint offset nint offset
) )
{ {
Context.glGetQueryBufferObjectuiv(id, buffer.Value, pname, offset); _context->glGetQueryBufferObjectuiv(id, buffer.Value, pname, offset);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -637,7 +637,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* pixels IntPtr* pixels
) )
{ {
Context.glGetTextureImage(texture.Value, level, format, (uint)type, bufSize, pixels); _context->glGetTextureImage(texture.Value, level, format, (uint)type, bufSize, pixels);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -648,7 +648,7 @@ namespace StgSharp.Graphics.OpenGL
float* @params float* @params
) )
{ {
Context.glGetTextureLevelParameterfv(texture.Value, level, pname, @params); _context->glGetTextureLevelParameterfv(texture.Value, level, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -659,7 +659,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetTextureLevelParameteriv(texture.Value, level, pname, @params); _context->glGetTextureLevelParameteriv(texture.Value, level, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -669,7 +669,7 @@ namespace StgSharp.Graphics.OpenGL
float* @params float* @params
) )
{ {
Context.glGetTextureParameterfv(texture.Value, pname, @params); _context->glGetTextureParameterfv(texture.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -679,7 +679,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetTextureParameterIiv(texture.Value, pname, @params); _context->glGetTextureParameterIiv(texture.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -689,7 +689,7 @@ namespace StgSharp.Graphics.OpenGL
uint* @params uint* @params
) )
{ {
Context.glGetTextureParameterIuiv(texture.Value, pname, @params); _context->glGetTextureParameterIuiv(texture.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -699,7 +699,7 @@ namespace StgSharp.Graphics.OpenGL
int* @params int* @params
) )
{ {
Context.glGetTextureParameteriv(texture.Value, pname, @params); _context->glGetTextureParameteriv(texture.Value, pname, @params);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -718,7 +718,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* pixels IntPtr* pixels
) )
{ {
Context.glGetTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, _context->glGetTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, width,
height, depth, format, (uint)type, bufSize, pixels); height, depth, format, (uint)type, bufSize, pixels);
} }
@@ -730,7 +730,7 @@ namespace StgSharp.Graphics.OpenGL
int* param int* param
) )
{ {
Context.glGetTransformFeedbacki_v(xfb, pname, index, param); _context->glGetTransformFeedbacki_v(xfb, pname, index, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -741,7 +741,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* param IntPtr* param
) )
{ {
Context.glGetTransformFeedbacki64_v(xfb, pname, index, param); _context->glGetTransformFeedbacki64_v(xfb, pname, index, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -751,7 +751,7 @@ namespace StgSharp.Graphics.OpenGL
int* param int* param
) )
{ {
Context.glGetTransformFeedbackiv(xfb, pname, param); _context->glGetTransformFeedbackiv(xfb, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -762,7 +762,7 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* param IntPtr* param
) )
{ {
Context.glGetVertexArrayIndexed64iv(vaobj, index, pname, param); _context->glGetVertexArrayIndexed64iv(vaobj, index, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -773,7 +773,7 @@ namespace StgSharp.Graphics.OpenGL
int* param int* param
) )
{ {
Context.glGetVertexArrayIndexediv(vaobj, index, pname, param); _context->glGetVertexArrayIndexediv(vaobj, index, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -783,7 +783,7 @@ namespace StgSharp.Graphics.OpenGL
int* param int* param
) )
{ {
Context.glGetVertexArrayiv(vaobj, pname, param); _context->glGetVertexArrayiv(vaobj, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -794,7 +794,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* attachmentsPtr = attachments) { fixed (uint* attachmentsPtr = attachments) {
Context.glInvalidateNamedFramebufferData(framebuffer.Value, numAttachments, attachmentsPtr); _context->glInvalidateNamedFramebufferData(framebuffer.Value, numAttachments, attachmentsPtr);
} }
} }
@@ -810,7 +810,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* attachmentsPtr = attachments) { fixed (uint* attachmentsPtr = attachments) {
Context.glInvalidateNamedFramebufferSubData(framebuffer.Value, numAttachments, _context->glInvalidateNamedFramebufferSubData(framebuffer.Value, numAttachments,
attachmentsPtr, x, y, width, height); attachmentsPtr, x, y, width, height);
} }
} }
@@ -821,7 +821,7 @@ namespace StgSharp.Graphics.OpenGL
uint access uint access
) )
{ {
Context.glMapNamedBuffer(buffer.Value, access); _context->glMapNamedBuffer(buffer.Value, access);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -832,7 +832,7 @@ namespace StgSharp.Graphics.OpenGL
uint access uint access
) )
{ {
Context.glMapNamedBufferRange(buffer.Value, offset, length, access); _context->glMapNamedBufferRange(buffer.Value, offset, length, access);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -840,7 +840,7 @@ namespace StgSharp.Graphics.OpenGL
uint barriers uint barriers
) )
{ {
Context.glMemoryBarrierByRegion(barriers); _context->glMemoryBarrierByRegion(barriers);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -852,7 +852,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glNamedBufferData(buffer.Value, size, dataPtr, usage); _context->glNamedBufferData(buffer.Value, size, dataPtr, usage);
} }
} }
@@ -865,7 +865,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glNamedBufferStorage(buffer.Value, size, dataPtr, flags); _context->glNamedBufferStorage(buffer.Value, size, dataPtr, flags);
} }
} }
@@ -878,7 +878,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* dataPtr = data) { fixed (IntPtr* dataPtr = data) {
Context.glNamedBufferSubData(buffer.Value, offset, size, dataPtr); _context->glNamedBufferSubData(buffer.Value, offset, size, dataPtr);
} }
} }
@@ -888,7 +888,7 @@ namespace StgSharp.Graphics.OpenGL
uint buf uint buf
) )
{ {
Context.glNamedFramebufferDrawBuffer(framebuffer.Value, buf); _context->glNamedFramebufferDrawBuffer(framebuffer.Value, buf);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -899,7 +899,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* bufsPtr = bufs) { fixed (uint* bufsPtr = bufs) {
Context.glNamedFramebufferDrawBuffers(framebuffer.Value, n, bufsPtr); _context->glNamedFramebufferDrawBuffers(framebuffer.Value, n, bufsPtr);
} }
} }
@@ -910,7 +910,7 @@ namespace StgSharp.Graphics.OpenGL
int param int param
) )
{ {
Context.glNamedFramebufferParameteri(framebuffer.Value, pname, param); _context->glNamedFramebufferParameteri(framebuffer.Value, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -919,7 +919,7 @@ namespace StgSharp.Graphics.OpenGL
uint src uint src
) )
{ {
Context.glNamedFramebufferReadBuffer(framebuffer.Value, src); _context->glNamedFramebufferReadBuffer(framebuffer.Value, src);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -930,7 +930,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle renderbuffer GlHandle renderbuffer
) )
{ {
Context.glNamedFramebufferRenderbuffer(framebuffer.Value, attachment, _context->glNamedFramebufferRenderbuffer(framebuffer.Value, attachment,
renderbuffertarget, renderbuffer.Value); renderbuffertarget, renderbuffer.Value);
} }
@@ -942,7 +942,8 @@ namespace StgSharp.Graphics.OpenGL
int level int level
) )
{ {
Context.glNamedFramebufferTexture(framebuffer.Value, attachment, texture.Value, level); _context->glNamedFramebufferTexture(framebuffer.Value, attachment, texture.Value,
level);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -954,7 +955,7 @@ namespace StgSharp.Graphics.OpenGL
int layer int layer
) )
{ {
Context.glNamedFramebufferTextureLayer(framebuffer.Value, attachment, texture.Value, _context->glNamedFramebufferTextureLayer(framebuffer.Value, attachment, texture.Value,
level, layer); level, layer);
} }
@@ -966,7 +967,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glNamedRenderbufferStorage(renderbuffer.Value, internalformat, width, height); _context->glNamedRenderbufferStorage(renderbuffer.Value, internalformat, width, height);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -978,7 +979,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glNamedRenderbufferStorageMultisample(renderbuffer.Value, samples, _context->glNamedRenderbufferStorageMultisample(renderbuffer.Value, samples,
internalformat, width, height); internalformat, width, height);
} }
@@ -994,13 +995,13 @@ namespace StgSharp.Graphics.OpenGL
IntPtr* data IntPtr* data
) )
{ {
Context.glReadnPixels(x, y, width, height, format, (uint)type, bufSize, data); _context->glReadnPixels(x, y, width, height, format, (uint)type, bufSize, data);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TextureBarrier() public void TextureBarrier()
{ {
Context.glTextureBarrier(); _context->glTextureBarrier();
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1010,7 +1011,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle buffer GlHandle buffer
) )
{ {
Context.glTextureBuffer(texture.Value, internalformat, buffer.Value); _context->glTextureBuffer(texture.Value, internalformat, buffer.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1022,7 +1023,8 @@ namespace StgSharp.Graphics.OpenGL
nuint size nuint size
) )
{ {
Context.glTextureBufferRange(texture.Value, internalformat, buffer.Value, offset, size); _context->glTextureBufferRange(texture.Value, internalformat, buffer.Value, offset,
size);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1032,7 +1034,7 @@ namespace StgSharp.Graphics.OpenGL
float param float param
) )
{ {
Context.glTextureParameterf(texture.Value, pname, param); _context->glTextureParameterf(texture.Value, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1043,7 +1045,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (float* paramPtr = param) { fixed (float* paramPtr = param) {
Context.glTextureParameterfv(texture.Value, pname, paramPtr); _context->glTextureParameterfv(texture.Value, pname, paramPtr);
} }
} }
@@ -1054,7 +1056,7 @@ namespace StgSharp.Graphics.OpenGL
int param int param
) )
{ {
Context.glTextureParameteri(texture.Value, pname, param); _context->glTextureParameteri(texture.Value, pname, param);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1065,7 +1067,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* @paramsPtr = @params) { fixed (int* @paramsPtr = @params) {
Context.glTextureParameterIiv(texture.Value, pname, @paramsPtr); _context->glTextureParameterIiv(texture.Value, pname, @paramsPtr);
} }
} }
@@ -1077,7 +1079,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (uint* @paramsPtr = @params) { fixed (uint* @paramsPtr = @params) {
Context.glTextureParameterIuiv(texture.Value, pname, @paramsPtr); _context->glTextureParameterIuiv(texture.Value, pname, @paramsPtr);
} }
} }
@@ -1089,7 +1091,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (int* paramPtr = param) { fixed (int* paramPtr = param) {
Context.glTextureParameteriv(texture.Value, pname, paramPtr); _context->glTextureParameteriv(texture.Value, pname, paramPtr);
} }
} }
@@ -1101,7 +1103,7 @@ namespace StgSharp.Graphics.OpenGL
int width int width
) )
{ {
Context.glTextureStorage1D(texture.Value, levels, internalformat, width); _context->glTextureStorage1D(texture.Value, levels, internalformat, width);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1113,7 +1115,7 @@ namespace StgSharp.Graphics.OpenGL
int height int height
) )
{ {
Context.glTextureStorage2D(texture.Value, levels, internalformat, width, height); _context->glTextureStorage2D(texture.Value, levels, internalformat, width, height);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1126,7 +1128,7 @@ namespace StgSharp.Graphics.OpenGL
byte fixedsamplelocations byte fixedsamplelocations
) )
{ {
Context.glTextureStorage2DMultisample(texture.Value, samples, internalformat, width, _context->glTextureStorage2DMultisample(texture.Value, samples, internalformat, width,
height, fixedsamplelocations); height, fixedsamplelocations);
} }
@@ -1140,7 +1142,8 @@ namespace StgSharp.Graphics.OpenGL
int depth int depth
) )
{ {
Context.glTextureStorage3D(texture.Value, levels, internalformat, width, height, depth); _context->glTextureStorage3D(texture.Value, levels, internalformat, width, height,
depth);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1154,7 +1157,7 @@ namespace StgSharp.Graphics.OpenGL
byte fixedsamplelocations byte fixedsamplelocations
) )
{ {
Context.glTextureStorage3DMultisample(texture.Value, samples, internalformat, width, _context->glTextureStorage3DMultisample(texture.Value, samples, internalformat, width,
height, depth, fixedsamplelocations); height, depth, fixedsamplelocations);
} }
@@ -1170,7 +1173,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* pixelsPtr = pixels) { fixed (IntPtr* pixelsPtr = pixels) {
Context.glTextureSubImage1D(texture.Value, level, xoffset, width, format, _context->glTextureSubImage1D(texture.Value, level, xoffset, width, format,
(uint)type, pixelsPtr); (uint)type, pixelsPtr);
} }
} }
@@ -1189,7 +1192,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* pixelsPtr = pixels) { fixed (IntPtr* pixelsPtr = pixels) {
Context.glTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, height, _context->glTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, height,
format, (uint)type, pixelsPtr); format, (uint)type, pixelsPtr);
} }
} }
@@ -1210,8 +1213,8 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* pixelsPtr = pixels) { fixed (IntPtr* pixelsPtr = pixels) {
Context.glTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, width, _context->glTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset,
height, depth, format, (uint)type, pixelsPtr); width, height, depth, format, (uint)type, pixelsPtr);
} }
} }
@@ -1222,7 +1225,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle buffer GlHandle buffer
) )
{ {
Context.glTransformFeedbackBufferBase(xfb, index, buffer.Value); _context->glTransformFeedbackBufferBase(xfb, index, buffer.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1234,7 +1237,7 @@ namespace StgSharp.Graphics.OpenGL
nuint size nuint size
) )
{ {
Context.glTransformFeedbackBufferRange(xfb, index, buffer.Value, offset, size); _context->glTransformFeedbackBufferRange(xfb, index, buffer.Value, offset, size);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1242,7 +1245,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle buffer GlHandle buffer
) )
{ {
return Context.glUnmapNamedBuffer(buffer.Value); return _context->glUnmapNamedBuffer(buffer.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1252,7 +1255,7 @@ namespace StgSharp.Graphics.OpenGL
uint bindingindex uint bindingindex
) )
{ {
Context.glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); _context->glVertexArrayAttribBinding(vaobj, attribindex, bindingindex);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1265,7 +1268,7 @@ namespace StgSharp.Graphics.OpenGL
uint relativeoffset uint relativeoffset
) )
{ {
Context.glVertexArrayAttribFormat(vaobj, attribindex, size, (uint)type, normalized, _context->glVertexArrayAttribFormat(vaobj, attribindex, size, (uint)type, normalized,
relativeoffset); relativeoffset);
} }
@@ -1278,7 +1281,7 @@ namespace StgSharp.Graphics.OpenGL
uint relativeoffset uint relativeoffset
) )
{ {
Context.glVertexArrayAttribIFormat(vaobj, attribindex, size, (uint)type, _context->glVertexArrayAttribIFormat(vaobj, attribindex, size, (uint)type,
relativeoffset); relativeoffset);
} }
@@ -1291,7 +1294,7 @@ namespace StgSharp.Graphics.OpenGL
uint relativeoffset uint relativeoffset
) )
{ {
Context.glVertexArrayAttribLFormat(vaobj, attribindex, size, (uint)type, _context->glVertexArrayAttribLFormat(vaobj, attribindex, size, (uint)type,
relativeoffset); relativeoffset);
} }
@@ -1302,7 +1305,7 @@ namespace StgSharp.Graphics.OpenGL
uint divisor uint divisor
) )
{ {
Context.glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); _context->glVertexArrayBindingDivisor(vaobj, bindingindex, divisor);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1311,7 +1314,7 @@ namespace StgSharp.Graphics.OpenGL
GlHandle buffer GlHandle buffer
) )
{ {
Context.glVertexArrayElementBuffer(vaobj, buffer.Value); _context->glVertexArrayElementBuffer(vaobj, buffer.Value);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1323,7 +1326,7 @@ namespace StgSharp.Graphics.OpenGL
int stride int stride
) )
{ {
Context.glVertexArrayVertexBuffer(vaobj, bindingindex, buffer.Value, offset, stride); _context->glVertexArrayVertexBuffer(vaobj, bindingindex, buffer.Value, offset, stride);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1341,7 +1344,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (nint* offsetsPtr = offsets) fixed (nint* offsetsPtr = offsets)
{ {
fixed (int* stridesPtr = strides) { fixed (int* stridesPtr = strides) {
Context.glVertexArrayVertexBuffers(vaobj, first, count, buffersPtr, _context->glVertexArrayVertexBuffers(vaobj, first, count, buffersPtr,
offsetsPtr, stridesPtr); offsetsPtr, stridesPtr);
} }
} }
@@ -25,10 +25,6 @@
// //
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// <auto-generated>
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
// Version: 4.6
// </auto-generated>
using StgSharp.Graphics.OpenGL; using StgSharp.Graphics.OpenGL;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -49,7 +45,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indirectPtr = indirect) { fixed (IntPtr* indirectPtr = indirect) {
Context.glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount, _context->glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount,
stride); stride);
} }
} }
@@ -65,7 +61,7 @@ namespace StgSharp.Graphics.OpenGL
) )
{ {
fixed (IntPtr* indirectPtr = indirect) { fixed (IntPtr* indirectPtr = indirect) {
Context.glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount, _context->glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount,
maxdrawcount, stride); maxdrawcount, stride);
} }
} }
@@ -77,7 +73,7 @@ namespace StgSharp.Graphics.OpenGL
float clamp float clamp
) )
{ {
Context.glPolygonOffsetClamp(factor, units, clamp); _context->glPolygonOffsetClamp(factor, units, clamp);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -94,7 +90,7 @@ namespace StgSharp.Graphics.OpenGL
fixed (uint* pConstantIndexPtr = pConstantIndex) fixed (uint* pConstantIndexPtr = pConstantIndex)
{ {
fixed (uint* pConstantValuePtr = pConstantValue) { fixed (uint* pConstantValuePtr = pConstantValue) {
Context.glSpecializeShader(shader.Value, pEntryPointPtr, _context->glSpecializeShader(shader.Value, pEntryPointPtr,
numSpecializationConstants, pConstantIndexPtr, numSpecializationConstants, pConstantIndexPtr,
pConstantValuePtr); pConstantValuePtr);
} }
+108 -17
View File
@@ -1,4 +1,4 @@
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// file="TimeSequence" // file="TimeSequence"
// Project: StgSharp // Project: StgSharp
@@ -40,22 +40,43 @@ namespace StgSharp.Common.Timing
public long PreviousFrameTick { get; protected set; } public long PreviousFrameTick { get; protected set; }
public static TimeSequence CreateLinear(double totalSeconds, double frameSeconds) => new LinearTimeSequence(totalSeconds, frameSeconds); public static TimeSequence CreateLinear(
double totalSeconds,
double frameSeconds
)
{
if (double.IsPositiveInfinity(totalSeconds)) {
return new InfiniteLinearTimeSequence(frameSeconds);
}
return new LinearTimeSequence(totalSeconds, frameSeconds);
}
public static TimeSequence CreateLinearInfinite(
double frameSeconds
)
{
return new InfiniteLinearTimeSequence(frameSeconds);
}
public static TimeSequence CreateLogarithmic( public static TimeSequence CreateLogarithmic(
double initialSliceSeconds, double initialSliceSeconds,
double totalSeconds, double totalSeconds,
double growthMultiplier, double growthMultiplier,
double minSliceSeconds) => new LogTimeSequence(initialSliceSeconds, double minSliceSeconds
totalSeconds, ) => new LogTimeSequence(initialSliceSeconds, totalSeconds, growthMultiplier,
growthMultiplier,
minSliceSeconds); minSliceSeconds);
public abstract bool EndsAt(long currentTick); public abstract bool EndsAt(
long currentTick
);
public abstract bool IsNextFrameReady(long currentTick); public abstract bool IsNextFrameReady(
long currentTick
);
public abstract void StartFrom(TimeSourceProviderBase source); public abstract void StartFrom(
TimeSourceProviderBase source
);
} }
@@ -66,7 +87,10 @@ namespace StgSharp.Common.Timing
private readonly double _totalSeconds; private readonly double _totalSeconds;
private long _frameLengthTicks; private long _frameLengthTicks;
public LinearTimeSequence(double totalSeconds, double frameSeconds) public LinearTimeSequence(
double totalSeconds,
double frameSeconds
)
{ {
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(totalSeconds); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(totalSeconds);
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(frameSeconds); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(frameSeconds);
@@ -78,10 +102,14 @@ namespace StgSharp.Common.Timing
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool EndsAt(long currentTick) => currentTick >= EndingTick; public override bool EndsAt(
long currentTick
) => currentTick >= EndingTick;
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool IsNextFrameReady(long currentTick) public override bool IsNextFrameReady(
long currentTick
)
{ {
long span = currentTick - PreviousFrameTick; long span = currentTick - PreviousFrameTick;
if (span >= _frameLengthTicks && currentTick < EndingTick) if (span >= _frameLengthTicks && currentTick < EndingTick)
@@ -92,7 +120,9 @@ namespace StgSharp.Common.Timing
return false; return false;
} }
public override void StartFrom(TimeSourceProviderBase source) public override void StartFrom(
TimeSourceProviderBase source
)
{ {
long f = source?.Frequency ?? throw new ArgumentNullException(nameof(source)); long f = source?.Frequency ?? throw new ArgumentNullException(nameof(source));
_frameLengthTicks = (long)Math.Max(1, _frameSeconds * f); _frameLengthTicks = (long)Math.Max(1, _frameSeconds * f);
@@ -127,7 +157,8 @@ namespace StgSharp.Common.Timing
double initialSliceSeconds, double initialSliceSeconds,
double totalSeconds, double totalSeconds,
double growthMultiplier, double growthMultiplier,
double minSliceSeconds) double minSliceSeconds
)
{ {
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(initialSliceSeconds); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(initialSliceSeconds);
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(totalSeconds); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(totalSeconds);
@@ -146,10 +177,17 @@ namespace StgSharp.Common.Timing
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool EndsAt(long currentTick) => currentTick >= EndingTick; public override bool EndsAt(
long currentTick
)
{
return currentTick >= EndingTick;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool IsNextFrameReady(long currentTick) public override bool IsNextFrameReady(
long currentTick
)
{ {
// Emit final once when reaching or passing end. // Emit final once when reaching or passing end.
if (currentTick >= EndingTick) if (currentTick >= EndingTick)
@@ -197,7 +235,9 @@ namespace StgSharp.Common.Timing
return true; return true;
} }
public override void StartFrom(TimeSourceProviderBase source) public override void StartFrom(
TimeSourceProviderBase source
)
{ {
_freq = source?.Frequency ?? throw new ArgumentNullException(nameof(source)); _freq = source?.Frequency ?? throw new ArgumentNullException(nameof(source));
BeginningTick = source.GetCurrentTimeSpanTick(); BeginningTick = source.GetCurrentTimeSpanTick();
@@ -212,7 +252,58 @@ namespace StgSharp.Common.Timing
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private long SecondsToTicks(double seconds) => (long)Math.Max(1L, Math.Round(seconds * _freq, MidpointRounding.AwayFromZero)); private long SecondsToTicks(
double seconds
) => (long)Math.Max(1L, Math.Round(seconds * _freq, MidpointRounding.AwayFromZero));
}
/// <summary>
/// Infinite linear time sequence: emits frames at fixed interval and never ends.
/// </summary>
internal sealed class InfiniteLinearTimeSequence : TimeSequence
{
private readonly double _frameSeconds;
private long _frameLengthTicks;
public InfiniteLinearTimeSequence(
double frameSeconds
)
{
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(frameSeconds);
_frameSeconds = frameSeconds;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool EndsAt(
long currentTick
) => false; // never ends
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool IsNextFrameReady(
long currentTick
)
{
long span = currentTick - PreviousFrameTick;
if (span >= _frameLengthTicks)
{
PreviousFrameTick += _frameLengthTicks;
return true;
}
return false;
}
public override void StartFrom(
TimeSourceProviderBase source
)
{
long f = source?.Frequency ?? throw new ArgumentNullException(nameof(source));
_frameLengthTicks = (long)Math.Max(1, _frameSeconds * f);
BeginningTick = source.GetCurrentTimeSpanTick();
EndingTick = long.MaxValue; // sentinel
PreviousFrameTick = BeginningTick;
}
} }
} }
@@ -1,4 +1,4 @@
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// file="TimeSpanProvider.Awaiting" // file="TimeSpanProvider.Awaiting"
// Project: StgSharp // Project: StgSharp
@@ -43,8 +43,8 @@ namespace StgSharp.Timing
private static int s_maxID; private static int s_maxID;
private EventHandler? _refreshHandler, _missHandler; private EventHandler? _refreshHandler, _missHandler;
private int _pendingSpans; // Number of unconsumed span ticks since last Wait.
private int _size, _id; private int _size, _id;
private long _pendingSpans; // Number of unconsumed span ticks since last Wait.
private readonly ManualResetEventSlim _event = new(); private readonly ManualResetEventSlim _event = new();
private readonly object _participantObject = new(); private readonly object _participantObject = new();
@@ -75,7 +75,7 @@ namespace StgSharp.Timing
/// <summary> /// <summary>
/// Number of span ticks not yet consumed by Wait ( &gt; 0 means last tick not waited). /// Number of span ticks not yet consumed by Wait ( &gt; 0 means last tick not waited).
/// </summary> /// </summary>
public int PendingSpanCount => Volatile.Read(ref _pendingSpans); public long PendingSpanCount => Volatile.Read(ref _pendingSpans);
internal ManualResetEventSlim AwaitingEvent internal ManualResetEventSlim AwaitingEvent
{ {
@@ -110,10 +110,8 @@ namespace StgSharp.Timing
// Consume one span slot (clamp at 0 so multiple subscribers won't make it negative). // Consume one span slot (clamp at 0 so multiple subscribers won't make it negative).
while (true) while (true)
{ {
int cur = Volatile.Read(ref _pendingSpans); long cur = Volatile.Read(ref _pendingSpans);
if (cur == 0) if (cur == 0) {
{
_event.Dispose();
return; return;
} }
@@ -134,7 +132,7 @@ namespace StgSharp.Timing
await Task.Run(() => _event.Wait()).ConfigureAwait(false); await Task.Run(() => _event.Wait()).ConfigureAwait(false);
while (true) while (true)
{ {
int cur = Volatile.Read(ref _pendingSpans); long cur = Volatile.Read(ref _pendingSpans);
if (cur == 0) if (cur == 0)
{ {
break; break;
@@ -156,23 +154,17 @@ namespace StgSharp.Timing
/// OperationCanceledException when token is cancelled. If the provider is disposed during /// OperationCanceledException when token is cancelled. If the provider is disposed during
/// wait an OperationCanceledException is thrown to indicate end. /// wait an OperationCanceledException is thrown to indicate end.
/// </summary> /// </summary>
public Task WaitNextSpanAsync(CancellationToken ct) public Task WaitNextSpanAsync(
{ CancellationToken ct
try )
{ {
// Block the current thread until the event is signaled or cancellation requested. // Block the current thread until the event is signaled or cancellation requested.
_event.Wait(ct); _event.Wait(ct);
}
catch (ObjectDisposedException)
{
// provider disposed while waiting - treat as cancellation/ended
throw new OperationCanceledException(ct);
}
// consume one pending span (same logic as non-cancellable variant) // consume one pending span (same logic as non-cancellable variant)
while (true) while (true)
{ {
int cur = Volatile.Read(ref _pendingSpans); long cur = Volatile.Read(ref _pendingSpans);
if (cur == 0) if (cur == 0)
{ {
break; break;
@@ -203,7 +195,9 @@ namespace StgSharp.Timing
/// True if the span provider is working. False if time is over (the sequence ended). /// True if the span provider is working. False if time is over (the sequence ended).
/// </returns> /// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
internal bool OnSpanTick(long currentTick) internal bool OnSpanTick(
long currentTick
)
{ {
if (_sequence.EndsAt(currentTick)) if (_sequence.EndsAt(currentTick))
{ {
@@ -223,7 +223,7 @@ namespace StgSharp.Mathematics.Numeric
package->LeftPrimOffset = left.KernelColumnLength; package->LeftPrimOffset = left.KernelColumnLength;
package->PrimCount = ans.KernelColumnLength / size; package->PrimCount = ans.KernelColumnLength / size;
package->SecCount = ans.KernelRowLength / size; package->SecCount = ans.KernelRowLength / size;
package->ElementSize = size; package->ElementSize = (int)MatrixElementType.F32;
package->ComputeMode = new MatrixOpMode(MatrixIndexStyle.BUFFER_INDEX, MatrixOperationSpecial.SEQ_FMA); package->ComputeMode = new MatrixOpMode(MatrixIndexStyle.BUFFER_INDEX, MatrixOperationSpecial.SEQ_FMA);
MatrixParallelHandle taskGroup = MatrixParallel.ScheduleTask(package); MatrixParallelHandle taskGroup = MatrixParallel.ScheduleTask(package);
@@ -80,14 +80,18 @@ namespace StgSharp.Mathematics.Numeric
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void ExecuteTaskPackage(Queue<IntPtr> taskQueue) public static unsafe void ExecuteTaskPackage(
Queue<IntPtr> taskQueue
)
{ {
while (taskQueue.TryDequeue(out nint handle)) while (taskQueue.TryDequeue(out nint handle))
{ {
MatrixParallelTaskPackage* p = (MatrixParallelTaskPackage*)handle; MatrixParallelTaskPackage* p = (MatrixParallelTaskPackage*)handle;
if ((short)p->ComputeMode.ParameterStyle < 0) { if ((short)p->ComputeMode.ParameterStyle < 0)
{
MatrixComputeModel.SpecialBufferCompute(p); MatrixComputeModel.SpecialBufferCompute(p);
} } else
{
switch (p->ComputeMode.OperationStyle) switch (p->ComputeMode.OperationStyle)
{ {
case MatrixIndexStyle.BUFFER_INDEX: case MatrixIndexStyle.BUFFER_INDEX:
@@ -117,6 +121,7 @@ namespace StgSharp.Mathematics.Numeric
} }
} }
} }
}
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Restart() public void Restart()
@@ -167,7 +172,9 @@ namespace StgSharp.Mathematics.Numeric
current.Priority = ThreadPriority.Normal; current.Priority = ThreadPriority.Normal;
} }
protected virtual void Dispose(bool disposing) protected virtual void Dispose(
bool disposing
)
{ {
if (!disposedValue) if (!disposedValue)
{ {
@@ -229,18 +236,18 @@ namespace StgSharp.Mathematics.Numeric
{ {
case RoleType.Worker://worker case RoleType.Worker://worker
// _ = Interlocked.Decrement(ref RemainThreadCount); // _ = Interlocked.Decrement(ref RemainThreadCount);
// Console.WriteLine("worker start"); // Console.WriteLine($"worker {Environment.CurrentManagedThreadId} start");
ExecuteTaskPackage(Tasks); ExecuteTaskPackage(Tasks);
BindedWrap.ReportThreadAccomplished(); BindedWrap.ReportThreadAccomplished();
// Console.WriteLine("worker end"); // Console.WriteLine($"worker {Environment.CurrentManagedThreadId} end");
break; break;
case RoleType.Scheduler://scheduler case RoleType.Scheduler://scheduler
// Console.WriteLine("scheduler start"); // Console.WriteLine($"scheduler {Environment.CurrentManagedThreadId} start");
BindedWrap.PublishTaskToWorkers(); BindedWrap.PublishTaskToWorkers();
BindedWrap.SetAllWorker(); BindedWrap.SetAllWorker();
// Console.WriteLine("scheduler done"); // Console.WriteLine($"scheduler {Environment.CurrentManagedThreadId} done");
ExecuteTaskPackage(Tasks); ExecuteTaskPackage(Tasks);
BindedWrap.ReportThreadAccomplished(); BindedWrap.ReportThreadAccomplished();
BindedWrap.WaitAllWorker(); BindedWrap.WaitAllWorker();
@@ -270,7 +277,10 @@ namespace StgSharp.Mathematics.Numeric
public readonly int LogicalProcessor; public readonly int LogicalProcessor;
public readonly nuint Mask; public readonly nuint Mask;
public AffinityBinding(int logicalProcessor, nuint mask) public AffinityBinding(
int logicalProcessor,
nuint mask
)
{ {
LogicalProcessor = logicalProcessor; LogicalProcessor = logicalProcessor;
Mask = mask; Mask = mask;
@@ -328,7 +338,9 @@ namespace StgSharp.Mathematics.Numeric
} }
} }
public static void Release(int logicalProcessor) public static void Release(
int logicalProcessor
)
{ {
if ((uint)logicalProcessor >= 64u) { if ((uint)logicalProcessor >= 64u) {
return; return;
@@ -385,11 +397,14 @@ namespace StgSharp.Mathematics.Numeric
[DllImport("kernel32.dll")] [DllImport("kernel32.dll")]
private static extern nuint SetThreadAffinityMask( private static extern nuint SetThreadAffinityMask(
IntPtr hThread, IntPtr hThread,
nuint dwThreadAffinityMask); nuint dwThreadAffinityMask
);
[LibraryImport("kernel32.dll")] [LibraryImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static partial bool GetNumaHighestNodeNumber(out uint HighestNodeNumber); private static partial bool GetNumaHighestNodeNumber(
out uint HighestNodeNumber
);
#elif LINUX #elif LINUX
+5
View File
@@ -264,6 +264,11 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx, fma);
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx_fma, fma); DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx_fma, fma);
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, 512, fma); DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, 512, fma);
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, sse, fma);
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, avx, fma);
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, avx_fma, fma);
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, 512, fma);
#pragma endregion #pragma endregion
#pragma region scaler_simd #pragma region scaler_simd
+177 -1
View File
@@ -142,7 +142,7 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, 512, fma)
{ {
const __m512i ones = _mm512_set1_epi32(1); const __m512i ones = _mm512_set1_epi32(1);
for (int col = 0; col < 8; ++col) { for (int col = 0; col < 16; ++col) {
register __m512 bcol = _mm512_load_ps((float *)&right->vec[col][0]); register __m512 bcol = _mm512_load_ps((float *)&right->vec[col][0]);
register __m512 ccol = _mm512_load_ps((float *)&ans->vec[col][0]); register __m512 ccol = _mm512_load_ps((float *)&ans->vec[col][0]);
register __m512i idx = _mm512_setzero_si512(); register __m512i idx = _mm512_setzero_si512();
@@ -203,3 +203,179 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, 512, fma)
_mm512_store_ps((float *)&ans->vec[col][0], ccol); _mm512_store_ps((float *)&ans->vec[col][0], ccol);
} }
} }
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, sse, fma)
{
for (int col = 0; col < 4; ++col) {
/* current answer column (two chunks: rows 0-1 and 2-3) */
register __m128d c_lo = _mm_castps_pd(PANEL_COL_VEC((*ans), col, 0));
register __m128d c_hi = _mm_castps_pd(PANEL_COL_VEC((*ans), col, 1));
/* right matrix column split into two chunks */
register __m128d b_lo = _mm_castps_pd(PANEL_COL_VEC((*right), col, 0));
register __m128d b_hi = _mm_castps_pd(PANEL_COL_VEC((*right), col, 1));
/* k = 0 */
{
register __m128d a_lo = _mm_castps_pd(PANEL_COL_VEC((*left), 0, 0));
register __m128d a_hi = _mm_castps_pd(PANEL_COL_VEC((*left), 0, 1));
register __m128d b = _mm_shuffle_pd(b_lo, b_lo, 0x0);
c_lo = _mm_add_pd(c_lo, _mm_mul_pd(a_lo, b));
c_hi = _mm_add_pd(c_hi, _mm_mul_pd(a_hi, b));
}
/* k = 1 */
{
register __m128d a_lo = _mm_castps_pd(PANEL_COL_VEC((*left), 1, 0));
register __m128d a_hi = _mm_castps_pd(PANEL_COL_VEC((*left), 1, 1));
register __m128d b = _mm_shuffle_pd(b_lo, b_lo, 0x3);
c_lo = _mm_add_pd(c_lo, _mm_mul_pd(a_lo, b));
c_hi = _mm_add_pd(c_hi, _mm_mul_pd(a_hi, b));
}
/* k = 2 */
{
register __m128d a_lo = _mm_castps_pd(PANEL_COL_VEC((*left), 2, 0));
register __m128d a_hi = _mm_castps_pd(PANEL_COL_VEC((*left), 2, 1));
register __m128d b = _mm_shuffle_pd(b_hi, b_hi, 0x0);
c_lo = _mm_add_pd(c_lo, _mm_mul_pd(a_lo, b));
c_hi = _mm_add_pd(c_hi, _mm_mul_pd(a_hi, b));
}
/* k = 3 */
{
register __m128d a_lo = _mm_castps_pd(PANEL_COL_VEC((*left), 3, 0));
register __m128d a_hi = _mm_castps_pd(PANEL_COL_VEC((*left), 3, 1));
register __m128d b = _mm_shuffle_pd(b_hi, b_hi, 0x3);
c_lo = _mm_add_pd(c_lo, _mm_mul_pd(a_lo, b));
c_hi = _mm_add_pd(c_hi, _mm_mul_pd(a_hi, b));
}
PANEL_COL_VEC((*ans), col, 0) = _mm_castpd_ps(c_lo);
PANEL_COL_VEC((*ans), col, 1) = _mm_castpd_ps(c_hi);
}
}
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, avx, fma)
{
register __m256d a0 = _mm256_load_pd((double *)&left->vec[0][0]);
register __m256d a1 = _mm256_load_pd((double *)&left->vec[1][0]);
register __m256d a2 = _mm256_load_pd((double *)&left->vec[2][0]);
register __m256d a3 = _mm256_load_pd((double *)&left->vec[3][0]);
register __m256d c0 = _mm256_load_pd((double *)&ans->vec[0][0]);
register __m256d c1 = _mm256_load_pd((double *)&ans->vec[1][0]);
register __m256d c2 = _mm256_load_pd((double *)&ans->vec[2][0]);
register __m256d c3 = _mm256_load_pd((double *)&ans->vec[3][0]);
register __m256d bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c0 = _mm256_add_pd(c0, _mm256_mul_pd(a0, _mm256_permute_pd(bcol, 0x0)));
c0 = _mm256_add_pd(c0, _mm256_mul_pd(a1, _mm256_permute_pd(bcol, 0x3)));
c0 = _mm256_add_pd(c0, _mm256_mul_pd(a2, _mm256_permute_pd(bcol, 0x0)));
c0 = _mm256_add_pd(c0, _mm256_mul_pd(a3, _mm256_permute_pd(bcol, 0x3)));
_mm256_store_pd((double *)&ans->vec[0][0], c0);
bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c1 = _mm256_add_pd(c1, _mm256_mul_pd(a0, _mm256_permute_pd(bcol, 0x0)));
c1 = _mm256_add_pd(c1, _mm256_mul_pd(a1, _mm256_permute_pd(bcol, 0x3)));
c1 = _mm256_add_pd(c1, _mm256_mul_pd(a2, _mm256_permute_pd(bcol, 0x0)));
c1 = _mm256_add_pd(c1, _mm256_mul_pd(a3, _mm256_permute_pd(bcol, 0x3)));
_mm256_store_pd((double *)&ans->vec[1][0], c1);
bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c2 = _mm256_add_pd(c2, _mm256_mul_pd(a0, _mm256_permute_pd(bcol, 0x0)));
c2 = _mm256_add_pd(c2, _mm256_mul_pd(a1, _mm256_permute_pd(bcol, 0x3)));
c2 = _mm256_add_pd(c2, _mm256_mul_pd(a2, _mm256_permute_pd(bcol, 0x0)));
c2 = _mm256_add_pd(c2, _mm256_mul_pd(a3, _mm256_permute_pd(bcol, 0x3)));
_mm256_store_pd((double *)&ans->vec[2][0], c2);
bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c3 = _mm256_add_pd(c3, _mm256_mul_pd(a0, _mm256_permute_pd(bcol, 0x0)));
c3 = _mm256_add_pd(c3, _mm256_mul_pd(a1, _mm256_permute_pd(bcol, 0x3)));
c3 = _mm256_add_pd(c3, _mm256_mul_pd(a2, _mm256_permute_pd(bcol, 0x0)));
c3 = _mm256_add_pd(c3, _mm256_mul_pd(a3, _mm256_permute_pd(bcol, 0x3)));
_mm256_store_pd((double *)&ans->vec[3][0], c3);
}
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, avx_fma, fma)
{
register __m256d a0 = _mm256_load_pd((double *)&left->vec[0][0]);
register __m256d a1 = _mm256_load_pd((double *)&left->vec[1][0]);
register __m256d a2 = _mm256_load_pd((double *)&left->vec[2][0]);
register __m256d a3 = _mm256_load_pd((double *)&left->vec[3][0]);
register __m256d c0 = _mm256_load_pd((double *)&ans->vec[0][0]);
register __m256d c1 = _mm256_load_pd((double *)&ans->vec[1][0]);
register __m256d c2 = _mm256_load_pd((double *)&ans->vec[2][0]);
register __m256d c3 = _mm256_load_pd((double *)&ans->vec[3][0]);
register __m256d bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c0 = _mm256_fmadd_pd(a0, _mm256_permute_pd(bcol, 0x0), c0);
c0 = _mm256_fmadd_pd(a1, _mm256_permute_pd(bcol, 0x3), c0);
c0 = _mm256_fmadd_pd(a2, _mm256_permute_pd(bcol, 0x0), c0);
c0 = _mm256_fmadd_pd(a3, _mm256_permute_pd(bcol, 0x3), c0);
_mm256_store_pd((double *)&ans->vec[0][0], c0);
bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c1 = _mm256_fmadd_pd(a0, _mm256_permute_pd(bcol, 0x0), c1);
c1 = _mm256_fmadd_pd(a1, _mm256_permute_pd(bcol, 0x3), c1);
c1 = _mm256_fmadd_pd(a2, _mm256_permute_pd(bcol, 0x0), c1);
c1 = _mm256_fmadd_pd(a3, _mm256_permute_pd(bcol, 0x3), c1);
_mm256_store_pd((double *)&ans->vec[1][0], c1);
bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c2 = _mm256_fmadd_pd(a0, _mm256_permute_pd(bcol, 0x0), c2);
c2 = _mm256_fmadd_pd(a1, _mm256_permute_pd(bcol, 0x3), c2);
c2 = _mm256_fmadd_pd(a2, _mm256_permute_pd(bcol, 0x0), c2);
c2 = _mm256_fmadd_pd(a3, _mm256_permute_pd(bcol, 0x3), c2);
_mm256_store_pd((double *)&ans->vec[2][0], c2);
bcol = _mm256_load_pd((double *)&right->vec[0][0]);
c3 = _mm256_fmadd_pd(a0, _mm256_permute_pd(bcol, 0x0), c3);
c3 = _mm256_fmadd_pd(a1, _mm256_permute_pd(bcol, 0x3), c3);
c3 = _mm256_fmadd_pd(a2, _mm256_permute_pd(bcol, 0x0), c3);
c3 = _mm256_fmadd_pd(a3, _mm256_permute_pd(bcol, 0x3), c3);
_mm256_store_pd((double *)&ans->vec[3][0], c3);
}
// ans = left * right + ans
// right is not transposed
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(double, 512, fma)
{
const __m512i ones = _mm512_set1_epi32(1);
register __m512d a0 = _mm512_load_pd((double *)&left->vec[0][0]);
register __m512d a1 = _mm512_load_pd((double *)&left->vec[1][0]);
register __m512d a2 = _mm512_load_pd((double *)&left->vec[2][0]);
register __m512d a3 = _mm512_load_pd((double *)&left->vec[3][0]);
register __m512d a4 = _mm512_load_pd((double *)&left->vec[4][0]);
register __m512d a5 = _mm512_load_pd((double *)&left->vec[5][0]);
register __m512d a6 = _mm512_load_pd((double *)&left->vec[6][0]);
register __m512d a7 = _mm512_load_pd((double *)&left->vec[7][0]);
for (int col = 0; col < 8; ++col) {
register __m512d bcol = _mm512_load_pd((double *)&right->vec[col][0]);
register __m512d ccol = _mm512_load_pd((double *)&ans->vec[col][0]);
register __m512i idx = _mm512_setzero_si512();
register __m512i increament = _mm512_load_si512(&ones);
ccol = _mm512_fmadd_pd(a0, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a1, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a2, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a3, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a4, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a5, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a6, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
ccol = _mm512_fmadd_pd(a7, _mm512_permutexvar_pd(idx, bcol), ccol);
idx = _mm512_add_epi64(idx, increament);
_mm512_store_pd((double *)&ans->vec[col][0], ccol);
}
}
+3 -3
View File
@@ -84,7 +84,7 @@ void load_intrinsic_sse(sn_intrinsic *context)
context->mat[F64].buffer_transpose = NULL; context->mat[F64].buffer_transpose = NULL;
context->mat[F64].build_panel = NULL; context->mat[F64].build_panel = NULL;
context->mat[F64].clear_panel = PNL_PROC(double, sse, clear); context->mat[F64].clear_panel = PNL_PROC(double, sse, clear);
context->mat[F64].panel_fma = NULL; context->mat[F64].panel_fma = PNL_PROC(double, sse, fma);
context->mat[F64].pivot = NULL; context->mat[F64].pivot = NULL;
context->mat[F64].store_panel = NULL; context->mat[F64].store_panel = NULL;
@@ -115,7 +115,7 @@ void load_intrinsic_avx(sn_intrinsic *context)
context->mat[F64].buffer_transpose = NULL; context->mat[F64].buffer_transpose = NULL;
context->mat[F64].build_panel = NULL; context->mat[F64].build_panel = NULL;
context->mat[F64].clear_panel = PNL_PROC(double, avx, clear); context->mat[F64].clear_panel = PNL_PROC(double, avx, clear);
context->mat[F64].panel_fma = NULL; context->mat[F64].panel_fma = PNL_PROC(double, avx, fma);
context->mat[F64].pivot = NULL; context->mat[F64].pivot = NULL;
context->mat[F64].store_panel = NULL; context->mat[F64].store_panel = NULL;
@@ -146,7 +146,7 @@ void load_intrinsic_512(sn_intrinsic *context)
context->mat[F64].buffer_transpose = NULL; context->mat[F64].buffer_transpose = NULL;
context->mat[F64].build_panel = BUILD_PANEL(512, double); context->mat[F64].build_panel = BUILD_PANEL(512, double);
context->mat[F64].clear_panel = PNL_PROC(double, 512, clear); context->mat[F64].clear_panel = PNL_PROC(double, 512, clear);
context->mat[F64].panel_fma = NULL; context->mat[F64].panel_fma = PNL_PROC(double, 512, fma);
context->mat[F64].pivot = NULL; context->mat[F64].pivot = NULL;
context->mat[F64].store_panel = STORE_PANEL(512, double); context->mat[F64].store_panel = STORE_PANEL(512, double);
+12 -7
View File
@@ -50,19 +50,22 @@ namespace StgSharp
.UseModule<GraphicModule>() .UseModule<GraphicModule>()
.InitializeModule(); .InitializeModule();
TestRender(); // TestRender();
/* /**/
HybridLayerSegregatedFitAllocator hlsf; HybridLayerSegregatedFitAllocator hlsf;
unchecked { unchecked {
hlsf = new((nuint)(64 * (ulong)10000 * 10000)); hlsf = new((nuint)(64 * (ulong)10000 * 10000));
} }
Matrix<float> m = Matrix<float>.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf); Matrix<double> m = Matrix<double>.Create(4000, 4000, MatrixLayout.DenseRectangle,
hlsf);
MatrixCompute.Fill(m, 1.0f); MatrixCompute.Fill(m, 1.0f);
Matrix<float> n = Matrix<float>.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf); Matrix<double> n = Matrix<double>.Create(4000, 4000, MatrixLayout.DenseRectangle,
hlsf);
MatrixCompute.Fill(n, 1.0f); MatrixCompute.Fill(n, 1.0f);
Matrix<float> p = Matrix<float>.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf); Matrix<double> p = Matrix<double>.Create(4000, 4000, MatrixLayout.DenseRectangle,
hlsf);
MatrixCompute.Fill(p, 0.0f);
// MatrixCompute.Fill(p, 0.0f);
/* /*
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
@@ -77,7 +80,9 @@ namespace StgSharp
Console.WriteLine($"{i}"); Console.WriteLine($"{i}");
GC.Collect(); GC.Collect();
} }
/*
/**/
Console.WriteLine("===================================================");
MatrixCompute.Mul(n, m, p); MatrixCompute.Mul(n, m, p);
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
{ {