From 0e93787fa25f6ac54679b01b30d0397270d7c81b Mon Sep 17 00:00:00 2001 From: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com> Date: Wed, 31 Dec 2025 18:15:43 +0800 Subject: [PATCH] Double add sub mul sc-mul ok --- StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs | 23 +- StgSharp.Common/Graphics/OpenGL/glFunction.cs | 170 ++--- .../Graphics/OpenGL/glFunction.v3_3.cs | 697 +++++++++--------- .../Graphics/OpenGL/glFunction.v4_0.cs | 98 +-- .../Graphics/OpenGL/glFunction.v4_1.cs | 212 +++--- .../Graphics/OpenGL/glFunction.v4_2.cs | 39 +- .../Graphics/OpenGL/glFunction.v4_3.cs | 116 ++- .../Graphics/OpenGL/glFunction.v4_4.cs | 28 +- .../Graphics/OpenGL/glFunction.v4_5.cs | 287 ++++---- .../Graphics/OpenGL/glFunction.v4_6.cs | 20 +- StgSharp.Common/Timing/TimeSequence.cs | 127 +++- .../Timing/TimeSpanProvider.Awaiting.cs | 36 +- .../Numeric/MatrixCompute.Float.cs | 2 +- .../Numeric/MatrixParallelThread.cs | 91 ++- StgSharp.Native/sn-head/sn_intrinsic.h | 5 + StgSharp.Native/sn-src/k_fma.c | 178 ++++- StgSharp.Native/sn-src/load_intrinsic.c | 6 +- StgSharpDebug/Program.cs | 19 +- 18 files changed, 1210 insertions(+), 944 deletions(-) diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs index cbc9383e..dd295fe8 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="FBO" // Project: StgSharp @@ -52,10 +52,14 @@ namespace StgSharp.Graphics.OpenGL public sealed class FrameBuffer : GlBufferObjectBase { - internal unsafe FrameBuffer(int count, glRender binding) + internal unsafe FrameBuffer( + int count, + glRender binding + ) : base(binding) { - _bufferHandle = GL.GenFrameBuffers(count); + _bufferHandle = new GlHandle[count]; + GL.GenFrameBuffers(_bufferHandle); } /// @@ -67,7 +71,9 @@ namespace StgSharp.Graphics.OpenGL /// Index of object to be binded in handle set /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override unsafe void Bind(int index) + public override unsafe void Bind( + int index + ) { GL.BindFrameBuffer(FrameBufferTarget.All, _bufferHandle[index]); } @@ -84,7 +90,10 @@ namespace StgSharp.Graphics.OpenGL /// Index of object to be binded in handle set /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Bind(FrameBufferTarget target, int index) + public unsafe void Bind( + FrameBufferTarget target, + int index + ) { GL.BindFrameBuffer(target, _bufferHandle[index]); } @@ -95,7 +104,9 @@ namespace StgSharp.Graphics.OpenGL OpenGLFunction.CurrentGL.BindFrameBuffer(FrameBufferTarget.All, GlHandle.Zero); } - protected override void Dispose(bool disposing) + protected override void Dispose( + bool disposing + ) { throw new NotImplementedException(); } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.cs index 4bc1a07a..1e712421 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.cs @@ -82,10 +82,7 @@ namespace StgSharp.Graphics.OpenGL get { #if DEBUG - if ((IntPtr)_context == IntPtr.Zero) - { - throw new NullReferenceException(); - } + ArgumentNullException.ThrowIfNull(_context, nameof(_context)); #endif return ref (*_context); } @@ -96,7 +93,7 @@ namespace StgSharp.Graphics.OpenGL uint type ) { - Context.glActiveTexture(type); + _context->glActiveTexture(type); } [Conditional("DEBUG")] @@ -104,7 +101,7 @@ namespace StgSharp.Graphics.OpenGL bool shouldReportWhenNormal ) { - uint code = Context.glGetError(); + uint code = _context->glGetError(); if (code != glConst.NO_ERROR) { throw new GlExecutionException(code); } @@ -119,12 +116,12 @@ namespace StgSharp.Graphics.OpenGL GlHandle handle ) { - Context.glBindBuffer((uint)bufferType, handle.Value); + _context->glBindBuffer((uint)bufferType, handle.Value); } /// /// Bind a frame BufferHandle to a frame BufferHandle target Same function as glBindFramebuffer . + /// href="https://docs._gl/gl3/glBindFramebuffer">glBindFramebuffer. /// /// /// The frame BufferHandle target of the binding operation. @@ -138,7 +135,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle handle ) { - Context.glBindFramebuffer((uint)target, handle.Value); + _context->glBindFramebuffer((uint)target, handle.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -146,7 +143,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle handle ) { - Context.glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value); + _context->glBindRenderbuffer(glConst.RENDERBUFFER, handle.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -154,7 +151,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle handle ) { - Context.glBindVertexArray(handle.Value); + _context->glBindVertexArray(handle.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -162,7 +159,7 @@ namespace StgSharp.Graphics.OpenGL FrameBufferTarget target ) { - return (FrameBufferStatus)Context.glCheckFramebufferStatus((uint)target); + return (FrameBufferStatus)_context->glCheckFramebufferStatus((uint)target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -170,7 +167,7 @@ namespace StgSharp.Graphics.OpenGL MaskBufferBit mask ) { - Context.glClear((uint)mask); + _context->glClear((uint)mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -179,7 +176,7 @@ namespace StgSharp.Graphics.OpenGL uint code = 0; for (int i = 0; i < 1024; i++) { - code = Context.glGetError(); + code = _context->glGetError(); if (code == 0) { return; } @@ -195,7 +192,7 @@ namespace StgSharp.Graphics.OpenGL [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void ClearGraphicError() { - while (Context.glGetError() != 0) { } + while (_context->glGetError() != 0) { } } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -204,14 +201,14 @@ namespace StgSharp.Graphics.OpenGL GlHandle rboHandle ) { - Context.glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment, - glConst.RENDERBUFFER, rboHandle.Value); + _context->glFramebufferRenderbuffer(glConst.FRAMEBUFFER, (uint)attachment, + glConst.RENDERBUFFER, rboHandle.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GlHandle CreateGraphicProgram() { - return GlHandle.Create(Context.glCreateProgram()); + return GlHandle.Create(_context->glCreateProgram()); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -221,7 +218,7 @@ namespace StgSharp.Graphics.OpenGL { GlHandle[] h = new GlHandle[count]; for (int i = 0; i < count; i++) { - h.SetValue(i, Context.glCreateProgram()); + h.SetValue(i, _context->glCreateProgram()); } return h; } @@ -236,10 +233,10 @@ namespace StgSharp.Graphics.OpenGL uint t = (uint)type; for (int i = 0; i < count; i++) { - uint id = Context.glCreateShader(t); + uint id = _context->glCreateShader(t); if (id == 0) { - uint error = Context.glGetError(); + uint error = _context->glGetError(); throw new InvalidOperationException($"Failed in creating shader: {error}"); } ret[i] = GlHandle.Create(id); @@ -252,7 +249,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle handle ) { - Context.glDeleteBuffers(1, (uint*)&handle); + _context->glDeleteBuffers(1, (uint*)&handle); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -267,16 +264,15 @@ namespace StgSharp.Graphics.OpenGL { uint* iptr = (uint*)hptr; for (int i = 0; i < handle.Length; i++) { - Context.glDeleteBuffers(1, iptr + i); + _context->glDeleteBuffers(1, iptr + i); } } } /// /// Delete a render BufferHandle object Very simlilar function as glDeleteRenderbuffers . The - /// only deifference is that this mehtod can only delete one renderbuffer at the same - /// time. + /// href="https://docs.gl/gl3/glDeleteRenderbuffers">glDeleteRenderbuffers. The only + /// deifference is that this mehtod can only delete one renderbuffer at the same time. /// /// /// Handle to BufferHandle to delete. @@ -285,7 +281,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle bufferHandle ) { - Context.glDeleteRenderbuffers(1, &bufferHandle.Value); + _context->glDeleteRenderbuffers(1, &bufferHandle.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -297,7 +293,7 @@ namespace StgSharp.Graphics.OpenGL { uint* iptr = (uint*)hptr; 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 ) { - Context.glDepthMask(isWrite ? (byte)1 : (byte)0); + _context->glDepthMask(isWrite ? (byte)1 : (byte)0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -314,7 +310,7 @@ namespace StgSharp.Graphics.OpenGL glOperation operation ) { - Context.glDisable((uint)operation); + _context->glDisable((uint)operation); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -324,7 +320,7 @@ namespace StgSharp.Graphics.OpenGL int count ) { - Context.glDrawArrays((uint)mode, first, count); + _context->glDrawArrays((uint)mode, first, count); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -344,7 +340,7 @@ namespace StgSharp.Graphics.OpenGL _ => throw new ArgumentException( $"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") }; - Context.glDrawElements((uint)mode, count, a, (nint*)ptr); + _context->glDrawElements((uint)mode, count, a, (nint*)ptr); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -365,7 +361,7 @@ namespace StgSharp.Graphics.OpenGL _ => throw new ArgumentException( $"{$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}"}{$"{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}"}") }; - Context.glDrawElementsInstanced((uint)mode, count, a, (nint*)ptr, amount); + _context->glDrawElementsInstanced((uint)mode, count, a, (nint*)ptr, amount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -373,7 +369,7 @@ namespace StgSharp.Graphics.OpenGL glOperation operation ) { - Context.glEnable((uint)operation); + _context->glEnable((uint)operation); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -385,8 +381,8 @@ namespace StgSharp.Graphics.OpenGL int level ) { - Context.glFramebufferTexture2D((uint)target, attachment, (uint)texTarget, - textureHandle.Value, level); + _context->glFramebufferTexture2D((uint)target, attachment, (uint)texTarget, + textureHandle.Value, level); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -398,31 +394,12 @@ namespace StgSharp.Graphics.OpenGL fixed (GlHandle* hptr = h) { for (int i = 0; i < count; i++) { - Context.glGenBuffers(count, ((uint*)hptr) + i); + _context->glGenBuffers(count, ((uint*)hptr) + i); } } 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)] public unsafe GlHandle[] GenRenderBuffer( int count @@ -430,7 +407,7 @@ namespace StgSharp.Graphics.OpenGL { GlHandle[] h = new GlHandle[count]; fixed (GlHandle* hptr = h) { - Context.glGenRenderbuffers(count, (uint*)hptr); + _context->glGenRenderbuffers(count, (uint*)hptr); } return h; } @@ -442,7 +419,7 @@ namespace StgSharp.Graphics.OpenGL { GlHandle[] h = new GlHandle[count]; fixed (GlHandle* hptr = h) { - Context.glGenTextures(count, (uint*)hptr); + _context->glGenTextures(count, (uint*)hptr); } return h; } @@ -453,7 +430,7 @@ namespace StgSharp.Graphics.OpenGL { GlHandle[] h = new GlHandle[count]; fixed (GlHandle* hptr = h) { - Context.glGenVertexArrays(count, (uint*)hptr); + _context->glGenVertexArrays(count, (uint*)hptr); } return h; } @@ -463,7 +440,7 @@ namespace StgSharp.Graphics.OpenGL ) { int ret = 0; - Context.glGetIntegerv(statusCode, &ret); + _context->glGetIntegerv(statusCode, &ret); return ret; } @@ -491,8 +468,8 @@ namespace StgSharp.Graphics.OpenGL ) where T : unmanaged,INumber { fixed (T* tptr = dataStream) { - Context.glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, - (nint*)tptr); + _context->glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, + (nint*)tptr); } } @@ -505,7 +482,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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); fixed (byte* ptr = code) { - int ret = Context.glGetUniformLocation(program.Value, ptr); + int ret = _context->glGetUniformLocation(program.Value, ptr); #if DEBUG if ((ret == glConst.INVALID_OPERATION) || (ret == glConst.INVALID_VALUE)) { @@ -539,7 +516,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - 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) { 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 ) { - Context.glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode); + _context->glPolygonMode(glConst.FRONT_AND_BACK, (uint)mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -584,8 +561,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* bptr = stream) { - Context.glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height, - (uint)format, (uint)dataType, (nint*)bptr); + _context->glReadPixels(beginPosition.X, beginPosition.Y, size.width, size.height, + (uint)format, (uint)dataType, (nint*)bptr); } } @@ -601,8 +578,8 @@ namespace StgSharp.Graphics.OpenGL throw new GlArrayFormatException(dataType, "i.PixelArray"); } fixed (byte* bptr = pixels) { - Context.glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height, - (uint)format, (uint)dataType, (nint*)bptr); + _context->glReadPixels(beginPosition.X, beginPosition.Y, i.Width, i.Height, + (uint)format, (uint)dataType, (nint*)bptr); } i.PixelUpdateCount++; } @@ -618,7 +595,7 @@ namespace StgSharp.Graphics.OpenGL 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)] @@ -634,7 +611,8 @@ namespace StgSharp.Graphics.OpenGL } 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,8 +629,8 @@ namespace StgSharp.Graphics.OpenGL } fixed (void* bufferPtr = bufferSpan) { - Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); } } @@ -670,8 +648,8 @@ namespace StgSharp.Graphics.OpenGL fixed (void* bufferPtr = bufferArray) { - Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); } } @@ -685,8 +663,8 @@ namespace StgSharp.Graphics.OpenGL int size = bufferSpan.Length * Marshal.SizeOf(); fixed (void* bufferPtr = bufferSpan) { - Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); } } @@ -702,8 +680,8 @@ namespace StgSharp.Graphics.OpenGL return; } fixed (void* bufferPtr = bufferArray) { - Context.glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, - (uint)usage); + _context->glBufferData((uint)bufferType, (nuint)size, (IntPtr*)bufferPtr, + (uint)usage); } } @@ -713,8 +691,8 @@ namespace StgSharp.Graphics.OpenGL (int width, int height) size ) { - Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width, - size.height); + _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, size.width, + size.height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -723,8 +701,8 @@ namespace StgSharp.Graphics.OpenGL (uint width, uint height) size ) { - Context.glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, - (int)size.width, (int)size.height); + _context->glRenderbufferStorage(glConst.RENDERBUFFER, (uint)internalFormat, + (int)size.width, (int)size.height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -738,9 +716,9 @@ namespace StgSharp.Graphics.OpenGL ) { uint type = GraphicFramework.GLtype[(int)t]; - Context.glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride, - (nint*)pointer); - Context.glEnableVertexAttribArray(index); + _context->glVertexAttribPointer(index, size, type, (byte)(normalized ? 1 : 0), stride, + (nint*)pointer); + _context->glEnableVertexAttribArray(index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -758,8 +736,8 @@ namespace StgSharp.Graphics.OpenGL fixed (T* tptr = pixels) { T* ptr = ((pixels == null) || (pixels.Length == 0)) ? (T*)IntPtr.Zero : tptr; - Context.glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, - (uint)targetChannel, (uint)type, (nint*)tptr); + _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, + (uint)targetChannel, (uint)type, (nint*)tptr); } } @@ -776,8 +754,8 @@ namespace StgSharp.Graphics.OpenGL ) where T : unmanaged, INumber { fixed (T* tPtr = pixelSpan) { - Context.glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, - (uint)targetChannel, (uint)type, (nint*)tPtr); + _context->glTexImage2D((uint)target, level, (int)sourceChannel, width, height, 0, + (uint)targetChannel, (uint)type, (nint*)tPtr); } } @@ -788,7 +766,7 @@ namespace StgSharp.Graphics.OpenGL int param ) { - Context.glTexParameteri((uint)target, pname, param); + _context->glTexParameteri((uint)target, pname, param); } public static bool TryGetFunctionPackage( @@ -805,13 +783,13 @@ namespace StgSharp.Graphics.OpenGL uint divisor ) { - Context.glVertexAttribDivisor(layoutIndex, divisor); + _context->glVertexAttribDivisor(layoutIndex, divisor); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void WaitAccomplishment() { - Context.glFinish(); + _context->glFinish(); } internal static OpenGLFunction BuildGlFunctionPackage( diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs index c00d8231..f20162dd 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v3_3.cs @@ -41,7 +41,7 @@ namespace StgSharp.Graphics.OpenGL uint texture ) { - Context.glActiveTexture(texture); + _context->glActiveTexture(texture); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -50,7 +50,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle shader ) { - Context.glAttachShader(program.Value, shader.Value); + _context->glAttachShader(program.Value, shader.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -59,7 +59,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glBeginConditionalRender(id, mode); + _context->glBeginConditionalRender(id, mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -68,7 +68,7 @@ namespace StgSharp.Graphics.OpenGL uint id ) { - Context.glBeginQuery(target, id); + _context->glBeginQuery(target, id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -76,7 +76,7 @@ namespace StgSharp.Graphics.OpenGL uint primitiveMode ) { - Context.glBeginTransformFeedback(primitiveMode); + _context->glBeginTransformFeedback(primitiveMode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -87,7 +87,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - Context.glBindAttribLocation(program.Value, index, namePtr); + _context->glBindAttribLocation(program.Value, index, namePtr); } } @@ -97,7 +97,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glBindBuffer(target, buffer.Value); + _context->glBindBuffer(target, buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -107,7 +107,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glBindBufferBase(target, index, buffer.Value); + _context->glBindBufferBase(target, index, buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -119,7 +119,7 @@ namespace StgSharp.Graphics.OpenGL nuint size ) { - Context.glBindBufferRange(target, index, buffer.Value, offset, size); + _context->glBindBufferRange(target, index, buffer.Value, offset, size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -130,7 +130,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - Context.glBindFragDataLocation(program.Value, color, namePtr); + _context->glBindFragDataLocation(program.Value, color, namePtr); } } @@ -143,7 +143,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - Context.glBindFragDataLocationIndexed(program.Value, colorNumber, index, namePtr); + _context->glBindFragDataLocationIndexed(program.Value, colorNumber, index, namePtr); } } @@ -153,7 +153,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle framebuffer ) { - Context.glBindFramebuffer(target, framebuffer.Value); + _context->glBindFramebuffer(target, framebuffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -162,7 +162,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle renderbuffer ) { - Context.glBindRenderbuffer(target, renderbuffer.Value); + _context->glBindRenderbuffer(target, renderbuffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -171,7 +171,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle sampler ) { - Context.glBindSampler(unit, sampler.Value); + _context->glBindSampler(unit, sampler.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -180,7 +180,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle texture ) { - Context.glBindTexture(target, texture.Value); + _context->glBindTexture(target, texture.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -188,7 +188,7 @@ namespace StgSharp.Graphics.OpenGL uint array ) { - Context.glBindVertexArray(array); + _context->glBindVertexArray(array); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -199,7 +199,7 @@ namespace StgSharp.Graphics.OpenGL float alpha ) { - Context.glBlendColor(red, green, blue, alpha); + _context->glBlendColor(red, green, blue, alpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -207,7 +207,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glBlendEquation(mode); + _context->glBlendEquation(mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -216,7 +216,7 @@ namespace StgSharp.Graphics.OpenGL uint modeAlpha ) { - Context.glBlendEquationSeparate(modeRGB, modeAlpha); + _context->glBlendEquationSeparate(modeRGB, modeAlpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -225,7 +225,7 @@ namespace StgSharp.Graphics.OpenGL uint dfactor ) { - Context.glBlendFunc(sfactor, dfactor); + _context->glBlendFunc(sfactor, dfactor); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -236,7 +236,7 @@ namespace StgSharp.Graphics.OpenGL uint dfactorAlpha ) { - Context.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + _context->glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -253,7 +253,7 @@ namespace StgSharp.Graphics.OpenGL uint filter ) { - Context.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, + _context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); } @@ -266,7 +266,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glBufferData(target, size, dataPtr, usage); + _context->glBufferData(target, size, dataPtr, usage); } } @@ -279,7 +279,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glBufferSubData(target, offset, size, dataPtr); + _context->glBufferSubData(target, offset, size, dataPtr); } } @@ -288,7 +288,7 @@ namespace StgSharp.Graphics.OpenGL uint target ) { - return Context.glCheckFramebufferStatus(target); + return _context->glCheckFramebufferStatus(target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -297,7 +297,7 @@ namespace StgSharp.Graphics.OpenGL uint clamp ) { - Context.glClampColor(target, clamp); + _context->glClampColor(target, clamp); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -305,7 +305,7 @@ namespace StgSharp.Graphics.OpenGL uint mask ) { - Context.glClear(mask); + _context->glClear(mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -316,7 +316,7 @@ namespace StgSharp.Graphics.OpenGL int stencil ) { - Context.glClearBufferfi(buffer, drawbuffer, depth, stencil); + _context->glClearBufferfi(buffer, drawbuffer, depth, stencil); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -327,7 +327,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glClearBufferfv(buffer, drawbuffer, valuePtr); + _context->glClearBufferfv(buffer, drawbuffer, valuePtr); } } @@ -339,7 +339,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* valuePtr = value) { - Context.glClearBufferiv(buffer, drawbuffer, valuePtr); + _context->glClearBufferiv(buffer, drawbuffer, valuePtr); } } @@ -351,7 +351,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glClearBufferuiv(buffer, drawbuffer, valuePtr); + _context->glClearBufferuiv(buffer, drawbuffer, valuePtr); } } @@ -363,7 +363,7 @@ namespace StgSharp.Graphics.OpenGL float alpha ) { - Context.glClearColor(red, green, blue, alpha); + _context->glClearColor(red, green, blue, alpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -371,7 +371,7 @@ namespace StgSharp.Graphics.OpenGL double depth ) { - Context.glClearDepth(depth); + _context->glClearDepth(depth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -379,7 +379,7 @@ namespace StgSharp.Graphics.OpenGL int s ) { - Context.glClearStencil(s); + _context->glClearStencil(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -389,7 +389,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr timeout ) { - return Context.glClientWaitSync(sync, flags, timeout); + return _context->glClientWaitSync(sync, flags, timeout); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -400,7 +400,7 @@ namespace StgSharp.Graphics.OpenGL byte alpha ) { - Context.glColorMask(red, green, blue, alpha); + _context->glColorMask(red, green, blue, alpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -412,7 +412,7 @@ namespace StgSharp.Graphics.OpenGL byte a ) { - Context.glColorMaski(index, r, g, b, a); + _context->glColorMaski(index, r, g, b, a); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -420,7 +420,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle shader ) { - Context.glCompileShader(shader.Value); + _context->glCompileShader(shader.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -435,7 +435,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTexImage1D(target, level, internalformat, width, border, + _context->glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, dataPtr); } } @@ -453,7 +453,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTexImage2D(target, level, internalformat, width, height, border, + _context->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, dataPtr); } } @@ -472,7 +472,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTexImage3D(target, level, internalformat, width, height, depth, + _context->glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, dataPtr); } } @@ -489,7 +489,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, + _context->glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, dataPtr); } } @@ -508,7 +508,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, + _context->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, dataPtr); } } @@ -529,7 +529,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, + _context->glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, dataPtr); } } @@ -543,7 +543,7 @@ namespace StgSharp.Graphics.OpenGL nuint size ) { - Context.glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); + _context->glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -557,7 +557,7 @@ namespace StgSharp.Graphics.OpenGL int border ) { - Context.glCopyTexImage1D(target, level, internalformat, x, y, width, border); + _context->glCopyTexImage1D(target, level, internalformat, x, y, width, border); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -572,7 +572,7 @@ namespace StgSharp.Graphics.OpenGL int border ) { - Context.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); + _context->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -585,7 +585,7 @@ namespace StgSharp.Graphics.OpenGL int width ) { - Context.glCopyTexSubImage1D(target, level, xoffset, x, y, width); + _context->glCopyTexSubImage1D(target, level, xoffset, x, y, width); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -600,7 +600,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); + _context->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -616,14 +616,14 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, + _context->glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public GlHandle CreateProgram() { - return GlHandle.Create(Context.glCreateProgram()); + return GlHandle.Create(_context->glCreateProgram()); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -631,7 +631,7 @@ namespace StgSharp.Graphics.OpenGL ShaderType type ) { - return Context.glCreateShader((uint)type); + return _context->glCreateShader((uint)type); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -639,7 +639,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glCullFace(mode); + _context->glCullFace(mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -649,7 +649,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* buffersPtr = buffers) { - Context.glDeleteBuffers(n, buffersPtr); + _context->glDeleteBuffers(n, buffersPtr); } } @@ -660,7 +660,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* framebuffersPtr = framebuffers) { - Context.glDeleteFramebuffers(n, framebuffersPtr); + _context->glDeleteFramebuffers(n, framebuffersPtr); } } @@ -669,7 +669,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle program ) { - Context.glDeleteProgram(program.Value); + _context->glDeleteProgram(program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -679,7 +679,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* idsPtr = ids) { - Context.glDeleteQueries(n, idsPtr); + _context->glDeleteQueries(n, idsPtr); } } @@ -690,7 +690,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* renderbuffersPtr = renderbuffers) { - Context.glDeleteRenderbuffers(n, renderbuffersPtr); + _context->glDeleteRenderbuffers(n, renderbuffersPtr); } } @@ -701,7 +701,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* samplersPtr = samplers) { - Context.glDeleteSamplers(count, samplersPtr); + _context->glDeleteSamplers(count, samplersPtr); } } @@ -710,7 +710,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle shader ) { - Context.glDeleteShader(shader.Value); + _context->glDeleteShader(shader.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -718,7 +718,7 @@ namespace StgSharp.Graphics.OpenGL glSync sync ) { - Context.glDeleteSync(sync); + _context->glDeleteSync(sync); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -728,7 +728,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* texturesPtr = textures) { - Context.glDeleteTextures(n, texturesPtr); + _context->glDeleteTextures(n, texturesPtr); } } @@ -739,7 +739,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* arraysPtr = arrays) { - Context.glDeleteVertexArrays(n, arraysPtr); + _context->glDeleteVertexArrays(n, arraysPtr); } } @@ -748,7 +748,7 @@ namespace StgSharp.Graphics.OpenGL uint func ) { - Context.glDepthFunc(func); + _context->glDepthFunc(func); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -756,7 +756,7 @@ namespace StgSharp.Graphics.OpenGL byte flag ) { - Context.glDepthMask(flag); + _context->glDepthMask(flag); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -765,7 +765,7 @@ namespace StgSharp.Graphics.OpenGL double f ) { - Context.glDepthRange(n, f); + _context->glDepthRange(n, f); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -774,7 +774,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle shader ) { - Context.glDetachShader(program.Value, shader.Value); + _context->glDetachShader(program.Value, shader.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -782,7 +782,7 @@ namespace StgSharp.Graphics.OpenGL uint cap ) { - Context.glDisable(cap); + _context->glDisable(cap); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -791,7 +791,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glDisablei(target, index); + _context->glDisablei(target, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -799,7 +799,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glDisableVertexAttribArray(index); + _context->glDisableVertexAttribArray(index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -809,7 +809,7 @@ namespace StgSharp.Graphics.OpenGL int count ) { - Context.glDrawArrays(mode, first, count); + _context->glDrawArrays(mode, first, count); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -820,7 +820,7 @@ namespace StgSharp.Graphics.OpenGL int instancecount ) { - Context.glDrawArraysInstanced(mode, first, count, instancecount); + _context->glDrawArraysInstanced(mode, first, count, instancecount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -828,7 +828,7 @@ namespace StgSharp.Graphics.OpenGL uint buf ) { - Context.glDrawBuffer(buf); + _context->glDrawBuffer(buf); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -838,7 +838,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* bufsPtr = bufs) { - Context.glDrawBuffers(n, bufsPtr); + _context->glDrawBuffers(n, bufsPtr); } } @@ -851,7 +851,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawElements(mode, count, (uint)type, indicesPtr); + _context->glDrawElements(mode, count, (uint)type, indicesPtr); } } @@ -865,7 +865,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawElementsBaseVertex(mode, count, (uint)type, indicesPtr, basevertex); + _context->glDrawElementsBaseVertex(mode, count, (uint)type, indicesPtr, basevertex); } } @@ -879,7 +879,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawElementsInstanced(mode, count, (uint)type, indicesPtr, instancecount); + _context->glDrawElementsInstanced(mode, count, (uint)type, indicesPtr, instancecount); } } @@ -894,7 +894,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawElementsInstancedBaseVertex(mode, count, (uint)type, indicesPtr, + _context->glDrawElementsInstancedBaseVertex(mode, count, (uint)type, indicesPtr, instancecount, basevertex); } } @@ -910,7 +910,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawRangeElements(mode, start, end, count, (uint)type, indicesPtr); + _context->glDrawRangeElements(mode, start, end, count, (uint)type, indicesPtr); } } @@ -926,7 +926,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawRangeElementsBaseVertex(mode, start, end, count, (uint)type, + _context->glDrawRangeElementsBaseVertex(mode, start, end, count, (uint)type, indicesPtr, basevertex); } } @@ -936,7 +936,7 @@ namespace StgSharp.Graphics.OpenGL uint cap ) { - Context.glEnable(cap); + _context->glEnable(cap); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -945,7 +945,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glEnablei(target, index); + _context->glEnablei(target, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -953,13 +953,13 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glEnableVertexAttribArray(index); + _context->glEnableVertexAttribArray(index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EndConditionalRender() { - Context.glEndConditionalRender(); + _context->glEndConditionalRender(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -967,13 +967,13 @@ namespace StgSharp.Graphics.OpenGL uint target ) { - Context.glEndQuery(target); + _context->glEndQuery(target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void EndTransformFeedback() { - Context.glEndTransformFeedback(); + _context->glEndTransformFeedback(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -982,19 +982,19 @@ namespace StgSharp.Graphics.OpenGL uint flags ) { - return Context.glFenceSync(condition, flags); + return _context->glFenceSync(condition, flags); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Finish() { - Context.glFinish(); + _context->glFinish(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Flush() { - Context.glFlush(); + _context->glFlush(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1004,7 +1004,7 @@ namespace StgSharp.Graphics.OpenGL nuint length ) { - Context.glFlushMappedBufferRange(target, offset, length); + _context->glFlushMappedBufferRange(target, offset, length); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1015,7 +1015,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle renderbuffer ) { - Context.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, + _context->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer.Value); } @@ -1027,7 +1027,7 @@ namespace StgSharp.Graphics.OpenGL int level ) { - Context.glFramebufferTexture(target, attachment, texture.Value, level); + _context->glFramebufferTexture(target, attachment, texture.Value, level); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1039,7 +1039,7 @@ namespace StgSharp.Graphics.OpenGL int level ) { - Context.glFramebufferTexture1D(target, attachment, textarget, texture.Value, level); + _context->glFramebufferTexture1D(target, attachment, textarget, texture.Value, level); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1051,7 +1051,7 @@ namespace StgSharp.Graphics.OpenGL int level ) { - Context.glFramebufferTexture2D(target, attachment, textarget, texture.Value, level); + _context->glFramebufferTexture2D(target, attachment, textarget, texture.Value, level); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1064,7 +1064,7 @@ namespace StgSharp.Graphics.OpenGL int zoffset ) { - Context.glFramebufferTexture3D(target, attachment, textarget, texture.Value, level, + _context->glFramebufferTexture3D(target, attachment, textarget, texture.Value, level, zoffset); } @@ -1077,7 +1077,7 @@ namespace StgSharp.Graphics.OpenGL int layer ) { - Context.glFramebufferTextureLayer(target, attachment, texture.Value, level, layer); + _context->glFramebufferTextureLayer(target, attachment, texture.Value, level, layer); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1085,7 +1085,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glFrontFace(mode); + _context->glFrontFace(mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1094,24 +1094,25 @@ namespace StgSharp.Graphics.OpenGL uint* buffers ) { - Context.glGenBuffers(n, buffers); + _context->glGenBuffers(n, buffers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void GenerateMipmap( - uint target + Texture2DTarget target ) { - Context.glGenerateMipmap(target); + _context->glGenerateMipmap((uint)target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void GenFramebuffers( - int n, - uint* framebuffers + public void GenFrameBuffers( + Span frameBuffers ) { - Context.glGenFramebuffers(n, framebuffers); + fixed (GlHandle* hPtr = frameBuffers) { + _context->glGenFramebuffers(frameBuffers.Length, (uint*)hPtr); + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1120,7 +1121,7 @@ namespace StgSharp.Graphics.OpenGL uint* ids ) { - Context.glGenQueries(n, ids); + _context->glGenQueries(n, ids); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1129,7 +1130,7 @@ namespace StgSharp.Graphics.OpenGL uint* renderbuffers ) { - Context.glGenRenderbuffers(n, renderbuffers); + _context->glGenRenderbuffers(n, renderbuffers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1138,7 +1139,7 @@ namespace StgSharp.Graphics.OpenGL uint* samplers ) { - Context.glGenSamplers(count, samplers); + _context->glGenSamplers(count, samplers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1147,7 +1148,7 @@ namespace StgSharp.Graphics.OpenGL uint* textures ) { - Context.glGenTextures(n, textures); + _context->glGenTextures(n, textures); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1156,7 +1157,7 @@ namespace StgSharp.Graphics.OpenGL uint* arrays ) { - Context.glGenVertexArrays(n, arrays); + _context->glGenVertexArrays(n, arrays); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1170,7 +1171,7 @@ namespace StgSharp.Graphics.OpenGL byte* name ) { - Context.glGetActiveAttrib(program.Value, index, bufSize, length, size, type, name); + _context->glGetActiveAttrib(program.Value, index, bufSize, length, size, type, name); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1184,7 +1185,7 @@ namespace StgSharp.Graphics.OpenGL byte* name ) { - Context.glGetActiveUniform(program.Value, index, bufSize, length, size, type, name); + _context->glGetActiveUniform(program.Value, index, bufSize, length, size, type, name); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1195,7 +1196,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetActiveUniformBlockiv(program.Value, uniformBlockIndex, pname, @params); + _context->glGetActiveUniformBlockiv(program.Value, uniformBlockIndex, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1207,7 +1208,7 @@ namespace StgSharp.Graphics.OpenGL byte* uniformBlockName ) { - Context.glGetActiveUniformBlockName(program.Value, uniformBlockIndex, bufSize, length, + _context->glGetActiveUniformBlockName(program.Value, uniformBlockIndex, bufSize, length, uniformBlockName); } @@ -1220,7 +1221,7 @@ namespace StgSharp.Graphics.OpenGL byte* uniformName ) { - Context.glGetActiveUniformName(program.Value, uniformIndex, bufSize, length, + _context->glGetActiveUniformName(program.Value, uniformIndex, bufSize, length, uniformName); } @@ -1234,7 +1235,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* uniformIndicesPtr = uniformIndices) { - Context.glGetActiveUniformsiv(program.Value, uniformCount, uniformIndicesPtr, pname, + _context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndicesPtr, pname, @params); } } @@ -1247,7 +1248,7 @@ namespace StgSharp.Graphics.OpenGL uint* shaders ) { - Context.glGetAttachedShaders(program.Value, maxCount, count, shaders); + _context->glGetAttachedShaders(program.Value, maxCount, count, shaders); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1257,7 +1258,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - return Context.glGetAttribLocation(program.Value, namePtr); + return _context->glGetAttribLocation(program.Value, namePtr); } } @@ -1268,7 +1269,7 @@ namespace StgSharp.Graphics.OpenGL byte* data ) { - Context.glGetBooleani_v(target, index, data); + _context->glGetBooleani_v(target, index, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1277,7 +1278,7 @@ namespace StgSharp.Graphics.OpenGL byte* data ) { - Context.glGetBooleanv(pname, data); + _context->glGetBooleanv(pname, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1287,7 +1288,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetBufferParameteri64v(target, pname, @params); + _context->glGetBufferParameteri64v(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1297,7 +1298,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetBufferParameteriv(target, pname, @params); + _context->glGetBufferParameteriv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1307,7 +1308,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetBufferPointerv(target, pname, @params); + _context->glGetBufferPointerv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1318,7 +1319,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* data ) { - Context.glGetBufferSubData(target, offset, size, data); + _context->glGetBufferSubData(target, offset, size, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1328,7 +1329,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* img ) { - Context.glGetCompressedTexImage(target, level, img); + _context->glGetCompressedTexImage(target, level, img); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1337,13 +1338,13 @@ namespace StgSharp.Graphics.OpenGL double* data ) { - Context.glGetDoublev(pname, data); + _context->glGetDoublev(pname, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public uint GetError() { - return Context.glGetError(); + return _context->glGetError(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1352,7 +1353,7 @@ namespace StgSharp.Graphics.OpenGL float* data ) { - Context.glGetFloatv(pname, data); + _context->glGetFloatv(pname, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1362,7 +1363,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - return Context.glGetFragDataIndex(program.Value, namePtr); + return _context->glGetFragDataIndex(program.Value, namePtr); } } @@ -1373,7 +1374,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - return Context.glGetFragDataLocation(program.Value, namePtr); + return _context->glGetFragDataLocation(program.Value, namePtr); } } @@ -1385,7 +1386,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetFramebufferAttachmentParameteriv(target, attachment, pname, @params); + _context->glGetFramebufferAttachmentParameteriv(target, attachment, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1395,7 +1396,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* data ) { - Context.glGetInteger64i_v(target, index, data); + _context->glGetInteger64i_v(target, index, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1404,7 +1405,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* data ) { - Context.glGetInteger64v(pname, data); + _context->glGetInteger64v(pname, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1414,7 +1415,7 @@ namespace StgSharp.Graphics.OpenGL int* data ) { - Context.glGetIntegeri_v(target, index, data); + _context->glGetIntegeri_v(target, index, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1423,7 +1424,7 @@ namespace StgSharp.Graphics.OpenGL int* data ) { - Context.glGetIntegerv(pname, data); + _context->glGetIntegerv(pname, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1433,7 +1434,7 @@ namespace StgSharp.Graphics.OpenGL float* val ) { - Context.glGetMultisamplefv(pname, index, val); + _context->glGetMultisamplefv(pname, index, val); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1444,7 +1445,7 @@ namespace StgSharp.Graphics.OpenGL byte* infoLog ) { - Context.glGetProgramInfoLog(program.Value, bufSize, length, infoLog); + _context->glGetProgramInfoLog(program.Value, bufSize, length, infoLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1454,7 +1455,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetProgramiv(program.Value, pname, @params); + _context->glGetProgramiv(program.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1464,7 +1465,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetQueryiv(target, pname, @params); + _context->glGetQueryiv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1474,7 +1475,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetQueryObjecti64v(id, pname, @params); + _context->glGetQueryObjecti64v(id, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1484,7 +1485,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetQueryObjectiv(id, pname, @params); + _context->glGetQueryObjectiv(id, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1494,7 +1495,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetQueryObjectui64v(id, pname, @params); + _context->glGetQueryObjectui64v(id, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1504,7 +1505,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetQueryObjectuiv(id, pname, @params); + _context->glGetQueryObjectuiv(id, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1514,7 +1515,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetRenderbufferParameteriv(target, pname, @params); + _context->glGetRenderbufferParameteriv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1524,7 +1525,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetSamplerParameterfv(sampler.Value, pname, @params); + _context->glGetSamplerParameterfv(sampler.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1534,7 +1535,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetSamplerParameterIiv(sampler.Value, pname, @params); + _context->glGetSamplerParameterIiv(sampler.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1544,7 +1545,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetSamplerParameterIuiv(sampler.Value, pname, @params); + _context->glGetSamplerParameterIuiv(sampler.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1554,7 +1555,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetSamplerParameteriv(sampler.Value, pname, @params); + _context->glGetSamplerParameteriv(sampler.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1565,7 +1566,7 @@ namespace StgSharp.Graphics.OpenGL byte* infoLog ) { - Context.glGetShaderInfoLog(shader.Value, bufSize, length, infoLog); + _context->glGetShaderInfoLog(shader.Value, bufSize, length, infoLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1575,7 +1576,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetShaderiv(shader.Value, pname, @params); + _context->glGetShaderiv(shader.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1586,7 +1587,7 @@ namespace StgSharp.Graphics.OpenGL byte* source ) { - Context.glGetShaderSource(shader.Value, bufSize, length, source); + _context->glGetShaderSource(shader.Value, bufSize, length, source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1594,7 +1595,7 @@ namespace StgSharp.Graphics.OpenGL uint name ) { - return Marshal.PtrToStringAuto((nint)Context.glGetString(name)) ?? string.Empty; + return Marshal.PtrToStringAuto((nint)_context->glGetString(name)) ?? string.Empty; } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1603,7 +1604,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - return Marshal.PtrToStringAuto((nint)Context.glGetStringi(name, index)) ?? string.Empty; + return Marshal.PtrToStringAuto((nint)_context->glGetStringi(name, index)) ?? string.Empty; } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1615,7 +1616,7 @@ namespace StgSharp.Graphics.OpenGL int* values ) { - Context.glGetSynciv(sync, pname, count, length, values); + _context->glGetSynciv(sync, pname, count, length, values); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1627,7 +1628,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glGetTexImage(target, level, format, (uint)type, pixels); + _context->glGetTexImage(target, level, format, (uint)type, pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1638,7 +1639,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetTexLevelParameterfv(target, level, pname, @params); + _context->glGetTexLevelParameterfv(target, level, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1649,7 +1650,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetTexLevelParameteriv(target, level, pname, @params); + _context->glGetTexLevelParameteriv(target, level, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1659,7 +1660,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetTexParameterfv(target, pname, @params); + _context->glGetTexParameterfv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1669,7 +1670,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetTexParameterIiv(target, pname, @params); + _context->glGetTexParameterIiv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1679,7 +1680,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetTexParameterIuiv(target, pname, @params); + _context->glGetTexParameterIuiv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1689,7 +1690,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetTexParameteriv(target, pname, @params); + _context->glGetTexParameteriv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1703,7 +1704,7 @@ namespace StgSharp.Graphics.OpenGL byte* name ) { - Context.glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, type, + _context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, type, name); } @@ -1714,7 +1715,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* uniformBlockNamePtr = uniformBlockName) { - return Context.glGetUniformBlockIndex(program.Value, uniformBlockNamePtr); + return _context->glGetUniformBlockIndex(program.Value, uniformBlockNamePtr); } } @@ -1725,7 +1726,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetUniformfv(program.Value, location, @params); + _context->glGetUniformfv(program.Value, location, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1737,7 +1738,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* uniformNamesPtr = uniformNames) { - Context.glGetUniformIndices(program.Value, uniformCount, uniformNamesPtr, + _context->glGetUniformIndices(program.Value, uniformCount, uniformNamesPtr, uniformIndices); } } @@ -1749,7 +1750,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetUniformiv(program.Value, location, @params); + _context->glGetUniformiv(program.Value, location, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1759,7 +1760,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - return Context.glGetUniformLocation(program.Value, namePtr); + return _context->glGetUniformLocation(program.Value, namePtr); } } @@ -1770,7 +1771,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetUniformuiv(program.Value, location, @params); + _context->glGetUniformuiv(program.Value, location, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1780,7 +1781,7 @@ namespace StgSharp.Graphics.OpenGL double* @params ) { - Context.glGetVertexAttribdv(index, pname, @params); + _context->glGetVertexAttribdv(index, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1790,7 +1791,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetVertexAttribfv(index, pname, @params); + _context->glGetVertexAttribfv(index, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1800,7 +1801,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetVertexAttribIiv(index, pname, @params); + _context->glGetVertexAttribIiv(index, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1810,7 +1811,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetVertexAttribIuiv(index, pname, @params); + _context->glGetVertexAttribIuiv(index, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1820,7 +1821,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetVertexAttribiv(index, pname, @params); + _context->glGetVertexAttribiv(index, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1830,7 +1831,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pointer ) { - Context.glGetVertexAttribPointerv(index, pname, pointer); + _context->glGetVertexAttribPointerv(index, pname, pointer); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1839,7 +1840,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glHint(target, mode); + _context->glHint(target, mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1847,7 +1848,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - return Context.glIsBuffer(buffer.Value); + return _context->glIsBuffer(buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1855,7 +1856,7 @@ namespace StgSharp.Graphics.OpenGL uint cap ) { - return Context.glIsEnabled(cap); + return _context->glIsEnabled(cap); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1864,7 +1865,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - return Context.glIsEnabledi(target, index); + return _context->glIsEnabledi(target, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1872,7 +1873,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle framebuffer ) { - return Context.glIsFramebuffer(framebuffer.Value); + return _context->glIsFramebuffer(framebuffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1880,7 +1881,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle program ) { - return Context.glIsProgram(program.Value); + return _context->glIsProgram(program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1888,7 +1889,7 @@ namespace StgSharp.Graphics.OpenGL uint id ) { - return Context.glIsQuery(id); + return _context->glIsQuery(id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1896,7 +1897,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle renderbuffer ) { - return Context.glIsRenderbuffer(renderbuffer.Value); + return _context->glIsRenderbuffer(renderbuffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1904,7 +1905,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle sampler ) { - return Context.glIsSampler(sampler.Value); + return _context->glIsSampler(sampler.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1912,7 +1913,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle shader ) { - return Context.glIsShader(shader.Value); + return _context->glIsShader(shader.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1920,7 +1921,7 @@ namespace StgSharp.Graphics.OpenGL glSync sync ) { - return Context.glIsSync(sync); + return _context->glIsSync(sync); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1928,7 +1929,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle texture ) { - return Context.glIsTexture(texture.Value); + return _context->glIsTexture(texture.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1936,7 +1937,7 @@ namespace StgSharp.Graphics.OpenGL uint array ) { - return Context.glIsVertexArray(array); + return _context->glIsVertexArray(array); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1944,7 +1945,7 @@ namespace StgSharp.Graphics.OpenGL float width ) { - Context.glLineWidth(width); + _context->glLineWidth(width); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1952,7 +1953,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle program ) { - Context.glLinkProgram(program.Value); + _context->glLinkProgram(program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1960,7 +1961,7 @@ namespace StgSharp.Graphics.OpenGL uint opcode ) { - Context.glLogicOp(opcode); + _context->glLogicOp(opcode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1969,7 +1970,7 @@ namespace StgSharp.Graphics.OpenGL uint access ) { - Context.glMapBuffer(target, access); + _context->glMapBuffer(target, access); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1980,7 +1981,7 @@ namespace StgSharp.Graphics.OpenGL uint access ) { - Context.glMapBufferRange(target, offset, length, access); + _context->glMapBufferRange(target, offset, length, access); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1994,7 +1995,7 @@ namespace StgSharp.Graphics.OpenGL fixed (int* firstPtr = first) { fixed (int* countPtr = count) { - Context.glMultiDrawArrays(mode, firstPtr, countPtr, drawcount); + _context->glMultiDrawArrays(mode, firstPtr, countPtr, drawcount); } } } @@ -2011,7 +2012,7 @@ namespace StgSharp.Graphics.OpenGL fixed (int* countPtr = count) { fixed (IntPtr* indicesPtr = indices) { - Context.glMultiDrawElements(mode, countPtr, (uint)type, indicesPtr, drawcount); + _context->glMultiDrawElements(mode, countPtr, (uint)type, indicesPtr, drawcount); } } } @@ -2031,7 +2032,7 @@ namespace StgSharp.Graphics.OpenGL fixed (IntPtr* indicesPtr = indices) { fixed (int* basevertexPtr = basevertex) { - Context.glMultiDrawElementsBaseVertex(mode, countPtr, (uint)type, + _context->glMultiDrawElementsBaseVertex(mode, countPtr, (uint)type, indicesPtr, drawcount, basevertexPtr); } } @@ -2044,7 +2045,7 @@ namespace StgSharp.Graphics.OpenGL float param ) { - Context.glPixelStoref(pname, param); + _context->glPixelStoref(pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2053,7 +2054,7 @@ namespace StgSharp.Graphics.OpenGL int param ) { - Context.glPixelStorei(pname, param); + _context->glPixelStorei(pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2062,7 +2063,7 @@ namespace StgSharp.Graphics.OpenGL float param ) { - Context.glPointParameterf(pname, param); + _context->glPointParameterf(pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2072,7 +2073,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* @paramsPtr = @params) { - Context.glPointParameterfv(pname, @paramsPtr); + _context->glPointParameterfv(pname, @paramsPtr); } } @@ -2082,7 +2083,7 @@ namespace StgSharp.Graphics.OpenGL int param ) { - Context.glPointParameteri(pname, param); + _context->glPointParameteri(pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2092,7 +2093,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* @paramsPtr = @params) { - Context.glPointParameteriv(pname, @paramsPtr); + _context->glPointParameteriv(pname, @paramsPtr); } } @@ -2101,7 +2102,7 @@ namespace StgSharp.Graphics.OpenGL float size ) { - Context.glPointSize(size); + _context->glPointSize(size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2110,7 +2111,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glPolygonMode(face, mode); + _context->glPolygonMode(face, mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2119,7 +2120,7 @@ namespace StgSharp.Graphics.OpenGL float units ) { - Context.glPolygonOffset(factor, units); + _context->glPolygonOffset(factor, units); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2127,7 +2128,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glPrimitiveRestartIndex(index); + _context->glPrimitiveRestartIndex(index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2135,7 +2136,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glProvokingVertex(mode); + _context->glProvokingVertex(mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2144,7 +2145,7 @@ namespace StgSharp.Graphics.OpenGL uint target ) { - Context.glQueryCounter(id, target); + _context->glQueryCounter(id, target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2152,7 +2153,7 @@ namespace StgSharp.Graphics.OpenGL uint src ) { - Context.glReadBuffer(src); + _context->glReadBuffer(src); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2166,7 +2167,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glReadPixels(x, y, width, height, format, (uint)type, pixels); + _context->glReadPixels(x, y, width, height, format, (uint)type, pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2177,7 +2178,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glRenderbufferStorage(target, internalformat, width, height); + _context->glRenderbufferStorage(target, internalformat, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2189,7 +2190,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glRenderbufferStorageMultisample(target, samples, internalformat, width, + _context->glRenderbufferStorageMultisample(target, samples, internalformat, width, height); } @@ -2199,7 +2200,7 @@ namespace StgSharp.Graphics.OpenGL byte invert ) { - Context.glSampleCoverage(value, invert); + _context->glSampleCoverage(value, invert); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2208,7 +2209,7 @@ namespace StgSharp.Graphics.OpenGL uint mask ) { - Context.glSampleMaski(maskNumber, mask); + _context->glSampleMaski(maskNumber, mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2218,7 +2219,7 @@ namespace StgSharp.Graphics.OpenGL float param ) { - Context.glSamplerParameterf(sampler.Value, pname, param); + _context->glSamplerParameterf(sampler.Value, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2229,7 +2230,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* paramPtr = param) { - Context.glSamplerParameterfv(sampler.Value, pname, paramPtr); + _context->glSamplerParameterfv(sampler.Value, pname, paramPtr); } } @@ -2240,7 +2241,7 @@ namespace StgSharp.Graphics.OpenGL int param ) { - Context.glSamplerParameteri(sampler.Value, pname, param); + _context->glSamplerParameteri(sampler.Value, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2251,7 +2252,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* paramPtr = param) { - Context.glSamplerParameterIiv(sampler.Value, pname, paramPtr); + _context->glSamplerParameterIiv(sampler.Value, pname, paramPtr); } } @@ -2263,7 +2264,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* paramPtr = param) { - Context.glSamplerParameterIuiv(sampler.Value, pname, paramPtr); + _context->glSamplerParameterIuiv(sampler.Value, pname, paramPtr); } } @@ -2275,7 +2276,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* paramPtr = param) { - Context.glSamplerParameteriv(sampler.Value, pname, paramPtr); + _context->glSamplerParameteriv(sampler.Value, pname, paramPtr); } } @@ -2287,7 +2288,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glScissor(x, y, width, height); + _context->glScissor(x, y, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2302,7 +2303,7 @@ namespace StgSharp.Graphics.OpenGL { byte* sPtr = stringPtr; fixed (int* lengthPtr = length) { - Context.glShaderSource(shader.Value, count, &sPtr, lengthPtr); + _context->glShaderSource(shader.Value, count, &sPtr, lengthPtr); } } } @@ -2314,7 +2315,7 @@ namespace StgSharp.Graphics.OpenGL uint mask ) { - Context.glStencilFunc(func, @ref, mask); + _context->glStencilFunc(func, @ref, mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2325,7 +2326,7 @@ namespace StgSharp.Graphics.OpenGL uint mask ) { - Context.glStencilFuncSeparate(face, func, @ref, mask); + _context->glStencilFuncSeparate(face, func, @ref, mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2333,7 +2334,7 @@ namespace StgSharp.Graphics.OpenGL uint mask ) { - Context.glStencilMask(mask); + _context->glStencilMask(mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2342,7 +2343,7 @@ namespace StgSharp.Graphics.OpenGL uint mask ) { - Context.glStencilMaskSeparate(face, mask); + _context->glStencilMaskSeparate(face, mask); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2352,7 +2353,7 @@ namespace StgSharp.Graphics.OpenGL uint zpass ) { - Context.glStencilOp(fail, zfail, zpass); + _context->glStencilOp(fail, zfail, zpass); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2363,7 +2364,7 @@ namespace StgSharp.Graphics.OpenGL uint dppass ) { - Context.glStencilOpSeparate(face, sfail, dpfail, dppass); + _context->glStencilOpSeparate(face, sfail, dpfail, dppass); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2373,7 +2374,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glTexBuffer(target, internalformat, buffer.Value); + _context->glTexBuffer(target, internalformat, buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2389,7 +2390,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTexImage1D(target, level, internalformat, width, border, format, + _context->glTexImage1D(target, level, internalformat, width, border, format, (uint)type, pixelsPtr); } } @@ -2408,7 +2409,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTexImage2D(target, level, internalformat, width, height, border, format, + _context->glTexImage2D(target, level, internalformat, width, height, border, format, (uint)type, pixelsPtr); } } @@ -2423,7 +2424,7 @@ namespace StgSharp.Graphics.OpenGL byte fixedsamplelocations ) { - Context.glTexImage2DMultisample(target, samples, internalformat, width, height, + _context->glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); } @@ -2442,7 +2443,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTexImage3D(target, level, internalformat, width, height, depth, border, + _context->glTexImage3D(target, level, internalformat, width, height, depth, border, format, (uint)type, pixelsPtr); } } @@ -2458,7 +2459,7 @@ namespace StgSharp.Graphics.OpenGL byte fixedsamplelocations ) { - Context.glTexImage3DMultisample(target, samples, internalformat, width, height, depth, + _context->glTexImage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); } @@ -2469,7 +2470,7 @@ namespace StgSharp.Graphics.OpenGL float param ) { - Context.glTexParameterf(target, pname, param); + _context->glTexParameterf(target, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2480,7 +2481,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* @paramsPtr = @params) { - Context.glTexParameterfv(target, pname, @paramsPtr); + _context->glTexParameterfv(target, pname, @paramsPtr); } } @@ -2491,7 +2492,7 @@ namespace StgSharp.Graphics.OpenGL int param ) { - Context.glTexParameteri(target, pname, param); + _context->glTexParameteri(target, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2502,7 +2503,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* @paramsPtr = @params) { - Context.glTexParameterIiv(target, pname, @paramsPtr); + _context->glTexParameterIiv(target, pname, @paramsPtr); } } @@ -2514,7 +2515,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* @paramsPtr = @params) { - Context.glTexParameterIuiv(target, pname, @paramsPtr); + _context->glTexParameterIuiv(target, pname, @paramsPtr); } } @@ -2526,7 +2527,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* @paramsPtr = @params) { - Context.glTexParameteriv(target, pname, @paramsPtr); + _context->glTexParameteriv(target, pname, @paramsPtr); } } @@ -2542,7 +2543,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTexSubImage1D(target, level, xoffset, width, format, (uint)type, + _context->glTexSubImage1D(target, level, xoffset, width, format, (uint)type, pixelsPtr); } } @@ -2561,7 +2562,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, + _context->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, (uint)type, pixelsPtr); } } @@ -2582,7 +2583,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, + _context->glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, (uint)type, pixelsPtr); } } @@ -2596,7 +2597,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* varyingsPtr = varyings) { - Context.glTransformFeedbackVaryings(program.Value, count, varyingsPtr, bufferMode); + _context->glTransformFeedbackVaryings(program.Value, count, varyingsPtr, bufferMode); } } @@ -2606,7 +2607,7 @@ namespace StgSharp.Graphics.OpenGL float v0 ) { - Context.glUniform1f(location, v0); + _context->glUniform1f(location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2617,7 +2618,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniform1fv(location, count, valuePtr); + _context->glUniform1fv(location, count, valuePtr); } } @@ -2627,7 +2628,7 @@ namespace StgSharp.Graphics.OpenGL int v0 ) { - Context.glUniform1i(location, v0); + _context->glUniform1i(location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2638,7 +2639,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* valuePtr = value) { - Context.glUniform1iv(location, count, valuePtr); + _context->glUniform1iv(location, count, valuePtr); } } @@ -2648,7 +2649,7 @@ namespace StgSharp.Graphics.OpenGL uint v0 ) { - Context.glUniform1ui(location, v0); + _context->glUniform1ui(location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2659,7 +2660,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glUniform1uiv(location, count, valuePtr); + _context->glUniform1uiv(location, count, valuePtr); } } @@ -2670,7 +2671,7 @@ namespace StgSharp.Graphics.OpenGL float v1 ) { - Context.glUniform2f(location, v0, v1); + _context->glUniform2f(location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2681,7 +2682,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniform2fv(location, count, valuePtr); + _context->glUniform2fv(location, count, valuePtr); } } @@ -2692,7 +2693,7 @@ namespace StgSharp.Graphics.OpenGL int v1 ) { - Context.glUniform2i(location, v0, v1); + _context->glUniform2i(location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2703,7 +2704,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* valuePtr = value) { - Context.glUniform2iv(location, count, valuePtr); + _context->glUniform2iv(location, count, valuePtr); } } @@ -2714,7 +2715,7 @@ namespace StgSharp.Graphics.OpenGL uint v1 ) { - Context.glUniform2ui(location, v0, v1); + _context->glUniform2ui(location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2725,7 +2726,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glUniform2uiv(location, count, valuePtr); + _context->glUniform2uiv(location, count, valuePtr); } } @@ -2737,7 +2738,7 @@ namespace StgSharp.Graphics.OpenGL float v2 ) { - Context.glUniform3f(location, v0, v1, v2); + _context->glUniform3f(location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2748,7 +2749,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniform3fv(location, count, valuePtr); + _context->glUniform3fv(location, count, valuePtr); } } @@ -2760,7 +2761,7 @@ namespace StgSharp.Graphics.OpenGL int v2 ) { - Context.glUniform3i(location, v0, v1, v2); + _context->glUniform3i(location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2771,7 +2772,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* valuePtr = value) { - Context.glUniform3iv(location, count, valuePtr); + _context->glUniform3iv(location, count, valuePtr); } } @@ -2783,7 +2784,7 @@ namespace StgSharp.Graphics.OpenGL uint v2 ) { - Context.glUniform3ui(location, v0, v1, v2); + _context->glUniform3ui(location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2794,7 +2795,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glUniform3uiv(location, count, valuePtr); + _context->glUniform3uiv(location, count, valuePtr); } } @@ -2807,7 +2808,7 @@ namespace StgSharp.Graphics.OpenGL float v3 ) { - Context.glUniform4f(location, v0, v1, v2, v3); + _context->glUniform4f(location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2818,7 +2819,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniform4fv(location, count, valuePtr); + _context->glUniform4fv(location, count, valuePtr); } } @@ -2831,7 +2832,7 @@ namespace StgSharp.Graphics.OpenGL int v3 ) { - Context.glUniform4i(location, v0, v1, v2, v3); + _context->glUniform4i(location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2842,7 +2843,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* valuePtr = value) { - Context.glUniform4iv(location, count, valuePtr); + _context->glUniform4iv(location, count, valuePtr); } } @@ -2855,7 +2856,7 @@ namespace StgSharp.Graphics.OpenGL uint v3 ) { - Context.glUniform4ui(location, v0, v1, v2, v3); + _context->glUniform4ui(location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2866,7 +2867,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glUniform4uiv(location, count, valuePtr); + _context->glUniform4uiv(location, count, valuePtr); } } @@ -2877,7 +2878,7 @@ namespace StgSharp.Graphics.OpenGL uint uniformBlockBinding ) { - Context.glUniformBlockBinding(program.Value, uniformBlockIndex, uniformBlockBinding); + _context->glUniformBlockBinding(program.Value, uniformBlockIndex, uniformBlockBinding); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2889,7 +2890,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix2fv(location, count, transpose, valuePtr); + _context->glUniformMatrix2fv(location, count, transpose, valuePtr); } } @@ -2902,7 +2903,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix2x3fv(location, count, transpose, valuePtr); + _context->glUniformMatrix2x3fv(location, count, transpose, valuePtr); } } @@ -2915,7 +2916,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix2x4fv(location, count, transpose, valuePtr); + _context->glUniformMatrix2x4fv(location, count, transpose, valuePtr); } } @@ -2928,7 +2929,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix3fv(location, count, transpose, valuePtr); + _context->glUniformMatrix3fv(location, count, transpose, valuePtr); } } @@ -2941,7 +2942,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix3x2fv(location, count, transpose, valuePtr); + _context->glUniformMatrix3x2fv(location, count, transpose, valuePtr); } } @@ -2954,7 +2955,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix3x4fv(location, count, transpose, valuePtr); + _context->glUniformMatrix3x4fv(location, count, transpose, valuePtr); } } @@ -2967,7 +2968,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix4fv(location, count, transpose, valuePtr); + _context->glUniformMatrix4fv(location, count, transpose, valuePtr); } } @@ -2980,7 +2981,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix4x2fv(location, count, transpose, valuePtr); + _context->glUniformMatrix4x2fv(location, count, transpose, valuePtr); } } @@ -2993,7 +2994,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glUniformMatrix4x3fv(location, count, transpose, valuePtr); + _context->glUniformMatrix4x3fv(location, count, transpose, valuePtr); } } @@ -3002,7 +3003,7 @@ namespace StgSharp.Graphics.OpenGL uint target ) { - return Context.glUnmapBuffer(target); + return _context->glUnmapBuffer(target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3010,7 +3011,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle program ) { - Context.glUseProgram(program.Value); + _context->glUseProgram(program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3018,7 +3019,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle program ) { - Context.glValidateProgram(program.Value); + _context->glValidateProgram(program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3027,7 +3028,7 @@ namespace StgSharp.Graphics.OpenGL double x ) { - Context.glVertexAttrib1d(index, x); + _context->glVertexAttrib1d(index, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3037,7 +3038,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttrib1dv(index, vPtr); + _context->glVertexAttrib1dv(index, vPtr); } } @@ -3047,7 +3048,7 @@ namespace StgSharp.Graphics.OpenGL float x ) { - Context.glVertexAttrib1f(index, x); + _context->glVertexAttrib1f(index, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3057,7 +3058,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* vPtr = v) { - Context.glVertexAttrib1fv(index, vPtr); + _context->glVertexAttrib1fv(index, vPtr); } } @@ -3067,7 +3068,7 @@ namespace StgSharp.Graphics.OpenGL short x ) { - Context.glVertexAttrib1s(index, x); + _context->glVertexAttrib1s(index, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3077,7 +3078,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (short* vPtr = v) { - Context.glVertexAttrib1sv(index, vPtr); + _context->glVertexAttrib1sv(index, vPtr); } } @@ -3088,7 +3089,7 @@ namespace StgSharp.Graphics.OpenGL double y ) { - Context.glVertexAttrib2d(index, x, y); + _context->glVertexAttrib2d(index, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3098,7 +3099,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttrib2dv(index, vPtr); + _context->glVertexAttrib2dv(index, vPtr); } } @@ -3109,7 +3110,7 @@ namespace StgSharp.Graphics.OpenGL float y ) { - Context.glVertexAttrib2f(index, x, y); + _context->glVertexAttrib2f(index, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3119,7 +3120,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* vPtr = v) { - Context.glVertexAttrib2fv(index, vPtr); + _context->glVertexAttrib2fv(index, vPtr); } } @@ -3130,7 +3131,7 @@ namespace StgSharp.Graphics.OpenGL short y ) { - Context.glVertexAttrib2s(index, x, y); + _context->glVertexAttrib2s(index, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3140,7 +3141,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (short* vPtr = v) { - Context.glVertexAttrib2sv(index, vPtr); + _context->glVertexAttrib2sv(index, vPtr); } } @@ -3152,7 +3153,7 @@ namespace StgSharp.Graphics.OpenGL double z ) { - Context.glVertexAttrib3d(index, x, y, z); + _context->glVertexAttrib3d(index, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3162,7 +3163,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttrib3dv(index, vPtr); + _context->glVertexAttrib3dv(index, vPtr); } } @@ -3174,7 +3175,7 @@ namespace StgSharp.Graphics.OpenGL float z ) { - Context.glVertexAttrib3f(index, x, y, z); + _context->glVertexAttrib3f(index, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3184,7 +3185,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* vPtr = v) { - Context.glVertexAttrib3fv(index, vPtr); + _context->glVertexAttrib3fv(index, vPtr); } } @@ -3196,7 +3197,7 @@ namespace StgSharp.Graphics.OpenGL short z ) { - Context.glVertexAttrib3s(index, x, y, z); + _context->glVertexAttrib3s(index, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3206,7 +3207,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (short* vPtr = v) { - Context.glVertexAttrib3sv(index, vPtr); + _context->glVertexAttrib3sv(index, vPtr); } } @@ -3217,7 +3218,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (sbyte* vPtr = v) { - Context.glVertexAttrib4bv(index, vPtr); + _context->glVertexAttrib4bv(index, vPtr); } } @@ -3230,7 +3231,7 @@ namespace StgSharp.Graphics.OpenGL double w ) { - Context.glVertexAttrib4d(index, x, y, z, w); + _context->glVertexAttrib4d(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3240,7 +3241,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttrib4dv(index, vPtr); + _context->glVertexAttrib4dv(index, vPtr); } } @@ -3253,7 +3254,7 @@ namespace StgSharp.Graphics.OpenGL float w ) { - Context.glVertexAttrib4f(index, x, y, z, w); + _context->glVertexAttrib4f(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3263,7 +3264,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* vPtr = v) { - Context.glVertexAttrib4fv(index, vPtr); + _context->glVertexAttrib4fv(index, vPtr); } } @@ -3274,7 +3275,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glVertexAttrib4iv(index, vPtr); + _context->glVertexAttrib4iv(index, vPtr); } } @@ -3285,7 +3286,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (sbyte* vPtr = v) { - Context.glVertexAttrib4Nbv(index, vPtr); + _context->glVertexAttrib4Nbv(index, vPtr); } } @@ -3296,7 +3297,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glVertexAttrib4Niv(index, vPtr); + _context->glVertexAttrib4Niv(index, vPtr); } } @@ -3307,7 +3308,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (short* vPtr = v) { - Context.glVertexAttrib4Nsv(index, vPtr); + _context->glVertexAttrib4Nsv(index, vPtr); } } @@ -3320,7 +3321,7 @@ namespace StgSharp.Graphics.OpenGL byte w ) { - Context.glVertexAttrib4Nub(index, x, y, z, w); + _context->glVertexAttrib4Nub(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3330,7 +3331,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* vPtr = v) { - Context.glVertexAttrib4Nubv(index, vPtr); + _context->glVertexAttrib4Nubv(index, vPtr); } } @@ -3341,7 +3342,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* vPtr = v) { - Context.glVertexAttrib4Nuiv(index, vPtr); + _context->glVertexAttrib4Nuiv(index, vPtr); } } @@ -3352,7 +3353,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (ushort* vPtr = v) { - Context.glVertexAttrib4Nusv(index, vPtr); + _context->glVertexAttrib4Nusv(index, vPtr); } } @@ -3365,7 +3366,7 @@ namespace StgSharp.Graphics.OpenGL short w ) { - Context.glVertexAttrib4s(index, x, y, z, w); + _context->glVertexAttrib4s(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3375,7 +3376,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (short* vPtr = v) { - Context.glVertexAttrib4sv(index, vPtr); + _context->glVertexAttrib4sv(index, vPtr); } } @@ -3386,7 +3387,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* vPtr = v) { - Context.glVertexAttrib4ubv(index, vPtr); + _context->glVertexAttrib4ubv(index, vPtr); } } @@ -3397,7 +3398,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* vPtr = v) { - Context.glVertexAttrib4uiv(index, vPtr); + _context->glVertexAttrib4uiv(index, vPtr); } } @@ -3408,7 +3409,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (ushort* vPtr = v) { - Context.glVertexAttrib4usv(index, vPtr); + _context->glVertexAttrib4usv(index, vPtr); } } @@ -3418,7 +3419,7 @@ namespace StgSharp.Graphics.OpenGL uint divisor ) { - Context.glVertexAttribDivisor(index, divisor); + _context->glVertexAttribDivisor(index, divisor); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3427,7 +3428,7 @@ namespace StgSharp.Graphics.OpenGL int x ) { - Context.glVertexAttribI1i(index, x); + _context->glVertexAttribI1i(index, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3437,7 +3438,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glVertexAttribI1iv(index, vPtr); + _context->glVertexAttribI1iv(index, vPtr); } } @@ -3447,7 +3448,7 @@ namespace StgSharp.Graphics.OpenGL uint x ) { - Context.glVertexAttribI1ui(index, x); + _context->glVertexAttribI1ui(index, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3457,7 +3458,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* vPtr = v) { - Context.glVertexAttribI1uiv(index, vPtr); + _context->glVertexAttribI1uiv(index, vPtr); } } @@ -3468,7 +3469,7 @@ namespace StgSharp.Graphics.OpenGL int y ) { - Context.glVertexAttribI2i(index, x, y); + _context->glVertexAttribI2i(index, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3478,7 +3479,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glVertexAttribI2iv(index, vPtr); + _context->glVertexAttribI2iv(index, vPtr); } } @@ -3489,7 +3490,7 @@ namespace StgSharp.Graphics.OpenGL uint y ) { - Context.glVertexAttribI2ui(index, x, y); + _context->glVertexAttribI2ui(index, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3499,7 +3500,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* vPtr = v) { - Context.glVertexAttribI2uiv(index, vPtr); + _context->glVertexAttribI2uiv(index, vPtr); } } @@ -3511,7 +3512,7 @@ namespace StgSharp.Graphics.OpenGL int z ) { - Context.glVertexAttribI3i(index, x, y, z); + _context->glVertexAttribI3i(index, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3521,7 +3522,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glVertexAttribI3iv(index, vPtr); + _context->glVertexAttribI3iv(index, vPtr); } } @@ -3533,7 +3534,7 @@ namespace StgSharp.Graphics.OpenGL uint z ) { - Context.glVertexAttribI3ui(index, x, y, z); + _context->glVertexAttribI3ui(index, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3543,7 +3544,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* vPtr = v) { - Context.glVertexAttribI3uiv(index, vPtr); + _context->glVertexAttribI3uiv(index, vPtr); } } @@ -3554,7 +3555,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (sbyte* vPtr = v) { - Context.glVertexAttribI4bv(index, vPtr); + _context->glVertexAttribI4bv(index, vPtr); } } @@ -3567,7 +3568,7 @@ namespace StgSharp.Graphics.OpenGL int w ) { - Context.glVertexAttribI4i(index, x, y, z, w); + _context->glVertexAttribI4i(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3577,7 +3578,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glVertexAttribI4iv(index, vPtr); + _context->glVertexAttribI4iv(index, vPtr); } } @@ -3588,7 +3589,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (short* vPtr = v) { - Context.glVertexAttribI4sv(index, vPtr); + _context->glVertexAttribI4sv(index, vPtr); } } @@ -3599,7 +3600,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* vPtr = v) { - Context.glVertexAttribI4ubv(index, vPtr); + _context->glVertexAttribI4ubv(index, vPtr); } } @@ -3612,7 +3613,7 @@ namespace StgSharp.Graphics.OpenGL uint w ) { - Context.glVertexAttribI4ui(index, x, y, z, w); + _context->glVertexAttribI4ui(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3622,7 +3623,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* vPtr = v) { - Context.glVertexAttribI4uiv(index, vPtr); + _context->glVertexAttribI4uiv(index, vPtr); } } @@ -3633,7 +3634,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (ushort* vPtr = v) { - Context.glVertexAttribI4usv(index, vPtr); + _context->glVertexAttribI4usv(index, vPtr); } } @@ -3647,7 +3648,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pointerPtr = pointer) { - Context.glVertexAttribIPointer(index, size, (uint)type, stride, pointerPtr); + _context->glVertexAttribIPointer(index, size, (uint)type, stride, pointerPtr); } } @@ -3659,7 +3660,7 @@ namespace StgSharp.Graphics.OpenGL uint value ) { - Context.glVertexAttribP1ui(index, (uint)type, normalized, value); + _context->glVertexAttribP1ui(index, (uint)type, normalized, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3671,7 +3672,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glVertexAttribP1uiv(index, (uint)type, normalized, valuePtr); + _context->glVertexAttribP1uiv(index, (uint)type, normalized, valuePtr); } } @@ -3683,7 +3684,7 @@ namespace StgSharp.Graphics.OpenGL uint value ) { - Context.glVertexAttribP2ui(index, (uint)type, normalized, value); + _context->glVertexAttribP2ui(index, (uint)type, normalized, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3695,7 +3696,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glVertexAttribP2uiv(index, (uint)type, normalized, valuePtr); + _context->glVertexAttribP2uiv(index, (uint)type, normalized, valuePtr); } } @@ -3707,7 +3708,7 @@ namespace StgSharp.Graphics.OpenGL uint value ) { - Context.glVertexAttribP3ui(index, (uint)type, normalized, value); + _context->glVertexAttribP3ui(index, (uint)type, normalized, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3719,7 +3720,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glVertexAttribP3uiv(index, (uint)type, normalized, valuePtr); + _context->glVertexAttribP3uiv(index, (uint)type, normalized, valuePtr); } } @@ -3731,7 +3732,7 @@ namespace StgSharp.Graphics.OpenGL uint value ) { - Context.glVertexAttribP4ui(index, (uint)type, normalized, value); + _context->glVertexAttribP4ui(index, (uint)type, normalized, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3743,7 +3744,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glVertexAttribP4uiv(index, (uint)type, normalized, valuePtr); + _context->glVertexAttribP4uiv(index, (uint)type, normalized, valuePtr); } } @@ -3758,7 +3759,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pointerPtr = pointer) { - Context.glVertexAttribPointer(index, size, (uint)type, normalized, stride, + _context->glVertexAttribPointer(index, size, (uint)type, normalized, stride, pointerPtr); } } @@ -3771,7 +3772,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glViewport(x, y, width, height); + _context->glViewport(x, y, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -3781,7 +3782,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr timeout ) { - Context.glWaitSync(sync, flags, timeout); + _context->glWaitSync(sync, flags, timeout); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs index 85a48a74..236ea9dd 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_0.cs @@ -42,7 +42,7 @@ namespace StgSharp.Graphics.OpenGL uint id ) { - Context.glBeginQueryIndexed(target, index, id); + _context->glBeginQueryIndexed(target, index, id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -51,7 +51,7 @@ namespace StgSharp.Graphics.OpenGL uint id ) { - Context.glBindTransformFeedback(target, id); + _context->glBindTransformFeedback(target, id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -60,7 +60,7 @@ namespace StgSharp.Graphics.OpenGL uint mode ) { - Context.glBlendEquationi(buf, mode); + _context->glBlendEquationi(buf, mode); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -70,7 +70,7 @@ namespace StgSharp.Graphics.OpenGL uint modeAlpha ) { - Context.glBlendEquationSeparatei(buf, modeRGB, modeAlpha); + _context->glBlendEquationSeparatei(buf, modeRGB, modeAlpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -80,7 +80,7 @@ namespace StgSharp.Graphics.OpenGL uint dst ) { - Context.glBlendFunci(buf, src, dst); + _context->glBlendFunci(buf, src, dst); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -92,7 +92,7 @@ namespace StgSharp.Graphics.OpenGL uint dstAlpha ) { - Context.glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); + _context->glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -102,7 +102,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* idsPtr = ids) { - Context.glDeleteTransformFeedbacks(n, idsPtr); + _context->glDeleteTransformFeedbacks(n, idsPtr); } } @@ -113,7 +113,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indirectPtr = indirect) { - Context.glDrawArraysIndirect(mode, indirectPtr); + _context->glDrawArraysIndirect(mode, indirectPtr); } } @@ -125,7 +125,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glDrawTransformFeedback(mode, id); + _context->glDrawTransformFeedback(mode, id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -145,7 +145,7 @@ namespace StgSharp.Graphics.OpenGL uint stream ) { - Context.glDrawTransformFeedbackStream(mode, id, stream); + _context->glDrawTransformFeedbackStream(mode, id, stream); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -154,7 +154,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glEndQueryIndexed(target, index); + _context->glEndQueryIndexed(target, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -163,7 +163,7 @@ namespace StgSharp.Graphics.OpenGL uint* ids ) { - Context.glGenTransformFeedbacks(n, ids); + _context->glGenTransformFeedbacks(n, ids); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -176,8 +176,8 @@ namespace StgSharp.Graphics.OpenGL byte* name ) { - Context.glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize, - length, name); + _context->glGetActiveSubroutineName(program.Value, (uint)shaderType, index, bufSize, + length, name); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -189,8 +189,8 @@ namespace StgSharp.Graphics.OpenGL int* values ) { - Context.glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName, - values); + _context->glGetActiveSubroutineUniformiv(program.Value, (uint)shaderType, index, pName, + values); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -203,8 +203,8 @@ namespace StgSharp.Graphics.OpenGL byte* name ) { - Context.glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index, - bufSize, length, name); + _context->glGetActiveSubroutineUniformName(program.Value, (uint)shaderType, index, + bufSize, length, name); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -215,7 +215,7 @@ namespace StgSharp.Graphics.OpenGL int* values ) { - Context.glGetProgramStageiv(program.Value, (uint)shaderType, pName, values); + _context->glGetProgramStageiv(program.Value, (uint)shaderType, pName, values); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -226,7 +226,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetQueryIndexediv(target, index, pName, @params); + _context->glGetQueryIndexediv(target, index, pName, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -237,7 +237,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - 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 ) { - Context.glGetUniformdv(program.Value, location, @params); + _context->glGetUniformdv(program.Value, location, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -270,7 +270,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetUniformSubroutineuiv((uint)shaderType, location, @params); + _context->glGetUniformSubroutineuiv((uint)shaderType, location, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -278,7 +278,7 @@ namespace StgSharp.Graphics.OpenGL uint id ) { - return Context.glIsTransformFeedback(id); + return _context->glIsTransformFeedback(id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -286,7 +286,7 @@ namespace StgSharp.Graphics.OpenGL float value ) { - Context.glMinSampleShading(value); + _context->glMinSampleShading(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -296,7 +296,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuesPtr = values) { - Context.glPatchParameterfv(pName, valuesPtr); + _context->glPatchParameterfv(pName, valuesPtr); } } @@ -306,19 +306,19 @@ namespace StgSharp.Graphics.OpenGL int value ) { - Context.glPatchParameteri(pName, value); + _context->glPatchParameteri(pName, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PauseTransformFeedback() { - Context.glPauseTransformFeedback(); + _context->glPauseTransformFeedback(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void ResumeTransformFeedback() { - Context.glResumeTransformFeedback(); + _context->glResumeTransformFeedback(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -327,7 +327,7 @@ namespace StgSharp.Graphics.OpenGL double x ) { - Context.glUniform1d(location, x); + _context->glUniform1d(location, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -338,7 +338,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glUniform1dv(location, count, valuePtr); + _context->glUniform1dv(location, count, valuePtr); } } @@ -349,7 +349,7 @@ namespace StgSharp.Graphics.OpenGL double y ) { - Context.glUniform2d(location, x, y); + _context->glUniform2d(location, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -360,7 +360,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glUniform2dv(location, count, valuePtr); + _context->glUniform2dv(location, count, valuePtr); } } @@ -372,7 +372,7 @@ namespace StgSharp.Graphics.OpenGL double z ) { - Context.glUniform3d(location, x, y, z); + _context->glUniform3d(location, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -383,7 +383,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glUniform3dv(location, count, valuePtr); + _context->glUniform3dv(location, count, valuePtr); } } @@ -396,7 +396,7 @@ namespace StgSharp.Graphics.OpenGL double w ) { - Context.glUniform4d(location, x, y, z, w); + _context->glUniform4d(location, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -407,7 +407,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glUniformMatrix2dv(location, count, transpose, valuePtr); + _context->glUniformMatrix2dv(location, count, transpose, valuePtr); } } @@ -433,7 +433,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glUniformMatrix2x4dv(location, count, transpose, valuePtr); + _context->glUniformMatrix2x4dv(location, count, transpose, valuePtr); } } @@ -459,7 +459,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glUniformMatrix3x2dv(location, count, transpose, valuePtr); + _context->glUniformMatrix3x2dv(location, count, transpose, valuePtr); } } @@ -485,7 +485,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glUniformMatrix4dv(location, count, transpose, valuePtr); + _context->glUniformMatrix4dv(location, count, transpose, valuePtr); } } @@ -511,7 +511,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glUniformMatrix4x3dv(location, count, transpose, valuePtr); + _context->glUniformMatrix4x3dv(location, count, transpose, valuePtr); } } @@ -536,7 +536,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* indicesPtr = indices) { - Context.glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr); + _context->glUniformSubroutinesuiv((uint)shaderType, count, indicesPtr); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs index cf45cea4..82810d51 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_1.cs @@ -41,7 +41,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle program ) { - Context.glActiveShaderProgram(pipeline, program.Value); + _context->glActiveShaderProgram(pipeline, program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -49,7 +49,7 @@ namespace StgSharp.Graphics.OpenGL uint pipeline ) { - Context.glBindProgramPipeline(pipeline); + _context->glBindProgramPipeline(pipeline); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -57,7 +57,7 @@ namespace StgSharp.Graphics.OpenGL float d ) { - Context.glClearDepthf(d); + _context->glClearDepthf(d); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -68,7 +68,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glDeleteProgramPipelines(n, pipelinesPtr); + _context->glDeleteProgramPipelines(n, pipelinesPtr); } } @@ -91,7 +91,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glDepthRangeArrayv(first, count, vPtr); + _context->glDepthRangeArrayv(first, count, vPtr); } } @@ -101,7 +101,7 @@ namespace StgSharp.Graphics.OpenGL float f ) { - Context.glDepthRangef(n, f); + _context->glDepthRangef(n, f); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -111,7 +111,7 @@ namespace StgSharp.Graphics.OpenGL double f ) { - Context.glDepthRangeIndexed(index, n, f); + _context->glDepthRangeIndexed(index, n, f); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -120,7 +120,7 @@ namespace StgSharp.Graphics.OpenGL uint* pipelines ) { - Context.glGenProgramPipelines(n, pipelines); + _context->glGenProgramPipelines(n, pipelines); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -130,7 +130,7 @@ namespace StgSharp.Graphics.OpenGL double* data ) { - Context.glGetDoublei_v(target, index, data); + _context->glGetDoublei_v(target, index, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -140,7 +140,7 @@ namespace StgSharp.Graphics.OpenGL float* data ) { - Context.glGetFloati_v(target, index, data); + _context->glGetFloati_v(target, index, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -152,7 +152,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* binary ) { - Context.glGetProgramBinary(program.Value, bufSize, length, binaryFormat, binary); + _context->glGetProgramBinary(program.Value, bufSize, length, binaryFormat, binary); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -163,7 +163,7 @@ namespace StgSharp.Graphics.OpenGL byte* infoLog ) { - Context.glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); + _context->glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -173,7 +173,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetProgramPipelineiv(pipeline, pname, @params); + _context->glGetProgramPipelineiv(pipeline, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -184,7 +184,7 @@ namespace StgSharp.Graphics.OpenGL int* precision ) { - Context.glGetShaderPrecisionFormat((uint)shaderType, precisiontype, range, precision); + _context->glGetShaderPrecisionFormat((uint)shaderType, precisiontype, range, precision); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -194,7 +194,7 @@ namespace StgSharp.Graphics.OpenGL double* @params ) { - Context.glGetVertexAttribLdv(index, pname, @params); + _context->glGetVertexAttribLdv(index, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -202,7 +202,7 @@ namespace StgSharp.Graphics.OpenGL uint pipeline ) { - return Context.glIsProgramPipeline(pipeline); + return _context->glIsProgramPipeline(pipeline); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -214,7 +214,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramParameteri(program.Value, pname, value); + _context->glProgramParameteri(program.Value, pname, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -235,7 +235,7 @@ namespace StgSharp.Graphics.OpenGL double v0 ) { - Context.glProgramUniform1d(program.Value, location, v0); + _context->glProgramUniform1d(program.Value, location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -247,7 +247,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform1f(program.Value, location, v0); + _context->glProgramUniform1f(program.Value, location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -270,7 +270,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform1i(program.Value, location, v0); + _context->glProgramUniform1i(program.Value, location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -293,7 +293,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform1ui(program.Value, location, v0); + _context->glProgramUniform1ui(program.Value, location, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -316,7 +316,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform2d(program.Value, location, v0, v1); + _context->glProgramUniform2d(program.Value, location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -340,7 +340,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform2f(program.Value, location, v0, v1); + _context->glProgramUniform2f(program.Value, location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -364,7 +364,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform2i(program.Value, location, v0, v1); + _context->glProgramUniform2i(program.Value, location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -388,7 +388,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform2ui(program.Value, location, v0, v1); + _context->glProgramUniform2ui(program.Value, location, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -412,7 +412,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform3d(program.Value, location, v0, v1, v2); + _context->glProgramUniform3d(program.Value, location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -437,7 +437,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform3f(program.Value, location, v0, v1, v2); + _context->glProgramUniform3f(program.Value, location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -462,7 +462,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform3i(program.Value, location, v0, v1, v2); + _context->glProgramUniform3i(program.Value, location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -487,7 +487,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform3ui(program.Value, location, v0, v1, v2); + _context->glProgramUniform3ui(program.Value, location, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -512,7 +512,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform4d(program.Value, location, v0, v1, v2, v3); + _context->glProgramUniform4d(program.Value, location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -538,7 +538,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform4f(program.Value, location, v0, v1, v2, v3); + _context->glProgramUniform4f(program.Value, location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -564,7 +564,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform4i(program.Value, location, v0, v1, v2, v3); + _context->glProgramUniform4i(program.Value, location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -590,7 +590,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glProgramUniform4ui(program.Value, location, v0, v1, v2, v3); + _context->glProgramUniform4ui(program.Value, location, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -616,7 +616,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* valuePtr = value) { - Context.glProgramUniform4uiv(program.Value, location, count, valuePtr); + _context->glProgramUniform4uiv(program.Value, location, count, valuePtr); } } @@ -630,8 +630,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix2dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix2dv(program.Value, location, count, transpose, + valuePtr); } } @@ -645,8 +645,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix2fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix2fv(program.Value, location, count, transpose, + valuePtr); } } @@ -660,8 +660,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix2x3dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix2x3dv(program.Value, location, count, transpose, + valuePtr); } } @@ -675,8 +675,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix2x3fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix2x3fv(program.Value, location, count, transpose, + valuePtr); } } @@ -690,8 +690,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix2x4dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix2x4dv(program.Value, location, count, transpose, + valuePtr); } } @@ -705,8 +705,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix2x4fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix2x4fv(program.Value, location, count, transpose, + valuePtr); } } @@ -720,8 +720,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix3dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix3dv(program.Value, location, count, transpose, + valuePtr); } } @@ -735,8 +735,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix3fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix3fv(program.Value, location, count, transpose, + valuePtr); } } @@ -750,8 +750,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix3x2dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix3x2dv(program.Value, location, count, transpose, + valuePtr); } } @@ -765,8 +765,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix3x2fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix3x2fv(program.Value, location, count, transpose, + valuePtr); } } @@ -780,8 +780,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix3x4dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix3x4dv(program.Value, location, count, transpose, + valuePtr); } } @@ -795,8 +795,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix3x4fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix3x4fv(program.Value, location, count, transpose, + valuePtr); } } @@ -810,8 +810,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix4dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix4dv(program.Value, location, count, transpose, + valuePtr); } } @@ -825,8 +825,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix4fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix4fv(program.Value, location, count, transpose, + valuePtr); } } @@ -840,8 +840,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix4x2dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix4x2dv(program.Value, location, count, transpose, + valuePtr); } } @@ -855,8 +855,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix4x2fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix4x2fv(program.Value, location, count, transpose, + valuePtr); } } @@ -870,8 +870,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* valuePtr = value) { - Context.glProgramUniformMatrix4x3dv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix4x3dv(program.Value, location, count, transpose, + valuePtr); } } @@ -885,15 +885,15 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* valuePtr = value) { - Context.glProgramUniformMatrix4x3fv(program.Value, location, count, transpose, - valuePtr); + _context->glProgramUniformMatrix4x3fv(program.Value, location, count, transpose, + valuePtr); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void ReleaseShaderCompiler() { - Context.glReleaseShaderCompiler(); + _context->glReleaseShaderCompiler(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -904,7 +904,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (int* vPtr = v) { - Context.glScissorArrayv(first, count, vPtr); + _context->glScissorArrayv(first, count, vPtr); } } @@ -917,7 +917,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glScissorIndexed(index, left, bottom, width, height); + _context->glScissorIndexed(index, left, bottom, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -927,7 +927,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 (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 ) { - Context.glUseProgramStages(pipeline, stages, program.Value); + _context->glUseProgramStages(pipeline, stages, program.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -963,7 +963,7 @@ namespace StgSharp.Graphics.OpenGL uint pipeline ) { - Context.glValidateProgramPipeline(pipeline); + _context->glValidateProgramPipeline(pipeline); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -972,7 +972,7 @@ namespace StgSharp.Graphics.OpenGL double x ) { - Context.glVertexAttribL1d(index, x); + _context->glVertexAttribL1d(index, x); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -982,7 +982,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttribL1dv(index, vPtr); + _context->glVertexAttribL1dv(index, vPtr); } } @@ -993,7 +993,7 @@ namespace StgSharp.Graphics.OpenGL double y ) { - Context.glVertexAttribL2d(index, x, y); + _context->glVertexAttribL2d(index, x, y); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1003,7 +1003,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttribL2dv(index, vPtr); + _context->glVertexAttribL2dv(index, vPtr); } } @@ -1015,7 +1015,7 @@ namespace StgSharp.Graphics.OpenGL double z ) { - Context.glVertexAttribL3d(index, x, y, z); + _context->glVertexAttribL3d(index, x, y, z); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1025,7 +1025,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttribL3dv(index, vPtr); + _context->glVertexAttribL3dv(index, vPtr); } } @@ -1038,7 +1038,7 @@ namespace StgSharp.Graphics.OpenGL double w ) { - Context.glVertexAttribL4d(index, x, y, z, w); + _context->glVertexAttribL4d(index, x, y, z, w); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1048,7 +1048,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (double* vPtr = v) { - Context.glVertexAttribL4dv(index, vPtr); + _context->glVertexAttribL4dv(index, vPtr); } } @@ -1062,7 +1062,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glViewportArrayv(first, count, vPtr); + _context->glViewportArrayv(first, count, vPtr); } } @@ -1087,7 +1087,7 @@ namespace StgSharp.Graphics.OpenGL float h ) { - Context.glViewportIndexedf(index, x, y, w, h); + _context->glViewportIndexedf(index, x, y, w, h); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1097,7 +1097,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (float* vPtr = v) { - Context.glViewportIndexedfv(index, vPtr); + _context->glViewportIndexedfv(index, vPtr); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs index 39379f71..666c5168 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_2.cs @@ -25,10 +25,6 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// -// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z -// Version: 4.2 -// using StgSharp.Graphics.OpenGL; using System; using System.Runtime.CompilerServices; @@ -50,7 +46,8 @@ namespace StgSharp.Graphics.OpenGL 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)] @@ -62,8 +59,8 @@ namespace StgSharp.Graphics.OpenGL uint baseinstance ) { - Context.glDrawArraysInstancedBaseInstance(mode, first, count, instancecount, - baseinstance); + _context->glDrawArraysInstancedBaseInstance(mode, first, count, instancecount, + baseinstance); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -77,8 +74,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr, - instancecount, baseinstance); + _context->glDrawElementsInstancedBaseInstance(mode, count, (uint)type, indicesPtr, + instancecount, baseinstance); } } @@ -94,9 +91,9 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indicesPtr = indices) { - Context.glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type, - indicesPtr, instancecount, - basevertex, baseinstance); + _context->glDrawElementsInstancedBaseVertexBaseInstance(mode, count, (uint)type, + indicesPtr, instancecount, + basevertex, baseinstance); } } @@ -107,7 +104,7 @@ namespace StgSharp.Graphics.OpenGL int instancecount ) { - Context.glDrawTransformFeedbackInstanced(mode, id, instancecount); + _context->glDrawTransformFeedbackInstanced(mode, id, instancecount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -118,7 +115,7 @@ namespace StgSharp.Graphics.OpenGL int instancecount ) { - Context.glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount); + _context->glDrawTransformFeedbackStreamInstanced(mode, id, stream, instancecount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -129,8 +126,8 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname, - @params); + _context->glGetActiveAtomicCounterBufferiv(program.Value, bufferIndex.Value, pname, + @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -142,7 +139,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetInternalformativ(target, internalformat, pname, count, @params); + _context->glGetInternalformativ(target, internalformat, pname, count, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -150,7 +147,7 @@ namespace StgSharp.Graphics.OpenGL uint barriers ) { - Context.glMemoryBarrier(barriers); + _context->glMemoryBarrier(barriers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -161,7 +158,7 @@ namespace StgSharp.Graphics.OpenGL int width ) { - Context.glTexStorage1D(target, levels, internalformat, width); + _context->glTexStorage1D(target, levels, internalformat, width); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -173,7 +170,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glTexStorage2D(target, levels, internalformat, width, height); + _context->glTexStorage2D(target, levels, internalformat, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -186,7 +183,7 @@ namespace StgSharp.Graphics.OpenGL int depth ) { - Context.glTexStorage3D(target, levels, internalformat, width, height, depth); + _context->glTexStorage3D(target, levels, internalformat, width, height, depth); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs index dbf03cb8..73c3de2a 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_3.cs @@ -25,10 +25,6 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// -// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z -// Version: 4.3 -// using StgSharp.Graphics.OpenGL; using System; using System.Runtime.CompilerServices; @@ -47,7 +43,7 @@ namespace StgSharp.Graphics.OpenGL int stride ) { - Context.glBindVertexBuffer(bindingindex, buffer.Value, offset, stride); + _context->glBindVertexBuffer(bindingindex, buffer.Value, offset, stride); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -60,7 +56,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glClearBufferData(target, internalformat, format, (uint)type, dataPtr); + _context->glClearBufferData(target, internalformat, format, (uint)type, dataPtr); } } @@ -76,8 +72,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glClearBufferSubData(target, internalformat, offset, size, format, - (uint)type, dataPtr); + _context->glClearBufferSubData(target, internalformat, offset, size, format, + (uint)type, dataPtr); } } @@ -100,9 +96,9 @@ namespace StgSharp.Graphics.OpenGL int srcDepth ) { - Context.glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, - dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, - srcDepth); + _context->glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, + dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, + srcDepth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -112,7 +108,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* userParamPtr = userParam) { - Context.glDebugMessageCallback(callback, userParamPtr); + _context->glDebugMessageCallback(callback, userParamPtr); } } @@ -127,7 +123,8 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - 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 ) { - 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)] @@ -161,7 +158,7 @@ namespace StgSharp.Graphics.OpenGL nint indirect ) { - Context.glDispatchComputeIndirect(indirect); + _context->glDispatchComputeIndirect(indirect); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -171,7 +168,7 @@ namespace StgSharp.Graphics.OpenGL int param ) { - Context.glFramebufferParameteri(target, pname, param); + _context->glFramebufferParameteri(target, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -186,8 +183,8 @@ namespace StgSharp.Graphics.OpenGL byte* messageLog ) { - return Context.glGetDebugMessageLog(count, bufSize, sources, types, ids, severities, - lengths, messageLog); + return _context->glGetDebugMessageLog(count, bufSize, sources, types, ids, severities, + lengths, messageLog); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -197,7 +194,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetFramebufferParameteriv(target, pname, @params); + _context->glGetFramebufferParameteriv(target, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -209,7 +206,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetInternalformati64v(target, internalformat, pname, count, @params); + _context->glGetInternalformati64v(target, internalformat, pname, count, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -221,7 +218,7 @@ namespace StgSharp.Graphics.OpenGL byte* label ) { - Context.glGetObjectLabel(identifier, name, bufSize, length, label); + _context->glGetObjectLabel(identifier, name, bufSize, length, label); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -233,7 +230,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glGetProgramInterfaceiv(program.Value, programInterface, pname, @params); + _context->glGetProgramInterfaceiv(program.Value, programInterface, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -256,7 +253,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (byte* namePtr = name) { - return Context.glGetProgramResourceIndex(program.Value, programInterface, namePtr); + return _context->glGetProgramResourceIndex(program.Value, programInterface, namePtr); } } @@ -273,8 +270,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* propsPtr = props) { - Context.glGetProgramResourceiv(program.Value, programInterface, index, propCount, - propsPtr, count, length, @params); + _context->glGetProgramResourceiv(program.Value, programInterface, index, propCount, + propsPtr, count, length, @params); } } @@ -286,7 +283,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - return Context.glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr); + return _context->glGetProgramResourceLocationIndex(program.Value, programInterface, namePtr); } } @@ -312,8 +309,8 @@ namespace StgSharp.Graphics.OpenGL byte* name ) { - Context.glGetProgramResourceName(program.Value, programInterface, index, bufSize, - length, name); + _context->glGetProgramResourceName(program.Value, programInterface, index, bufSize, + length, name); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -321,7 +318,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glInvalidateBufferData(buffer.Value); + _context->glInvalidateBufferData(buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -331,7 +328,7 @@ namespace StgSharp.Graphics.OpenGL nuint length ) { - Context.glInvalidateBufferSubData(buffer.Value, offset, length); + _context->glInvalidateBufferSubData(buffer.Value, offset, length); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -342,7 +339,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* attachmentsPtr = attachments) { - Context.glInvalidateFramebuffer(target, numAttachments, attachmentsPtr); + _context->glInvalidateFramebuffer(target, numAttachments, attachmentsPtr); } } @@ -358,8 +355,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* attachmentsPtr = attachments) { - Context.glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y, - width, height); + _context->glInvalidateSubFramebuffer(target, numAttachments, attachmentsPtr, x, y, + width, height); } } @@ -369,7 +366,7 @@ namespace StgSharp.Graphics.OpenGL int level ) { - Context.glInvalidateTexImage(texture.Value, level); + _context->glInvalidateTexImage(texture.Value, level); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -384,8 +381,8 @@ namespace StgSharp.Graphics.OpenGL int depth ) { - Context.glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, - height, depth); + _context->glInvalidateTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, + width, height, depth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -397,7 +394,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indirectPtr = indirect) { - Context.glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride); + _context->glMultiDrawArraysIndirect(mode, indirectPtr, drawcount, stride); } } @@ -411,8 +408,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indirectPtr = indirect) { - Context.glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount, - stride); + _context->glMultiDrawElementsIndirect(mode, (uint)type, indirectPtr, drawcount, + stride); } } @@ -425,7 +422,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 (byte* labelPtr = label) { - Context.glObjectPtrLabel(ptrPtr, length, labelPtr); + _context->glObjectPtrLabel(ptrPtr, length, labelPtr); } } } @@ -447,7 +444,7 @@ namespace StgSharp.Graphics.OpenGL [MethodImpl(MethodImplOptions.AggressiveInlining)] public void PopDebugGroup() { - Context.glPopDebugGroup(); + _context->glPopDebugGroup(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -459,7 +456,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding); + _context->glShaderStorageBlockBinding(program.Value, storageBlockIndex, storageBlockBinding); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -482,7 +479,7 @@ namespace StgSharp.Graphics.OpenGL nuint size ) { - Context.glTexBufferRange(target, internalformat, buffer.Value, offset, size); + _context->glTexBufferRange(target, internalformat, buffer.Value, offset, size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -495,8 +492,8 @@ namespace StgSharp.Graphics.OpenGL byte fixedsamplelocations ) { - Context.glTexStorage2DMultisample(target, samples, internalformat, width, height, - fixedsamplelocations); + _context->glTexStorage2DMultisample(target, samples, internalformat, width, height, + fixedsamplelocations); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -510,8 +507,8 @@ namespace StgSharp.Graphics.OpenGL byte fixedsamplelocations ) { - Context.glTexStorage3DMultisample(target, samples, internalformat, width, height, depth, - fixedsamplelocations); + _context->glTexStorage3DMultisample(target, samples, internalformat, width, height, + depth, fixedsamplelocations); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -526,8 +523,8 @@ namespace StgSharp.Graphics.OpenGL uint numlayers ) { - Context.glTextureView(texture.Value, target, origtexture.Value, internalformat, - minlevel, numlevels, minlayer, numlayers); + _context->glTextureView(texture.Value, target, origtexture.Value, internalformat, + minlevel, numlevels, minlayer, numlayers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -536,7 +533,7 @@ namespace StgSharp.Graphics.OpenGL uint bindingindex ) { - Context.glVertexAttribBinding(attribindex, bindingindex); + _context->glVertexAttribBinding(attribindex, bindingindex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -548,7 +545,8 @@ namespace StgSharp.Graphics.OpenGL uint relativeoffset ) { - Context.glVertexAttribFormat(attribindex, size, (uint)type, normalized, relativeoffset); + _context->glVertexAttribFormat(attribindex, size, (uint)type, normalized, + relativeoffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -559,7 +557,7 @@ namespace StgSharp.Graphics.OpenGL uint relativeoffset ) { - Context.glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset); + _context->glVertexAttribIFormat(attribindex, size, (uint)type, relativeoffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -570,7 +568,7 @@ namespace StgSharp.Graphics.OpenGL uint relativeoffset ) { - Context.glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset); + _context->glVertexAttribLFormat(attribindex, size, (uint)type, relativeoffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -579,7 +577,7 @@ namespace StgSharp.Graphics.OpenGL uint divisor ) { - Context.glVertexBindingDivisor(bindingindex, divisor); + _context->glVertexBindingDivisor(bindingindex, divisor); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs index a965e83e..2ebcc672 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_4.cs @@ -25,10 +25,6 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// -// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z -// Version: 4.4 -// using StgSharp.Graphics.OpenGL; using System; using System.Runtime.CompilerServices; @@ -48,7 +44,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* buffersPtr = buffers) { - Context.glBindBuffersBase(target, first, count, buffersPtr); + _context->glBindBuffersBase(target, first, count, buffersPtr); } } @@ -67,8 +63,8 @@ namespace StgSharp.Graphics.OpenGL fixed (nint* offsetsPtr = offsets) { fixed (nuint* sizesPtr = sizes) { - Context.glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr, - sizesPtr); + _context->glBindBuffersRange(target, first, count, buffersPtr, offsetsPtr, + sizesPtr); } } } @@ -82,7 +78,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glBindSamplers(first, count, samplersPtr); + _context->glBindSamplers(first, count, samplersPtr); } } @@ -106,7 +102,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* texturesPtr = textures) { - Context.glBindTextures(first, count, texturesPtr); + _context->glBindTextures(first, count, texturesPtr); } } @@ -124,8 +120,8 @@ namespace StgSharp.Graphics.OpenGL fixed (nint* offsetsPtr = offsets) { fixed (int* stridesPtr = strides) { - Context.glBindVertexBuffers(first, count, buffersPtr, offsetsPtr, - stridesPtr); + _context->glBindVertexBuffers(first, count, buffersPtr, offsetsPtr, + stridesPtr); } } } @@ -140,7 +136,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glClearTexImage(texture.Value, level, format, (uint)type, dataPtr); + _context->glClearTexImage(texture.Value, level, format, (uint)type, dataPtr); } } @@ -174,8 +170,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, - height, depth, format, (uint)type, dataPtr); + _context->glClearTexSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, + height, depth, format, (uint)type, dataPtr); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs index 550d42a2..9e72156d 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_5.cs @@ -25,10 +25,6 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// -// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z -// Version: 4.5 -// using StgSharp.Graphics.OpenGL; using System; using System.Runtime.CompilerServices; @@ -45,7 +41,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle texture ) { - Context.glBindTextureUnit(unit, texture.Value); + _context->glBindTextureUnit(unit, texture.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -64,9 +60,9 @@ namespace StgSharp.Graphics.OpenGL uint filter ) { - Context.glBlitNamedFramebuffer(readFramebuffer.Value, drawFramebuffer.Value, srcX0, - srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, - filter); + _context->glBlitNamedFramebuffer(readFramebuffer.Value, drawFramebuffer.Value, srcX0, + srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, + filter); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -75,7 +71,7 @@ namespace StgSharp.Graphics.OpenGL uint target ) { - return Context.glCheckNamedFramebufferStatus(framebuffer.Value, target); + return _context->glCheckNamedFramebufferStatus(framebuffer.Value, target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -88,8 +84,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glClearNamedBufferData(buffer.Value, internalformat, format, (uint)type, - dataPtr); + _context->glClearNamedBufferData(buffer.Value, internalformat, format, (uint)type, + dataPtr); } } @@ -105,8 +101,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glClearNamedBufferSubData(buffer.Value, internalformat, offset, size, - format, (uint)type, dataPtr); + _context->glClearNamedBufferSubData(buffer.Value, internalformat, offset, size, + format, (uint)type, dataPtr); } } @@ -119,8 +115,8 @@ namespace StgSharp.Graphics.OpenGL int stencil ) { - Context.glClearNamedFramebufferfi(framebuffer.Value, buffer, drawbuffer, depth, - stencil); + _context->glClearNamedFramebufferfi(framebuffer.Value, buffer, drawbuffer, depth, + stencil); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -132,7 +128,8 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - 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) { - Context.glClearNamedFramebufferuiv(framebuffer.Value, buffer, drawbuffer, valuePtr); + _context->glClearNamedFramebufferuiv(framebuffer.Value, buffer, drawbuffer, + valuePtr); } } @@ -168,7 +167,7 @@ namespace StgSharp.Graphics.OpenGL uint depth ) { - Context.glClipControl(origin, depth); + _context->glClipControl(origin, depth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -183,8 +182,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTextureSubImage1D(texture.Value, level, xoffset, width, format, - imageSize, dataPtr); + _context->glCompressedTextureSubImage1D(texture.Value, level, xoffset, width, + format, imageSize, dataPtr); } } @@ -202,8 +201,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, - height, format, imageSize, dataPtr); + _context->glCompressedTextureSubImage2D(texture.Value, level, xoffset, yoffset, + width, height, format, imageSize, dataPtr); } } @@ -223,9 +222,9 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* dataPtr = data) { - Context.glCompressedTextureSubImage3D(texture.Value, level, xoffset, yoffset, - zoffset, width, height, depth, format, - imageSize, dataPtr); + _context->glCompressedTextureSubImage3D(texture.Value, level, xoffset, yoffset, + zoffset, width, height, depth, format, + imageSize, dataPtr); } } @@ -238,8 +237,8 @@ namespace StgSharp.Graphics.OpenGL nuint size ) { - Context.glCopyNamedBufferSubData(readBuffer.Value, writeBuffer.Value, readOffset, - writeOffset, size); + _context->glCopyNamedBufferSubData(readBuffer.Value, writeBuffer.Value, readOffset, + writeOffset, size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -252,7 +251,7 @@ namespace StgSharp.Graphics.OpenGL int width ) { - Context.glCopyTextureSubImage1D(texture.Value, level, xoffset, x, y, width); + _context->glCopyTextureSubImage1D(texture.Value, level, xoffset, x, y, width); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -267,8 +266,8 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glCopyTextureSubImage2D(texture.Value, level, xoffset, yoffset, x, y, width, - height); + _context->glCopyTextureSubImage2D(texture.Value, level, xoffset, yoffset, x, y, width, + height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -284,8 +283,8 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glCopyTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, x, y, - width, height); + _context->glCopyTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, x, y, + width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -294,7 +293,7 @@ namespace StgSharp.Graphics.OpenGL uint* buffers ) { - Context.glCreateBuffers(n, buffers); + _context->glCreateBuffers(n, buffers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -303,7 +302,7 @@ namespace StgSharp.Graphics.OpenGL uint* framebuffers ) { - Context.glCreateFramebuffers(n, framebuffers); + _context->glCreateFramebuffers(n, framebuffers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -312,7 +311,7 @@ namespace StgSharp.Graphics.OpenGL uint* pipelines ) { - Context.glCreateProgramPipelines(n, pipelines); + _context->glCreateProgramPipelines(n, pipelines); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -322,7 +321,7 @@ namespace StgSharp.Graphics.OpenGL uint* ids ) { - Context.glCreateQueries(target, n, ids); + _context->glCreateQueries(target, n, ids); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -331,7 +330,7 @@ namespace StgSharp.Graphics.OpenGL uint* renderbuffers ) { - Context.glCreateRenderbuffers(n, renderbuffers); + _context->glCreateRenderbuffers(n, renderbuffers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -340,7 +339,7 @@ namespace StgSharp.Graphics.OpenGL uint* samplers ) { - Context.glCreateSamplers(n, samplers); + _context->glCreateSamplers(n, samplers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -350,7 +349,7 @@ namespace StgSharp.Graphics.OpenGL uint* textures ) { - Context.glCreateTextures(target, n, textures); + _context->glCreateTextures(target, n, textures); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -359,7 +358,7 @@ namespace StgSharp.Graphics.OpenGL uint* ids ) { - Context.glCreateTransformFeedbacks(n, ids); + _context->glCreateTransformFeedbacks(n, ids); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -368,7 +367,7 @@ namespace StgSharp.Graphics.OpenGL uint* arrays ) { - Context.glCreateVertexArrays(n, arrays); + _context->glCreateVertexArrays(n, arrays); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -377,7 +376,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glDisableVertexArrayAttrib(vaobj, index); + _context->glDisableVertexArrayAttrib(vaobj, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -386,7 +385,7 @@ namespace StgSharp.Graphics.OpenGL uint index ) { - Context.glEnableVertexArrayAttrib(vaobj, index); + _context->glEnableVertexArrayAttrib(vaobj, index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -396,7 +395,7 @@ namespace StgSharp.Graphics.OpenGL nuint length ) { - Context.glFlushMappedNamedBufferRange(buffer.Value, offset, length); + _context->glFlushMappedNamedBufferRange(buffer.Value, offset, length); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -404,7 +403,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle texture ) { - Context.glGenerateTextureMipmap(texture.Value); + _context->glGenerateTextureMipmap(texture.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -415,7 +414,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glGetCompressedTextureImage(texture.Value, level, bufSize, pixels); + _context->glGetCompressedTextureImage(texture.Value, level, bufSize, pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -432,14 +431,15 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glGetCompressedTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, - width, height, depth, bufSize, pixels); + _context->glGetCompressedTextureSubImage(texture.Value, level, xoffset, yoffset, + zoffset, width, height, depth, bufSize, + pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public uint GetGraphicsResetStatus() { - return Context.glGetGraphicsResetStatus(); + return _context->glGetGraphicsResetStatus(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -449,7 +449,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetNamedBufferParameteri64v(buffer.Value, pname, @params); + _context->glGetNamedBufferParameteri64v(buffer.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -459,7 +459,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetNamedBufferParameteriv(buffer.Value, pname, @params); + _context->glGetNamedBufferParameteriv(buffer.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -469,7 +469,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* @params ) { - Context.glGetNamedBufferPointerv(buffer.Value, pname, @params); + _context->glGetNamedBufferPointerv(buffer.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -480,7 +480,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* data ) { - Context.glGetNamedBufferSubData(buffer.Value, offset, size, data); + _context->glGetNamedBufferSubData(buffer.Value, offset, size, data); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -491,8 +491,8 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetNamedFramebufferAttachmentParameteriv(framebuffer.Value, attachment, pname, - @params); + _context->glGetNamedFramebufferAttachmentParameteriv(framebuffer.Value, attachment, + pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -502,7 +502,7 @@ namespace StgSharp.Graphics.OpenGL int* param ) { - Context.glGetNamedFramebufferParameteriv(framebuffer.Value, pname, param); + _context->glGetNamedFramebufferParameteriv(framebuffer.Value, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -512,7 +512,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetNamedRenderbufferParameteriv(renderbuffer.Value, pname, @params); + _context->glGetNamedRenderbufferParameteriv(renderbuffer.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -523,7 +523,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glGetnCompressedTexImage(target, lod, bufSize, pixels); + _context->glGetnCompressedTexImage(target, lod, bufSize, pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -536,7 +536,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glGetnTexImage(target, level, format, (uint)type, bufSize, pixels); + _context->glGetnTexImage(target, level, format, (uint)type, bufSize, pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -547,7 +547,7 @@ namespace StgSharp.Graphics.OpenGL double* @params ) { - Context.glGetnUniformdv(program.Value, location, bufSize, @params); + _context->glGetnUniformdv(program.Value, location, bufSize, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -558,7 +558,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetnUniformfv(program.Value, location, bufSize, @params); + _context->glGetnUniformfv(program.Value, location, bufSize, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -569,7 +569,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetnUniformiv(program.Value, location, bufSize, @params); + _context->glGetnUniformiv(program.Value, location, bufSize, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -580,7 +580,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetnUniformuiv(program.Value, location, bufSize, @params); + _context->glGetnUniformuiv(program.Value, location, bufSize, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -591,7 +591,7 @@ namespace StgSharp.Graphics.OpenGL nint offset ) { - Context.glGetQueryBufferObjecti64v(id, buffer.Value, pname, offset); + _context->glGetQueryBufferObjecti64v(id, buffer.Value, pname, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -602,7 +602,7 @@ namespace StgSharp.Graphics.OpenGL nint offset ) { - Context.glGetQueryBufferObjectiv(id, buffer.Value, pname, offset); + _context->glGetQueryBufferObjectiv(id, buffer.Value, pname, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -613,7 +613,7 @@ namespace StgSharp.Graphics.OpenGL nint offset ) { - Context.glGetQueryBufferObjectui64v(id, buffer.Value, pname, offset); + _context->glGetQueryBufferObjectui64v(id, buffer.Value, pname, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -624,7 +624,7 @@ namespace StgSharp.Graphics.OpenGL nint offset ) { - Context.glGetQueryBufferObjectuiv(id, buffer.Value, pname, offset); + _context->glGetQueryBufferObjectuiv(id, buffer.Value, pname, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -637,7 +637,7 @@ namespace StgSharp.Graphics.OpenGL 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)] @@ -648,7 +648,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetTextureLevelParameterfv(texture.Value, level, pname, @params); + _context->glGetTextureLevelParameterfv(texture.Value, level, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -659,7 +659,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetTextureLevelParameteriv(texture.Value, level, pname, @params); + _context->glGetTextureLevelParameteriv(texture.Value, level, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -669,7 +669,7 @@ namespace StgSharp.Graphics.OpenGL float* @params ) { - Context.glGetTextureParameterfv(texture.Value, pname, @params); + _context->glGetTextureParameterfv(texture.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -679,7 +679,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetTextureParameterIiv(texture.Value, pname, @params); + _context->glGetTextureParameterIiv(texture.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -689,7 +689,7 @@ namespace StgSharp.Graphics.OpenGL uint* @params ) { - Context.glGetTextureParameterIuiv(texture.Value, pname, @params); + _context->glGetTextureParameterIuiv(texture.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -699,7 +699,7 @@ namespace StgSharp.Graphics.OpenGL int* @params ) { - Context.glGetTextureParameteriv(texture.Value, pname, @params); + _context->glGetTextureParameteriv(texture.Value, pname, @params); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -718,8 +718,8 @@ namespace StgSharp.Graphics.OpenGL IntPtr* pixels ) { - Context.glGetTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, - height, depth, format, (uint)type, bufSize, pixels); + _context->glGetTextureSubImage(texture.Value, level, xoffset, yoffset, zoffset, width, + height, depth, format, (uint)type, bufSize, pixels); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -730,7 +730,7 @@ namespace StgSharp.Graphics.OpenGL int* param ) { - Context.glGetTransformFeedbacki_v(xfb, pname, index, param); + _context->glGetTransformFeedbacki_v(xfb, pname, index, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -741,7 +741,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* param ) { - Context.glGetTransformFeedbacki64_v(xfb, pname, index, param); + _context->glGetTransformFeedbacki64_v(xfb, pname, index, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -751,7 +751,7 @@ namespace StgSharp.Graphics.OpenGL int* param ) { - Context.glGetTransformFeedbackiv(xfb, pname, param); + _context->glGetTransformFeedbackiv(xfb, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -762,7 +762,7 @@ namespace StgSharp.Graphics.OpenGL IntPtr* param ) { - Context.glGetVertexArrayIndexed64iv(vaobj, index, pname, param); + _context->glGetVertexArrayIndexed64iv(vaobj, index, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -773,7 +773,7 @@ namespace StgSharp.Graphics.OpenGL int* param ) { - Context.glGetVertexArrayIndexediv(vaobj, index, pname, param); + _context->glGetVertexArrayIndexediv(vaobj, index, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -783,7 +783,7 @@ namespace StgSharp.Graphics.OpenGL int* param ) { - Context.glGetVertexArrayiv(vaobj, pname, param); + _context->glGetVertexArrayiv(vaobj, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -794,7 +794,7 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* attachmentsPtr = attachments) { - Context.glInvalidateNamedFramebufferData(framebuffer.Value, numAttachments, attachmentsPtr); + _context->glInvalidateNamedFramebufferData(framebuffer.Value, numAttachments, attachmentsPtr); } } @@ -810,8 +810,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (uint* attachmentsPtr = attachments) { - Context.glInvalidateNamedFramebufferSubData(framebuffer.Value, numAttachments, - attachmentsPtr, x, y, width, height); + _context->glInvalidateNamedFramebufferSubData(framebuffer.Value, numAttachments, + attachmentsPtr, x, y, width, height); } } @@ -821,7 +821,7 @@ namespace StgSharp.Graphics.OpenGL uint access ) { - Context.glMapNamedBuffer(buffer.Value, access); + _context->glMapNamedBuffer(buffer.Value, access); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -832,7 +832,7 @@ namespace StgSharp.Graphics.OpenGL uint access ) { - Context.glMapNamedBufferRange(buffer.Value, offset, length, access); + _context->glMapNamedBufferRange(buffer.Value, offset, length, access); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -840,7 +840,7 @@ namespace StgSharp.Graphics.OpenGL uint barriers ) { - Context.glMemoryBarrierByRegion(barriers); + _context->glMemoryBarrierByRegion(barriers); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -852,7 +852,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - 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) { - Context.glNamedBufferSubData(buffer.Value, offset, size, dataPtr); + _context->glNamedBufferSubData(buffer.Value, offset, size, dataPtr); } } @@ -888,7 +888,7 @@ namespace StgSharp.Graphics.OpenGL uint buf ) { - Context.glNamedFramebufferDrawBuffer(framebuffer.Value, buf); + _context->glNamedFramebufferDrawBuffer(framebuffer.Value, buf); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -899,7 +899,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glNamedFramebufferParameteri(framebuffer.Value, pname, param); + _context->glNamedFramebufferParameteri(framebuffer.Value, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -919,7 +919,7 @@ namespace StgSharp.Graphics.OpenGL uint src ) { - Context.glNamedFramebufferReadBuffer(framebuffer.Value, src); + _context->glNamedFramebufferReadBuffer(framebuffer.Value, src); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -930,8 +930,8 @@ namespace StgSharp.Graphics.OpenGL GlHandle renderbuffer ) { - Context.glNamedFramebufferRenderbuffer(framebuffer.Value, attachment, - renderbuffertarget, renderbuffer.Value); + _context->glNamedFramebufferRenderbuffer(framebuffer.Value, attachment, + renderbuffertarget, renderbuffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -942,7 +942,8 @@ namespace StgSharp.Graphics.OpenGL int level ) { - Context.glNamedFramebufferTexture(framebuffer.Value, attachment, texture.Value, level); + _context->glNamedFramebufferTexture(framebuffer.Value, attachment, texture.Value, + level); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -954,8 +955,8 @@ namespace StgSharp.Graphics.OpenGL int layer ) { - Context.glNamedFramebufferTextureLayer(framebuffer.Value, attachment, texture.Value, - level, layer); + _context->glNamedFramebufferTextureLayer(framebuffer.Value, attachment, texture.Value, + level, layer); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -966,7 +967,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glNamedRenderbufferStorage(renderbuffer.Value, internalformat, width, height); + _context->glNamedRenderbufferStorage(renderbuffer.Value, internalformat, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -978,8 +979,8 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glNamedRenderbufferStorageMultisample(renderbuffer.Value, samples, - internalformat, width, height); + _context->glNamedRenderbufferStorageMultisample(renderbuffer.Value, samples, + internalformat, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -994,13 +995,13 @@ namespace StgSharp.Graphics.OpenGL 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)] public void TextureBarrier() { - Context.glTextureBarrier(); + _context->glTextureBarrier(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1010,7 +1011,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glTextureBuffer(texture.Value, internalformat, buffer.Value); + _context->glTextureBuffer(texture.Value, internalformat, buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1022,7 +1023,8 @@ namespace StgSharp.Graphics.OpenGL nuint size ) { - Context.glTextureBufferRange(texture.Value, internalformat, buffer.Value, offset, size); + _context->glTextureBufferRange(texture.Value, internalformat, buffer.Value, offset, + size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1032,7 +1034,7 @@ namespace StgSharp.Graphics.OpenGL float param ) { - Context.glTextureParameterf(texture.Value, pname, param); + _context->glTextureParameterf(texture.Value, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1043,7 +1045,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glTextureParameteri(texture.Value, pname, param); + _context->glTextureParameteri(texture.Value, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1065,7 +1067,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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) { - Context.glTextureParameterIuiv(texture.Value, pname, @paramsPtr); + _context->glTextureParameterIuiv(texture.Value, pname, @paramsPtr); } } @@ -1089,7 +1091,7 @@ namespace StgSharp.Graphics.OpenGL ) { 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 ) { - Context.glTextureStorage1D(texture.Value, levels, internalformat, width); + _context->glTextureStorage1D(texture.Value, levels, internalformat, width); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1113,7 +1115,7 @@ namespace StgSharp.Graphics.OpenGL int height ) { - Context.glTextureStorage2D(texture.Value, levels, internalformat, width, height); + _context->glTextureStorage2D(texture.Value, levels, internalformat, width, height); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1126,8 +1128,8 @@ namespace StgSharp.Graphics.OpenGL byte fixedsamplelocations ) { - Context.glTextureStorage2DMultisample(texture.Value, samples, internalformat, width, - height, fixedsamplelocations); + _context->glTextureStorage2DMultisample(texture.Value, samples, internalformat, width, + height, fixedsamplelocations); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1140,7 +1142,8 @@ namespace StgSharp.Graphics.OpenGL int depth ) { - Context.glTextureStorage3D(texture.Value, levels, internalformat, width, height, depth); + _context->glTextureStorage3D(texture.Value, levels, internalformat, width, height, + depth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1154,8 +1157,8 @@ namespace StgSharp.Graphics.OpenGL byte fixedsamplelocations ) { - Context.glTextureStorage3DMultisample(texture.Value, samples, internalformat, width, - height, depth, fixedsamplelocations); + _context->glTextureStorage3DMultisample(texture.Value, samples, internalformat, width, + height, depth, fixedsamplelocations); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1170,8 +1173,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTextureSubImage1D(texture.Value, level, xoffset, width, format, - (uint)type, pixelsPtr); + _context->glTextureSubImage1D(texture.Value, level, xoffset, width, format, + (uint)type, pixelsPtr); } } @@ -1189,8 +1192,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, height, - format, (uint)type, pixelsPtr); + _context->glTextureSubImage2D(texture.Value, level, xoffset, yoffset, width, height, + format, (uint)type, pixelsPtr); } } @@ -1210,8 +1213,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* pixelsPtr = pixels) { - Context.glTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, width, - height, depth, format, (uint)type, pixelsPtr); + _context->glTextureSubImage3D(texture.Value, level, xoffset, yoffset, zoffset, + width, height, depth, format, (uint)type, pixelsPtr); } } @@ -1222,7 +1225,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glTransformFeedbackBufferBase(xfb, index, buffer.Value); + _context->glTransformFeedbackBufferBase(xfb, index, buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1234,7 +1237,7 @@ namespace StgSharp.Graphics.OpenGL nuint size ) { - Context.glTransformFeedbackBufferRange(xfb, index, buffer.Value, offset, size); + _context->glTransformFeedbackBufferRange(xfb, index, buffer.Value, offset, size); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1242,7 +1245,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - return Context.glUnmapNamedBuffer(buffer.Value); + return _context->glUnmapNamedBuffer(buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1252,7 +1255,7 @@ namespace StgSharp.Graphics.OpenGL uint bindingindex ) { - Context.glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); + _context->glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1265,8 +1268,8 @@ namespace StgSharp.Graphics.OpenGL uint relativeoffset ) { - Context.glVertexArrayAttribFormat(vaobj, attribindex, size, (uint)type, normalized, - relativeoffset); + _context->glVertexArrayAttribFormat(vaobj, attribindex, size, (uint)type, normalized, + relativeoffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1278,8 +1281,8 @@ namespace StgSharp.Graphics.OpenGL uint relativeoffset ) { - Context.glVertexArrayAttribIFormat(vaobj, attribindex, size, (uint)type, - relativeoffset); + _context->glVertexArrayAttribIFormat(vaobj, attribindex, size, (uint)type, + relativeoffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1291,8 +1294,8 @@ namespace StgSharp.Graphics.OpenGL uint relativeoffset ) { - Context.glVertexArrayAttribLFormat(vaobj, attribindex, size, (uint)type, - relativeoffset); + _context->glVertexArrayAttribLFormat(vaobj, attribindex, size, (uint)type, + relativeoffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1302,7 +1305,7 @@ namespace StgSharp.Graphics.OpenGL uint divisor ) { - Context.glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); + _context->glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1311,7 +1314,7 @@ namespace StgSharp.Graphics.OpenGL GlHandle buffer ) { - Context.glVertexArrayElementBuffer(vaobj, buffer.Value); + _context->glVertexArrayElementBuffer(vaobj, buffer.Value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1323,7 +1326,7 @@ namespace StgSharp.Graphics.OpenGL int stride ) { - Context.glVertexArrayVertexBuffer(vaobj, bindingindex, buffer.Value, offset, stride); + _context->glVertexArrayVertexBuffer(vaobj, bindingindex, buffer.Value, offset, stride); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1341,8 +1344,8 @@ namespace StgSharp.Graphics.OpenGL fixed (nint* offsetsPtr = offsets) { fixed (int* stridesPtr = strides) { - Context.glVertexArrayVertexBuffers(vaobj, first, count, buffersPtr, - offsetsPtr, stridesPtr); + _context->glVertexArrayVertexBuffers(vaobj, first, count, buffersPtr, + offsetsPtr, stridesPtr); } } } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs index e30e324a..f7bcec58 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.v4_6.cs @@ -25,10 +25,6 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// -// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z -// Version: 4.6 -// using StgSharp.Graphics.OpenGL; using System; using System.Runtime.CompilerServices; @@ -49,8 +45,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indirectPtr = indirect) { - Context.glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount, - stride); + _context->glMultiDrawArraysIndirectCount(mode, indirectPtr, drawcount, maxdrawcount, + stride); } } @@ -65,8 +61,8 @@ namespace StgSharp.Graphics.OpenGL ) { fixed (IntPtr* indirectPtr = indirect) { - Context.glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount, - maxdrawcount, stride); + _context->glMultiDrawElementsIndirectCount(mode, (uint)type, indirectPtr, drawcount, + maxdrawcount, stride); } } @@ -77,7 +73,7 @@ namespace StgSharp.Graphics.OpenGL float clamp ) { - Context.glPolygonOffsetClamp(factor, units, clamp); + _context->glPolygonOffsetClamp(factor, units, clamp); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -94,9 +90,9 @@ namespace StgSharp.Graphics.OpenGL fixed (uint* pConstantIndexPtr = pConstantIndex) { fixed (uint* pConstantValuePtr = pConstantValue) { - Context.glSpecializeShader(shader.Value, pEntryPointPtr, - numSpecializationConstants, pConstantIndexPtr, - pConstantValuePtr); + _context->glSpecializeShader(shader.Value, pEntryPointPtr, + numSpecializationConstants, pConstantIndexPtr, + pConstantValuePtr); } } } diff --git a/StgSharp.Common/Timing/TimeSequence.cs b/StgSharp.Common/Timing/TimeSequence.cs index fdc20b5e..95b06554 100644 --- a/StgSharp.Common/Timing/TimeSequence.cs +++ b/StgSharp.Common/Timing/TimeSequence.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="TimeSequence" // Project: StgSharp @@ -40,22 +40,43 @@ namespace StgSharp.Common.Timing 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( double initialSliceSeconds, double totalSeconds, double growthMultiplier, - double minSliceSeconds) => new LogTimeSequence(initialSliceSeconds, - totalSeconds, - growthMultiplier, - minSliceSeconds); + double minSliceSeconds + ) => new LogTimeSequence(initialSliceSeconds, totalSeconds, growthMultiplier, + 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 long _frameLengthTicks; - public LinearTimeSequence(double totalSeconds, double frameSeconds) + public LinearTimeSequence( + double totalSeconds, + double frameSeconds + ) { ArgumentOutOfRangeException.ThrowIfNegativeOrZero(totalSeconds); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(frameSeconds); @@ -78,10 +102,14 @@ namespace StgSharp.Common.Timing } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool EndsAt(long currentTick) => currentTick >= EndingTick; + public override bool EndsAt( + long currentTick + ) => currentTick >= EndingTick; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool IsNextFrameReady(long currentTick) + public override bool IsNextFrameReady( + long currentTick + ) { long span = currentTick - PreviousFrameTick; if (span >= _frameLengthTicks && currentTick < EndingTick) @@ -92,7 +120,9 @@ namespace StgSharp.Common.Timing return false; } - public override void StartFrom(TimeSourceProviderBase source) + public override void StartFrom( + TimeSourceProviderBase source + ) { long f = source?.Frequency ?? throw new ArgumentNullException(nameof(source)); _frameLengthTicks = (long)Math.Max(1, _frameSeconds * f); @@ -127,7 +157,8 @@ namespace StgSharp.Common.Timing double initialSliceSeconds, double totalSeconds, double growthMultiplier, - double minSliceSeconds) + double minSliceSeconds + ) { ArgumentOutOfRangeException.ThrowIfNegativeOrZero(initialSliceSeconds); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(totalSeconds); @@ -146,10 +177,17 @@ namespace StgSharp.Common.Timing } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool EndsAt(long currentTick) => currentTick >= EndingTick; + public override bool EndsAt( + long currentTick + ) + { + return currentTick >= EndingTick; + } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool IsNextFrameReady(long currentTick) + public override bool IsNextFrameReady( + long currentTick + ) { // Emit final once when reaching or passing end. if (currentTick >= EndingTick) @@ -197,7 +235,9 @@ namespace StgSharp.Common.Timing return true; } - public override void StartFrom(TimeSourceProviderBase source) + public override void StartFrom( + TimeSourceProviderBase source + ) { _freq = source?.Frequency ?? throw new ArgumentNullException(nameof(source)); BeginningTick = source.GetCurrentTimeSpanTick(); @@ -212,7 +252,58 @@ namespace StgSharp.Common.Timing } [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)); + + } + + /// + /// Infinite linear time sequence: emits frames at fixed interval and never ends. + /// + 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; + } } } diff --git a/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs b/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs index bdbb6864..4c0a96b3 100644 --- a/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs +++ b/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="TimeSpanProvider.Awaiting" // Project: StgSharp @@ -43,8 +43,8 @@ namespace StgSharp.Timing private static int s_maxID; private EventHandler? _refreshHandler, _missHandler; - private int _pendingSpans; // Number of unconsumed span ticks since last Wait. private int _size, _id; + private long _pendingSpans; // Number of unconsumed span ticks since last Wait. private readonly ManualResetEventSlim _event = new(); private readonly object _participantObject = new(); @@ -75,7 +75,7 @@ namespace StgSharp.Timing /// /// Number of span ticks not yet consumed by Wait ( > 0 means last tick not waited). /// - public int PendingSpanCount => Volatile.Read(ref _pendingSpans); + public long PendingSpanCount => Volatile.Read(ref _pendingSpans); 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). while (true) { - int cur = Volatile.Read(ref _pendingSpans); - if (cur == 0) - { - _event.Dispose(); + long cur = Volatile.Read(ref _pendingSpans); + if (cur == 0) { return; } @@ -134,7 +132,7 @@ namespace StgSharp.Timing await Task.Run(() => _event.Wait()).ConfigureAwait(false); while (true) { - int cur = Volatile.Read(ref _pendingSpans); + long cur = Volatile.Read(ref _pendingSpans); if (cur == 0) { break; @@ -156,23 +154,17 @@ namespace StgSharp.Timing /// OperationCanceledException when token is cancelled. If the provider is disposed during /// wait an OperationCanceledException is thrown to indicate end. /// - public Task WaitNextSpanAsync(CancellationToken ct) + public Task WaitNextSpanAsync( + CancellationToken ct + ) { - try - { - // Block the current thread until the event is signaled or cancellation requested. - _event.Wait(ct); - } - catch (ObjectDisposedException) - { - // provider disposed while waiting - treat as cancellation/ended - throw new OperationCanceledException(ct); - } + // Block the current thread until the event is signaled or cancellation requested. + _event.Wait(ct); // consume one pending span (same logic as non-cancellable variant) while (true) { - int cur = Volatile.Read(ref _pendingSpans); + long cur = Volatile.Read(ref _pendingSpans); if (cur == 0) { break; @@ -203,7 +195,9 @@ namespace StgSharp.Timing /// True if the span provider is working. False if time is over (the sequence ended). /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool OnSpanTick(long currentTick) + internal bool OnSpanTick( + long currentTick + ) { if (_sequence.EndsAt(currentTick)) { diff --git a/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs b/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs index aa8b106c..71a330ea 100644 --- a/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs +++ b/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs @@ -223,7 +223,7 @@ namespace StgSharp.Mathematics.Numeric package->LeftPrimOffset = left.KernelColumnLength; package->PrimCount = ans.KernelColumnLength / size; package->SecCount = ans.KernelRowLength / size; - package->ElementSize = size; + package->ElementSize = (int)MatrixElementType.F32; package->ComputeMode = new MatrixOpMode(MatrixIndexStyle.BUFFER_INDEX, MatrixOperationSpecial.SEQ_FMA); MatrixParallelHandle taskGroup = MatrixParallel.ScheduleTask(package); diff --git a/StgSharp.Mathematics/Numeric/MatrixParallelThread.cs b/StgSharp.Mathematics/Numeric/MatrixParallelThread.cs index 64e01834..2dc21186 100644 --- a/StgSharp.Mathematics/Numeric/MatrixParallelThread.cs +++ b/StgSharp.Mathematics/Numeric/MatrixParallelThread.cs @@ -80,40 +80,45 @@ namespace StgSharp.Mathematics.Numeric } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void ExecuteTaskPackage(Queue taskQueue) + public static unsafe void ExecuteTaskPackage( + Queue taskQueue + ) { while (taskQueue.TryDequeue(out nint handle)) { MatrixParallelTaskPackage* p = (MatrixParallelTaskPackage*)handle; - if ((short)p->ComputeMode.ParameterStyle < 0) { - MatrixComputeModel.SpecialBufferCompute(p); - } - switch (p->ComputeMode.OperationStyle) + if ((short)p->ComputeMode.ParameterStyle < 0) { - case MatrixIndexStyle.BUFFER_INDEX: - switch (p->ComputeMode.ParameterStyle) - { - case MatrixOperationParam.RIGHT_ANS_PARAM: - MatrixComputeModel.BufferComputeUnary(p); - break; - case MatrixOperationParam.LEFT_RIGHT_ANS_PARAM: - MatrixComputeModel.BufferComputeBinary(p); - break; - case MatrixOperationParam.RIGHT_ANS_SCALAR_PARAM: - MatrixComputeModel.BufferComputeUnaryScalar(p); - break; - case MatrixOperationParam.LEFT_RIGHT_ANS_SCALAR_PARAM: - MatrixComputeModel.BufferComputeBinaryScalar(p); - break; - case MatrixOperationParam.ANS_SCALAR_PARAM: - MatrixComputeModel.BufferComputeNoOperatorScalar(p); - break; - default: - break; - } - break; - default: - break; + MatrixComputeModel.SpecialBufferCompute(p); + } else + { + switch (p->ComputeMode.OperationStyle) + { + case MatrixIndexStyle.BUFFER_INDEX: + switch (p->ComputeMode.ParameterStyle) + { + case MatrixOperationParam.RIGHT_ANS_PARAM: + MatrixComputeModel.BufferComputeUnary(p); + break; + case MatrixOperationParam.LEFT_RIGHT_ANS_PARAM: + MatrixComputeModel.BufferComputeBinary(p); + break; + case MatrixOperationParam.RIGHT_ANS_SCALAR_PARAM: + MatrixComputeModel.BufferComputeUnaryScalar(p); + break; + case MatrixOperationParam.LEFT_RIGHT_ANS_SCALAR_PARAM: + MatrixComputeModel.BufferComputeBinaryScalar(p); + break; + case MatrixOperationParam.ANS_SCALAR_PARAM: + MatrixComputeModel.BufferComputeNoOperatorScalar(p); + break; + default: + break; + } + break; + default: + break; + } } } } @@ -167,7 +172,9 @@ namespace StgSharp.Mathematics.Numeric current.Priority = ThreadPriority.Normal; } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose( + bool disposing + ) { if (!disposedValue) { @@ -229,18 +236,18 @@ namespace StgSharp.Mathematics.Numeric { case RoleType.Worker://worker // _ = Interlocked.Decrement(ref RemainThreadCount); - // Console.WriteLine("worker start"); + // Console.WriteLine($"worker {Environment.CurrentManagedThreadId} start"); ExecuteTaskPackage(Tasks); BindedWrap.ReportThreadAccomplished(); - // Console.WriteLine("worker end"); + // Console.WriteLine($"worker {Environment.CurrentManagedThreadId} end"); break; case RoleType.Scheduler://scheduler - // Console.WriteLine("scheduler start"); + // Console.WriteLine($"scheduler {Environment.CurrentManagedThreadId} start"); BindedWrap.PublishTaskToWorkers(); BindedWrap.SetAllWorker(); - // Console.WriteLine("scheduler done"); + // Console.WriteLine($"scheduler {Environment.CurrentManagedThreadId} done"); ExecuteTaskPackage(Tasks); BindedWrap.ReportThreadAccomplished(); BindedWrap.WaitAllWorker(); @@ -270,7 +277,10 @@ namespace StgSharp.Mathematics.Numeric public readonly int LogicalProcessor; public readonly nuint Mask; - public AffinityBinding(int logicalProcessor, nuint mask) + public AffinityBinding( + int logicalProcessor, + nuint mask + ) { LogicalProcessor = logicalProcessor; 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) { return; @@ -385,11 +397,14 @@ namespace StgSharp.Mathematics.Numeric [DllImport("kernel32.dll")] private static extern nuint SetThreadAffinityMask( IntPtr hThread, - nuint dwThreadAffinityMask); + nuint dwThreadAffinityMask + ); [LibraryImport("kernel32.dll")] [return: MarshalAs(UnmanagedType.Bool)] - private static partial bool GetNumaHighestNodeNumber(out uint HighestNodeNumber); + private static partial bool GetNumaHighestNodeNumber( + out uint HighestNodeNumber + ); #elif LINUX diff --git a/StgSharp.Native/sn-head/sn_intrinsic.h b/StgSharp.Native/sn-head/sn_intrinsic.h index a66ec7df..ea05fabf 100644 --- a/StgSharp.Native/sn-head/sn_intrinsic.h +++ b/StgSharp.Native/sn-head/sn_intrinsic.h @@ -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, 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 region scaler_simd diff --git a/StgSharp.Native/sn-src/k_fma.c b/StgSharp.Native/sn-src/k_fma.c index 11ad5d05..9da92a74 100644 --- a/StgSharp.Native/sn-src/k_fma.c +++ b/StgSharp.Native/sn-src/k_fma.c @@ -142,7 +142,7 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, 512, fma) { 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 ccol = _mm512_load_ps((float *)&ans->vec[col][0]); 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); } } + +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); + } +} diff --git a/StgSharp.Native/sn-src/load_intrinsic.c b/StgSharp.Native/sn-src/load_intrinsic.c index 668a8c6f..a95a0941 100644 --- a/StgSharp.Native/sn-src/load_intrinsic.c +++ b/StgSharp.Native/sn-src/load_intrinsic.c @@ -84,7 +84,7 @@ void load_intrinsic_sse(sn_intrinsic *context) context->mat[F64].buffer_transpose = NULL; context->mat[F64].build_panel = NULL; 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].store_panel = NULL; @@ -115,7 +115,7 @@ void load_intrinsic_avx(sn_intrinsic *context) context->mat[F64].buffer_transpose = NULL; context->mat[F64].build_panel = NULL; 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].store_panel = NULL; @@ -146,7 +146,7 @@ void load_intrinsic_512(sn_intrinsic *context) context->mat[F64].buffer_transpose = NULL; context->mat[F64].build_panel = BUILD_PANEL(512, double); 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].store_panel = STORE_PANEL(512, double); diff --git a/StgSharpDebug/Program.cs b/StgSharpDebug/Program.cs index 9778822f..6273151f 100644 --- a/StgSharpDebug/Program.cs +++ b/StgSharpDebug/Program.cs @@ -50,19 +50,22 @@ namespace StgSharp .UseModule() .InitializeModule(); - TestRender(); - /* + // TestRender(); + /**/ HybridLayerSegregatedFitAllocator hlsf; unchecked { hlsf = new((nuint)(64 * (ulong)10000 * 10000)); } - Matrix m = Matrix.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf); + Matrix m = Matrix.Create(4000, 4000, MatrixLayout.DenseRectangle, + hlsf); MatrixCompute.Fill(m, 1.0f); - Matrix n = Matrix.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf); + Matrix n = Matrix.Create(4000, 4000, MatrixLayout.DenseRectangle, + hlsf); MatrixCompute.Fill(n, 1.0f); - Matrix p = Matrix.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf); + Matrix p = Matrix.Create(4000, 4000, MatrixLayout.DenseRectangle, + hlsf); + MatrixCompute.Fill(p, 0.0f); - // MatrixCompute.Fill(p, 0.0f); /* for (int i = 0; i < 10; i++) { @@ -77,7 +80,9 @@ namespace StgSharp Console.WriteLine($"{i}"); GC.Collect(); } - /* + + /**/ + Console.WriteLine("==================================================="); MatrixCompute.Mul(n, m, p); for (int i = 0; i < 20; i++) {