add a scanner, but this seems to be a wrong solution. Change open-source head

This commit is contained in:
Youmu Liu
2026-07-07 18:20:38 +08:00
parent b053567eb7
commit 1705d7c245
276 changed files with 3468 additions and 7205 deletions
+48 -63
View File
@@ -1,30 +1,10 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------------
// file="glFunction.v3_3"
// Project: StgSharp
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Copyright (c) Nitload.
// SPDX-License-Identifier: MIT
// -----------------------------------------------------------------------------
using StgSharp.Graphics.OpenGL;
using System;
using System.Runtime.CompilerServices;
@@ -253,8 +233,8 @@ namespace StgSharp.Graphics.OpenGL
uint filter
)
{
_context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
filter);
_context->glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
mask, filter);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -436,7 +416,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* dataPtr = data) {
_context->glCompressedTexImage1D(target, level, internalformat, width, border,
imageSize, dataPtr);
imageSize, dataPtr);
}
}
@@ -453,8 +433,8 @@ namespace StgSharp.Graphics.OpenGL
)
{
fixed (IntPtr* dataPtr = data) {
_context->glCompressedTexImage2D(target, level, internalformat, width, height, border,
imageSize, dataPtr);
_context->glCompressedTexImage2D(target, level, internalformat, width, height,
border, imageSize, dataPtr);
}
}
@@ -472,8 +452,8 @@ namespace StgSharp.Graphics.OpenGL
)
{
fixed (IntPtr* dataPtr = data) {
_context->glCompressedTexImage3D(target, level, internalformat, width, height, depth,
border, imageSize, dataPtr);
_context->glCompressedTexImage3D(target, level, internalformat, width, height,
depth, border, imageSize, dataPtr);
}
}
@@ -489,8 +469,8 @@ namespace StgSharp.Graphics.OpenGL
)
{
fixed (IntPtr* dataPtr = data) {
_context->glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize,
dataPtr);
_context->glCompressedTexSubImage1D(target, level, xoffset, width, format,
imageSize, dataPtr);
}
}
@@ -509,7 +489,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* dataPtr = data) {
_context->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height,
format, imageSize, dataPtr);
format, imageSize, dataPtr);
}
}
@@ -530,7 +510,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* dataPtr = data) {
_context->glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width,
height, depth, format, imageSize, dataPtr);
height, depth, format, imageSize, dataPtr);
}
}
@@ -617,7 +597,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width,
height);
height);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -879,7 +859,8 @@ namespace StgSharp.Graphics.OpenGL
)
{
fixed (IntPtr* indicesPtr = indices) {
_context->glDrawElementsInstanced(mode, count, (uint)type, indicesPtr, instancecount);
_context->glDrawElementsInstanced(mode, count, (uint)type, indicesPtr,
instancecount);
}
}
@@ -895,7 +876,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* indicesPtr = indices) {
_context->glDrawElementsInstancedBaseVertex(mode, count, (uint)type, indicesPtr,
instancecount, basevertex);
instancecount, basevertex);
}
}
@@ -927,7 +908,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* indicesPtr = indices) {
_context->glDrawRangeElementsBaseVertex(mode, start, end, count, (uint)type,
indicesPtr, basevertex);
indicesPtr, basevertex);
}
}
@@ -1016,7 +997,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glFramebufferRenderbuffer(target, attachment, renderbuffertarget,
renderbuffer.Value);
renderbuffer.Value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1065,7 +1046,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glFramebufferTexture3D(target, attachment, textarget, texture.Value, level,
zoffset);
zoffset);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1209,7 +1190,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glGetActiveUniformBlockName(program.Value, uniformBlockIndex, bufSize, length,
uniformBlockName);
uniformBlockName);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1222,7 +1203,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glGetActiveUniformName(program.Value, uniformIndex, bufSize, length,
uniformName);
uniformName);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1235,8 +1216,8 @@ namespace StgSharp.Graphics.OpenGL
)
{
fixed (uint* uniformIndicesPtr = uniformIndices) {
_context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndicesPtr, pname,
@params);
_context->glGetActiveUniformsiv(program.Value, uniformCount, uniformIndicesPtr,
pname, @params);
}
}
@@ -1604,7 +1585,8 @@ namespace StgSharp.Graphics.OpenGL
uint index
)
{
return Marshal.PtrToStringAuto((nint)_context->glGetStringi(name, index)) ?? string.Empty;
return Marshal.PtrToStringAuto((nint)_context->glGetStringi(name, index)) ??
string.Empty;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1704,8 +1686,8 @@ namespace StgSharp.Graphics.OpenGL
byte* name
)
{
_context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size, type,
name);
_context->glGetTransformFeedbackVarying(program.Value, index, bufSize, length, size,
type, name);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -1739,7 +1721,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (byte* uniformNamesPtr = uniformNames) {
_context->glGetUniformIndices(program.Value, uniformCount, uniformNamesPtr,
uniformIndices);
uniformIndices);
}
}
@@ -2012,7 +1994,8 @@ namespace StgSharp.Graphics.OpenGL
fixed (int* countPtr = count)
{
fixed (IntPtr* indicesPtr = indices) {
_context->glMultiDrawElements(mode, countPtr, (uint)type, indicesPtr, drawcount);
_context->glMultiDrawElements(mode, countPtr, (uint)type, indicesPtr,
drawcount);
}
}
}
@@ -2033,7 +2016,8 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (int* basevertexPtr = basevertex) {
_context->glMultiDrawElementsBaseVertex(mode, countPtr, (uint)type,
indicesPtr, drawcount, basevertexPtr);
indicesPtr, drawcount,
basevertexPtr);
}
}
}
@@ -2191,7 +2175,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glRenderbufferStorageMultisample(target, samples, internalformat, width,
height);
height);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -2391,7 +2375,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pixelsPtr = pixels) {
_context->glTexImage1D(target, level, internalformat, width, border, format,
(uint)type, pixelsPtr);
(uint)type, pixelsPtr);
}
}
@@ -2410,7 +2394,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pixelsPtr = pixels) {
_context->glTexImage2D(target, level, internalformat, width, height, border, format,
(uint)type, pixelsPtr);
(uint)type, pixelsPtr);
}
}
@@ -2425,7 +2409,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glTexImage2DMultisample(target, samples, internalformat, width, height,
fixedsamplelocations);
fixedsamplelocations);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -2444,7 +2428,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pixelsPtr = pixels) {
_context->glTexImage3D(target, level, internalformat, width, height, depth, border,
format, (uint)type, pixelsPtr);
format, (uint)type, pixelsPtr);
}
}
@@ -2460,7 +2444,7 @@ namespace StgSharp.Graphics.OpenGL
)
{
_context->glTexImage3DMultisample(target, samples, internalformat, width, height, depth,
fixedsamplelocations);
fixedsamplelocations);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -2544,7 +2528,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pixelsPtr = pixels) {
_context->glTexSubImage1D(target, level, xoffset, width, format, (uint)type,
pixelsPtr);
pixelsPtr);
}
}
@@ -2563,7 +2547,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pixelsPtr = pixels) {
_context->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format,
(uint)type, pixelsPtr);
(uint)type, pixelsPtr);
}
}
@@ -2584,7 +2568,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pixelsPtr = pixels) {
_context->glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, (uint)type, pixelsPtr);
depth, format, (uint)type, pixelsPtr);
}
}
@@ -2597,7 +2581,8 @@ namespace StgSharp.Graphics.OpenGL
)
{
fixed (byte* varyingsPtr = varyings) {
_context->glTransformFeedbackVaryings(program.Value, count, varyingsPtr, bufferMode);
_context->glTransformFeedbackVaryings(program.Value, count, varyingsPtr,
bufferMode);
}
}
@@ -3760,7 +3745,7 @@ namespace StgSharp.Graphics.OpenGL
{
fixed (IntPtr* pointerPtr = pointer) {
_context->glVertexAttribPointer(index, size, (uint)type, normalized, stride,
pointerPtr);
pointerPtr);
}
}