Merge branch 'giga' of ssh://ssh.github.com:443/Nitload-NSI/CCD_Github into local
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,7 +71,9 @@ namespace StgSharp.Graphics.OpenGL
|
||||
/// Index of object to be binded in handle set
|
||||
/// </param>
|
||||
[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
|
||||
/// </param>
|
||||
[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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bind a frame BufferHandle to a frame BufferHandle target Same function as <see ///
|
||||
/// href="https://docs._gl/gl3/glBindFramebuffer"> glBindFramebuffer </see>.
|
||||
/// href="https://docs._gl/gl3/glBindFramebuffer">glBindFramebuffer</see>.
|
||||
/// </summary>
|
||||
/// <param _label="target">
|
||||
/// The frame BufferHandle target of the binding operation.
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete a render BufferHandle object Very simlilar function as <see ///
|
||||
/// href="https://docs.gl/gl3/glDeleteRenderbuffers"> glDeleteRenderbuffers </see>. The
|
||||
/// only deifference is that this mehtod can only delete one renderbuffer at the same
|
||||
/// time.
|
||||
/// href="https://docs.gl/gl3/glDeleteRenderbuffers">glDeleteRenderbuffers</see>. The only
|
||||
/// deifference is that this mehtod can only delete one renderbuffer at the same time.
|
||||
/// </summary>
|
||||
/// <param _label="bufferHandle">
|
||||
/// Handle to BufferHandle to delete.
|
||||
@@ -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<T>
|
||||
{
|
||||
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<T>();
|
||||
|
||||
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<T>
|
||||
{
|
||||
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(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.2
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.3
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.4
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.5
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Generated by StgSharp.GenerateGL on 2025-12-30 02:54:41Z
|
||||
// Version: 4.6
|
||||
// </auto-generated>
|
||||
using StgSharp.Graphics.OpenGL;
|
||||
using 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Infinite linear time sequence: emits frames at fixed interval and never ends.
|
||||
/// </summary>
|
||||
internal sealed class InfiniteLinearTimeSequence : TimeSequence
|
||||
{
|
||||
|
||||
private readonly double _frameSeconds;
|
||||
private long _frameLengthTicks;
|
||||
|
||||
public InfiniteLinearTimeSequence(
|
||||
double frameSeconds
|
||||
)
|
||||
{
|
||||
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(frameSeconds);
|
||||
_frameSeconds = frameSeconds;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override bool EndsAt(
|
||||
long currentTick
|
||||
) => false; // never ends
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override bool IsNextFrameReady(
|
||||
long currentTick
|
||||
)
|
||||
{
|
||||
long span = currentTick - PreviousFrameTick;
|
||||
if (span >= _frameLengthTicks)
|
||||
{
|
||||
PreviousFrameTick += _frameLengthTicks;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void StartFrom(
|
||||
TimeSourceProviderBase source
|
||||
)
|
||||
{
|
||||
long f = source?.Frequency ?? throw new ArgumentNullException(nameof(source));
|
||||
_frameLengthTicks = (long)Math.Max(1, _frameSeconds * f);
|
||||
BeginningTick = source.GetCurrentTimeSpanTick();
|
||||
EndingTick = long.MaxValue; // sentinel
|
||||
PreviousFrameTick = BeginningTick;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="TimeSpanProvider.Awaiting"
|
||||
// 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
|
||||
/// <summary>
|
||||
/// Number of span ticks not yet consumed by Wait ( > 0 means last tick not waited).
|
||||
/// </summary>
|
||||
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.
|
||||
/// </summary>
|
||||
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).
|
||||
/// </returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal bool OnSpanTick(long currentTick)
|
||||
internal bool OnSpanTick(
|
||||
long currentTick
|
||||
)
|
||||
{
|
||||
if (_sequence.EndsAt(currentTick))
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -80,40 +80,45 @@ namespace StgSharp.Mathematics.Numeric
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void ExecuteTaskPackage(Queue<IntPtr> taskQueue)
|
||||
public static unsafe void ExecuteTaskPackage(
|
||||
Queue<IntPtr> taskQueue
|
||||
)
|
||||
{
|
||||
while (taskQueue.TryDequeue(out nint handle))
|
||||
{
|
||||
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
|
||||
|
||||
|
||||
@@ -253,6 +253,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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -50,19 +50,22 @@ namespace StgSharp
|
||||
.UseModule<GraphicModule>()
|
||||
.InitializeModule();
|
||||
|
||||
TestRender();
|
||||
/*
|
||||
// TestRender();
|
||||
/**/
|
||||
HybridLayerSegregatedFitAllocator hlsf;
|
||||
unchecked {
|
||||
hlsf = new((nuint)(64 * (ulong)10000 * 10000));
|
||||
}
|
||||
Matrix<float> m = Matrix<float>.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf);
|
||||
Matrix<double> m = Matrix<double>.Create(4000, 4000, MatrixLayout.DenseRectangle,
|
||||
hlsf);
|
||||
MatrixCompute.Fill(m, 1.0f);
|
||||
Matrix<float> n = Matrix<float>.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf);
|
||||
Matrix<double> n = Matrix<double>.Create(4000, 4000, MatrixLayout.DenseRectangle,
|
||||
hlsf);
|
||||
MatrixCompute.Fill(n, 1.0f);
|
||||
Matrix<float> p = Matrix<float>.Create(4000, 4000, MatrixLayout.DenseRectangle, hlsf);
|
||||
Matrix<double> p = Matrix<double>.Create(4000, 4000, MatrixLayout.DenseRectangle,
|
||||
hlsf);
|
||||
MatrixCompute.Fill(p, 0.0f);
|
||||
|
||||
// MatrixCompute.Fill(p, 0.0f);
|
||||
/*
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user