diff --git a/StgSharp.Benchmark/HlsfAllocatorBench.cs b/StgSharp.Benchmark/HlsfAllocatorBench.cs index 730bfd87..0d23d002 100644 --- a/StgSharp.Benchmark/HlsfAllocatorBench.cs +++ b/StgSharp.Benchmark/HlsfAllocatorBench.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="HlsfAllocatorBench" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using BenchmarkDotNet.Attributes; -using StgSharp.HighPerformance.Memory; +using StgSharp.Mathematics.Memory; using System.Runtime.InteropServices; namespace StgSharp.Benchmark @@ -40,15 +40,7 @@ namespace StgSharp.Benchmark private const int AllocationCount = 2048; - private static readonly int[] AllocSizes = [ - 64, - 96, - 150, - 200, - 400, - 1024, - 4096 - ]; + private static readonly int[] AllocSizes = [64, 96, 150, 200, 400, 1024, 4096]; private HybridLayerSegregatedFitAllocator _hlsfAllocator = null!; private readonly List _hlsfLocalList = new(); private readonly List _libcLocalList = new(); @@ -104,9 +96,7 @@ namespace StgSharp.Benchmark _hlsfAllocator = new HybridLayerSegregatedFitAllocator(GetArenaBytes(), align:(int)Alignment); } - private static uint AlignSize( - uint size - ) + private static uint AlignSize(uint size) { uint mask = Alignment - 1; return (size + mask) & ~mask; @@ -119,9 +109,7 @@ namespace StgSharp.Benchmark int mb = defaultMb; string? env = Environment.GetEnvironmentVariable("HLSF_BENCH_ARENA_MB"); - if (!string.IsNullOrWhiteSpace(env) && - int.TryParse(env, out int parsed) && - parsed >= minMb) { + if (!string.IsNullOrWhiteSpace(env) && int.TryParse(env, out int parsed) && parsed >= minMb) { mb = parsed; } @@ -130,10 +118,7 @@ namespace StgSharp.Benchmark private uint GetNextRandomSize() => (uint)AllocSizes[_random.Next(AllocSizes.Length)]; - private void RunHlsf( - HybridLayerSegregatedFitAllocator allocator, - FreePolicy policy - ) + private void RunHlsf(HybridLayerSegregatedFitAllocator allocator, FreePolicy policy) { _hlsfLocalList.Clear(); diff --git a/StgSharp.Common/Data/ValueBox.cs b/StgSharp.Common/Data/ValueBox.cs deleted file mode 100644 index cdc41081..00000000 --- a/StgSharp.Common/Data/ValueBox.cs +++ /dev/null @@ -1,91 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ValueBox" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Data -{ - public interface IValueBox - { - - ref object ValueReference { get; } - - static virtual IValueBox AsGeneric(IValueBox box) where T: unmanaged - { - if (box is not IValueBox genericBox) { - return null; - } - return genericBox; - } - - static virtual bool IsGeneric(IValueBox box) where T: unmanaged - { - return box is IValueBox; - } - - } - - public interface IValueBox where T: unmanaged - { - - T Value { get; set; } - - } - - /// - /// A class attempt to reduce cost of boxing, though still a bit slower than direct access to - /// _origin value type instance. - /// - /// - /// Type of instance to be boxed. - /// - public class ValueBox : IValueBox, IValueBox where T: unmanaged - { - - private T _value; - - public ValueBox(T value) - { - _value = value; - } - - public ref object ValueReference => ref Unsafe.As(ref _value); - - public T Value - { - get => _value; - set => _value = value; - } - - } -} diff --git a/StgSharp.Common/HighPerformance/Lable.cs b/StgSharp.Common/HighPerformance/Lable.cs deleted file mode 100644 index 4afdc83e..00000000 --- a/StgSharp.Common/HighPerformance/Lable.cs +++ /dev/null @@ -1,68 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Lable" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.HighPerformance -{ - public class DataLabel - { - - public DataLabel(string labelName) - { - Name = labelName; - } - - public string Name - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get; - init; - } - - public override unsafe int GetHashCode() - { - ReadOnlySpan nameSpan = Name.AsSpan(); - fixed (char* cptr = nameSpan) { - return NativeIntrinsic.Context.city_hash_simplify(cptr, Name.Length); - } - } - - } - - public static class DataLabelBuilder - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static DataLabel AsLabel(this string name) - { - return new DataLabel(name); - } - - } -} \ No newline at end of file diff --git a/StgSharp.Common/HighPerformance/Memory/BufferStack.cs b/StgSharp.Common/HighPerformance/Memory/BufferStack.cs index b98798d5..b9ec7794 100644 --- a/StgSharp.Common/HighPerformance/Memory/BufferStack.cs +++ b/StgSharp.Common/HighPerformance/Memory/BufferStack.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="BufferStack" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -29,10 +29,10 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { [CollectionBuilder(typeof(BufferStackBuilder), nameof(BufferStackBuilder.Create))] - public unsafe class BufferStack : IDisposable where T : unmanaged + public unsafe class BufferStack : IDisposable where T: unmanaged { private byte* _buffer; diff --git a/StgSharp.Common/HighPerformance/Memory/ConcurrentBufferStack.cs b/StgSharp.Common/HighPerformance/Memory/ConcurrentBufferStack.cs index 4fa35a1a..a1fd757f 100644 --- a/StgSharp.Common/HighPerformance/Memory/ConcurrentBufferStack.cs +++ b/StgSharp.Common/HighPerformance/Memory/ConcurrentBufferStack.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="ConcurrentBufferStack" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -33,7 +33,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public static class BufferStackBuilder { @@ -279,9 +279,8 @@ namespace StgSharp.HighPerformance.Memory T* dataStart = (T*)(_buffer + sizeof(Header)); fixed (T* sourcePtr = span) { - Buffer.MemoryCopy(sourcePtr, dataStart, - (nuint)header->Capacity * (nuint)sizeof(T), - (nuint)span.Length * (nuint)sizeof(T)); + Buffer.MemoryCopy(sourcePtr, dataStart, (nuint)header->Capacity * (nuint)sizeof(T), + (nuint)span.Length * (nuint)sizeof(T)); } header->Top = span.Length; diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs index af34888a..0aea7f4c 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="HLSFAllocationHandle" // Project: StgSharp @@ -32,9 +32,9 @@ using System.Drawing; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using Allocator = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; +using Allocator = StgSharp.Mathematics.Memory.HybridLayerSegregatedFitAllocator; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public readonly unsafe struct HybridLayerSegregatedFitAllocationHandle { diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Alloc.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Alloc.cs index f965c934..0030c946 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Alloc.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Alloc.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="HLSFAllocator.Alloc" // Project: StgSharp @@ -27,9 +27,9 @@ // ----------------------------------------------------------------------- using System; using System.Numerics; -using hlsfHandle = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; +using hlsfHandle = StgSharp.Mathematics.Memory.HybridLayerSegregatedFitAllocationHandle; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public unsafe partial class HybridLayerSegregatedFitAllocator { diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.BucketNode.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.BucketNode.cs index d64112f7..b5b96588 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.BucketNode.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.BucketNode.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="HLSFAllocator.BucketNode" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -30,7 +30,7 @@ using System.Reflection.Metadata; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public unsafe partial class HybridLayerSegregatedFitAllocator { diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs index 2fa3aafd..3aaa3fd6 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="HLSFAllocator.Debug" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -31,13 +31,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public sealed class HLSFPositionChainBreakException : Exception { - public HLSFPositionChainBreakException() - : base("Position chain of an HLSF allocator is broken") { } + public HLSFPositionChainBreakException() : base("Position chain of an HLSF allocator is broken") { } } diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs index 959b94c2..2e158b4c 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="HLSFAllocator.Free" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -35,9 +35,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -using hlsfHandle = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; +using hlsfHandle = StgSharp.Mathematics.Memory.HybridLayerSegregatedFitAllocationHandle; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public enum FreePolicy { @@ -90,10 +90,7 @@ namespace StgSharp.HighPerformance.Memory /// Handle to the allocated memory block /// /// - public void Free( - hlsfHandle handle, - FreePolicy collectPolicy = FreePolicy.NoCollect - ) + public void Free(hlsfHandle handle, FreePolicy collectPolicy = FreePolicy.NoCollect) { Entry* e = handle.EntryHandle; if (e == null) { diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs index 2bc5c4f6..008acdfb 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="HLSFAllocator.Level" // Project: StgSharp @@ -33,14 +33,14 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public unsafe partial class HybridLayerSegregatedFitAllocator { private const int MaxLevel = 9; - private int[] _levelSizeArray = [ 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216 ]; + private int[] _levelSizeArray = [64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216]; public int AlignOfLevel(int bucketLevel) { diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs index aadef52e..3620d76b 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="HLSFAllocator.SegmentEntry" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -29,7 +29,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public unsafe partial class HybridLayerSegregatedFitAllocator { @@ -38,10 +38,7 @@ namespace StgSharp.HighPerformance.Memory /// Check if two Entries are adjacent in memory /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static bool AssertAdjacentTo( - Entry* current, - Entry* other - ) + private static bool AssertAdjacentTo(Entry* current, Entry* other) { // Only a predicate; never throw here. Callers rely on false to skip merging. return other->Position + (nuint)other->Size == current->Position || @@ -51,11 +48,7 @@ namespace StgSharp.HighPerformance.Memory /// /// check out if a bucket is within the same higher-level boundary as currentOffset /// - private bool AssertBoundary( - Entry* previous, - Entry* current, - int level - ) + private bool AssertBoundary(Entry* previous, Entry* current, int level) { level = int.Min(level, MaxLevel); int nextLevelSize = _levelSizeArray[level] * 4; @@ -68,21 +61,14 @@ namespace StgSharp.HighPerformance.Memory /// Determine segment index based on size and originLevel /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int DetermineSegmentIndex( - int[] levelSizeArray, - long size, - int level - ) + private static int DetermineSegmentIndex(int[] levelSizeArray, long size, int level) { level = int.Min(level, MaxLevel); return (int)((size - 1) / levelSizeArray[level]); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void InsertEntryAfter( - Entry* entry, - Entry* position - ) + private static void InsertEntryAfter(Entry* entry, Entry* position) { Entry* next = position->NextNear; entry->NextNear = next; @@ -92,10 +78,7 @@ namespace StgSharp.HighPerformance.Memory } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void InsertEntryBefore( - Entry* entry, - Entry* position - ) + private static void InsertEntryBefore(Entry* entry, Entry* position) { Entry* prev = position->PreviousNear; entry->NextNear = position; @@ -109,9 +92,7 @@ namespace StgSharp.HighPerformance.Memory /// Current Entry will serve as the final merged block. The Merge will be in lazy /// strategy. /// - private void MergeAndRemoveFromBuckets( - Entry* entry - ) + private void MergeAndRemoveFromBuckets(Entry* entry) { if (entry == null) { return; @@ -171,9 +152,7 @@ namespace StgSharp.HighPerformance.Memory /// Remove node from position linked list, this method does not recycle a BucketNode from /// size bucket /// - private void RemoveFromPositionChain( - Entry* entry - ) + private void RemoveFromPositionChain(Entry* entry) { Entry* prev = entry->PreviousNear; Entry* next = entry->NextNear; @@ -190,11 +169,7 @@ namespace StgSharp.HighPerformance.Memory } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void SetEntryLevel( - Entry* entry, - nuint position, - long size - ) + private static void SetEntryLevel(Entry* entry, nuint position, long size) { entry ->Position = position; entry->Size = size; diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.cs index 0f82a8c7..ed2705b7 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="HLSFAllocator" // Project: StgSharp @@ -31,7 +31,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public unsafe partial class HybridLayerSegregatedFitAllocator : IDisposable { diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs index a7fd554e..57c34ad9 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="SlabAllocationHandle" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -28,7 +28,7 @@ using System; using System.Runtime.CompilerServices; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public unsafe struct SlabAllocationHandle : IDisposable where T: unmanaged { diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs index 3f55ad79..d1edf4b4 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="SlabAllocator.Chunked" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -33,9 +33,9 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { - internal sealed unsafe class ChunkedSlabAllocator : SlabAllocator where T : unmanaged + internal sealed unsafe class ChunkedSlabAllocator : SlabAllocator where T: unmanaged { private bool _disposed; @@ -96,6 +96,7 @@ namespace StgSharp.HighPerformance.Memory return; } _disposed = true; + // NativeMemory.Free((void*)_currentBuffer); while (_buffers.TryPop(out nuint buffer)) { diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs index 3e4b02fe..7ebb68dd 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="SlabAllocator.ChunkedConcurrent" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -36,9 +36,9 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { - internal sealed unsafe class ConcurrentChunkedSlabAllocator : SlabAllocator where T : unmanaged + internal sealed unsafe class ConcurrentChunkedSlabAllocator : SlabAllocator where T: unmanaged { private bool _disposed; diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs index ca511a7c..f10bd41f 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="SlabAllocator.SequencialConcurrent" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -32,15 +32,15 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { public sealed unsafe class ConcurrentSequentialSlabAllocator : SlabAllocator where T: unmanaged { - private bool _disposed; - private T* _buffer; + private bool _disposed; + private readonly BufferExpansionLock _lock = new(); private readonly ConcurrentBufferStack _stack; private readonly int _elementSize; diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs index b5294d4b..01e91f86 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="SlabAllocator" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -27,9 +27,9 @@ // ----------------------------------------------------------------------- using System; -namespace StgSharp.HighPerformance.Memory +namespace StgSharp.Mathematics.Memory { - public abstract class SlabAllocator : IDisposable where T : unmanaged + public abstract class SlabAllocator : IDisposable where T: unmanaged { public abstract nuint Allocate(); @@ -56,32 +56,29 @@ namespace StgSharp.HighPerformance.Memory /// Thrown when requesting unsupported configurations. /// /// - /// Important Threading Considerations: While SLAB + /// Important Threading Considerations: While SLAB /// /// allocators themselves may be designed for single-threaded use, allocated objects /// are /// frequently shared across multiple threads in real-world applications. Due to /// the /// special implementation of expandable concurrent sequential SLAB allocators, /// they rely /// on internal expansion locks to ensure that memory buffer expansions /// (which involve /// copying the entire buffer to a new location) do not occur while - /// other threads are /// reading from allocated regions. - /// Sequential Layout Limitations: ///
Sequential layout SLAB allocators + /// other threads are /// reading from allocated regions.
+ /// Sequential Layout Limitations: ///
Sequential layout SLAB allocators /// cannot provide a single-threaded /// version because: They use contiguous memory /// layout that - /// requires buffer expansion when capacity is exceeded /// - /// Buffer expansion involves copying all /// - /// existing data to a new memory location /// + /// type="bullet">They use contiguous memory /// layout that requires + /// buffer expansion when capacity is exceeded + /// ///Buffer expansion involves copying all /// + /// existing data to a new memory location /// /// Without proper synchronization, concurrent access to allocated objects during /// - /// expansion would cause memory corruption The + /// expansion would cause memory corruptionThe /// /// expansion lock mechanism is essential even if allocation itself is single- /// - /// threaded
Chunked Layout: /// - ///
Chunked layout allocators can optionally provide single-threaded /// - /// versions since they don't require buffer expansion and copying. Each chunk is /// - /// allocated independently, avoiding the memory relocation issues present in sequential - /// /// layouts.
+ /// threaded
Chunked Layout: + /// ///
Chunked layout allocators can optionally provide single-threaded + /// /// versions since they don't require buffer expansion and copying. Each chunk is + /// /// allocated independently, avoiding the memory relocation issues present in + /// sequential /// layouts.
///
- public static SlabAllocator Create( - nuint count, - SlabBufferLayout layout, - bool concurrentSupport = true) + public static SlabAllocator Create(nuint count, SlabBufferLayout layout, bool concurrentSupport = true) { if (concurrentSupport) { return layout switch diff --git a/StgSharp.Common/HighPerformance/IRegisterType.cs b/StgSharp.Common/HighPerformance/RegisterAbstraction/IRegisterType.cs similarity index 93% rename from StgSharp.Common/HighPerformance/IRegisterType.cs rename to StgSharp.Common/HighPerformance/RegisterAbstraction/IRegisterType.cs index 561dd387..93a03881 100644 --- a/StgSharp.Common/HighPerformance/IRegisterType.cs +++ b/StgSharp.Common/HighPerformance/RegisterAbstraction/IRegisterType.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="IRegisterType" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -32,7 +32,7 @@ using System.Numerics; using System.Text; using System.Threading.Tasks; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { /// /// Abstraction for a wide SIMD register or equivalent packed numeric storage. Provides raw diff --git a/StgSharp.Common/HighPerformance/M128.cs b/StgSharp.Common/HighPerformance/RegisterAbstraction/M128.cs similarity index 94% rename from StgSharp.Common/HighPerformance/M128.cs rename to StgSharp.Common/HighPerformance/RegisterAbstraction/M128.cs index 6b011ca5..43dc2407 100644 --- a/StgSharp.Common/HighPerformance/M128.cs +++ b/StgSharp.Common/HighPerformance/RegisterAbstraction/M128.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="M128" // Project: StgSharp @@ -36,7 +36,7 @@ using System.Runtime.Intrinsics.X86; using System.Text; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { [StructLayout(LayoutKind.Explicit, Pack = 16)] public unsafe struct M128 : IRegisterPresentation diff --git a/StgSharp.Common/HighPerformance/M256.cs b/StgSharp.Common/HighPerformance/RegisterAbstraction/M256.cs similarity index 93% rename from StgSharp.Common/HighPerformance/M256.cs rename to StgSharp.Common/HighPerformance/RegisterAbstraction/M256.cs index d811ea0e..d016e937 100644 --- a/StgSharp.Common/HighPerformance/M256.cs +++ b/StgSharp.Common/HighPerformance/RegisterAbstraction/M256.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="M256" // Project: StgSharp @@ -35,7 +35,7 @@ using System.Runtime.Intrinsics; using System.Text; using System.Threading.Tasks; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { [StructLayout(LayoutKind.Explicit, Pack = 16)] public unsafe struct M256 : IRegisterPresentation diff --git a/StgSharp.Common/HighPerformance/M512.cs b/StgSharp.Common/HighPerformance/RegisterAbstraction/M512.cs similarity index 81% rename from StgSharp.Common/HighPerformance/M512.cs rename to StgSharp.Common/HighPerformance/RegisterAbstraction/M512.cs index fb0265af..a4cccd23 100644 --- a/StgSharp.Common/HighPerformance/M512.cs +++ b/StgSharp.Common/HighPerformance/RegisterAbstraction/M512.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="M512" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -35,7 +35,7 @@ using System.Runtime.Intrinsics; using System.Text; using System.Threading.Tasks; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 64)] public unsafe struct M512 : IRegisterPresentation @@ -44,17 +44,17 @@ namespace StgSharp.HighPerformance [FieldOffset(0)] private fixed byte _buffer[64]; [FieldOffset(0)] private Vector512 Vec; - public ref T AsRef() where T : unmanaged, INumber + public ref T AsRef() where T: unmanaged, INumber { return ref Unsafe.As(ref _buffer[0]); } - public void BroadCastFrom(T value) where T : unmanaged, INumber + public void BroadCastFrom(T value) where T: unmanaged, INumber { Vec = Vector512.Create(value).AsSingle(); } - public ref T Member(int index) where T : unmanaged, INumber + public ref T Member(int index) where T: unmanaged, INumber { return ref Unsafe.As(ref _buffer[0]); } diff --git a/StgSharp.Common/HighPerformance/M64.cs b/StgSharp.Common/HighPerformance/RegisterAbstraction/M64.cs similarity index 86% rename from StgSharp.Common/HighPerformance/M64.cs rename to StgSharp.Common/HighPerformance/RegisterAbstraction/M64.cs index 21eb5e41..7c2d1de8 100644 --- a/StgSharp.Common/HighPerformance/M64.cs +++ b/StgSharp.Common/HighPerformance/RegisterAbstraction/M64.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="M64" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { [StructLayout(LayoutKind.Explicit, Pack = 8)] public unsafe struct M64 : IRegisterPresentation @@ -47,12 +47,12 @@ namespace StgSharp.HighPerformance Unsafe.SkipInit(out value); } - public ref T AsRef() where T : unmanaged,INumber + public ref T AsRef() where T: unmanaged,INumber { return ref Unsafe.As(ref buffer[0]); } - public void BroadCastFrom(T value) where T : unmanaged, INumber + public void BroadCastFrom(T value) where T: unmanaged, INumber { vec = Vector64.Create(value).AsSingle(); } @@ -68,7 +68,7 @@ namespace StgSharp.HighPerformance } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ref T Member(int index) where T : unmanaged, INumber + public ref T Member(int index) where T: unmanaged, INumber { return ref Unsafe.As(ref buffer[index * sizeof(T)]); } diff --git a/StgSharp.Common/HighPerformance/UnsafeCompute.cs b/StgSharp.Common/HighPerformance/UnsafeCompute.cs deleted file mode 100644 index 78cdbdf3..00000000 --- a/StgSharp.Common/HighPerformance/UnsafeCompute.cs +++ /dev/null @@ -1,54 +0,0 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="UnsafeCompute" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using System.Runtime.CompilerServices; - -namespace StgSharp.HighPerformance -{ - public static class UnsafeCompute - { - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int CityHashSimplify(char* span, int length) - { - return NativeIntrinsic.Context.city_hash_simplify(span, length); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int CityHashSimplify(char* span, int begin, int length) - { - return NativeIntrinsic.Context.city_hash_simplify(span + begin, length); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int IndexOfCharPair(char* source, int pairValue, int length) - { - return NativeIntrinsic.Context.index_pair(source, pairValue, length); - } - - } -} diff --git a/StgSharp.Common/StgSharp.Common.csproj b/StgSharp.Common/StgSharp.Common.csproj index df68a9c5..747ff55a 100644 --- a/StgSharp.Common/StgSharp.Common.csproj +++ b/StgSharp.Common/StgSharp.Common.csproj @@ -23,4 +23,8 @@ + + + + \ No newline at end of file diff --git a/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs b/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs index 2f3f5b47..a8366e99 100644 --- a/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs +++ b/StgSharp.Common/Timing/TimeSpanProvider.Awaiting.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="TimeSpanProvider.Awaiting" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance.Memory; +using StgSharp.Mathematics.Memory; using System; using System.Collections.Concurrent; @@ -154,9 +154,7 @@ namespace StgSharp.Timing /// OperationCanceledException when token is cancelled. If the provider is disposed during /// wait an OperationCanceledException is thrown to indicate end. /// - public Task WaitNextSpanAsync( - CancellationToken ct - ) + public Task WaitNextSpanAsync(CancellationToken ct) { // Block the current thread until the event is signaled or cancellation requested. _event.Wait(ct); @@ -195,9 +193,7 @@ namespace StgSharp.Timing /// True if the span provider is working. False if time is over (the sequence ended). /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool OnSpanTick( - long currentTick - ) + internal bool OnSpanTick(long currentTick) { if (_sequence.EndsAt(currentTick)) { diff --git a/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs b/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs index d3ed5347..39b25262 100644 --- a/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs +++ b/StgSharp.Graphics/OpenGL/Buffer/TextureGL.cs @@ -1,311 +1,276 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="TextureGL" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.HighPerformance; - -using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Graphics.OpenGL -{ - public sealed unsafe class TextureGL - { +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="TextureGL" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Mathematics; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics.OpenGL +{ + public sealed unsafe class TextureGL + { + private int currentEditingTextureIndex; - private OpenGLFunction _gl; - internal GlHandle[] _textureHandle; - - internal TextureGL( - int count, - glRender binding - ) - { - // sourceList = new Image[count]; - this._gl = binding.GL; - _textureHandle = _gl.GenTextures(count); - } - - public GlHandle this[ - int index - ] - { - get => _textureHandle[index]; - } - - public int Count - { - get => _textureHandle.Length; + private OpenGLFunction _gl; + internal GlHandle[] _textureHandle; + + internal TextureGL(int count, glRender binding) + { + // sourceList = new Image[count]; + this._gl = binding.GL; + _textureHandle = _gl.GenTextures(count); + } + + public GlHandle this[int index] + { + get => _textureHandle[index]; + } + + public int Count + { + get => _textureHandle.Length; } // internal Image[] sourceList; - public int IndexOfCurrentTexture - { - get => currentEditingTextureIndex; + public int IndexOfCurrentTexture + { + get => currentEditingTextureIndex; + } + + internal OpenGLFunction GL => _gl; + + public void ActivateAs(TextureUnit unit) + { + _gl.ActiveTextureUnit((uint)unit); + } + + public void Bind2D(int index) + { + currentEditingTextureIndex = index; + _gl.BindTexture(glConst.TEXTURE_2D, _textureHandle[index]); } - internal OpenGLFunction GL => _gl; - - public void ActivateAs( - TextureUnit unit - ) - { - _gl.ActiveTextureUnit((uint)unit); - } - - public void Bind2D( - int index - ) - { - currentEditingTextureIndex = index; - _gl.BindTexture(glConst.TEXTURE_2D, _textureHandle[index]); - } - - /// - /// Load an to certain texture. + /// + /// Load an to certain texture. /// - /// - /// + /// + /// /// - /// - /// + /// + /// /// - public unsafe void LoadTexture( - int index, - Image i - ) - { - byte[] handle = i.PixelBuffer; - _gl.TextureImage2d(Texture2DTarget.Texture2D, 0, i.Channel, i.Width, i.Height, - i.Channel, i.PixelLayout, pixels:handle); - _gl.GenerateMipmap(Texture2DTarget.Texture2D); + public unsafe void LoadTexture(int index, Image i) + { + byte[] handle = i.PixelBuffer; + _gl.TextureImage2d(Texture2DTarget.Texture2D, 0, i.Channel, i.Width, i.Height, i.Channel, i.PixelLayout, + pixels:handle); + _gl.GenerateMipmap(Texture2DTarget.Texture2D); } #region texture setting - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Set2dFilterProperty( - int index, - TextureFilter onMinify, - TextureFilter onMagnify - ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dFilterProperty(int index, TextureFilter onMinify, TextureFilter onMagnify) { #if DEBUG - if (index != currentEditingTextureIndex) - { + if (index != currentEditingTextureIndex) + { throw new InvalidOperationException( - "Texture to be editted is not the one being activated."); + "Texture to be editted is not the one being activated."); } #endif - _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MIN_FILTER, (int)onMinify); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MIN_FILTER, (int)onMinify); _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MAG_FILTER, - (int)onMagnify); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Set2dWrapProperty( - int index, - TextureWrap onHorizontial, - TextureWrap onVertical - ) + (int)onMagnify); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dWrapProperty(int index, TextureWrap onHorizontial, TextureWrap onVertical) { #if DEBUG - if (index != currentEditingTextureIndex) - { + if (index != currentEditingTextureIndex) + { throw new InvalidOperationException( - "Texture to be editted is not the one being activated."); + "Texture to be editted is not the one being activated."); } #endif _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_S, - (int)onHorizontial); - _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_T, (int)onVertical); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Set2dProperty( - int index, - TextureProperty property - ) - { - Set2dFilterProperty(index, property.FilterOnMinify, property.FilterOnMagnify); - Set2dWrapProperty(index, property.WrapOnHorizontial, property.WrapOnVertical); + (int)onHorizontial); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_T, (int)onVertical); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dProperty(int index, TextureProperty property) + { + Set2dFilterProperty(index, property.FilterOnMinify, property.FilterOnMagnify); + Set2dWrapProperty(index, property.WrapOnHorizontial, property.WrapOnVertical); } #endregion texture setting - } - - [StructLayout(LayoutKind.Explicit)] - public struct TextureProperty - { - - [FieldOffset(0)] private M128 mask; - [FieldOffset(0)] private TextureFilter mag; + } + + [StructLayout(LayoutKind.Explicit)] + public struct TextureProperty + { + + [FieldOffset(0)] private M128 mask; + [FieldOffset(0)] private TextureFilter mag; [FieldOffset(4)] private TextureFilter min; - [FieldOffset(8)] private TextureWrap hori; - [FieldOffset(12)] private TextureWrap vert; - - public TextureProperty( - TextureFilter onMagnify, - TextureFilter onMinify, - TextureWrap onHorizontial, - TextureWrap onVertical - ) - { - FilterOnMagnify = onMagnify; - FilterOnMinify = onMinify; - WrapOnHorizontial = onHorizontial; - WrapOnVertical = onVertical; + [FieldOffset(8)] private TextureWrap hori; + [FieldOffset(12)] private TextureWrap vert; + + public TextureProperty( + TextureFilter onMagnify, + TextureFilter onMinify, + TextureWrap onHorizontial, + TextureWrap onVertical) + { + FilterOnMagnify = onMagnify; + FilterOnMinify = onMinify; + WrapOnHorizontial = onHorizontial; + WrapOnVertical = onVertical; + } + + public TextureFilter FilterOnMagnify + { + get => mag; + set => mag = value; + } + + public TextureFilter FilterOnMinify + { + get => min; + set => min = value; + } + + public TextureWrap WrapOnHorizontial + { + get => hori; + set => hori = value; + } + + public TextureWrap WrapOnVertical + { + get => vert; + set => vert = value; + } + + public override bool Equals([NotNullWhen(true)] object obj) + { + return base.Equals(obj); + } + + public override int GetHashCode() + { + return HashCode.Combine(FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, WrapOnVertical); + } + + public override string ToString() + { + return $"FilterOnMagnify:{FilterOnMagnify}, " + $"FilterOnMagnify:{FilterOnMagnify}, " + $"WrapOnHorizontial:{WrapOnHorizontial}, " + $"WrapOnVertical:{WrapOnVertical}"; + } + + public static bool operator !=(TextureProperty left, TextureProperty right) + { + return left.mask != right.mask; } - public TextureFilter FilterOnMagnify - { - get => mag; - set => mag = value; + public static bool operator ==(TextureProperty left, TextureProperty right) + { + return left.mask == right.mask; } - public TextureFilter FilterOnMinify - { - get => min; - set => min = value; - } - - public TextureWrap WrapOnHorizontial - { - get => hori; - set => hori = value; - } - - public TextureWrap WrapOnVertical - { - get => vert; - set => vert = value; - } - - public override bool Equals( - [NotNullWhen(true)] object obj - ) - { - return base.Equals(obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, - WrapOnVertical); - } - - public override string ToString() - { - return $"FilterOnMagnify:{FilterOnMagnify}, " + $"FilterOnMagnify:{FilterOnMagnify}, " + $"WrapOnHorizontial:{WrapOnHorizontial}, " + $"WrapOnVertical:{WrapOnVertical}"; - } - - public static bool operator !=( - TextureProperty left, - TextureProperty right - ) - { - return left.mask != right.mask; - } - - public static bool operator ==( - TextureProperty left, - TextureProperty right - ) - { - return left.mask == right.mask; - } - - public static implicit operator TextureProperty( + public static implicit operator TextureProperty( ( TextureFilter onMagnify, TextureFilter onMinify, TextureWrap onHorizontial, TextureWrap onVertical - ) propertyValueTuple - ) - { - return new TextureProperty(propertyValueTuple.onMagnify, propertyValueTuple.onMinify, - propertyValueTuple.onHorizontial, - propertyValueTuple.onVertical); - } - + ) propertyValueTuple) + { + return new TextureProperty(propertyValueTuple.onMagnify, propertyValueTuple.onMinify, + propertyValueTuple.onHorizontial, propertyValueTuple.onVertical); + } + } #pragma warning disable CA1008 public enum TextureFilter #pragma warning restore CA1008 - { - - Nearest = glConst.NEAREST, - Linear = glConst.LINEAR, - NearestLinearMipmap = glConst.NEAREST_MIPMAP_LINEAR, - LinearLinearMipmap = glConst.LINEAR_MIPMAP_LINEAR, - NearestNearestMipmap = glConst.NEAREST_MIPMAP_NEAREST, - LinearNearestMipmap = glConst.LINEAR_MIPMAP_NEAREST, - + { + + Nearest = glConst.NEAREST, + Linear = glConst.LINEAR, + NearestLinearMipmap = glConst.NEAREST_MIPMAP_LINEAR, + LinearLinearMipmap = glConst.LINEAR_MIPMAP_LINEAR, + NearestNearestMipmap = glConst.NEAREST_MIPMAP_NEAREST, + LinearNearestMipmap = glConst.LINEAR_MIPMAP_NEAREST, + } #pragma warning disable CA1008 public enum TextureUnit #pragma warning restore CA1008 - { - - Unit0 = glConst.TEXTURE0, - Unit1 = glConst.TEXTURE1, - Unit2 = glConst.TEXTURE2, - Unit3 = glConst.TEXTURE3, - Unit4 = glConst.TEXTURE4, - Unit5 = glConst.TEXTURE5, - Unit6 = glConst.TEXTURE6, - Unit7 = glConst.TEXTURE7, - Unit8 = glConst.TEXTURE8, - Unit9 = glConst.TEXTURE9, - Unit10 = glConst.TEXTURE10, - Unit11 = glConst.TEXTURE11, - Unit12 = glConst.TEXTURE12, - Unit13 = glConst.TEXTURE13, - Unit14 = glConst.TEXTURE14, - Unit15 = glConst.TEXTURE15, - + { + + Unit0 = glConst.TEXTURE0, + Unit1 = glConst.TEXTURE1, + Unit2 = glConst.TEXTURE2, + Unit3 = glConst.TEXTURE3, + Unit4 = glConst.TEXTURE4, + Unit5 = glConst.TEXTURE5, + Unit6 = glConst.TEXTURE6, + Unit7 = glConst.TEXTURE7, + Unit8 = glConst.TEXTURE8, + Unit9 = glConst.TEXTURE9, + Unit10 = glConst.TEXTURE10, + Unit11 = glConst.TEXTURE11, + Unit12 = glConst.TEXTURE12, + Unit13 = glConst.TEXTURE13, + Unit14 = glConst.TEXTURE14, + Unit15 = glConst.TEXTURE15, + } #pragma warning disable CA1008 public enum TextureWrap #pragma warning restore CA1008 - { - - Repeat = glConst.REPEAT, - MirroredRepeat = glConst.MIRRORED_REPEAT, - ClampToEdge = glConst.CLAMP_TO_EDGE, - ClampToBorder = glConst.CLAMP_TO_BORDER, - - } + { + + Repeat = glConst.REPEAT, + MirroredRepeat = glConst.MIRRORED_REPEAT, + ClampToEdge = glConst.CLAMP_TO_EDGE, + ClampToBorder = glConst.CLAMP_TO_BORDER, + + } } \ No newline at end of file diff --git a/StgSharp.Graphics/OpenGL/glApiManager.Load.cs b/StgSharp.Graphics/OpenGL/glApiManager.Load.cs index e8528709..8d09d27c 100644 --- a/StgSharp.Graphics/OpenGL/glApiManager.Load.cs +++ b/StgSharp.Graphics/OpenGL/glApiManager.Load.cs @@ -1,1611 +1,1589 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glApiManager.Load" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Graphics.OpenGL -{ - public static partial class glManager - { - - internal static unsafe bool LoadGLcore10( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core10) - { - DefaultLog.InternalAppendLog("The core version 1.0 is not supported."); - return false; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glApiManager.Load" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Graphics.OpenGL +{ + public static partial class glManager + { + + internal static unsafe bool LoadGLcore10( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core10) + { + DefaultLog.InternalAppendLog("The core version 1.0 is not supported."); + return false; } #region load - contextPtr->glBlendFunc = LoadGLFunction(load, "glBlendFunc"u8); - contextPtr->glClear = LoadGLFunction(load, "glClear"u8); - contextPtr->glClearColor = LoadGLFunction(load, "glClearColor"u8); - contextPtr->glClearDepth = LoadGLFunction(load, "glClearDepth"u8); - contextPtr->glClearStencil = LoadGLFunction(load, "glClearStencil"u8); - contextPtr->glColorMask = LoadGLFunction(load, "glColorMask"u8); - contextPtr->glCullFace = LoadGLFunction(load, "glCullFace"u8); - contextPtr->glDepthFunc = LoadGLFunction(load, "glDepthFunc"u8); - contextPtr->glDepthMask = LoadGLFunction(load, "glDepthMask"u8); - contextPtr->glDepthRange = LoadGLFunction(load, "glDepthRange"u8); - contextPtr->glDisable = LoadGLFunction(load, "glDisable"u8); - contextPtr->glDrawBuffer = LoadGLFunction(load, "glDrawBuffer"u8); - contextPtr->glEnable = LoadGLFunction(load, "glEnable"u8); - contextPtr->glFinish = LoadGLFunction(load, "glFinish"u8); - contextPtr->glFlush = LoadGLFunction(load, "glFlush"u8); - contextPtr->glFrontFace = LoadGLFunction(load, "glFrontFace"u8); - contextPtr->glGetBooleanv = LoadGLFunction(load, "glGetBooleanv"u8); - contextPtr->glGetDoublev = LoadGLFunction(load, "glGetDoublev"u8); - contextPtr->glGetError = LoadGLFunction(load, "glGetError"u8); - contextPtr->glGetFloatv = LoadGLFunction(load, "glGetFloatv"u8); - contextPtr->glGetIntegerv = LoadGLFunction(load, "glGetIntegerv"u8); - contextPtr->glGetString = LoadGLFunction(load, "glGetString"u8); - contextPtr->glGetTexImage = LoadGLFunction(load, "glGetTexImage"u8); - contextPtr->glGetTexLevelParameterfv = LoadGLFunction(load, "glGetTexLevelParameterfv"u8); - contextPtr->glGetTexLevelParameteriv = LoadGLFunction(load, "glGetTexLevelParameteriv"u8); - contextPtr->glGetTexParameterfv = LoadGLFunction(load, "glGetTexParameterfv"u8); - contextPtr->glGetTexParameteriv = LoadGLFunction(load, "glGetTexParameteriv"u8); - contextPtr->glHint = LoadGLFunction(load, "glHint"u8); - contextPtr->glIsEnabled = LoadGLFunction(load, "glIsEnabled"u8); - contextPtr->glLineWidth = LoadGLFunction(load, "glLineWidth"u8); - contextPtr->glLogicOp = LoadGLFunction(load, "glLogicOp"u8); - contextPtr->glPixelStoref = LoadGLFunction(load, "glPixelStoref"u8); - contextPtr->glPixelStorei = LoadGLFunction(load, "glPixelStorei"u8); - contextPtr->glPointSize = LoadGLFunction(load, "glPointSize"u8); - contextPtr->glPolygonMode = LoadGLFunction(load, "glPolygonMode"u8); - contextPtr->glReadBuffer = LoadGLFunction(load, "glReadBuffer"u8); - contextPtr->glReadPixels = LoadGLFunction(load, "glReadPixels"u8); - contextPtr->glScissor = LoadGLFunction(load, "glScissor"u8); - contextPtr->glStencilFunc = LoadGLFunction(load, "glStencilFunc"u8); - contextPtr->glStencilMask = LoadGLFunction(load, "glStencilMask"u8); - contextPtr->glStencilOp = LoadGLFunction(load, "glStencilOp"u8); - contextPtr->glTexImage1D = LoadGLFunction(load, "glTexImage1D"u8); - contextPtr->glTexImage2D = LoadGLFunction(load, "glTexImage2D"u8); - contextPtr->glTexParameterf = LoadGLFunction(load, "glTexParameterf"u8); - contextPtr->glTexParameterfv = LoadGLFunction(load, "glTexParameterfv"u8); - contextPtr->glTexParameteri = LoadGLFunction(load, "glTexParameteri"u8); - contextPtr->glTexParameteriv = LoadGLFunction(load, "glTexParameteriv"u8); + contextPtr->glBlendFunc = LoadGLFunction(load, "glBlendFunc"u8); + contextPtr->glClear = LoadGLFunction(load, "glClear"u8); + contextPtr->glClearColor = LoadGLFunction(load, "glClearColor"u8); + contextPtr->glClearDepth = LoadGLFunction(load, "glClearDepth"u8); + contextPtr->glClearStencil = LoadGLFunction(load, "glClearStencil"u8); + contextPtr->glColorMask = LoadGLFunction(load, "glColorMask"u8); + contextPtr->glCullFace = LoadGLFunction(load, "glCullFace"u8); + contextPtr->glDepthFunc = LoadGLFunction(load, "glDepthFunc"u8); + contextPtr->glDepthMask = LoadGLFunction(load, "glDepthMask"u8); + contextPtr->glDepthRange = LoadGLFunction(load, "glDepthRange"u8); + contextPtr->glDisable = LoadGLFunction(load, "glDisable"u8); + contextPtr->glDrawBuffer = LoadGLFunction(load, "glDrawBuffer"u8); + contextPtr->glEnable = LoadGLFunction(load, "glEnable"u8); + contextPtr->glFinish = LoadGLFunction(load, "glFinish"u8); + contextPtr->glFlush = LoadGLFunction(load, "glFlush"u8); + contextPtr->glFrontFace = LoadGLFunction(load, "glFrontFace"u8); + contextPtr->glGetBooleanv = LoadGLFunction(load, "glGetBooleanv"u8); + contextPtr->glGetDoublev = LoadGLFunction(load, "glGetDoublev"u8); + contextPtr->glGetError = LoadGLFunction(load, "glGetError"u8); + contextPtr->glGetFloatv = LoadGLFunction(load, "glGetFloatv"u8); + contextPtr->glGetIntegerv = LoadGLFunction(load, "glGetIntegerv"u8); + contextPtr->glGetString = LoadGLFunction(load, "glGetString"u8); + contextPtr->glGetTexImage = LoadGLFunction(load, "glGetTexImage"u8); + contextPtr->glGetTexLevelParameterfv = LoadGLFunction(load, "glGetTexLevelParameterfv"u8); + contextPtr->glGetTexLevelParameteriv = LoadGLFunction(load, "glGetTexLevelParameteriv"u8); + contextPtr->glGetTexParameterfv = LoadGLFunction(load, "glGetTexParameterfv"u8); + contextPtr->glGetTexParameteriv = LoadGLFunction(load, "glGetTexParameteriv"u8); + contextPtr->glHint = LoadGLFunction(load, "glHint"u8); + contextPtr->glIsEnabled = LoadGLFunction(load, "glIsEnabled"u8); + contextPtr->glLineWidth = LoadGLFunction(load, "glLineWidth"u8); + contextPtr->glLogicOp = LoadGLFunction(load, "glLogicOp"u8); + contextPtr->glPixelStoref = LoadGLFunction(load, "glPixelStoref"u8); + contextPtr->glPixelStorei = LoadGLFunction(load, "glPixelStorei"u8); + contextPtr->glPointSize = LoadGLFunction(load, "glPointSize"u8); + contextPtr->glPolygonMode = LoadGLFunction(load, "glPolygonMode"u8); + contextPtr->glReadBuffer = LoadGLFunction(load, "glReadBuffer"u8); + contextPtr->glReadPixels = LoadGLFunction(load, "glReadPixels"u8); + contextPtr->glScissor = LoadGLFunction(load, "glScissor"u8); + contextPtr->glStencilFunc = LoadGLFunction(load, "glStencilFunc"u8); + contextPtr->glStencilMask = LoadGLFunction(load, "glStencilMask"u8); + contextPtr->glStencilOp = LoadGLFunction(load, "glStencilOp"u8); + contextPtr->glTexImage1D = LoadGLFunction(load, "glTexImage1D"u8); + contextPtr->glTexImage2D = LoadGLFunction(load, "glTexImage2D"u8); + contextPtr->glTexParameterf = LoadGLFunction(load, "glTexParameterf"u8); + contextPtr->glTexParameterfv = LoadGLFunction(load, "glTexParameterfv"u8); + contextPtr->glTexParameteri = LoadGLFunction(load, "glTexParameteri"u8); + contextPtr->glTexParameteriv = LoadGLFunction(load, "glTexParameteriv"u8); contextPtr->glViewport = LoadGLFunction(load, "glViewport"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore11( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core11) - { - DefaultLog.InternalAppendLog("The core version 1.1 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore11( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core11) + { + DefaultLog.InternalAppendLog("The core version 1.1 is not supported."); + return false; } #region load - contextPtr->glBindTexture = LoadGLFunction(load, "glBindTexture"u8); + contextPtr->glBindTexture = LoadGLFunction(load, "glBindTexture"u8); contextPtr->glCopyTexImage1D = LoadGLFunction(load, - "glCopyTexImage1D"u8); + "glCopyTexImage1D"u8); contextPtr->glCopyTexImage2D = LoadGLFunction(load, - "glCopyTexImage2D"u8); + "glCopyTexImage2D"u8); contextPtr->glCopyTexSubImage1D = LoadGLFunction(load, - "glCopyTexSubImage1D"u8); + "glCopyTexSubImage1D"u8); contextPtr->glCopyTexSubImage2D = LoadGLFunction(load, - "glCopyTexSubImage2D"u8); + "glCopyTexSubImage2D"u8); contextPtr->glDeleteTextures = LoadGLFunction(load, - "glDeleteTextures"u8); - contextPtr->glDrawArrays = LoadGLFunction(load, "glDrawArrays"u8); + "glDeleteTextures"u8); + contextPtr->glDrawArrays = LoadGLFunction(load, "glDrawArrays"u8); contextPtr->glDrawElements = LoadGLFunction(load, - "glDrawElements"u8); + "glDrawElements"u8); contextPtr->glGenTextures = LoadGLFunction(load, "glGenTextures"u8); // contextPtr->glGetPointerv =LoadGLFunction(load,"glGetPointerv"u8); - contextPtr->glIsTexture = LoadGLFunction(load, "glIsTexture"u8); - contextPtr->glPolygonOffset = LoadGLFunction(load, "glPolygonOffset"u8); + contextPtr->glIsTexture = LoadGLFunction(load, "glIsTexture"u8); + contextPtr->glPolygonOffset = LoadGLFunction(load, "glPolygonOffset"u8); contextPtr->glTexSubImage1D = LoadGLFunction(load, - "glTexSubImage1D"u8); + "glTexSubImage1D"u8); contextPtr->glTexSubImage2D = LoadGLFunction(load, "glTexSubImage2D"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore12( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core12) - { - DefaultLog.InternalAppendLog("The core version 1.2 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore12( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core12) + { + DefaultLog.InternalAppendLog("The core version 1.2 is not supported."); + return false; } #region load contextPtr->glCopyTexSubImage3D = LoadGLFunction(load, - "glCopyTexSubImage3D"u8); + "glCopyTexSubImage3D"u8); contextPtr->glDrawRangeElements = LoadGLFunction(load, - "glDrawRangeElements"u8); + "glDrawRangeElements"u8); contextPtr->glTexImage3D = LoadGLFunction(load, - "glTexImage3D"u8); + "glTexImage3D"u8); contextPtr->glTexSubImage3D = LoadGLFunction(load, "glTexSubImage3D"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.2 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore13( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core13) - { - DefaultLog.InternalAppendLog("The core version 1.3 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.2 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore13( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core13) + { + DefaultLog.InternalAppendLog("The core version 1.3 is not supported."); + return false; } #region load - contextPtr->glActiveTexture = LoadGLFunction(load, "glActiveTexture"u8); + contextPtr->glActiveTexture = LoadGLFunction(load, "glActiveTexture"u8); contextPtr->glCompressedTexImage1D = LoadGLFunction(load, - "glCompressedTexImage1D"u8); + "glCompressedTexImage1D"u8); contextPtr->glCompressedTexImage2D = LoadGLFunction(load, - "glCompressedTexImage2D"u8); + "glCompressedTexImage2D"u8); contextPtr->glCompressedTexImage3D = LoadGLFunction(load, - "glCompressedTexImage3D"u8); + "glCompressedTexImage3D"u8); contextPtr->glCompressedTexSubImage1D = LoadGLFunction(load, - "glCompressedTexSubImage1D"u8); + "glCompressedTexSubImage1D"u8); contextPtr->glCompressedTexSubImage2D = LoadGLFunction(load, - "glCompressedTexSubImage2D"u8); + "glCompressedTexSubImage2D"u8); contextPtr->glCompressedTexSubImage3D = LoadGLFunction(load, - "glCompressedTexSubImage3D"u8); + "glCompressedTexSubImage3D"u8); contextPtr->glGetCompressedTexImage = LoadGLFunction(load, - "glGetCompressedTexImage"u8); + "glGetCompressedTexImage"u8); contextPtr->glSampleCoverage = LoadGLFunction(load, "glSampleCoverage"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.3 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore14( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core14) - { - DefaultLog.InternalAppendLog("The core version 1.4 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.3 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore14( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core14) + { + DefaultLog.InternalAppendLog("The core version 1.4 is not supported."); + return false; } #region load contextPtr->glBlendColor = LoadGLFunction(load, - "glBlendColor"u8); - contextPtr->glBlendEquation = LoadGLFunction(load, "glBlendEquation"u8); + "glBlendColor"u8); + contextPtr->glBlendEquation = LoadGLFunction(load, "glBlendEquation"u8); contextPtr->glBlendFuncSeparate = LoadGLFunction(load, - "glBlendFuncSeparate"u8); + "glBlendFuncSeparate"u8); contextPtr->glMultiDrawArrays = LoadGLFunction(load, - "glMultiDrawArrays"u8); + "glMultiDrawArrays"u8); contextPtr->glMultiDrawElements = LoadGLFunction(load, - "glMultiDrawElements"u8); + "glMultiDrawElements"u8); contextPtr->glPointParameterf = LoadGLFunction(load, - "glPointParameterf"u8); + "glPointParameterf"u8); contextPtr->glPointParameterfv = LoadGLFunction(load, - "glPointParameterfv"u8); + "glPointParameterfv"u8); contextPtr->glPointParameteri = LoadGLFunction(load, - "glPointParameteri"u8); + "glPointParameteri"u8); contextPtr->glPointParameteriv = LoadGLFunction(load, "glPointParameteriv"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.4 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore15( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core15) - { - DefaultLog.InternalAppendLog("The core version 1.5 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.4 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore15( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core15) + { + DefaultLog.InternalAppendLog("The core version 1.5 is not supported."); + return false; } #region load - contextPtr->glBeginQuery = LoadGLFunction(load, "glBeginQuery"u8); - contextPtr->glBindBuffer = LoadGLFunction(load, "glBindBuffer"u8); + contextPtr->glBeginQuery = LoadGLFunction(load, "glBeginQuery"u8); + contextPtr->glBindBuffer = LoadGLFunction(load, "glBindBuffer"u8); contextPtr->glBufferData = LoadGLFunction(load, - "glBufferData"u8); + "glBufferData"u8); contextPtr->glBufferSubData = LoadGLFunction(load, - "glBufferSubData"u8); - contextPtr->glDeleteBuffers = LoadGLFunction(load, "glDeleteBuffers"u8); - contextPtr->glDeleteQueries = LoadGLFunction(load, "glDeleteQueries"u8); - contextPtr->glEndQuery = LoadGLFunction(load, "glEndQuery"u8); - contextPtr->glGenBuffers = LoadGLFunction(load, "glGenBuffers"u8); - contextPtr->glGenQueries = LoadGLFunction(load, "glGenQueries"u8); + "glBufferSubData"u8); + contextPtr->glDeleteBuffers = LoadGLFunction(load, "glDeleteBuffers"u8); + contextPtr->glDeleteQueries = LoadGLFunction(load, "glDeleteQueries"u8); + contextPtr->glEndQuery = LoadGLFunction(load, "glEndQuery"u8); + contextPtr->glGenBuffers = LoadGLFunction(load, "glGenBuffers"u8); + contextPtr->glGenQueries = LoadGLFunction(load, "glGenQueries"u8); contextPtr->glGetBufferParameteriv = LoadGLFunction(load, - "glGetBufferParameteriv"u8); + "glGetBufferParameteriv"u8); contextPtr->glGetBufferPointerv = LoadGLFunction(load, - "glGetBufferPointerv"u8); + "glGetBufferPointerv"u8); contextPtr->glGetBufferSubData = LoadGLFunction(load, - "glGetBufferSubData"u8); + "glGetBufferSubData"u8); contextPtr->glGetQueryObjectiv = LoadGLFunction(load, - "glGetQueryObjectiv"u8); + "glGetQueryObjectiv"u8); contextPtr->glGetQueryObjectuiv = LoadGLFunction(load, - "glGetQueryObjectuiv"u8); - contextPtr->glGetQueryiv = LoadGLFunction(load, "glGetQueryiv"u8); - contextPtr->glIsBuffer = LoadGLFunction(load, "glIsBuffer"u8); - contextPtr->glIsQuery = LoadGLFunction(load, "glIsQuery"u8); - contextPtr->glMapBuffer = LoadGLFunction(load, "glMapBuffer"u8); + "glGetQueryObjectuiv"u8); + contextPtr->glGetQueryiv = LoadGLFunction(load, "glGetQueryiv"u8); + contextPtr->glIsBuffer = LoadGLFunction(load, "glIsBuffer"u8); + contextPtr->glIsQuery = LoadGLFunction(load, "glIsQuery"u8); + contextPtr->glMapBuffer = LoadGLFunction(load, "glMapBuffer"u8); contextPtr->glUnmapBuffer = LoadGLFunction(load, "glUnmapBuffer"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 1.5 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore20( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core20) - { - DefaultLog.InternalAppendLog("The core version 2.0 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 1.5 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore20( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core20) + { + DefaultLog.InternalAppendLog("The core version 2.0 is not supported."); + return false; } #region load - contextPtr->glAttachShader = LoadGLFunction(load, "glAttachShader"u8); + contextPtr->glAttachShader = LoadGLFunction(load, "glAttachShader"u8); contextPtr->glBindAttribLocation = LoadGLFunction(load, - "glBindAttribLocation"u8); + "glBindAttribLocation"u8); contextPtr->glBlendEquationSeparate = LoadGLFunction(load, - "glBlendEquationSeparate"u8); - contextPtr->glCompileShader = LoadGLFunction(load, "glCompileShader"u8); - contextPtr->glCreateProgram = LoadGLFunction(load, "glCreateProgram"u8); - contextPtr->glCreateShader = LoadGLFunction(load, "glCreateShader"u8); - contextPtr->glDeleteProgram = LoadGLFunction(load, "glDeleteProgram"u8); - contextPtr->glDeleteShader = LoadGLFunction(load, "glDeleteShader"u8); - contextPtr->glDetachShader = LoadGLFunction(load, "glDetachShader"u8); + "glBlendEquationSeparate"u8); + contextPtr->glCompileShader = LoadGLFunction(load, "glCompileShader"u8); + contextPtr->glCreateProgram = LoadGLFunction(load, "glCreateProgram"u8); + contextPtr->glCreateShader = LoadGLFunction(load, "glCreateShader"u8); + contextPtr->glDeleteProgram = LoadGLFunction(load, "glDeleteProgram"u8); + contextPtr->glDeleteShader = LoadGLFunction(load, "glDeleteShader"u8); + contextPtr->glDetachShader = LoadGLFunction(load, "glDetachShader"u8); contextPtr->glDisableVertexAttribArray = LoadGLFunction(load, - "glDisableVertexAttribArray"u8); - contextPtr->glDrawBuffers = LoadGLFunction(load, "glDrawBuffers"u8); + "glDisableVertexAttribArray"u8); + contextPtr->glDrawBuffers = LoadGLFunction(load, "glDrawBuffers"u8); contextPtr->glEnableVertexAttribArray = LoadGLFunction(load, - "glEnableVertexAttribArray"u8); + "glEnableVertexAttribArray"u8); contextPtr->glGetActiveAttrib = LoadGLFunction(load, - "glGetActiveAttrib"u8); + "glGetActiveAttrib"u8); contextPtr->glGetActiveUniform = LoadGLFunction(load, - "glGetActiveUniform"u8); + "glGetActiveUniform"u8); contextPtr->glGetAttachedShaders = LoadGLFunction(load, - "glGetAttachedShaders"u8); + "glGetAttachedShaders"u8); contextPtr->glGetAttribLocation = LoadGLFunction(load, - "glGetAttribLocation"u8); + "glGetAttribLocation"u8); contextPtr->glGetProgramInfoLog = LoadGLFunction(load, - "glGetProgramInfoLog"u8); + "glGetProgramInfoLog"u8); contextPtr->glGetProgramiv = LoadGLFunction(load, - "glGetProgramiv"u8); + "glGetProgramiv"u8); contextPtr->glGetShaderInfoLog = LoadGLFunction(load, - "glGetShaderInfoLog"u8); + "glGetShaderInfoLog"u8); contextPtr->glGetShaderSource = LoadGLFunction(load, - "glGetShaderSource"u8); - contextPtr->glGetShaderiv = LoadGLFunction(load, "glGetShaderiv"u8); + "glGetShaderSource"u8); + contextPtr->glGetShaderiv = LoadGLFunction(load, "glGetShaderiv"u8); contextPtr->glGetUniformLocation = LoadGLFunction(load, - "glGetUniformLocation"u8); + "glGetUniformLocation"u8); contextPtr->glGetUniformfv = LoadGLFunction(load, - "glGetUniformfv"u8); + "glGetUniformfv"u8); contextPtr->glGetUniformiv = LoadGLFunction(load, - "glGetUniformiv"u8); + "glGetUniformiv"u8); contextPtr->glGetVertexAttribPointerv = LoadGLFunction(load, - "glGetVertexAttribPointerv"u8); + "glGetVertexAttribPointerv"u8); contextPtr->glGetVertexAttribdv = LoadGLFunction(load, - "glGetVertexAttribdv"u8); + "glGetVertexAttribdv"u8); contextPtr->glGetVertexAttribfv = LoadGLFunction(load, - "glGetVertexAttribfv"u8); + "glGetVertexAttribfv"u8); contextPtr->glGetVertexAttribiv = LoadGLFunction(load, - "glGetVertexAttribiv"u8); - contextPtr->glIsProgram = LoadGLFunction(load, "glIsProgram"u8); - contextPtr->glIsShader = LoadGLFunction(load, "glIsShader"u8); - contextPtr->glLinkProgram = LoadGLFunction(load, "glLinkProgram"u8); + "glGetVertexAttribiv"u8); + contextPtr->glIsProgram = LoadGLFunction(load, "glIsProgram"u8); + contextPtr->glIsShader = LoadGLFunction(load, "glIsShader"u8); + contextPtr->glLinkProgram = LoadGLFunction(load, "glLinkProgram"u8); contextPtr->glShaderSource = LoadGLFunction(load, - "glShaderSource"u8); + "glShaderSource"u8); contextPtr->glStencilFuncSeparate = LoadGLFunction(load, - "glStencilFuncSeparate"u8); + "glStencilFuncSeparate"u8); contextPtr->glStencilMaskSeparate = LoadGLFunction(load, - "glStencilMaskSeparate"u8); + "glStencilMaskSeparate"u8); contextPtr->glStencilOpSeparate = LoadGLFunction(load, - "glStencilOpSeparate"u8); - contextPtr->glUniform1f = LoadGLFunction(load, "glUniform1f"u8); - contextPtr->glUniform1fv = LoadGLFunction(load, "glUniform1fv"u8); - contextPtr->glUniform1i = LoadGLFunction(load, "glUniform1i"u8); - contextPtr->glUniform1iv = LoadGLFunction(load, "glUniform1iv"u8); - contextPtr->glUniform2f = LoadGLFunction(load, "glUniform2f"u8); - contextPtr->glUniform2fv = LoadGLFunction(load, "glUniform2fv"u8); - contextPtr->glUniform2i = LoadGLFunction(load, "glUniform2i"u8); - contextPtr->glUniform2iv = LoadGLFunction(load, "glUniform2iv"u8); + "glStencilOpSeparate"u8); + contextPtr->glUniform1f = LoadGLFunction(load, "glUniform1f"u8); + contextPtr->glUniform1fv = LoadGLFunction(load, "glUniform1fv"u8); + contextPtr->glUniform1i = LoadGLFunction(load, "glUniform1i"u8); + contextPtr->glUniform1iv = LoadGLFunction(load, "glUniform1iv"u8); + contextPtr->glUniform2f = LoadGLFunction(load, "glUniform2f"u8); + contextPtr->glUniform2fv = LoadGLFunction(load, "glUniform2fv"u8); + contextPtr->glUniform2i = LoadGLFunction(load, "glUniform2i"u8); + contextPtr->glUniform2iv = LoadGLFunction(load, "glUniform2iv"u8); contextPtr->glUniform3f = LoadGLFunction(load, - "glUniform3f"u8); - contextPtr->glUniform3fv = LoadGLFunction(load, "glUniform3fv"u8); - contextPtr->glUniform3i = LoadGLFunction(load, "glUniform3i"u8); - contextPtr->glUniform3iv = LoadGLFunction(load, "glUniform3iv"u8); + "glUniform3f"u8); + contextPtr->glUniform3fv = LoadGLFunction(load, "glUniform3fv"u8); + contextPtr->glUniform3i = LoadGLFunction(load, "glUniform3i"u8); + contextPtr->glUniform3iv = LoadGLFunction(load, "glUniform3iv"u8); contextPtr->glUniform4f = LoadGLFunction(load, - "glUniform4f"u8); - contextPtr->glUniform4fv = LoadGLFunction(load, "glUniform4fv"u8); + "glUniform4f"u8); + contextPtr->glUniform4fv = LoadGLFunction(load, "glUniform4fv"u8); contextPtr->glUniform4i = LoadGLFunction(load, - "glUniform4i"u8); - contextPtr->glUniform4iv = LoadGLFunction(load, "glUniform4iv"u8); + "glUniform4i"u8); + contextPtr->glUniform4iv = LoadGLFunction(load, "glUniform4iv"u8); contextPtr->glUniformMatrix2fv = LoadGLFunction(load, - "glUniformMatrix2fv"u8); + "glUniformMatrix2fv"u8); contextPtr->glUniformMatrix3fv = LoadGLFunction(load, - "glUniformMatrix3fv"u8); + "glUniformMatrix3fv"u8); contextPtr->glUniformMatrix4fv = LoadGLFunction(load, - "glUniformMatrix4fv"u8); - contextPtr->glUseProgram = LoadGLFunction(load, "glUseProgram"u8); - contextPtr->glValidateProgram = LoadGLFunction(load, "glValidateProgram"u8); + "glUniformMatrix4fv"u8); + contextPtr->glUseProgram = LoadGLFunction(load, "glUseProgram"u8); + contextPtr->glValidateProgram = LoadGLFunction(load, "glValidateProgram"u8); contextPtr->glVertexAttrib1d = LoadGLFunction(load, - "glVertexAttrib1d"u8); + "glVertexAttrib1d"u8); contextPtr->glVertexAttrib1dv = LoadGLFunction(load, - "glVertexAttrib1dv"u8); + "glVertexAttrib1dv"u8); contextPtr->glVertexAttrib1f = LoadGLFunction(load, - "glVertexAttrib1f"u8); + "glVertexAttrib1f"u8); contextPtr->glVertexAttrib1fv = LoadGLFunction(load, - "glVertexAttrib1fv"u8); + "glVertexAttrib1fv"u8); contextPtr->glVertexAttrib1s = LoadGLFunction(load, - "glVertexAttrib1s"u8); + "glVertexAttrib1s"u8); contextPtr->glVertexAttrib1sv = LoadGLFunction(load, - "glVertexAttrib1sv"u8); + "glVertexAttrib1sv"u8); contextPtr->glVertexAttrib2d = LoadGLFunction(load, - "glVertexAttrib2d"u8); + "glVertexAttrib2d"u8); contextPtr->glVertexAttrib2dv = LoadGLFunction(load, - "glVertexAttrib2dv"u8); + "glVertexAttrib2dv"u8); contextPtr->glVertexAttrib2f = LoadGLFunction(load, - "glVertexAttrib2f"u8); + "glVertexAttrib2f"u8); contextPtr->glVertexAttrib2fv = LoadGLFunction(load, - "glVertexAttrib2fv"u8); + "glVertexAttrib2fv"u8); contextPtr->glVertexAttrib2s = LoadGLFunction(load, - "glVertexAttrib2s"u8); + "glVertexAttrib2s"u8); contextPtr->glVertexAttrib2sv = LoadGLFunction(load, - "glVertexAttrib2sv"u8); + "glVertexAttrib2sv"u8); contextPtr->glVertexAttrib3d = LoadGLFunction(load, - "glVertexAttrib3d"u8); + "glVertexAttrib3d"u8); contextPtr->glVertexAttrib3dv = LoadGLFunction(load, - "glVertexAttrib3dv"u8); + "glVertexAttrib3dv"u8); contextPtr->glVertexAttrib3f = LoadGLFunction(load, - "glVertexAttrib3f"u8); + "glVertexAttrib3f"u8); contextPtr->glVertexAttrib3fv = LoadGLFunction(load, - "glVertexAttrib3fv"u8); + "glVertexAttrib3fv"u8); contextPtr->glVertexAttrib3s = LoadGLFunction(load, - "glVertexAttrib3s"u8); + "glVertexAttrib3s"u8); contextPtr->glVertexAttrib3sv = LoadGLFunction(load, - "glVertexAttrib3sv"u8); + "glVertexAttrib3sv"u8); contextPtr->glVertexAttrib4Nbv = LoadGLFunction(load, - "glVertexAttrib4Nbv"u8); + "glVertexAttrib4Nbv"u8); contextPtr->glVertexAttrib4Niv = LoadGLFunction(load, - "glVertexAttrib4Niv"u8); + "glVertexAttrib4Niv"u8); contextPtr->glVertexAttrib4Nsv = LoadGLFunction(load, - "glVertexAttrib4Nsv"u8); + "glVertexAttrib4Nsv"u8); contextPtr->glVertexAttrib4Nub = LoadGLFunction(load, - "glVertexAttrib4Nub"u8); + "glVertexAttrib4Nub"u8); contextPtr->glVertexAttrib4Nubv = LoadGLFunction(load, - "glVertexAttrib4Nubv"u8); + "glVertexAttrib4Nubv"u8); contextPtr->glVertexAttrib4Nuiv = LoadGLFunction(load, - "glVertexAttrib4Nuiv"u8); + "glVertexAttrib4Nuiv"u8); contextPtr->glVertexAttrib4Nusv = LoadGLFunction(load, - "glVertexAttrib4Nusv"u8); + "glVertexAttrib4Nusv"u8); contextPtr->glVertexAttrib4bv = LoadGLFunction(load, - "glVertexAttrib4bv"u8); + "glVertexAttrib4bv"u8); contextPtr->glVertexAttrib4d = LoadGLFunction(load, - "glVertexAttrib4d"u8); + "glVertexAttrib4d"u8); contextPtr->glVertexAttrib4dv = LoadGLFunction(load, - "glVertexAttrib4dv"u8); + "glVertexAttrib4dv"u8); contextPtr->glVertexAttrib4f = LoadGLFunction(load, - "glVertexAttrib4f"u8); + "glVertexAttrib4f"u8); contextPtr->glVertexAttrib4fv = LoadGLFunction(load, - "glVertexAttrib4fv"u8); + "glVertexAttrib4fv"u8); contextPtr->glVertexAttrib4iv = LoadGLFunction(load, - "glVertexAttrib4iv"u8); + "glVertexAttrib4iv"u8); contextPtr->glVertexAttrib4s = LoadGLFunction(load, - "glVertexAttrib4s"u8); + "glVertexAttrib4s"u8); contextPtr->glVertexAttrib4sv = LoadGLFunction(load, - "glVertexAttrib4sv"u8); + "glVertexAttrib4sv"u8); contextPtr->glVertexAttrib4ubv = LoadGLFunction(load, - "glVertexAttrib4ubv"u8); + "glVertexAttrib4ubv"u8); contextPtr->glVertexAttrib4uiv = LoadGLFunction(load, - "glVertexAttrib4uiv"u8); + "glVertexAttrib4uiv"u8); contextPtr->glVertexAttrib4usv = LoadGLFunction(load, - "glVertexAttrib4usv"u8); + "glVertexAttrib4usv"u8); contextPtr->glVertexAttribPointer = LoadGLFunction(load, "glVertexAttribPointer"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 2.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore21( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core21) - { - DefaultLog.InternalAppendLog("The core version 2.1 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 2.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore21( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core21) + { + DefaultLog.InternalAppendLog("The core version 2.1 is not supported."); + return false; } #region load contextPtr->glUniformMatrix2x3fv = LoadGLFunction(load, - "glUniformMatrix2x3fv"u8); + "glUniformMatrix2x3fv"u8); contextPtr->glUniformMatrix2x4fv = LoadGLFunction(load, - "glUniformMatrix2x4fv"u8); + "glUniformMatrix2x4fv"u8); contextPtr->glUniformMatrix3x2fv = LoadGLFunction(load, - "glUniformMatrix3x2fv"u8); + "glUniformMatrix3x2fv"u8); contextPtr->glUniformMatrix3x4fv = LoadGLFunction(load, - "glUniformMatrix3x4fv"u8); + "glUniformMatrix3x4fv"u8); contextPtr->glUniformMatrix4x2fv = LoadGLFunction(load, - "glUniformMatrix4x2fv"u8); + "glUniformMatrix4x2fv"u8); contextPtr->glUniformMatrix4x3fv = LoadGLFunction(load, "glUniformMatrix4x3fv"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 2.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore30( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core30) - { - DefaultLog.InternalAppendLog("The core version 3.0 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 2.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore30( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core30) + { + DefaultLog.InternalAppendLog("The core version 3.0 is not supported."); + return false; } #region load contextPtr->glBeginConditionalRender = LoadGLFunction(load, - "glBeginConditionalRender"u8); + "glBeginConditionalRender"u8); contextPtr->glBeginTransformFeedback = LoadGLFunction(load, - "glBeginTransformFeedback"u8); + "glBeginTransformFeedback"u8); contextPtr->glBindBufferBase = LoadGLFunction(load, - "glBindBufferBase"u8); + "glBindBufferBase"u8); contextPtr->glBindBufferRange = LoadGLFunction(load, - "glBindBufferRange"u8); + "glBindBufferRange"u8); contextPtr->glBindFragDataLocation = LoadGLFunction(load, - "glBindFragDataLocation"u8); + "glBindFragDataLocation"u8); contextPtr->glBindFramebuffer = LoadGLFunction(load, - "glBindFramebuffer"u8); + "glBindFramebuffer"u8); contextPtr->glBindRenderbuffer = LoadGLFunction(load, - "glBindRenderbuffer"u8); - contextPtr->glBindVertexArray = LoadGLFunction(load, "glBindVertexArray"u8); + "glBindRenderbuffer"u8); + contextPtr->glBindVertexArray = LoadGLFunction(load, "glBindVertexArray"u8); contextPtr->glBlitFramebuffer = LoadGLFunction(load, - "glBlitFramebuffer"u8); + "glBlitFramebuffer"u8); contextPtr->glCheckFramebufferStatus = LoadGLFunction(load, - "glCheckFramebufferStatus"u8); - contextPtr->glClampColor = LoadGLFunction(load, "glClampColor"u8); + "glCheckFramebufferStatus"u8); + contextPtr->glClampColor = LoadGLFunction(load, "glClampColor"u8); contextPtr->glClearBufferfi = LoadGLFunction(load, - "glClearBufferfi"u8); + "glClearBufferfi"u8); contextPtr->glClearBufferfv = LoadGLFunction(load, - "glClearBufferfv"u8); + "glClearBufferfv"u8); contextPtr->glClearBufferiv = LoadGLFunction(load, - "glClearBufferiv"u8); + "glClearBufferiv"u8); contextPtr->glClearBufferuiv = LoadGLFunction(load, - "glClearBufferuiv"u8); + "glClearBufferuiv"u8); contextPtr->glColorMaski = LoadGLFunction(load, - "glColorMaski"u8); + "glColorMaski"u8); contextPtr->glDeleteFramebuffers = LoadGLFunction(load, - "glDeleteFramebuffers"u8); + "glDeleteFramebuffers"u8); contextPtr->glDeleteRenderbuffers = LoadGLFunction(load, - "glDeleteRenderbuffers"u8); + "glDeleteRenderbuffers"u8); contextPtr->glDeleteVertexArrays = LoadGLFunction(load, - "glDeleteVertexArrays"u8); - contextPtr->glDisablei = LoadGLFunction(load, "glDisablei"u8); - contextPtr->glEnablei = LoadGLFunction(load, "glEnablei"u8); - contextPtr->glEndConditionalRender = LoadGLFunction(load, "glEndConditionalRender"u8); - contextPtr->glEndTransformFeedback = LoadGLFunction(load, "glEndTransformFeedback"u8); + "glDeleteVertexArrays"u8); + contextPtr->glDisablei = LoadGLFunction(load, "glDisablei"u8); + contextPtr->glEnablei = LoadGLFunction(load, "glEnablei"u8); + contextPtr->glEndConditionalRender = LoadGLFunction(load, "glEndConditionalRender"u8); + contextPtr->glEndTransformFeedback = LoadGLFunction(load, "glEndTransformFeedback"u8); contextPtr->glFlushMappedBufferRange = LoadGLFunction(load, - "glFlushMappedBufferRange"u8); + "glFlushMappedBufferRange"u8); contextPtr->glFramebufferRenderbuffer = LoadGLFunction(load, - "glFramebufferRenderbuffer"u8); + "glFramebufferRenderbuffer"u8); contextPtr->glFramebufferTexture1D = LoadGLFunction(load, - "glFramebufferTexture1D"u8); + "glFramebufferTexture1D"u8); contextPtr->glFramebufferTexture2D = LoadGLFunction(load, - "glFramebufferTexture2D"u8); + "glFramebufferTexture2D"u8); contextPtr->glFramebufferTexture3D = LoadGLFunction(load, - "glFramebufferTexture3D"u8); + "glFramebufferTexture3D"u8); contextPtr->glFramebufferTextureLayer = LoadGLFunction(load, - "glFramebufferTextureLayer"u8); + "glFramebufferTextureLayer"u8); contextPtr->glGenFramebuffers = LoadGLFunction(load, - "glGenFramebuffers"u8); + "glGenFramebuffers"u8); contextPtr->glGenRenderbuffers = LoadGLFunction(load, - "glGenRenderbuffers"u8); + "glGenRenderbuffers"u8); contextPtr->glGenVertexArrays = LoadGLFunction(load, - "glGenVertexArrays"u8); - contextPtr->glGenerateMipmap = LoadGLFunction(load, "glGenerateMipmap"u8); + "glGenVertexArrays"u8); + contextPtr->glGenerateMipmap = LoadGLFunction(load, "glGenerateMipmap"u8); contextPtr->glGetBooleani_v = LoadGLFunction(load, - "glGetBooleani_v"u8); + "glGetBooleani_v"u8); contextPtr->glGetFragDataLocation = LoadGLFunction(load, - "glGetFragDataLocation"u8); + "glGetFragDataLocation"u8); contextPtr->glGetFramebufferAttachmentParameteriv = LoadGLFunction(load, - "glGetFramebufferAttachmentParameteriv"u8); + "glGetFramebufferAttachmentParameteriv"u8); contextPtr->glGetIntegeri_v = LoadGLFunction(load, - "glGetIntegeri_v"u8); + "glGetIntegeri_v"u8); contextPtr->glGetRenderbufferParameteriv = LoadGLFunction(load, - "glGetRenderbufferParameteriv"u8); - contextPtr->glGetStringi = LoadGLFunction(load, "glGetStringi"u8); + "glGetRenderbufferParameteriv"u8); + contextPtr->glGetStringi = LoadGLFunction(load, "glGetStringi"u8); contextPtr->glGetTexParameterIiv = LoadGLFunction(load, - "glGetTexParameterIiv"u8); + "glGetTexParameterIiv"u8); contextPtr->glGetTexParameterIuiv = LoadGLFunction(load, - "glGetTexParameterIuiv"u8); + "glGetTexParameterIuiv"u8); contextPtr->glGetTransformFeedbackVarying = LoadGLFunction(load, - "glGetTransformFeedbackVarying"u8); + "glGetTransformFeedbackVarying"u8); contextPtr->glGetUniformuiv = LoadGLFunction(load, - "glGetUniformuiv"u8); + "glGetUniformuiv"u8); contextPtr->glGetVertexAttribIiv = LoadGLFunction(load, - "glGetVertexAttribIiv"u8); + "glGetVertexAttribIiv"u8); contextPtr->glGetVertexAttribIuiv = LoadGLFunction(load, - "glGetVertexAttribIuiv"u8); - contextPtr->glIsEnabledi = LoadGLFunction(load, "glIsEnabledi"u8); - contextPtr->glIsFramebuffer = LoadGLFunction(load, "glIsFramebuffer"u8); - contextPtr->glIsRenderbuffer = LoadGLFunction(load, "glIsRenderbuffer"u8); - contextPtr->glIsVertexArray = LoadGLFunction(load, "glIsVertexArray"u8); + "glGetVertexAttribIuiv"u8); + contextPtr->glIsEnabledi = LoadGLFunction(load, "glIsEnabledi"u8); + contextPtr->glIsFramebuffer = LoadGLFunction(load, "glIsFramebuffer"u8); + contextPtr->glIsRenderbuffer = LoadGLFunction(load, "glIsRenderbuffer"u8); + contextPtr->glIsVertexArray = LoadGLFunction(load, "glIsVertexArray"u8); contextPtr->glMapBufferRange = LoadGLFunction(load, - "glMapBufferRange"u8); + "glMapBufferRange"u8); contextPtr->glRenderbufferStorage = LoadGLFunction(load, - "glRenderbufferStorage"u8); + "glRenderbufferStorage"u8); contextPtr->glRenderbufferStorageMultisample = LoadGLFunction(load, - "glRenderbufferStorageMultisample"u8); + "glRenderbufferStorageMultisample"u8); contextPtr->glTexParameterIiv = LoadGLFunction(load, - "glTexParameterIiv"u8); + "glTexParameterIiv"u8); contextPtr->glTexParameterIuiv = LoadGLFunction(load, - "glTexParameterIuiv"u8); + "glTexParameterIuiv"u8); contextPtr->glTransformFeedbackVaryings = LoadGLFunction(load, - "glTransformFeedbackVaryings"u8); - contextPtr->glUniform1ui = LoadGLFunction(load, "glUniform1ui"u8); - contextPtr->glUniform1uiv = LoadGLFunction(load, "glUniform1uiv"u8); - contextPtr->glUniform2ui = LoadGLFunction(load, "glUniform2ui"u8); - contextPtr->glUniform2uiv = LoadGLFunction(load, "glUniform2uiv"u8); + "glTransformFeedbackVaryings"u8); + contextPtr->glUniform1ui = LoadGLFunction(load, "glUniform1ui"u8); + contextPtr->glUniform1uiv = LoadGLFunction(load, "glUniform1uiv"u8); + contextPtr->glUniform2ui = LoadGLFunction(load, "glUniform2ui"u8); + contextPtr->glUniform2uiv = LoadGLFunction(load, "glUniform2uiv"u8); contextPtr->glUniform3ui = LoadGLFunction(load, - "glUniform3ui"u8); - contextPtr->glUniform3uiv = LoadGLFunction(load, "glUniform3uiv"u8); + "glUniform3ui"u8); + contextPtr->glUniform3uiv = LoadGLFunction(load, "glUniform3uiv"u8); contextPtr->glUniform4ui = LoadGLFunction(load, - "glUniform4ui"u8); - contextPtr->glUniform4uiv = LoadGLFunction(load, "glUniform4uiv"u8); + "glUniform4ui"u8); + contextPtr->glUniform4uiv = LoadGLFunction(load, "glUniform4uiv"u8); contextPtr->glVertexAttribI1i = LoadGLFunction(load, - "glVertexAttribI1i"u8); + "glVertexAttribI1i"u8); contextPtr->glVertexAttribI1iv = LoadGLFunction(load, - "glVertexAttribI1iv"u8); + "glVertexAttribI1iv"u8); contextPtr->glVertexAttribI1ui = LoadGLFunction(load, - "glVertexAttribI1ui"u8); + "glVertexAttribI1ui"u8); contextPtr->glVertexAttribI1uiv = LoadGLFunction(load, - "glVertexAttribI1uiv"u8); + "glVertexAttribI1uiv"u8); contextPtr->glVertexAttribI2i = LoadGLFunction(load, - "glVertexAttribI2i"u8); + "glVertexAttribI2i"u8); contextPtr->glVertexAttribI2iv = LoadGLFunction(load, - "glVertexAttribI2iv"u8); + "glVertexAttribI2iv"u8); contextPtr->glVertexAttribI2ui = LoadGLFunction(load, - "glVertexAttribI2ui"u8); + "glVertexAttribI2ui"u8); contextPtr->glVertexAttribI2uiv = LoadGLFunction(load, - "glVertexAttribI2uiv"u8); + "glVertexAttribI2uiv"u8); contextPtr->glVertexAttribI3i = LoadGLFunction(load, - "glVertexAttribI3i"u8); + "glVertexAttribI3i"u8); contextPtr->glVertexAttribI3iv = LoadGLFunction(load, - "glVertexAttribI3iv"u8); + "glVertexAttribI3iv"u8); contextPtr->glVertexAttribI3ui = LoadGLFunction(load, - "glVertexAttribI3ui"u8); + "glVertexAttribI3ui"u8); contextPtr->glVertexAttribI3uiv = LoadGLFunction(load, - "glVertexAttribI3uiv"u8); + "glVertexAttribI3uiv"u8); contextPtr->glVertexAttribI4bv = LoadGLFunction(load, - "glVertexAttribI4bv"u8); + "glVertexAttribI4bv"u8); contextPtr->glVertexAttribI4i = LoadGLFunction(load, - "glVertexAttribI4i"u8); + "glVertexAttribI4i"u8); contextPtr->glVertexAttribI4iv = LoadGLFunction(load, - "glVertexAttribI4iv"u8); + "glVertexAttribI4iv"u8); contextPtr->glVertexAttribI4sv = LoadGLFunction(load, - "glVertexAttribI4sv"u8); + "glVertexAttribI4sv"u8); contextPtr->glVertexAttribI4ubv = LoadGLFunction(load, - "glVertexAttribI4ubv"u8); + "glVertexAttribI4ubv"u8); contextPtr->glVertexAttribI4ui = LoadGLFunction(load, - "glVertexAttribI4ui"u8); + "glVertexAttribI4ui"u8); contextPtr->glVertexAttribI4uiv = LoadGLFunction(load, - "glVertexAttribI4uiv"u8); + "glVertexAttribI4uiv"u8); contextPtr->glVertexAttribI4usv = LoadGLFunction(load, - "glVertexAttribI4usv"u8); + "glVertexAttribI4usv"u8); contextPtr->glVertexAttribIPointer = LoadGLFunction(load, "glVertexAttribIPointer"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore31( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core31) - { - DefaultLog.InternalAppendLog("The core version 3.1 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore31( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core31) + { + DefaultLog.InternalAppendLog("The core version 3.1 is not supported."); + return false; } #region load contextPtr->glBindBufferBase = LoadGLFunction(load, - "glBindBufferBase"u8); + "glBindBufferBase"u8); contextPtr->glBindBufferRange = LoadGLFunction(load, - "glBindBufferRange"u8); + "glBindBufferRange"u8); contextPtr->glCopyBufferSubData = LoadGLFunction(load, - "glCopyBufferSubData"u8); + "glCopyBufferSubData"u8); contextPtr->glDrawArraysInstanced = LoadGLFunction(load, - "glDrawArraysInstanced"u8); + "glDrawArraysInstanced"u8); contextPtr->glDrawElementsInstanced = LoadGLFunction(load, - "glDrawElementsInstanced"u8); + "glDrawElementsInstanced"u8); contextPtr->glGetActiveUniformBlockName = LoadGLFunction(load, - "glGetActiveUniformBlockName"u8); + "glGetActiveUniformBlockName"u8); contextPtr->glGetActiveUniformBlockiv = LoadGLFunction(load, - "glGetActiveUniformBlockiv"u8); + "glGetActiveUniformBlockiv"u8); contextPtr->glGetActiveUniformName = LoadGLFunction(load, - "glGetActiveUniformName"u8); + "glGetActiveUniformName"u8); contextPtr->glGetActiveUniformsiv = LoadGLFunction(load, - "glGetActiveUniformsiv"u8); + "glGetActiveUniformsiv"u8); contextPtr->glGetIntegeri_v = LoadGLFunction(load, - "glGetIntegeri_v"u8); + "glGetIntegeri_v"u8); contextPtr->glGetUniformBlockIndex = LoadGLFunction(load, - "glGetUniformBlockIndex"u8); + "glGetUniformBlockIndex"u8); contextPtr->glGetUniformIndices = LoadGLFunction(load, - "glGetUniformIndices"u8); + "glGetUniformIndices"u8); contextPtr->glPrimitiveRestartIndex = LoadGLFunction(load, - "glPrimitiveRestartIndex"u8); - contextPtr->glTexBuffer = LoadGLFunction(load, "glTexBuffer"u8); + "glPrimitiveRestartIndex"u8); + contextPtr->glTexBuffer = LoadGLFunction(load, "glTexBuffer"u8); contextPtr->glUniformBlockBinding = LoadGLFunction(load, "glUniformBlockBinding"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore32( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core32) - { - DefaultLog.InternalAppendLog("The core version 3.2 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore32( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core32) + { + DefaultLog.InternalAppendLog("The core version 3.2 is not supported."); + return false; } #region load contextPtr->glClientWaitSync = LoadGLFunction(load, - "glClientWaitSync"u8); - contextPtr->glDeleteSync = LoadGLFunction(load, "glDeleteSync"u8); + "glClientWaitSync"u8); + contextPtr->glDeleteSync = LoadGLFunction(load, "glDeleteSync"u8); contextPtr->glDrawElementsBaseVertex = LoadGLFunction(load, - "glDrawElementsBaseVertex"u8); + "glDrawElementsBaseVertex"u8); contextPtr->glDrawElementsInstancedBaseVertex = LoadGLFunction(load, - "glDrawElementsInstancedBaseVertex"u8); + "glDrawElementsInstancedBaseVertex"u8); contextPtr->glDrawRangeElementsBaseVertex = LoadGLFunction(load, - "glDrawRangeElementsBaseVertex"u8); - contextPtr->glFenceSync = LoadGLFunction(load, "glFenceSync"u8); + "glDrawRangeElementsBaseVertex"u8); + contextPtr->glFenceSync = LoadGLFunction(load, "glFenceSync"u8); contextPtr->glFramebufferTexture = LoadGLFunction(load, - "glFramebufferTexture"u8); + "glFramebufferTexture"u8); contextPtr->glGetBufferParameteri64v = LoadGLFunction(load, - "glGetBufferParameteri64v"u8); + "glGetBufferParameteri64v"u8); contextPtr->glGetInteger64i_v = LoadGLFunction(load, - "glGetInteger64i_v"u8); - contextPtr->glGetInteger64v = LoadGLFunction(load, "glGetInteger64v"u8); + "glGetInteger64i_v"u8); + contextPtr->glGetInteger64v = LoadGLFunction(load, "glGetInteger64v"u8); contextPtr->glGetMultisamplefv = LoadGLFunction(load, - "glGetMultisamplefv"u8); + "glGetMultisamplefv"u8); contextPtr->glGetSynciv = LoadGLFunction(load, - "glGetSynciv"u8); - contextPtr->glIsSync = LoadGLFunction(load, "glIsSync"u8); + "glGetSynciv"u8); + contextPtr->glIsSync = LoadGLFunction(load, "glIsSync"u8); contextPtr->glMultiDrawElementsBaseVertex = LoadGLFunction(load, - "glMultiDrawElementsBaseVertex"u8); - contextPtr->glProvokingVertex = LoadGLFunction(load, "glProvokingVertex"u8); - contextPtr->glSampleMaski = LoadGLFunction(load, "glSampleMaski"u8); + "glMultiDrawElementsBaseVertex"u8); + contextPtr->glProvokingVertex = LoadGLFunction(load, "glProvokingVertex"u8); + contextPtr->glSampleMaski = LoadGLFunction(load, "glSampleMaski"u8); contextPtr->glTexImage2DMultisample = LoadGLFunction(load, - "glTexImage2DMultisample"u8); + "glTexImage2DMultisample"u8); contextPtr->glTexImage3DMultisample = LoadGLFunction(load, - "glTexImage3DMultisample"u8); + "glTexImage3DMultisample"u8); contextPtr->glWaitSync = LoadGLFunction(load, "glWaitSync"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.2 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore33( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core33) - { - DefaultLog.InternalAppendLog("The core version 3.3 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.2 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore33( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core33) + { + DefaultLog.InternalAppendLog("The core version 3.3 is not supported."); + return false; } #region load contextPtr->glBindFragDataLocationIndexed = LoadGLFunction(load, - "glBindFragDataLocationIndexed"u8); - contextPtr->glBindSampler = LoadGLFunction(load, "glBindSampler"u8); + "glBindFragDataLocationIndexed"u8); + contextPtr->glBindSampler = LoadGLFunction(load, "glBindSampler"u8); contextPtr->glDeleteSamplers = LoadGLFunction(load, - "glDeleteSamplers"u8); - contextPtr->glGenSamplers = LoadGLFunction(load, "glGenSamplers"u8); + "glDeleteSamplers"u8); + contextPtr->glGenSamplers = LoadGLFunction(load, "glGenSamplers"u8); contextPtr->glGetFragDataIndex = LoadGLFunction(load, - "glGetFragDataIndex"u8); + "glGetFragDataIndex"u8); contextPtr->glGetQueryObjecti64v = LoadGLFunction(load, - "glGetQueryObjecti64v"u8); + "glGetQueryObjecti64v"u8); contextPtr->glGetQueryObjectui64v = LoadGLFunction(load, - "glGetQueryObjectui64v"u8); + "glGetQueryObjectui64v"u8); contextPtr->glGetSamplerParameterIiv = LoadGLFunction(load, - "glGetSamplerParameterIiv"u8); + "glGetSamplerParameterIiv"u8); contextPtr->glGetSamplerParameterIuiv = LoadGLFunction(load, - "glGetSamplerParameterIuiv"u8); + "glGetSamplerParameterIuiv"u8); contextPtr->glGetSamplerParameterfv = LoadGLFunction(load, - "glGetSamplerParameterfv"u8); + "glGetSamplerParameterfv"u8); contextPtr->glGetSamplerParameteriv = LoadGLFunction(load, - "glGetSamplerParameteriv"u8); - contextPtr->glIsSampler = LoadGLFunction(load, "glIsSampler"u8); - contextPtr->glQueryCounter = LoadGLFunction(load, "glQueryCounter"u8); + "glGetSamplerParameteriv"u8); + contextPtr->glIsSampler = LoadGLFunction(load, "glIsSampler"u8); + contextPtr->glQueryCounter = LoadGLFunction(load, "glQueryCounter"u8); contextPtr->glSamplerParameterIiv = LoadGLFunction(load, - "glSamplerParameterIiv"u8); + "glSamplerParameterIiv"u8); contextPtr->glSamplerParameterIuiv = LoadGLFunction(load, - "glSamplerParameterIuiv"u8); + "glSamplerParameterIuiv"u8); contextPtr->glSamplerParameterf = LoadGLFunction(load, - "glSamplerParameterf"u8); + "glSamplerParameterf"u8); contextPtr->glSamplerParameterfv = LoadGLFunction(load, - "glSamplerParameterfv"u8); + "glSamplerParameterfv"u8); contextPtr->glSamplerParameteri = LoadGLFunction(load, - "glSamplerParameteri"u8); + "glSamplerParameteri"u8); contextPtr->glSamplerParameteriv = LoadGLFunction(load, - "glSamplerParameteriv"u8); + "glSamplerParameteriv"u8); contextPtr->glVertexAttribDivisor = LoadGLFunction(load, - "glVertexAttribDivisor"u8); + "glVertexAttribDivisor"u8); contextPtr->glVertexAttribP1ui = LoadGLFunction(load, - "glVertexAttribP1ui"u8); + "glVertexAttribP1ui"u8); contextPtr->glVertexAttribP1uiv = LoadGLFunction(load, - "glVertexAttribP1uiv"u8); + "glVertexAttribP1uiv"u8); contextPtr->glVertexAttribP2ui = LoadGLFunction(load, - "glVertexAttribP2ui"u8); + "glVertexAttribP2ui"u8); contextPtr->glVertexAttribP2uiv = LoadGLFunction(load, - "glVertexAttribP2uiv"u8); + "glVertexAttribP2uiv"u8); contextPtr->glVertexAttribP3ui = LoadGLFunction(load, - "glVertexAttribP3ui"u8); + "glVertexAttribP3ui"u8); contextPtr->glVertexAttribP3uiv = LoadGLFunction(load, - "glVertexAttribP3uiv"u8); + "glVertexAttribP3uiv"u8); contextPtr->glVertexAttribP4ui = LoadGLFunction(load, - "glVertexAttribP4ui"u8); + "glVertexAttribP4ui"u8); contextPtr->glVertexAttribP4uiv = LoadGLFunction(load, "glVertexAttribP4uiv"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 3.3 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore40( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core40) - { - DefaultLog.InternalAppendLog("The core version 4.0 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 3.3 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore40( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core40) + { + DefaultLog.InternalAppendLog("The core version 4.0 is not supported."); + return false; } #region load contextPtr->glBeginQueryIndexed = LoadGLFunction(load, - "glBeginQueryIndexed"u8); + "glBeginQueryIndexed"u8); contextPtr->glBindTransformFeedback = LoadGLFunction(load, - "glBindTransformFeedback"u8); + "glBindTransformFeedback"u8); contextPtr->glBlendEquationSeparatei = LoadGLFunction(load, - "glBlendEquationSeparatei"u8); - contextPtr->glBlendEquationi = LoadGLFunction(load, "glBlendEquationi"u8); + "glBlendEquationSeparatei"u8); + contextPtr->glBlendEquationi = LoadGLFunction(load, "glBlendEquationi"u8); contextPtr->glBlendFuncSeparatei = LoadGLFunction(load, - "glBlendFuncSeparatei"u8); - contextPtr->glBlendFunci = LoadGLFunction(load, "glBlendFunci"u8); + "glBlendFuncSeparatei"u8); + contextPtr->glBlendFunci = LoadGLFunction(load, "glBlendFunci"u8); contextPtr->glDeleteTransformFeedbacks = LoadGLFunction(load, - "glDeleteTransformFeedbacks"u8); + "glDeleteTransformFeedbacks"u8); contextPtr->glDrawArraysIndirect = LoadGLFunction(load, - "glDrawArraysIndirect"u8); + "glDrawArraysIndirect"u8); contextPtr->glDrawElementsIndirect = LoadGLFunction(load, - "glDrawElementsIndirect"u8); + "glDrawElementsIndirect"u8); contextPtr->glDrawTransformFeedback = LoadGLFunction(load, - "glDrawTransformFeedback"u8); + "glDrawTransformFeedback"u8); contextPtr->glDrawTransformFeedbackStream = LoadGLFunction(load, - "glDrawTransformFeedbackStream"u8); + "glDrawTransformFeedbackStream"u8); contextPtr->glEndQueryIndexed = LoadGLFunction(load, - "glEndQueryIndexed"u8); + "glEndQueryIndexed"u8); contextPtr->glGenTransformFeedbacks = LoadGLFunction(load, - "glGenTransformFeedbacks"u8); + "glGenTransformFeedbacks"u8); contextPtr->glGetActiveSubroutineName = LoadGLFunction(load, - "glGetActiveSubroutineName"u8); + "glGetActiveSubroutineName"u8); contextPtr->glGetActiveSubroutineUniformName = LoadGLFunction(load, - "glGetActiveSubroutineUniformName"u8); + "glGetActiveSubroutineUniformName"u8); contextPtr->glGetActiveSubroutineUniformiv = LoadGLFunction(load, - "glGetActiveSubroutineUniformiv"u8); + "glGetActiveSubroutineUniformiv"u8); contextPtr->glGetProgramStageiv = LoadGLFunction(load, - "glGetProgramStageiv"u8); + "glGetProgramStageiv"u8); contextPtr->glGetQueryIndexediv = LoadGLFunction(load, - "glGetQueryIndexediv"u8); + "glGetQueryIndexediv"u8); contextPtr->glGetSubroutineIndex = LoadGLFunction(load, - "glGetSubroutineIndex"u8); + "glGetSubroutineIndex"u8); contextPtr->glGetSubroutineUniformLocation = LoadGLFunction(load, - "glGetSubroutineUniformLocation"u8); + "glGetSubroutineUniformLocation"u8); contextPtr->glGetUniformSubroutineuiv = LoadGLFunction(load, - "glGetUniformSubroutineuiv"u8); + "glGetUniformSubroutineuiv"u8); contextPtr->glGetUniformdv = LoadGLFunction(load, - "glGetUniformdv"u8); + "glGetUniformdv"u8); contextPtr->glIsTransformFeedback = LoadGLFunction(load, - "glIsTransformFeedback"u8); - contextPtr->glMinSampleShading = LoadGLFunction(load, "glMinSampleShading"u8); + "glIsTransformFeedback"u8); + contextPtr->glMinSampleShading = LoadGLFunction(load, "glMinSampleShading"u8); contextPtr->glPatchParameterfv = LoadGLFunction(load, - "glPatchParameterfv"u8); + "glPatchParameterfv"u8); contextPtr->glPatchParameteri = LoadGLFunction(load, - "glPatchParameteri"u8); + "glPatchParameteri"u8); contextPtr->glPauseTransformFeedback = LoadGLFunction(load, - "glPauseTransformFeedback"u8); + "glPauseTransformFeedback"u8); contextPtr->glResumeTransformFeedback = LoadGLFunction(load, - "glResumeTransformFeedback"u8); - contextPtr->glUniform1d = LoadGLFunction(load, "glUniform1d"u8); - contextPtr->glUniform1dv = LoadGLFunction(load, "glUniform1dv"u8); - contextPtr->glUniform2d = LoadGLFunction(load, "glUniform2d"u8); - contextPtr->glUniform2dv = LoadGLFunction(load, "glUniform2dv"u8); + "glResumeTransformFeedback"u8); + contextPtr->glUniform1d = LoadGLFunction(load, "glUniform1d"u8); + contextPtr->glUniform1dv = LoadGLFunction(load, "glUniform1dv"u8); + contextPtr->glUniform2d = LoadGLFunction(load, "glUniform2d"u8); + contextPtr->glUniform2dv = LoadGLFunction(load, "glUniform2dv"u8); contextPtr->glUniform3d = LoadGLFunction(load, - "glUniform3d"u8); - contextPtr->glUniform3dv = LoadGLFunction(load, "glUniform3dv"u8); + "glUniform3d"u8); + contextPtr->glUniform3dv = LoadGLFunction(load, "glUniform3dv"u8); contextPtr->glUniform4d = LoadGLFunction(load, - "glUniform4d"u8); - contextPtr->glUniform4dv = LoadGLFunction(load, "glUniform4dv"u8); + "glUniform4d"u8); + contextPtr->glUniform4dv = LoadGLFunction(load, "glUniform4dv"u8); contextPtr->glUniformMatrix2dv = LoadGLFunction(load, - "glUniformMatrix2dv"u8); + "glUniformMatrix2dv"u8); contextPtr->glUniformMatrix2x3dv = LoadGLFunction(load, - "glUniformMatrix2x3dv"u8); + "glUniformMatrix2x3dv"u8); contextPtr->glUniformMatrix2x4dv = LoadGLFunction(load, - "glUniformMatrix2x4dv"u8); + "glUniformMatrix2x4dv"u8); contextPtr->glUniformMatrix3dv = LoadGLFunction(load, - "glUniformMatrix3dv"u8); + "glUniformMatrix3dv"u8); contextPtr->glUniformMatrix3x2dv = LoadGLFunction(load, - "glUniformMatrix3x2dv"u8); + "glUniformMatrix3x2dv"u8); contextPtr->glUniformMatrix3x4dv = LoadGLFunction(load, - "glUniformMatrix3x4dv"u8); + "glUniformMatrix3x4dv"u8); contextPtr->glUniformMatrix4dv = LoadGLFunction(load, - "glUniformMatrix4dv"u8); + "glUniformMatrix4dv"u8); contextPtr->glUniformMatrix4x2dv = LoadGLFunction(load, - "glUniformMatrix4x2dv"u8); + "glUniformMatrix4x2dv"u8); contextPtr->glUniformMatrix4x3dv = LoadGLFunction(load, - "glUniformMatrix4x3dv"u8); + "glUniformMatrix4x3dv"u8); contextPtr->glUniformSubroutinesuiv = LoadGLFunction(load, "glUniformSubroutinesuiv"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.0 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore41( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core41) - { - DefaultLog.InternalAppendLog("The core version 4.1 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.0 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore41( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core41) + { + DefaultLog.InternalAppendLog("The core version 4.1 is not supported."); + return false; } #region load contextPtr->glActiveShaderProgram = LoadGLFunction(load, - "glActiveShaderProgram"u8); + "glActiveShaderProgram"u8); contextPtr->glBindProgramPipeline = LoadGLFunction(load, - "glBindProgramPipeline"u8); - contextPtr->glClearDepthf = LoadGLFunction(load, "glClearDepthf"u8); + "glBindProgramPipeline"u8); + contextPtr->glClearDepthf = LoadGLFunction(load, "glClearDepthf"u8); contextPtr->glCreateShaderProgramv = LoadGLFunction(load, - "glCreateShaderProgramv"u8); + "glCreateShaderProgramv"u8); contextPtr->glDeleteProgramPipelines = LoadGLFunction(load, - "glDeleteProgramPipelines"u8); + "glDeleteProgramPipelines"u8); contextPtr->glDepthRangeArrayv = LoadGLFunction(load, - "glDepthRangeArrayv"u8); + "glDepthRangeArrayv"u8); contextPtr->glDepthRangeIndexed = LoadGLFunction(load, - "glDepthRangeIndexed"u8); - contextPtr->glDepthRangef = LoadGLFunction(load, "glDepthRangef"u8); + "glDepthRangeIndexed"u8); + contextPtr->glDepthRangef = LoadGLFunction(load, "glDepthRangef"u8); contextPtr->glGenProgramPipelines = LoadGLFunction(load, - "glGenProgramPipelines"u8); + "glGenProgramPipelines"u8); contextPtr->glGetDoublei_v = LoadGLFunction(load, - "glGetDoublei_v"u8); + "glGetDoublei_v"u8); contextPtr->glGetFloati_v = LoadGLFunction(load, - "glGetFloati_v"u8); + "glGetFloati_v"u8); contextPtr->glGetProgramBinary = LoadGLFunction(load, - "glGetProgramBinary"u8); + "glGetProgramBinary"u8); contextPtr->glGetProgramPipelineInfoLog = LoadGLFunction(load, - "glGetProgramPipelineInfoLog"u8); + "glGetProgramPipelineInfoLog"u8); contextPtr->glGetProgramPipelineiv = LoadGLFunction(load, - "glGetProgramPipelineiv"u8); + "glGetProgramPipelineiv"u8); contextPtr->glGetShaderPrecisionFormat = LoadGLFunction(load, - "glGetShaderPrecisionFormat"u8); + "glGetShaderPrecisionFormat"u8); contextPtr->glGetVertexAttribLdv = LoadGLFunction(load, - "glGetVertexAttribLdv"u8); - contextPtr->glIsProgramPipeline = LoadGLFunction(load, "glIsProgramPipeline"u8); + "glGetVertexAttribLdv"u8); + contextPtr->glIsProgramPipeline = LoadGLFunction(load, "glIsProgramPipeline"u8); contextPtr->glProgramBinary = LoadGLFunction(load, - "glProgramBinary"u8); + "glProgramBinary"u8); contextPtr->glProgramParameteri = LoadGLFunction(load, - "glProgramParameteri"u8); + "glProgramParameteri"u8); contextPtr->glProgramUniform1d = LoadGLFunction(load, - "glProgramUniform1d"u8); + "glProgramUniform1d"u8); contextPtr->glProgramUniform1dv = LoadGLFunction(load, - "glProgramUniform1dv"u8); + "glProgramUniform1dv"u8); contextPtr->glProgramUniform1f = LoadGLFunction(load, - "glProgramUniform1f"u8); + "glProgramUniform1f"u8); contextPtr->glProgramUniform1fv = LoadGLFunction(load, - "glProgramUniform1fv"u8); + "glProgramUniform1fv"u8); contextPtr->glProgramUniform1i = LoadGLFunction(load, - "glProgramUniform1i"u8); + "glProgramUniform1i"u8); contextPtr->glProgramUniform1iv = LoadGLFunction(load, - "glProgramUniform1iv"u8); + "glProgramUniform1iv"u8); contextPtr->glProgramUniform1ui = LoadGLFunction(load, - "glProgramUniform1ui"u8); + "glProgramUniform1ui"u8); contextPtr->glProgramUniform1uiv = LoadGLFunction(load, - "glProgramUniform1uiv"u8); + "glProgramUniform1uiv"u8); contextPtr->glProgramUniform2d = LoadGLFunction(load, - "glProgramUniform2d"u8); + "glProgramUniform2d"u8); contextPtr->glProgramUniform2dv = LoadGLFunction(load, - "glProgramUniform2dv"u8); + "glProgramUniform2dv"u8); contextPtr->glProgramUniform2f = LoadGLFunction(load, - "glProgramUniform2f"u8); + "glProgramUniform2f"u8); contextPtr->glProgramUniform2fv = LoadGLFunction(load, - "glProgramUniform2fv"u8); + "glProgramUniform2fv"u8); contextPtr->glProgramUniform2i = LoadGLFunction(load, - "glProgramUniform2i"u8); + "glProgramUniform2i"u8); contextPtr->glProgramUniform2iv = LoadGLFunction(load, - "glProgramUniform2iv"u8); + "glProgramUniform2iv"u8); contextPtr->glProgramUniform2ui = LoadGLFunction(load, - "glProgramUniform2ui"u8); + "glProgramUniform2ui"u8); contextPtr->glProgramUniform2uiv = LoadGLFunction(load, - "glProgramUniform2uiv"u8); + "glProgramUniform2uiv"u8); contextPtr->glProgramUniform3d = LoadGLFunction(load, - "glProgramUniform3d"u8); + "glProgramUniform3d"u8); contextPtr->glProgramUniform3dv = LoadGLFunction(load, - "glProgramUniform3dv"u8); + "glProgramUniform3dv"u8); contextPtr->glProgramUniform3f = LoadGLFunction(load, - "glProgramUniform3f"u8); + "glProgramUniform3f"u8); contextPtr->glProgramUniform3fv = LoadGLFunction(load, - "glProgramUniform3fv"u8); + "glProgramUniform3fv"u8); contextPtr->glProgramUniform3i = LoadGLFunction(load, - "glProgramUniform3i"u8); + "glProgramUniform3i"u8); contextPtr->glProgramUniform3iv = LoadGLFunction(load, - "glProgramUniform3iv"u8); + "glProgramUniform3iv"u8); contextPtr->glProgramUniform3ui = LoadGLFunction(load, - "glProgramUniform3ui"u8); + "glProgramUniform3ui"u8); contextPtr->glProgramUniform3uiv = LoadGLFunction(load, - "glProgramUniform3uiv"u8); + "glProgramUniform3uiv"u8); contextPtr->glProgramUniform4d = LoadGLFunction(load, - "glProgramUniform4d"u8); + "glProgramUniform4d"u8); contextPtr->glProgramUniform4dv = LoadGLFunction(load, - "glProgramUniform4dv"u8); + "glProgramUniform4dv"u8); contextPtr->glProgramUniform4f = LoadGLFunction(load, - "glProgramUniform4f"u8); + "glProgramUniform4f"u8); contextPtr->glProgramUniform4fv = LoadGLFunction(load, - "glProgramUniform4fv"u8); + "glProgramUniform4fv"u8); contextPtr->glProgramUniform4i = LoadGLFunction(load, - "glProgramUniform4i"u8); + "glProgramUniform4i"u8); contextPtr->glProgramUniform4iv = LoadGLFunction(load, - "glProgramUniform4iv"u8); + "glProgramUniform4iv"u8); contextPtr->glProgramUniform4ui = LoadGLFunction(load, - "glProgramUniform4ui"u8); + "glProgramUniform4ui"u8); contextPtr->glProgramUniform4uiv = LoadGLFunction(load, - "glProgramUniform4uiv"u8); + "glProgramUniform4uiv"u8); contextPtr->glProgramUniformMatrix2dv = LoadGLFunction(load, - "glProgramUniformMatrix2dv"u8); + "glProgramUniformMatrix2dv"u8); contextPtr->glProgramUniformMatrix2fv = LoadGLFunction(load, - "glProgramUniformMatrix2fv"u8); + "glProgramUniformMatrix2fv"u8); contextPtr->glProgramUniformMatrix2x3dv = LoadGLFunction(load, - "glProgramUniformMatrix2x3dv"u8); + "glProgramUniformMatrix2x3dv"u8); contextPtr->glProgramUniformMatrix2x3fv = LoadGLFunction(load, - "glProgramUniformMatrix2x3fv"u8); + "glProgramUniformMatrix2x3fv"u8); contextPtr->glProgramUniformMatrix2x4dv = LoadGLFunction(load, - "glProgramUniformMatrix2x4dv"u8); + "glProgramUniformMatrix2x4dv"u8); contextPtr->glProgramUniformMatrix2x4fv = LoadGLFunction(load, - "glProgramUniformMatrix2x4fv"u8); + "glProgramUniformMatrix2x4fv"u8); contextPtr->glProgramUniformMatrix3dv = LoadGLFunction(load, - "glProgramUniformMatrix3dv"u8); + "glProgramUniformMatrix3dv"u8); contextPtr->glProgramUniformMatrix3fv = LoadGLFunction(load, - "glProgramUniformMatrix3fv"u8); + "glProgramUniformMatrix3fv"u8); contextPtr->glProgramUniformMatrix3x2dv = LoadGLFunction(load, - "glProgramUniformMatrix3x2dv"u8); + "glProgramUniformMatrix3x2dv"u8); contextPtr->glProgramUniformMatrix3x2fv = LoadGLFunction(load, - "glProgramUniformMatrix3x2fv"u8); + "glProgramUniformMatrix3x2fv"u8); contextPtr->glProgramUniformMatrix3x4dv = LoadGLFunction(load, - "glProgramUniformMatrix3x4dv"u8); + "glProgramUniformMatrix3x4dv"u8); contextPtr->glProgramUniformMatrix3x4fv = LoadGLFunction(load, - "glProgramUniformMatrix3x4fv"u8); + "glProgramUniformMatrix3x4fv"u8); contextPtr->glProgramUniformMatrix4dv = LoadGLFunction(load, - "glProgramUniformMatrix4dv"u8); + "glProgramUniformMatrix4dv"u8); contextPtr->glProgramUniformMatrix4fv = LoadGLFunction(load, - "glProgramUniformMatrix4fv"u8); + "glProgramUniformMatrix4fv"u8); contextPtr->glProgramUniformMatrix4x2dv = LoadGLFunction(load, - "glProgramUniformMatrix4x2dv"u8); + "glProgramUniformMatrix4x2dv"u8); contextPtr->glProgramUniformMatrix4x2fv = LoadGLFunction(load, - "glProgramUniformMatrix4x2fv"u8); + "glProgramUniformMatrix4x2fv"u8); contextPtr->glProgramUniformMatrix4x3dv = LoadGLFunction(load, - "glProgramUniformMatrix4x3dv"u8); + "glProgramUniformMatrix4x3dv"u8); contextPtr->glProgramUniformMatrix4x3fv = LoadGLFunction(load, - "glProgramUniformMatrix4x3fv"u8); + "glProgramUniformMatrix4x3fv"u8); contextPtr->glReleaseShaderCompiler = LoadGLFunction(load, - "glReleaseShaderCompiler"u8); + "glReleaseShaderCompiler"u8); contextPtr->glScissorArrayv = LoadGLFunction(load, - "glScissorArrayv"u8); + "glScissorArrayv"u8); contextPtr->glScissorIndexed = LoadGLFunction(load, - "glScissorIndexed"u8); + "glScissorIndexed"u8); contextPtr->glScissorIndexedv = LoadGLFunction(load, - "glScissorIndexedv"u8); + "glScissorIndexedv"u8); contextPtr->glShaderBinary = LoadGLFunction(load, - "glShaderBinary"u8); + "glShaderBinary"u8); contextPtr->glUseProgramStages = LoadGLFunction(load, - "glUseProgramStages"u8); + "glUseProgramStages"u8); contextPtr->glValidateProgramPipeline = LoadGLFunction(load, - "glValidateProgramPipeline"u8); + "glValidateProgramPipeline"u8); contextPtr->glVertexAttribL1d = LoadGLFunction(load, - "glVertexAttribL1d"u8); + "glVertexAttribL1d"u8); contextPtr->glVertexAttribL1dv = LoadGLFunction(load, - "glVertexAttribL1dv"u8); + "glVertexAttribL1dv"u8); contextPtr->glVertexAttribL2d = LoadGLFunction(load, - "glVertexAttribL2d"u8); + "glVertexAttribL2d"u8); contextPtr->glVertexAttribL2dv = LoadGLFunction(load, - "glVertexAttribL2dv"u8); + "glVertexAttribL2dv"u8); contextPtr->glVertexAttribL3d = LoadGLFunction(load, - "glVertexAttribL3d"u8); + "glVertexAttribL3d"u8); contextPtr->glVertexAttribL3dv = LoadGLFunction(load, - "glVertexAttribL3dv"u8); + "glVertexAttribL3dv"u8); contextPtr->glVertexAttribL4d = LoadGLFunction(load, - "glVertexAttribL4d"u8); + "glVertexAttribL4d"u8); contextPtr->glVertexAttribL4dv = LoadGLFunction(load, - "glVertexAttribL4dv"u8); + "glVertexAttribL4dv"u8); contextPtr->glVertexAttribLPointer = LoadGLFunction(load, - "glVertexAttribLPointer"u8); + "glVertexAttribLPointer"u8); contextPtr->glViewportArrayv = LoadGLFunction(load, - "glViewportArrayv"u8); + "glViewportArrayv"u8); contextPtr->glViewportIndexedf = LoadGLFunction(load, - "glViewportIndexedf"u8); + "glViewportIndexedf"u8); contextPtr->glViewportIndexedfv = LoadGLFunction(load, "glViewportIndexedfv"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.1 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore42( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core42) - { - DefaultLog.InternalAppendLog("The core version 4.2 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.1 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore42( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core42) + { + DefaultLog.InternalAppendLog("The core version 4.2 is not supported."); + return false; } #region load contextPtr->glBindImageTexture = LoadGLFunction(load, - "glBindImageTexture"u8); + "glBindImageTexture"u8); contextPtr->glDrawArraysInstancedBaseInstance = LoadGLFunction(load, - "glDrawArraysInstancedBaseInstance"u8); + "glDrawArraysInstancedBaseInstance"u8); contextPtr->glDrawElementsInstancedBaseInstance = LoadGLFunction(load, - "glDrawElementsInstancedBaseInstance"u8); + "glDrawElementsInstancedBaseInstance"u8); contextPtr->glDrawElementsInstancedBaseVertexBaseInstance = LoadGLFunction(load, - "glDrawElementsInstancedBaseVertexBaseInstance"u8); + "glDrawElementsInstancedBaseVertexBaseInstance"u8); contextPtr->glDrawTransformFeedbackInstanced = LoadGLFunction(load, - "glDrawTransformFeedbackInstanced"u8); + "glDrawTransformFeedbackInstanced"u8); contextPtr->glDrawTransformFeedbackStreamInstanced = LoadGLFunction(load, - "glDrawTransformFeedbackStreamInstanced"u8); + "glDrawTransformFeedbackStreamInstanced"u8); contextPtr->glGetActiveAtomicCounterBufferiv = LoadGLFunction(load, - "glGetActiveAtomicCounterBufferiv"u8); + "glGetActiveAtomicCounterBufferiv"u8); contextPtr->glGetInternalformativ = LoadGLFunction(load, - "glGetInternalformativ"u8); - contextPtr->glMemoryBarrier = LoadGLFunction(load, "glMemoryBarrier"u8); + "glGetInternalformativ"u8); + contextPtr->glMemoryBarrier = LoadGLFunction(load, "glMemoryBarrier"u8); contextPtr->glTexStorage1D = LoadGLFunction(load, - "glTexStorage1D"u8); + "glTexStorage1D"u8); contextPtr->glTexStorage2D = LoadGLFunction(load, - "glTexStorage2D"u8); + "glTexStorage2D"u8); contextPtr->glTexStorage3D = LoadGLFunction(load, "glTexStorage3D"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.2 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore43( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core43) - { - DefaultLog.InternalAppendLog("The core version 4.3 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.2 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore43( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core43) + { + DefaultLog.InternalAppendLog("The core version 4.3 is not supported."); + return false; } #region load contextPtr->glBindVertexBuffer = LoadGLFunction(load, - "glBindVertexBuffer"u8); + "glBindVertexBuffer"u8); contextPtr->glClearBufferData = LoadGLFunction(load, - "glClearBufferData"u8); + "glClearBufferData"u8); contextPtr->glClearBufferSubData = LoadGLFunction(load, - "glClearBufferSubData"u8); + "glClearBufferSubData"u8); contextPtr->glCopyImageSubData = LoadGLFunction(load, - "glCopyImageSubData"u8); + "glCopyImageSubData"u8); contextPtr->glDebugMessageCallback = LoadGLFunction(load, - "glDebugMessageCallback"u8); + "glDebugMessageCallback"u8); contextPtr->glDebugMessageControl = LoadGLFunction(load, - "glDebugMessageControl"u8); + "glDebugMessageControl"u8); contextPtr->glDebugMessageInsert = LoadGLFunction(load, - "glDebugMessageInsert"u8); + "glDebugMessageInsert"u8); contextPtr->glDispatchCompute = LoadGLFunction(load, - "glDispatchCompute"u8); + "glDispatchCompute"u8); contextPtr->glDispatchComputeIndirect = LoadGLFunction(load, - "glDispatchComputeIndirect"u8); + "glDispatchComputeIndirect"u8); contextPtr->glFramebufferParameteri = LoadGLFunction(load, - "glFramebufferParameteri"u8); + "glFramebufferParameteri"u8); contextPtr->glGetDebugMessageLog = LoadGLFunction(load, - "glGetDebugMessageLog"u8); + "glGetDebugMessageLog"u8); contextPtr->glGetFramebufferParameteriv = LoadGLFunction(load, - "glGetFramebufferParameteriv"u8); + "glGetFramebufferParameteriv"u8); contextPtr->glGetInternalformati64v = LoadGLFunction(load, - "glGetInternalformati64v"u8); + "glGetInternalformati64v"u8); contextPtr->glGetObjectLabel = LoadGLFunction(load, - "glGetObjectLabel"u8); + "glGetObjectLabel"u8); contextPtr->glGetObjectPtrLabel = LoadGLFunction(load, "glGetObjectPtrLabel"u8); // contextPtr->glGetPointerv =LoadGLFunction(load,"glGetPointerv"u8); contextPtr->glGetProgramInterfaceiv = LoadGLFunction(load, - "glGetProgramInterfaceiv"u8); + "glGetProgramInterfaceiv"u8); contextPtr->glGetProgramResourceIndex = LoadGLFunction(load, - "glGetProgramResourceIndex"u8); + "glGetProgramResourceIndex"u8); contextPtr->glGetProgramResourceLocation = LoadGLFunction(load, - "glGetProgramResourceLocation"u8); + "glGetProgramResourceLocation"u8); contextPtr->glGetProgramResourceLocationIndex = LoadGLFunction(load, - "glGetProgramResourceLocationIndex"u8); + "glGetProgramResourceLocationIndex"u8); contextPtr->glGetProgramResourceName = LoadGLFunction(load, - "glGetProgramResourceName"u8); + "glGetProgramResourceName"u8); contextPtr->glGetProgramResourceiv = LoadGLFunction(load, - "glGetProgramResourceiv"u8); + "glGetProgramResourceiv"u8); contextPtr->glInvalidateBufferData = LoadGLFunction(load, - "glInvalidateBufferData"u8); + "glInvalidateBufferData"u8); contextPtr->glInvalidateBufferSubData = LoadGLFunction(load, - "glInvalidateBufferSubData"u8); + "glInvalidateBufferSubData"u8); contextPtr->glInvalidateFramebuffer = LoadGLFunction(load, - "glInvalidateFramebuffer"u8); + "glInvalidateFramebuffer"u8); contextPtr->glInvalidateSubFramebuffer = LoadGLFunction(load, - "glInvalidateSubFramebuffer"u8); + "glInvalidateSubFramebuffer"u8); contextPtr->glInvalidateTexImage = LoadGLFunction(load, - "glInvalidateTexImage"u8); + "glInvalidateTexImage"u8); contextPtr->glInvalidateTexSubImage = LoadGLFunction(load, - "glInvalidateTexSubImage"u8); + "glInvalidateTexSubImage"u8); contextPtr->glMultiDrawArraysIndirect = LoadGLFunction(load, - "glMultiDrawArraysIndirect"u8); + "glMultiDrawArraysIndirect"u8); contextPtr->glMultiDrawElementsIndirect = LoadGLFunction(load, - "glMultiDrawElementsIndirect"u8); + "glMultiDrawElementsIndirect"u8); contextPtr->glObjectLabel = LoadGLFunction(load, - "glObjectLabel"u8); + "glObjectLabel"u8); contextPtr->glObjectPtrLabel = LoadGLFunction(load, - "glObjectPtrLabel"u8); - contextPtr->glPopDebugGroup = LoadGLFunction(load, "glPopDebugGroup"u8); + "glObjectPtrLabel"u8); + contextPtr->glPopDebugGroup = LoadGLFunction(load, "glPopDebugGroup"u8); contextPtr->glPushDebugGroup = LoadGLFunction(load, - "glPushDebugGroup"u8); + "glPushDebugGroup"u8); contextPtr->glShaderStorageBlockBinding = LoadGLFunction(load, - "glShaderStorageBlockBinding"u8); + "glShaderStorageBlockBinding"u8); contextPtr->glTexBufferRange = LoadGLFunction(load, - "glTexBufferRange"u8); + "glTexBufferRange"u8); contextPtr->glTexStorage2DMultisample = LoadGLFunction(load, - "glTexStorage2DMultisample"u8); + "glTexStorage2DMultisample"u8); contextPtr->glTexStorage3DMultisample = LoadGLFunction(load, - "glTexStorage3DMultisample"u8); + "glTexStorage3DMultisample"u8); contextPtr->glTextureView = LoadGLFunction(load, - "glTextureView"u8); + "glTextureView"u8); contextPtr->glVertexAttribBinding = LoadGLFunction(load, - "glVertexAttribBinding"u8); + "glVertexAttribBinding"u8); contextPtr->glVertexAttribFormat = LoadGLFunction(load, - "glVertexAttribFormat"u8); + "glVertexAttribFormat"u8); contextPtr->glVertexAttribIFormat = LoadGLFunction(load, - "glVertexAttribIFormat"u8); + "glVertexAttribIFormat"u8); contextPtr->glClearBufferData = LoadGLFunction(load, - "glClearBufferData"u8); + "glClearBufferData"u8); contextPtr->glVertexBindingDivisor = LoadGLFunction(load, "glVertexBindingDivisor"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.3 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore44( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core44) - { - DefaultLog.InternalAppendLog("The core version 4.4 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.3 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore44( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core44) + { + DefaultLog.InternalAppendLog("The core version 4.4 is not supported."); + return false; } #region load contextPtr->glBindBuffersBase = LoadGLFunction(load, - "glBindBuffersBase"u8); + "glBindBuffersBase"u8); contextPtr->glBindBuffersRange = LoadGLFunction(load, - "glBindBuffersRange"u8); + "glBindBuffersRange"u8); contextPtr->glBindImageTextures = LoadGLFunction(load, - "glBindImageTextures"u8); + "glBindImageTextures"u8); contextPtr->glBindSamplers = LoadGLFunction(load, - "glBindSamplers"u8); + "glBindSamplers"u8); contextPtr->glBindTextures = LoadGLFunction(load, - "glBindTextures"u8); + "glBindTextures"u8); contextPtr->glBindVertexBuffers = LoadGLFunction(load, - "glBindVertexBuffers"u8); + "glBindVertexBuffers"u8); contextPtr->glBufferStorage = LoadGLFunction(load, - "glBufferStorage"u8); + "glBufferStorage"u8); contextPtr->glClearTexImage = LoadGLFunction(load, - "glClearTexImage"u8); + "glClearTexImage"u8); contextPtr->glClearTexSubImage = LoadGLFunction(load, "glClearTexSubImage"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.4 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore45( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core45) - { - DefaultLog.InternalAppendLog("The core version 4.5 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.4 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore45( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core45) + { + DefaultLog.InternalAppendLog("The core version 4.5 is not supported."); + return false; } #region load contextPtr->glBindTextureUnit = LoadGLFunction(load, - "glBindTextureUnit"u8); + "glBindTextureUnit"u8); contextPtr->glBlitNamedFramebuffer = LoadGLFunction(load, - "glBlitNamedFramebuffer"u8); + "glBlitNamedFramebuffer"u8); contextPtr->glCheckNamedFramebufferStatus = LoadGLFunction(load, - "glCheckNamedFramebufferStatus"u8); + "glCheckNamedFramebufferStatus"u8); contextPtr->glClearNamedBufferData = LoadGLFunction(load, - "glClearNamedBufferData"u8); + "glClearNamedBufferData"u8); contextPtr->glClearNamedBufferSubData = LoadGLFunction(load, - "glClearNamedBufferSubData"u8); + "glClearNamedBufferSubData"u8); contextPtr->glClearNamedFramebufferfi = LoadGLFunction(load, - "glClearNamedFramebufferfi"u8); + "glClearNamedFramebufferfi"u8); contextPtr->glClearNamedFramebufferfv = LoadGLFunction(load, - "glClearNamedFramebufferfv"u8); + "glClearNamedFramebufferfv"u8); contextPtr->glClearNamedFramebufferiv = LoadGLFunction(load, - "glClearNamedFramebufferiv"u8); + "glClearNamedFramebufferiv"u8); contextPtr->glClearNamedFramebufferuiv = LoadGLFunction(load, - "glClearNamedFramebufferuiv"u8); - contextPtr->glClipControl = LoadGLFunction(load, "glClipControl"u8); + "glClearNamedFramebufferuiv"u8); + contextPtr->glClipControl = LoadGLFunction(load, "glClipControl"u8); contextPtr->glCompressedTextureSubImage1D = LoadGLFunction(load, - "glCompressedTextureSubImage1D"u8); + "glCompressedTextureSubImage1D"u8); contextPtr->glCompressedTextureSubImage2D = LoadGLFunction(load, - "glCompressedTextureSubImage2D"u8); + "glCompressedTextureSubImage2D"u8); contextPtr->glCompressedTextureSubImage3D = LoadGLFunction(load, - "glCompressedTextureSubImage3D"u8); + "glCompressedTextureSubImage3D"u8); contextPtr->glCopyNamedBufferSubData = LoadGLFunction(load, - "glCopyNamedBufferSubData"u8); + "glCopyNamedBufferSubData"u8); contextPtr->glCopyTextureSubImage1D = LoadGLFunction(load, - "glCopyTextureSubImage1D"u8); + "glCopyTextureSubImage1D"u8); contextPtr->glCopyTextureSubImage2D = LoadGLFunction(load, - "glCopyTextureSubImage2D"u8); + "glCopyTextureSubImage2D"u8); contextPtr->glCopyTextureSubImage3D = LoadGLFunction(load, - "glCopyTextureSubImage3D"u8); - contextPtr->glCreateBuffers = LoadGLFunction(load, "glCreateBuffers"u8); + "glCopyTextureSubImage3D"u8); + contextPtr->glCreateBuffers = LoadGLFunction(load, "glCreateBuffers"u8); contextPtr->glCreateFramebuffers = LoadGLFunction(load, - "glCreateFramebuffers"u8); + "glCreateFramebuffers"u8); contextPtr->glCreateProgramPipelines = LoadGLFunction(load, - "glCreateProgramPipelines"u8); + "glCreateProgramPipelines"u8); contextPtr->glCreateQueries = LoadGLFunction(load, - "glCreateQueries"u8); + "glCreateQueries"u8); contextPtr->glCreateRenderbuffers = LoadGLFunction(load, - "glCreateRenderbuffers"u8); + "glCreateRenderbuffers"u8); contextPtr->glCreateSamplers = LoadGLFunction(load, - "glCreateSamplers"u8); + "glCreateSamplers"u8); contextPtr->glCreateTextures = LoadGLFunction(load, - "glCreateTextures"u8); + "glCreateTextures"u8); contextPtr->glCreateTransformFeedbacks = LoadGLFunction(load, - "glCreateTransformFeedbacks"u8); + "glCreateTransformFeedbacks"u8); contextPtr->glCreateVertexArrays = LoadGLFunction(load, - "glCreateVertexArrays"u8); + "glCreateVertexArrays"u8); contextPtr->glDisableVertexArrayAttrib = LoadGLFunction(load, - "glDisableVertexArrayAttrib"u8); + "glDisableVertexArrayAttrib"u8); contextPtr->glEnableVertexArrayAttrib = LoadGLFunction(load, - "glEnableVertexArrayAttrib"u8); + "glEnableVertexArrayAttrib"u8); contextPtr->glFlushMappedNamedBufferRange = LoadGLFunction(load, - "glFlushMappedNamedBufferRange"u8); + "glFlushMappedNamedBufferRange"u8); contextPtr->glGenerateTextureMipmap = LoadGLFunction(load, - "glGenerateTextureMipmap"u8); + "glGenerateTextureMipmap"u8); contextPtr->glGetCompressedTextureImage = LoadGLFunction(load, - "glGetCompressedTextureImage"u8); + "glGetCompressedTextureImage"u8); contextPtr->glGetCompressedTextureSubImage = LoadGLFunction(load, - "glGetCompressedTextureSubImage"u8); + "glGetCompressedTextureSubImage"u8); contextPtr->glGetGraphicsResetStatus = LoadGLFunction(load, - "glGetGraphicsResetStatus"u8); + "glGetGraphicsResetStatus"u8); contextPtr->glGetNamedBufferParameteri64v = LoadGLFunction(load, - "glGetNamedBufferParameteri64v"u8); + "glGetNamedBufferParameteri64v"u8); contextPtr->glGetNamedBufferParameteriv = LoadGLFunction(load, - "glGetNamedBufferParameteriv"u8); + "glGetNamedBufferParameteriv"u8); contextPtr->glGetNamedBufferPointerv = LoadGLFunction(load, - "glGetNamedBufferPointerv"u8); + "glGetNamedBufferPointerv"u8); contextPtr->glGetNamedBufferSubData = LoadGLFunction(load, - "glGetNamedBufferSubData"u8); + "glGetNamedBufferSubData"u8); contextPtr->glGetNamedFramebufferAttachmentParameteriv = LoadGLFunction(load, - "glGetNamedFramebufferAttachmentParameteriv"u8); + "glGetNamedFramebufferAttachmentParameteriv"u8); contextPtr->glGetNamedFramebufferParameteriv = LoadGLFunction(load, - "glGetNamedFramebufferParameteriv"u8); + "glGetNamedFramebufferParameteriv"u8); contextPtr->glGetNamedRenderbufferParameteriv = LoadGLFunction(load, - "glGetNamedRenderbufferParameteriv"u8); + "glGetNamedRenderbufferParameteriv"u8); contextPtr->glGetQueryBufferObjecti64v = LoadGLFunction(load, - "glGetQueryBufferObjecti64v"u8); + "glGetQueryBufferObjecti64v"u8); contextPtr->glGetQueryBufferObjectiv = LoadGLFunction(load, - "glGetQueryBufferObjectiv"u8); + "glGetQueryBufferObjectiv"u8); contextPtr->glGetQueryBufferObjectui64v = LoadGLFunction(load, - "glGetQueryBufferObjectui64v"u8); + "glGetQueryBufferObjectui64v"u8); contextPtr->glGetQueryBufferObjectuiv = LoadGLFunction(load, - "glGetQueryBufferObjectuiv"u8); + "glGetQueryBufferObjectuiv"u8); contextPtr->glGetTextureImage = LoadGLFunction(load, - "glGetTextureImage"u8); + "glGetTextureImage"u8); contextPtr->glGetTextureLevelParameterfv = LoadGLFunction(load, - "glGetTextureLevelParameterfv"u8); + "glGetTextureLevelParameterfv"u8); contextPtr->glGetTextureLevelParameteriv = LoadGLFunction(load, - "glGetTextureLevelParameteriv"u8); + "glGetTextureLevelParameteriv"u8); contextPtr->glGetTextureParameterIiv = LoadGLFunction(load, - "glGetTextureParameterIiv"u8); + "glGetTextureParameterIiv"u8); contextPtr->glGetTextureParameterIuiv = LoadGLFunction(load, - "glGetTextureParameterIuiv"u8); + "glGetTextureParameterIuiv"u8); contextPtr->glGetTextureParameterfv = LoadGLFunction(load, - "glGetTextureParameterfv"u8); + "glGetTextureParameterfv"u8); contextPtr->glGetTextureParameteriv = LoadGLFunction(load, - "glGetTextureParameteriv"u8); + "glGetTextureParameteriv"u8); contextPtr->glGetTextureSubImage = LoadGLFunction(load, - "glGetTextureSubImage"u8); + "glGetTextureSubImage"u8); contextPtr->glGetTransformFeedbacki64_v = LoadGLFunction(load, - "glGetTransformFeedbacki64_v"u8); + "glGetTransformFeedbacki64_v"u8); contextPtr->glGetTransformFeedbacki_v = LoadGLFunction(load, - "glGetTransformFeedbacki_v"u8); + "glGetTransformFeedbacki_v"u8); contextPtr->glGetTransformFeedbackiv = LoadGLFunction(load, - "glGetTransformFeedbackiv"u8); + "glGetTransformFeedbackiv"u8); contextPtr->glGetVertexArrayIndexed64iv = LoadGLFunction(load, - "glGetVertexArrayIndexed64iv"u8); + "glGetVertexArrayIndexed64iv"u8); contextPtr->glGetVertexArrayIndexediv = LoadGLFunction(load, - "glGetVertexArrayIndexediv"u8); + "glGetVertexArrayIndexediv"u8); contextPtr->glGetVertexArrayiv = LoadGLFunction(load, - "glGetVertexArrayiv"u8); + "glGetVertexArrayiv"u8); contextPtr->glGetnCompressedTexImage = LoadGLFunction(load, - "glGetnCompressedTexImage"u8); + "glGetnCompressedTexImage"u8); contextPtr->glGetnTexImage = LoadGLFunction(load, - "glGetnTexImage"u8); + "glGetnTexImage"u8); contextPtr->glGetnUniformdv = LoadGLFunction(load, - "glGetnUniformdv"u8); + "glGetnUniformdv"u8); contextPtr->glGetnUniformfv = LoadGLFunction(load, - "glGetnUniformfv"u8); + "glGetnUniformfv"u8); contextPtr->glGetnUniformiv = LoadGLFunction(load, - "glGetnUniformiv"u8); + "glGetnUniformiv"u8); contextPtr->glGetnUniformuiv = LoadGLFunction(load, - "glGetnUniformuiv"u8); + "glGetnUniformuiv"u8); contextPtr->glInvalidateNamedFramebufferData = LoadGLFunction(load, - "glInvalidateNamedFramebufferData"u8); + "glInvalidateNamedFramebufferData"u8); contextPtr->glInvalidateNamedFramebufferSubData = LoadGLFunction(load, - "glInvalidateNamedFramebufferSubData"u8); + "glInvalidateNamedFramebufferSubData"u8); contextPtr->glMapNamedBuffer = LoadGLFunction(load, - "glMapNamedBuffer"u8); + "glMapNamedBuffer"u8); contextPtr->glMapNamedBufferRange = LoadGLFunction(load, - "glMapNamedBufferRange"u8); + "glMapNamedBufferRange"u8); contextPtr->glMemoryBarrierByRegion = LoadGLFunction(load, - "glMemoryBarrierByRegion"u8); + "glMemoryBarrierByRegion"u8); contextPtr->glNamedBufferData = LoadGLFunction(load, - "glNamedBufferData"u8); + "glNamedBufferData"u8); contextPtr->glNamedBufferStorage = LoadGLFunction(load, - "glNamedBufferStorage"u8); + "glNamedBufferStorage"u8); contextPtr->glNamedBufferSubData = LoadGLFunction(load, - "glNamedBufferSubData"u8); + "glNamedBufferSubData"u8); contextPtr->glNamedFramebufferDrawBuffer = LoadGLFunction(load, - "glNamedFramebufferDrawBuffer"u8); + "glNamedFramebufferDrawBuffer"u8); contextPtr->glNamedFramebufferDrawBuffers = LoadGLFunction(load, - "glNamedFramebufferDrawBuffers"u8); + "glNamedFramebufferDrawBuffers"u8); contextPtr->glNamedFramebufferParameteri = LoadGLFunction(load, - "glNamedFramebufferParameteri"u8); + "glNamedFramebufferParameteri"u8); contextPtr->glNamedFramebufferReadBuffer = LoadGLFunction(load, - "glNamedFramebufferReadBuffer"u8); + "glNamedFramebufferReadBuffer"u8); contextPtr->glNamedFramebufferRenderbuffer = LoadGLFunction(load, - "glNamedFramebufferRenderbuffer"u8); + "glNamedFramebufferRenderbuffer"u8); contextPtr->glNamedFramebufferTexture = LoadGLFunction(load, - "glNamedFramebufferTexture"u8); + "glNamedFramebufferTexture"u8); contextPtr->glNamedFramebufferTextureLayer = LoadGLFunction(load, - "glNamedFramebufferTextureLayer"u8); + "glNamedFramebufferTextureLayer"u8); contextPtr->glNamedRenderbufferStorage = LoadGLFunction(load, - "glNamedRenderbufferStorage"u8); + "glNamedRenderbufferStorage"u8); contextPtr->glNamedRenderbufferStorageMultisample = LoadGLFunction(load, - "glNamedRenderbufferStorageMultisample"u8); + "glNamedRenderbufferStorageMultisample"u8); contextPtr->glReadnPixels = LoadGLFunction(load, - "glReadnPixels"u8); - contextPtr->glTextureBarrier = LoadGLFunction(load, "glTextureBarrier"u8); + "glReadnPixels"u8); + contextPtr->glTextureBarrier = LoadGLFunction(load, "glTextureBarrier"u8); contextPtr->glTextureBuffer = LoadGLFunction(load, - "glTextureBuffer"u8); + "glTextureBuffer"u8); contextPtr->glTextureBufferRange = LoadGLFunction(load, - "glTextureBufferRange"u8); + "glTextureBufferRange"u8); contextPtr->glTextureParameterIiv = LoadGLFunction(load, - "glTextureParameterIiv"u8); + "glTextureParameterIiv"u8); contextPtr->glTextureParameterIuiv = LoadGLFunction(load, - "glTextureParameterIuiv"u8); + "glTextureParameterIuiv"u8); contextPtr->glTextureParameterf = LoadGLFunction(load, - "glTextureParameterf"u8); + "glTextureParameterf"u8); contextPtr->glTextureParameterfv = LoadGLFunction(load, - "glTextureParameterfv"u8); + "glTextureParameterfv"u8); contextPtr->glTextureParameteri = LoadGLFunction(load, - "glTextureParameteri"u8); + "glTextureParameteri"u8); contextPtr->glTextureParameteriv = LoadGLFunction(load, - "glTextureParameteriv"u8); + "glTextureParameteriv"u8); contextPtr->glTextureStorage1D = LoadGLFunction(load, - "glTextureStorage1D"u8); + "glTextureStorage1D"u8); contextPtr->glTextureStorage2D = LoadGLFunction(load, - "glTextureStorage2D"u8); + "glTextureStorage2D"u8); contextPtr->glTextureStorage2DMultisample = LoadGLFunction(load, - "glTextureStorage2DMultisample"u8); + "glTextureStorage2DMultisample"u8); contextPtr->glTextureStorage3D = LoadGLFunction(load, - "glTextureStorage3D"u8); + "glTextureStorage3D"u8); contextPtr->glTextureStorage3DMultisample = LoadGLFunction(load, - "glTextureStorage3DMultisample"u8); + "glTextureStorage3DMultisample"u8); contextPtr->glTextureSubImage1D = LoadGLFunction(load, - "glTextureSubImage1D"u8); + "glTextureSubImage1D"u8); contextPtr->glTextureSubImage2D = LoadGLFunction(load, - "glTextureSubImage2D"u8); + "glTextureSubImage2D"u8); contextPtr->glTextureSubImage3D = LoadGLFunction(load, - "glTextureSubImage3D"u8); + "glTextureSubImage3D"u8); contextPtr->glTransformFeedbackBufferBase = LoadGLFunction(load, - "glTransformFeedbackBufferBase"u8); + "glTransformFeedbackBufferBase"u8); contextPtr->glTransformFeedbackBufferRange = LoadGLFunction(load, - "glTransformFeedbackBufferRange"u8); - contextPtr->glUnmapNamedBuffer = LoadGLFunction(load, "glUnmapNamedBuffer"u8); + "glTransformFeedbackBufferRange"u8); + contextPtr->glUnmapNamedBuffer = LoadGLFunction(load, "glUnmapNamedBuffer"u8); contextPtr->glVertexArrayAttribBinding = LoadGLFunction(load, - "glVertexArrayAttribBinding"u8); + "glVertexArrayAttribBinding"u8); contextPtr->glVertexArrayAttribFormat = LoadGLFunction(load, - "glVertexArrayAttribFormat"u8); + "glVertexArrayAttribFormat"u8); contextPtr->glVertexArrayAttribIFormat = LoadGLFunction(load, - "glVertexArrayAttribIFormat"u8); + "glVertexArrayAttribIFormat"u8); contextPtr->glVertexArrayAttribLFormat = LoadGLFunction(load, - "glVertexArrayAttribLFormat"u8); + "glVertexArrayAttribLFormat"u8); contextPtr->glVertexArrayBindingDivisor = LoadGLFunction(load, - "glVertexArrayBindingDivisor"u8); + "glVertexArrayBindingDivisor"u8); contextPtr->glVertexArrayElementBuffer = LoadGLFunction(load, - "glVertexArrayElementBuffer"u8); + "glVertexArrayElementBuffer"u8); contextPtr->glVertexArrayVertexBuffer = LoadGLFunction(load, - "glVertexArrayVertexBuffer"u8); + "glVertexArrayVertexBuffer"u8); contextPtr->glVertexArrayVertexBuffers = LoadGLFunction(load, "glVertexArrayVertexBuffers"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.5 APIs"); - return true; - } - - internal static unsafe bool LoadGLcore46( - glContextShadow* contextPtr, - delegate*, IntPtr> load - ) - { - if (!core46) - { - DefaultLog.InternalAppendLog("The core version 4.6 is not supported."); - return false; + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.5 APIs"); + return true; + } + + internal static unsafe bool LoadGLcore46( + glContextShadow* contextPtr, + delegate*, IntPtr> load) + { + if (!core46) + { + DefaultLog.InternalAppendLog("The core version 4.6 is not supported."); + return false; } #region load contextPtr->glMultiDrawArraysIndirectCount = LoadGLFunction(load, - "glMultiDrawArraysIndirectCount"u8); + "glMultiDrawArraysIndirectCount"u8); contextPtr->glMultiDrawElementsIndirectCount = LoadGLFunction(load, - "glMultiDrawElementsIndirectCount"u8); + "glMultiDrawElementsIndirectCount"u8); contextPtr->glPolygonOffsetClamp = LoadGLFunction(load, - "glPolygonOffsetClamp"u8); + "glPolygonOffsetClamp"u8); contextPtr->glSpecializeShader = LoadGLFunction(load, "glSpecializeShader"u8); #endregion load - DefaultLog.InternalAppendLog("Successfully load OpenGL 4.6 APIs"); - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static unsafe IntPtr LoadGLFunction( - delegate*, IntPtr> load, - ReadOnlySpan name - ) - { - IntPtr ptr = load(name); - if (ptr == IntPtr.Zero) { - DefaultLog.InternalAppendLog($"Failed to load proc {System.Text.Encoding.UTF8.GetString(name)}."); - } - return ptr; - } - - } + DefaultLog.InternalAppendLog("Successfully load OpenGL 4.6 APIs"); + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe IntPtr LoadGLFunction(delegate*, IntPtr> load, ReadOnlySpan name) + { + IntPtr ptr = load(name); + if (ptr == IntPtr.Zero) { + DefaultLog.InternalAppendLog($"Failed to load proc {System.Text.Encoding.UTF8.GetString(name)}."); + } + return ptr; + } + + } } diff --git a/StgSharp.Graphics/OpenGL/glApiManager.cs b/StgSharp.Graphics/OpenGL/glApiManager.cs index 75ec6163..9083afb1 100644 --- a/StgSharp.Graphics/OpenGL/glApiManager.cs +++ b/StgSharp.Graphics/OpenGL/glApiManager.cs @@ -1,48 +1,48 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="glApiManager" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics; -using StgSharp.MVVM; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="glApiManager" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics; +using StgSharp.MVVM; using StgSharp.MVVM; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Graphics.OpenGL -{ - public static partial class glManager - { - - private const int glExtension = 0x1f03; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.OpenGL +{ + public static partial class glManager + { + + private const int glExtension = 0x1f03; private const int glVersion = 0x1f02; private static readonly string[] glBranch = { @@ -54,93 +54,89 @@ namespace StgSharp.Graphics.OpenGL private static string glExtensionList; - - /// - /// Load all supported OpenGL APIs and bind them to given . + /// + /// Load all supported OpenGL APIs and bind them to given . /// - /// - /// The handle to current OpenGL viewPortDisplay + /// + /// The handle to current OpenGL viewPortDisplay /// - public static unsafe void LoadOpenGLApiTo( - IntPtr contextHandle - ) - { - OpenglContext* context = (OpenglContext*)contextHandle; - if (context->glGetString != null) { - return; - } - delegate*, IntPtr> loader = &GraphicFramework.glfwGetProcAddress; - IntPtr proc = GraphicFramework.glfwGetProcAddress("glGetString"u8); - if (proc == IntPtr.Zero) + public static unsafe void LoadOpenGLApiTo(IntPtr contextHandle) + { + OpenglContext* context = (OpenglContext*)contextHandle; + if (context->glGetString != null) { + return; + } + delegate*, IntPtr> loader = &GraphicFramework.glfwGetProcAddress; + IntPtr proc = GraphicFramework.glfwGetProcAddress("glGetString"u8); + if (proc == IntPtr.Zero) { #if DEBUG Console.WriteLine("Cannot load GL."); #endif - throw new NotSupportedException("Cannot load gl"); - } + throw new NotSupportedException("Cannot load gl"); + } context->glGetString = (delegate*)proc; - string coreVersion; - if (context->glGetString(glVersion) == null) { - DefaultLog.InternalWriteLog("Failed to call glGetString", LogType.Error); - } - coreVersion = Marshal.PtrToStringAnsi((nint)context->glGetString(glVersion)) ?? - string.Empty; + string coreVersion; + if (context->glGetString(glVersion) == null) { + DefaultLog.InternalWriteLog("Failed to call glGetString", LogType.Error); + } + coreVersion = Marshal.PtrToStringAnsi((nint)context->glGetString(glVersion)) ?? string.Empty; - foreach (string branch in glBranch) - { - if (coreVersion.Contains(branch)) { - coreVersion.Replace(branch, string.Empty); - } - } - string[] versionSep = coreVersion!.Split('.'); - int majorVersion = int.Parse(versionSep[0]); - int minorVersion = int.Parse(versionSep[1]); + foreach (string branch in glBranch) + { + if (coreVersion.Contains(branch)) { + coreVersion.Replace(branch, string.Empty); + } + } + string[] versionSep = coreVersion!.Split('.'); + int majorVersion = int.Parse(versionSep[0]); + int minorVersion = int.Parse(versionSep[1]); CheckCoreVersion(majorVersion, minorVersion); - if (LoadGLcore10((glContextShadow*)context, loader) && - LoadGLcore11((glContextShadow*)context, loader) && - LoadGLcore12((glContextShadow*)context, loader) && - LoadGLcore13((glContextShadow*)context, loader) && - LoadGLcore14((glContextShadow*)context, loader) && - LoadGLcore15((glContextShadow*)context, loader) && - LoadGLcore20((glContextShadow*)context, loader) && - LoadGLcore21((glContextShadow*)context, loader) && - LoadGLcore30((glContextShadow*)context, loader) && - LoadGLcore31((glContextShadow*)context, loader) && - LoadGLcore32((glContextShadow*)context, loader) && - LoadGLcore33((glContextShadow*)context, loader) && - LoadGLcore40((glContextShadow*)context, loader) && - LoadGLcore41((glContextShadow*)context, loader) && - LoadGLcore42((glContextShadow*)context, loader) && - LoadGLcore43((glContextShadow*)context, loader) && - LoadGLcore44((glContextShadow*)context, loader) && - LoadGLcore45((glContextShadow*)context, loader) && + if (LoadGLcore10((glContextShadow*)context, loader) && + LoadGLcore11((glContextShadow*)context, loader) && + LoadGLcore12((glContextShadow*)context, loader) && + LoadGLcore13((glContextShadow*)context, loader) && + LoadGLcore14((glContextShadow*)context, loader) && + LoadGLcore15((glContextShadow*)context, loader) && + LoadGLcore20((glContextShadow*)context, loader) && + LoadGLcore21((glContextShadow*)context, loader) && + LoadGLcore30((glContextShadow*)context, loader) && + LoadGLcore31((glContextShadow*)context, loader) && + LoadGLcore32((glContextShadow*)context, loader) && + LoadGLcore33((glContextShadow*)context, loader) && + LoadGLcore40((glContextShadow*)context, loader) && + LoadGLcore41((glContextShadow*)context, loader) && + LoadGLcore42((glContextShadow*)context, loader) && + LoadGLcore43((glContextShadow*)context, loader) && + LoadGLcore44((glContextShadow*)context, loader) && + LoadGLcore45((glContextShadow*)context, loader) && LoadGLcore46((glContextShadow*)context, loader)) { } - uint code = context->glGetError(); - if (code != 0) - { - Console.WriteLine(code); - throw new GlExecutionException(code); + uint code = context->glGetError(); + if (code != 0) + { + Console.WriteLine(code); + throw new GlExecutionException(code); } - int extensionCount; - context->glGetIntegerv(glConst.NUM_EXTENSIONS, &extensionCount); - if (extensionCount == 0) - { + int extensionCount; + context->glGetIntegerv(glConst.NUM_EXTENSIONS, &extensionCount); + if (extensionCount == 0) + { DefaultLog.InternalWriteLog( - "No supported OpenGL extensions are found.", LogType.Info); - return; + "No supported OpenGL extensions are found.", LogType.Info); + return; } HashSet extensions = []; - for (uint i = 0; i < extensionCount; i++) - { - byte* strPtr = context->glGetStringi(glConst.EXTENSIONS, i); - extensions.Add(Marshal.PtrToStringAnsi((IntPtr)strPtr) ?? string.Empty); + for (uint i = 0; i < extensionCount; i++) + { + byte* strPtr = context->glGetStringi(glConst.EXTENSIONS, i); + extensions.Add(Marshal.PtrToStringAnsi((IntPtr)strPtr) ?? string.Empty); } DefaultLog.InternalWriteLog( @@ -149,3283 +145,3278 @@ namespace StgSharp.Graphics.OpenGL #region checkGLextensions - if (extensions.Contains("gl_4DFX_multisample")) - { - _4DFX_multisample = true; - extensions.Remove("gl_4DFX_multisample"); - } - if (extensions.Contains("gl_3DFX_tbuffer")) - { - _3DFX_tbuffer = true; - extensions.Remove("gl_3DFX_tbuffer"); - } - if (extensions.Contains("gl_3DFX_texture_compression_FXT1")) - { - _3DFX_texture_compression_FXT1 = true; - extensions.Remove("gl_3DFX_texture_compression_FXT1"); - } - if (extensions.Contains("gl_AMD_blend_minmax_factor")) - { - AMD_blend_minmax_factor = true; - extensions.Remove("glAMD_blend_minmax_factor"); - } - if (extensions.Contains("gl_AMD_conservative_depth")) - { - AMD_conservative_depth = true; - extensions.Remove("glAMD_conservative_depth"); - } - if (extensions.Contains("gl_AMD_debug_output")) - { - AMD_debug_output = true; - extensions.Remove("glAMD_debug_output"); - } - if (extensions.Contains("gl_AMD_depth_clamp_separate")) - { - AMD_depth_clamp_separate = true; - extensions.Remove("glAMD_depth_clamp_separate"); - } - if (extensions.Contains("gl_AMD_draw_buffers_blend")) - { - AMD_draw_buffers_blend = true; - extensions.Remove("glAMD_draw_buffers_blend"); - } - if (extensions.Contains("gl_AMD_framebuffer_multisample_advanced")) - { - AMD_framebuffer_multisample_advanced = true; - extensions.Remove("glAMD_framebuffer_multisample_advanced"); - } - if (extensions.Contains("gl_AMD_framebuffer_sample_positions")) - { - AMD_framebuffer_sample_positions = true; - extensions.Remove("glAMD_framebuffer_sample_positions"); - } - if (extensions.Contains("gl_AMD_gcn_shader")) - { - AMD_gcn_shader = true; - extensions.Remove("glAMD_gcn_shader"); - } - if (extensions.Contains("gl_AMD_gpu_shader_half_float")) - { - AMD_gpu_shader_half_float = true; - extensions.Remove("glAMD_gpu_shader_half_float"); - } - if (extensions.Contains("gl_AMD_gpu_shader_int16")) - { - AMD_gpu_shader_int16 = true; - extensions.Remove("glAMD_gpu_shader_int16"); - } - if (extensions.Contains("gl_AMD_gpu_shader_int64")) - { - AMD_gpu_shader_int64 = true; - extensions.Remove("glAMD_gpu_shader_int64"); - } - if (extensions.Contains("gl_AMD_interleaved_elements")) - { - AMD_interleaved_elements = true; - extensions.Remove("glAMD_interleaved_elements"); - } - if (extensions.Contains("gl_AMD_multi_draw_indirect")) - { - AMD_multi_draw_indirect = true; - extensions.Remove("glAMD_multi_draw_indirect"); - } - if (extensions.Contains("gl_AMD_name_gen_delete")) - { - AMD_name_gen_delete = true; - extensions.Remove("glAMD_name_gen_delete"); - } - if (extensions.Contains("gl_AMD_occlusion_query_event")) - { - AMD_occlusion_query_event = true; - extensions.Remove("glAMD_occlusion_query_event"); - } - if (extensions.Contains("gl_AMD_performance_monitor")) - { - AMD_performance_monitor = true; - extensions.Remove("glAMD_performance_monitor"); - } - if (extensions.Contains("gl_AMD_pinned_memory")) - { - AMD_pinned_memory = true; - extensions.Remove("glAMD_pinned_memory"); - } - if (extensions.Contains("gl_AMD_query_buffer_object")) - { - AMD_query_buffer_object = true; - extensions.Remove("glAMD_query_buffer_object"); - } - if (extensions.Contains("gl_AMD_sample_positions")) - { - AMD_sample_positions = true; - extensions.Remove("glAMD_sample_positions"); - } - if (extensions.Contains("gl_AMD_seamless_cubemap_per_texture")) - { - AMD_seamless_cubemap_per_texture = true; - extensions.Remove("glAMD_seamless_cubemap_per_texture"); - } - if (extensions.Contains("gl_AMD_shader_atomic_counter_ops")) - { - AMD_shader_atomic_counter_ops = true; - extensions.Remove("glAMD_shader_atomic_counter_ops"); - } - if (extensions.Contains("gl_AMD_shader_ballot")) - { - AMD_shader_ballot = true; - extensions.Remove("glAMD_shader_ballot"); - } - if (extensions.Contains("gl_AMD_shader_explicit_vertex_parameter")) - { - AMD_shader_explicit_vertex_parameter = true; - extensions.Remove("glAMD_shader_explicit_vertex_parameter"); - } - if (extensions.Contains("gl_AMD_shader_gpu_shader_half_float_fetch")) - { - AMD_shader_gpu_shader_half_float_fetch = true; - extensions.Remove("glAMD_shader_gpu_shader_half_float_fetch"); - } - if (extensions.Contains("gl_AMD_shader_image_load_store_lod")) - { - AMD_shader_image_load_store_lod = true; - extensions.Remove("glAMD_shader_image_load_store_lod"); - } - if (extensions.Contains("gl_AMD_shader_stencil_export")) - { - AMD_shader_stencil_export = true; - extensions.Remove("glAMD_shader_stencil_export"); - } - if (extensions.Contains("gl_AMD_shader_trinary_minmax")) - { - AMD_shader_trinary_minmax = true; - extensions.Remove("glAMD_shader_trinary_minmax"); - } - if (extensions.Contains("gl_AMD_sparse_texture")) - { - AMD_sparse_texture = true; - extensions.Remove("glAMD_sparse_texture"); - } - if (extensions.Contains("gl_AMD_stencil_operation_extended")) - { - AMD_stencil_operation_extended = true; - extensions.Remove("glAMD_stencil_operation_extended"); - } - if (extensions.Contains("gl_AMD_texture_gather_bias_lod")) - { - AMD_texture_gather_bias_lod = true; - extensions.Remove("glAMD_texture_gather_bias_lod"); - } - if (extensions.Contains("gl_AMD_texture_texture4")) - { - AMD_texture_texture4 = true; - extensions.Remove("glAMD_texture_texture4"); - } - if (extensions.Contains("gl_AMD_transform_feedback3_lines_triangles")) - { - AMD_transform_feedback3_lines_triangles = true; - extensions.Remove("glAMD_transform_feedback3_lines_triangles"); - } - if (extensions.Contains("gl_AMD_transform_feedback4")) - { - AMD_transform_feedback4 = true; - extensions.Remove("glAMD_transform_feedback4"); - } - if (extensions.Contains("gl_AMD_vertex_shader_layer")) - { - AMD_vertex_shader_layer = true; - extensions.Remove("glAMD_vertex_shader_layer"); - } - if (extensions.Contains("gl_AMD_vertex_shader_tessellator")) - { - AMD_vertex_shader_tessellator = true; - extensions.Remove("glAMD_vertex_shader_tessellator"); - } - if (extensions.Contains("gl_AMD_vertex_shader_viewport_index")) - { - AMD_vertex_shader_viewport_index = true; - extensions.Remove("glAMD_vertex_shader_viewport_index"); - } - if (extensions.Contains("gl_APPLE_aux_depth_stencil")) - { - APPLE_aux_depth_stencil = true; - extensions.Remove("glAPPLE_aux_depth_stencil"); - } - if (extensions.Contains("gl_APPLE_client_storage")) - { - APPLE_client_storage = true; - extensions.Remove("glAPPLE_client_storage"); - } - if (extensions.Contains("gl_APPLE_element_array")) - { - APPLE_element_array = true; - extensions.Remove("glAPPLE_element_array"); - } - if (extensions.Contains("gl_APPLE_fence")) - { - APPLE_fence = true; - extensions.Remove("glAPPLE_fence"); - } - if (extensions.Contains("gl_APPLE_float_pixels")) - { - APPLE_float_pixels = true; - extensions.Remove("glAPPLE_float_pixels"); - } - if (extensions.Contains("gl_APPLE_flush_buffer_range")) - { - APPLE_flush_buffer_range = true; - extensions.Remove("glAPPLE_flush_buffer_range"); - } - if (extensions.Contains("gl_APPLE_object_purgeable")) - { - APPLE_object_purgeable = true; - extensions.Remove("glAPPLE_object_purgeable"); - } - if (extensions.Contains("gl_APPLE_rgb_422")) - { - APPLE_rgb_422 = true; - extensions.Remove("glAPPLE_rgb_422"); - } - if (extensions.Contains("gl_APPLE_row_bytes")) - { - APPLE_row_bytes = true; - extensions.Remove("glAPPLE_row_bytes"); - } - if (extensions.Contains("gl_APPLE_specular_vector")) - { - APPLE_specular_vector = true; - extensions.Remove("glAPPLE_specular_vector"); - } - if (extensions.Contains("gl_APPLE_texture_range")) - { - APPLE_texture_range = true; - extensions.Remove("glAPPLE_texture_range"); - } - if (extensions.Contains("gl_APPLE_transform_hint")) - { - APPLE_transform_hint = true; - extensions.Remove("glAPPLE_transform_hint"); - } - if (extensions.Contains("gl_APPLE_vertex_array_object")) - { - APPLE_vertex_array_object = true; - extensions.Remove("glAPPLE_vertex_array_object"); - } - if (extensions.Contains("gl_APPLE_vertex_array_range")) - { - APPLE_vertex_array_range = true; - extensions.Remove("glAPPLE_vertex_array_range"); - } - if (extensions.Contains("gl_APPLE_vertex_program_evaluators")) - { - APPLE_vertex_program_evaluators = true; - extensions.Remove("glAPPLE_vertex_program_evaluators"); - } - if (extensions.Contains("gl_APPLE_ycbcr_422")) - { - APPLE_ycbcr_422 = true; - extensions.Remove("glAPPLE_ycbcr_422"); - } - if (extensions.Contains("gl_ARB_ES2_compatibility")) - { - ARB_ES2_compatibility = true; - extensions.Remove("glARB_ES2_compatibility"); - } - if (extensions.Contains("gl_ARB_ES3_1_compatibility")) - { - ARB_ES3_1_compatibility = true; - extensions.Remove("glARB_ES3_1_compatibility"); - } - if (extensions.Contains("gl_ARB_ES3_2_compatibility")) - { - ARB_ES3_2_compatibility = true; - extensions.Remove("glARB_ES3_2_compatibility"); - } - if (extensions.Contains("gl_ARB_ES3_compatibility")) - { - ARB_ES3_compatibility = true; - extensions.Remove("glARB_ES3_compatibility"); - } - if (extensions.Contains("gl_ARB_arrays_of_arrays")) - { - ARB_arrays_of_arrays = true; - extensions.Remove("glARB_arrays_of_arrays"); - } - if (extensions.Contains("gl_ARB_base_instance")) - { - ARB_base_instance = true; - extensions.Remove("glARB_base_instance"); - } - if (extensions.Contains("gl_ARB_bindless_texture")) - { - ARB_bindless_texture = true; - extensions.Remove("glARB_bindless_texture"); - } - if (extensions.Contains("gl_ARB_blend_func_extended")) - { - ARB_blend_func_extended = true; - extensions.Remove("glARB_blend_func_extended"); - } - if (extensions.Contains("gl_ARB_buffer_storage")) - { - ARB_buffer_storage = true; - extensions.Remove("glARB_buffer_storage"); - } - if (extensions.Contains("gl_ARB_cl_event")) - { - ARB_cl_event = true; - extensions.Remove("glARB_cl_event"); - } - if (extensions.Contains("gl_ARB_clear_buffer_object")) - { - ARB_clear_buffer_object = true; - extensions.Remove("glARB_clear_buffer_object"); - } - if (extensions.Contains("gl_ARB_clear_texture")) - { - ARB_clear_texture = true; - extensions.Remove("glARB_clear_texture"); - } - if (extensions.Contains("gl_ARB_clip_control")) - { - ARB_clip_control = true; - extensions.Remove("glARB_clip_control"); - } - if (extensions.Contains("gl_ARB_color_buffer_float")) - { - ARB_color_buffer_float = true; - extensions.Remove("glARB_color_buffer_float"); - } - if (extensions.Contains("gl_ARB_compatibility")) - { - ARB_compatibility = true; - extensions.Remove("glARB_compatibility"); - } - if (extensions.Contains("gl_ARB_compressed_texture_pixel_storage")) - { - ARB_compressed_texture_pixel_storage = true; - extensions.Remove("glARB_compressed_texture_pixel_storage"); - } - if (extensions.Contains("gl_ARB_compute_shader")) - { - ARB_compute_shader = true; - extensions.Remove("glARB_compute_shader"); - } - if (extensions.Contains("gl_ARB_compute_variable_group_size")) - { - ARB_compute_variable_group_size = true; - extensions.Remove("glARB_compute_variable_group_size"); - } - if (extensions.Contains("gl_ARB_conditional_render_inverted")) - { - ARB_conditional_render_inverted = true; - extensions.Remove("glARB_conditional_render_inverted"); - } - if (extensions.Contains("gl_ARB_conservative_depth")) - { - ARB_conservative_depth = true; - extensions.Remove("glARB_conservative_depth"); - } - if (extensions.Contains("gl_ARB_copy_buffer")) - { - ARB_copy_buffer = true; - extensions.Remove("glARB_copy_buffer"); - } - if (extensions.Contains("gl_ARB_copy_image")) - { - ARB_copy_image = true; - extensions.Remove("glARB_copy_image"); - } - if (extensions.Contains("gl_ARB_cull_distance")) - { - ARB_cull_distance = true; - extensions.Remove("glARB_cull_distance"); - } - if (extensions.Contains("gl_ARB_debug_output")) - { - ARB_debug_output = true; - extensions.Remove("glARB_debug_output"); - } - if (extensions.Contains("gl_ARB_depth_buffer_float")) - { - ARB_depth_buffer_float = true; - extensions.Remove("glARB_depth_buffer_float"); - } - if (extensions.Contains("gl_ARB_depth_clamp")) - { - ARB_depth_clamp = true; - extensions.Remove("glARB_depth_clamp"); - } - if (extensions.Contains("gl_ARB_depth_texture")) - { - ARB_depth_texture = true; - extensions.Remove("glARB_depth_texture"); - } - if (extensions.Contains("gl_ARB_derivative_control")) - { - ARB_derivative_control = true; - extensions.Remove("glARB_derivative_control"); - } - if (extensions.Contains("gl_ARB_direct_state_access")) - { - ARB_direct_state_access = true; - extensions.Remove("glARB_direct_state_access"); - } - if (extensions.Contains("gl_ARB_draw_buffers")) - { - ARB_draw_buffers = true; - extensions.Remove("glARB_draw_buffers"); - } - if (extensions.Contains("gl_ARB_draw_buffers_blend")) - { - ARB_draw_buffers_blend = true; - extensions.Remove("glARB_draw_buffers_blend"); - } - if (extensions.Contains("gl_ARB_draw_elements_base_vertex")) - { - ARB_draw_elements_base_vertex = true; - extensions.Remove("glARB_draw_elements_base_vertex"); - } - if (extensions.Contains("gl_ARB_draw_indirect")) - { - ARB_draw_indirect = true; - extensions.Remove("glARB_draw_indirect"); - } - if (extensions.Contains("gl_ARB_draw_instanced")) - { - ARB_draw_instanced = true; - extensions.Remove("glARB_draw_instanced"); - } - if (extensions.Contains("gl_ARB_enhanced_layouts")) - { - ARB_enhanced_layouts = true; - extensions.Remove("glARB_enhanced_layouts"); - } - if (extensions.Contains("gl_ARB_explicit_attrib_location")) - { - ARB_explicit_attrib_location = true; - extensions.Remove("glARB_explicit_attrib_location"); - } - if (extensions.Contains("gl_ARB_explicit_uniform_location")) - { - ARB_explicit_uniform_location = true; - extensions.Remove("glARB_explicit_uniform_location"); - } - if (extensions.Contains("gl_ARB_fragment_coord_conventions")) - { - ARB_fragment_coord_conventions = true; - extensions.Remove("glARB_fragment_coord_conventions"); - } - if (extensions.Contains("gl_ARB_fragment_layer_viewport")) - { - ARB_fragment_layer_viewport = true; - extensions.Remove("glARB_fragment_layer_viewport"); - } - if (extensions.Contains("gl_ARB_fragment_program")) - { - ARB_fragment_program = true; - extensions.Remove("glARB_fragment_program"); - } - if (extensions.Contains("gl_ARB_fragment_program_shadow")) - { - ARB_fragment_program_shadow = true; - extensions.Remove("glARB_fragment_program_shadow"); - } - if (extensions.Contains("gl_ARB_fragment_shader")) - { - ARB_fragment_shader = true; - extensions.Remove("glARB_fragment_shader"); - } - if (extensions.Contains("gl_ARB_fragment_shader_interlock")) - { - ARB_fragment_shader_interlock = true; - extensions.Remove("glARB_fragment_shader_interlock"); - } - if (extensions.Contains("gl_ARB_framebuffer_no_attachments")) - { - ARB_framebuffer_no_attachments = true; - extensions.Remove("glARB_framebuffer_no_attachments"); - } - if (extensions.Contains("gl_ARB_framebuffer_object")) - { - ARB_framebuffer_object = true; - extensions.Remove("glARB_framebuffer_object"); - } - if (extensions.Contains("gl_ARB_framebuffer_sRGB")) - { - ARB_framebuffer_sRGB = true; - extensions.Remove("glARB_framebuffer_sRGB"); - } - if (extensions.Contains("gl_ARB_geometry_shader4")) - { - ARB_geometry_shader4 = true; - extensions.Remove("glARB_geometry_shader4"); - } - if (extensions.Contains("gl_ARB_get_program_binary")) - { - ARB_get_program_binary = true; - extensions.Remove("glARB_get_program_binary"); - } - if (extensions.Contains("gl_ARB_get_texture_sub_image")) - { - ARB_get_texture_sub_image = true; - extensions.Remove("glARB_get_texture_sub_image"); - } - if (extensions.Contains("gl_ARB_gl_spirv")) - { - ARB_gl_spirv = true; - extensions.Remove("glARB_gl_spirv"); - } - if (extensions.Contains("gl_ARB_gpu_shader5")) - { - ARB_gpu_shader5 = true; - extensions.Remove("glARB_gpu_shader5"); - } - if (extensions.Contains("gl_ARB_gpu_shader_fp64")) - { - ARB_gpu_shader_fp64 = true; - extensions.Remove("glARB_gpu_shader_fp64"); - } - if (extensions.Contains("gl_ARB_gpu_shader_int64")) - { - ARB_gpu_shader_int64 = true; - extensions.Remove("glARB_gpu_shader_int64"); - } - if (extensions.Contains("gl_ARB_half_float_pixel")) - { - ARB_half_float_pixel = true; - extensions.Remove("glARB_half_float_pixel"); - } - if (extensions.Contains("gl_ARB_half_float_vertex")) - { - ARB_half_float_vertex = true; - extensions.Remove("glARB_half_float_vertex"); - } - if (extensions.Contains("gl_ARB_imaging")) - { - ARB_imaging = true; - extensions.Remove("glARB_imaging"); - } - if (extensions.Contains("gl_ARB_indirect_parameters")) - { - ARB_indirect_parameters = true; - extensions.Remove("glARB_indirect_parameters"); - } - if (extensions.Contains("gl_ARB_instanced_arrays")) - { - ARB_instanced_arrays = true; - extensions.Remove("glARB_instanced_arrays"); - } - if (extensions.Contains("gl_ARB_internalformat_query")) - { - ARB_internalformat_query = true; - extensions.Remove("glARB_internalformat_query"); - } - if (extensions.Contains("gl_ARB_internalformat_query2")) - { - ARB_internalformat_query2 = true; - extensions.Remove("glARB_internalformat_query2"); - } - if (extensions.Contains("gl_ARB_invalidate_subdata")) - { - ARB_invalidate_subdata = true; - extensions.Remove("glARB_invalidate_subdata"); - } - if (extensions.Contains("gl_ARB_map_buffer_alignment")) - { - ARB_map_buffer_alignment = true; - extensions.Remove("glARB_map_buffer_alignment"); - } - if (extensions.Contains("gl_ARB_map_buffer_range")) - { - ARB_map_buffer_range = true; - extensions.Remove("glARB_map_buffer_range"); - } - if (extensions.Contains("gl_ARB_matrix_palette")) - { - ARB_matrix_palette = true; - extensions.Remove("glARB_matrix_palette"); - } - if (extensions.Contains("gl_ARB_multi_bind")) - { - ARB_multi_bind = true; - extensions.Remove("glARB_multi_bind"); - } - if (extensions.Contains("gl_ARB_multi_draw_indirect")) - { - ARB_multi_draw_indirect = true; - extensions.Remove("glARB_multi_draw_indirect"); - } - if (extensions.Contains("gl_ARB_multisample")) - { - ARB_multisample = true; - extensions.Remove("glARB_multisample"); - } - if (extensions.Contains("gl_ARB_multitexture")) - { - ARB_multitexture = true; - extensions.Remove("glARB_multitexture"); - } - if (extensions.Contains("gl_ARB_occlusion_query")) - { - ARB_occlusion_query = true; - extensions.Remove("glARB_occlusion_query"); - } - if (extensions.Contains("gl_ARB_occlusion_query2")) - { - ARB_occlusion_query2 = true; - extensions.Remove("glARB_occlusion_query2"); - } - if (extensions.Contains("gl_ARB_parallel_shader_compile")) - { - ARB_parallel_shader_compile = true; - extensions.Remove("glARB_parallel_shader_compile"); - } - if (extensions.Contains("gl_ARB_pipeline_statistics_query")) - { - ARB_pipeline_statistics_query = true; - extensions.Remove("glARB_pipeline_statistics_query"); - } - if (extensions.Contains("gl_ARB_pixel_buffer_object")) - { - ARB_pixel_buffer_object = true; - extensions.Remove("glARB_pixel_buffer_object"); - } - if (extensions.Contains("gl_ARB_point_parameters")) - { - ARB_point_parameters = true; - extensions.Remove("glARB_point_parameters"); - } - if (extensions.Contains("gl_ARB_point_sprite")) - { - ARB_point_sprite = true; - extensions.Remove("glARB_point_sprite"); - } - if (extensions.Contains("gl_ARB_polygon_offset_clamp")) - { - ARB_polygon_offset_clamp = true; - extensions.Remove("glARB_polygon_offset_clamp"); - } - if (extensions.Contains("gl_ARB_post_depth_coverage")) - { - ARB_post_depth_coverage = true; - extensions.Remove("glARB_post_depth_coverage"); - } - if (extensions.Contains("gl_ARB_program_interface_query")) - { - ARB_program_interface_query = true; - extensions.Remove("glARB_program_interface_query"); - } - if (extensions.Contains("gl_ARB_provoking_vertex")) - { - ARB_provoking_vertex = true; - extensions.Remove("glARB_provoking_vertex"); - } - if (extensions.Contains("gl_ARB_query_buffer_object")) - { - ARB_query_buffer_object = true; - extensions.Remove("glARB_query_buffer_object"); - } - if (extensions.Contains("gl_ARB_robust_buffer_access_behavior")) - { - ARB_robust_buffer_access_behavior = true; - extensions.Remove("glARB_robust_buffer_access_behavior"); - } - if (extensions.Contains("gl_ARB_robustness")) - { - ARB_robustness = true; - extensions.Remove("glARB_robustness"); - } - if (extensions.Contains("gl_ARB_robustness_isolation")) - { - ARB_robustness_isolation = true; - extensions.Remove("glARB_robustness_isolation"); - } - if (extensions.Contains("gl_ARB_sample_locations")) - { - ARB_sample_locations = true; - extensions.Remove("glARB_sample_locations"); - } - if (extensions.Contains("gl_ARB_sample_shading")) - { - ARB_sample_shading = true; - extensions.Remove("glARB_sample_shading"); - } - if (extensions.Contains("gl_ARB_sampler_objects")) - { - ARB_sampler_objects = true; - extensions.Remove("glARB_sampler_objects"); - } - if (extensions.Contains("gl_ARB_seamless_cube_map")) - { - ARB_seamless_cube_map = true; - extensions.Remove("glARB_seamless_cube_map"); - } - if (extensions.Contains("gl_ARB_seamless_cubemap_per_texture")) - { - ARB_seamless_cubemap_per_texture = true; - extensions.Remove("glARB_seamless_cubemap_per_texture"); - } - if (extensions.Contains("gl_ARB_separate_shader_objects")) - { - ARB_separate_shader_objects = true; - extensions.Remove("glARB_separate_shader_objects"); - } - if (extensions.Contains("gl_ARB_shader_atomic_counter_ops")) - { - ARB_shader_atomic_counter_ops = true; - extensions.Remove("glARB_shader_atomic_counter_ops"); - } - if (extensions.Contains("gl_ARB_shader_atomic_counters")) - { - ARB_shader_atomic_counters = true; - extensions.Remove("glARB_shader_atomic_counters"); - } - if (extensions.Contains("gl_ARB_shader_ballot")) - { - ARB_shader_ballot = true; - extensions.Remove("glARB_shader_ballot"); - } - if (extensions.Contains("gl_ARB_shader_bit_encoding")) - { - ARB_shader_bit_encoding = true; - extensions.Remove("glARB_shader_bit_encoding"); - } - if (extensions.Contains("gl_ARB_shader_clock")) - { - ARB_shader_clock = true; - extensions.Remove("glARB_shader_clock"); - } - if (extensions.Contains("gl_ARB_shader_draw_parameters")) - { - ARB_shader_draw_parameters = true; - extensions.Remove("glARB_shader_draw_parameters"); - } - if (extensions.Contains("gl_ARB_shader_group_vote")) - { - ARB_shader_group_vote = true; - extensions.Remove("glARB_shader_group_vote"); - } - if (extensions.Contains("gl_ARB_shader_image_load_store")) - { - ARB_shader_image_load_store = true; - extensions.Remove("glARB_shader_image_load_store"); - } - if (extensions.Contains("gl_ARB_shader_image_size")) - { - ARB_shader_image_size = true; - extensions.Remove("glARB_shader_image_size"); - } - if (extensions.Contains("gl_ARB_shader_objects")) - { - ARB_shader_objects = true; - extensions.Remove("glARB_shader_objects"); - } - if (extensions.Contains("gl_ARB_shader_precision")) - { - ARB_shader_precision = true; - extensions.Remove("glARB_shader_precision"); - } - if (extensions.Contains("gl_ARB_shader_stencil_export")) - { - ARB_shader_stencil_export = true; - extensions.Remove("glARB_shader_stencil_export"); - } - if (extensions.Contains("gl_ARB_shader_storage_buffer_object")) - { - ARB_shader_storage_buffer_object = true; - extensions.Remove("glARB_shader_storage_buffer_object"); - } - if (extensions.Contains("gl_ARB_shader_subroutine")) - { - ARB_shader_subroutine = true; - extensions.Remove("glARB_shader_subroutine"); - } - if (extensions.Contains("gl_ARB_shader_texture_image_samples")) - { - ARB_shader_texture_image_samples = true; - extensions.Remove("glARB_shader_texture_image_samples"); - } - if (extensions.Contains("gl_ARB_shader_texture_lod")) - { - ARB_shader_texture_lod = true; - extensions.Remove("glARB_shader_texture_lod"); - } - if (extensions.Contains("gl_ARB_shader_viewport_layer_array")) - { - ARB_shader_viewport_layer_array = true; - extensions.Remove("glARB_shader_viewport_layer_array"); - } - if (extensions.Contains("gl_ARB_shading_language_100")) - { - ARB_shading_language_100 = true; - extensions.Remove("glARB_shading_language_100"); - } - if (extensions.Contains("gl_ARB_shading_language_420pack")) - { - ARB_shading_language_420pack = true; - extensions.Remove("glARB_shading_language_420pack"); - } - if (extensions.Contains("gl_ARB_shading_language_include")) - { - ARB_shading_language_include = true; - extensions.Remove("glARB_shading_language_include"); - } - if (extensions.Contains("gl_ARB_shading_language_packing")) - { - ARB_shading_language_packing = true; - extensions.Remove("glARB_shading_language_packing"); - } - if (extensions.Contains("gl_ARB_shadow")) - { - ARB_shadow = true; - extensions.Remove("glARB_shadow"); - } - if (extensions.Contains("gl_ARB_shadow_ambient")) - { - ARB_shadow_ambient = true; - extensions.Remove("glARB_shadow_ambient"); - } - if (extensions.Contains("gl_ARB_sparse_buffer")) - { - ARB_sparse_buffer = true; - extensions.Remove("glARB_sparse_buffer"); - } - if (extensions.Contains("gl_ARB_sparse_texture")) - { - ARB_sparse_texture = true; - extensions.Remove("glARB_sparse_texture"); - } - if (extensions.Contains("gl_ARB_sparse_texture2")) - { - ARB_sparse_texture2 = true; - extensions.Remove("glARB_sparse_texture2"); - } - if (extensions.Contains("gl_ARB_sparse_texture_clamp")) - { - ARB_sparse_texture_clamp = true; - extensions.Remove("glARB_sparse_texture_clamp"); - } - if (extensions.Contains("gl_ARB_spirv_extensions")) - { - ARB_spirv_extensions = true; - extensions.Remove("glARB_spirv_extensions"); - } - if (extensions.Contains("gl_ARB_stencil_texturing")) - { - ARB_stencil_texturing = true; - extensions.Remove("glARB_stencil_texturing"); - } - if (extensions.Contains("gl_ARB_sync")) - { - ARB_sync = true; - extensions.Remove("glARB_sync"); - } - if (extensions.Contains("gl_ARB_tessellation_shader")) - { - ARB_tessellation_shader = true; - extensions.Remove("glARB_tessellation_shader"); - } - if (extensions.Contains("gl_ARB_texture_barrier")) - { - ARB_texture_barrier = true; - extensions.Remove("glARB_texture_barrier"); - } - if (extensions.Contains("gl_ARB_texture_border_clamp")) - { - ARB_texture_border_clamp = true; - extensions.Remove("glARB_texture_border_clamp"); - } - if (extensions.Contains("gl_ARB_texture_buffer_object")) - { - ARB_texture_buffer_object = true; - extensions.Remove("glARB_texture_buffer_object"); - } - if (extensions.Contains("gl_ARB_texture_buffer_object_rgb32")) - { - ARB_texture_buffer_object_rgb32 = true; - extensions.Remove("glARB_texture_buffer_object_rgb32"); - } - if (extensions.Contains("gl_ARB_texture_buffer_range")) - { - ARB_texture_buffer_range = true; - extensions.Remove("glARB_texture_buffer_range"); - } - if (extensions.Contains("gl_ARB_texture_compression")) - { - ARB_texture_compression = true; - extensions.Remove("glARB_texture_compression"); - } - if (extensions.Contains("gl_ARB_texture_compression_bptc")) - { - ARB_texture_compression_bptc = true; - extensions.Remove("glARB_texture_compression_bptc"); - } - if (extensions.Contains("gl_ARB_texture_compression_rgtc")) - { - ARB_texture_compression_rgtc = true; - extensions.Remove("glARB_texture_compression_rgtc"); - } - if (extensions.Contains("gl_ARB_texture_cube_map")) - { - ARB_texture_cube_map = true; - extensions.Remove("glARB_texture_cube_map"); - } - if (extensions.Contains("gl_ARB_texture_cube_map_array")) - { - ARB_texture_cube_map_array = true; - extensions.Remove("glARB_texture_cube_map_array"); - } - if (extensions.Contains("gl_ARB_texture_env_add")) - { - ARB_texture_env_add = true; - extensions.Remove("glARB_texture_env_add"); - } - if (extensions.Contains("gl_ARB_texture_env_combine")) - { - ARB_texture_env_combine = true; - extensions.Remove("glARB_texture_env_combine"); - } - if (extensions.Contains("gl_ARB_texture_env_crossbar")) - { - ARB_texture_env_crossbar = true; - extensions.Remove("glARB_texture_env_crossbar"); - } - if (extensions.Contains("gl_ARB_texture_env_dot3")) - { - ARB_texture_env_dot3 = true; - extensions.Remove("glARB_texture_env_dot3"); - } - if (extensions.Contains("gl_ARB_texture_filter_anisotropic")) - { - ARB_texture_filter_anisotropic = true; - extensions.Remove("glARB_texture_filter_anisotropic"); - } - if (extensions.Contains("gl_ARB_texture_filter_minmax")) - { - ARB_texture_filter_minmax = true; - extensions.Remove("glARB_texture_filter_minmax"); - } - if (extensions.Contains("gl_ARB_texture_float")) - { - ARB_texture_float = true; - extensions.Remove("glARB_texture_float"); - } - if (extensions.Contains("gl_ARB_texture_gather")) - { - ARB_texture_gather = true; - extensions.Remove("glARB_texture_gather"); - } - if (extensions.Contains("gl_ARB_texture_mirror_clamp_to_edge")) - { - ARB_texture_mirror_clamp_to_edge = true; - extensions.Remove("glARB_texture_mirror_clamp_to_edge"); - } - if (extensions.Contains("gl_ARB_texture_mirrored_repeat")) - { - ARB_texture_mirrored_repeat = true; - extensions.Remove("glARB_texture_mirrored_repeat"); - } - if (extensions.Contains("gl_ARB_texture_multisample")) - { - ARB_texture_multisample = true; - extensions.Remove("glARB_texture_multisample"); - } - if (extensions.Contains("gl_ARB_texture_non_power_of_two")) - { - ARB_texture_non_power_of_two = true; - extensions.Remove("glARB_texture_non_power_of_two"); - } - if (extensions.Contains("gl_ARB_texture_query_levels")) - { - ARB_texture_query_levels = true; - extensions.Remove("glARB_texture_query_levels"); - } - if (extensions.Contains("gl_ARB_texture_query_lod")) - { - ARB_texture_query_lod = true; - extensions.Remove("glARB_texture_query_lod"); - } - if (extensions.Contains("gl_ARB_texture_rectangle")) - { - ARB_texture_rectangle = true; - extensions.Remove("glARB_texture_rectangle"); - } - if (extensions.Contains("gl_ARB_texture_rg")) - { - ARB_texture_rg = true; - extensions.Remove("glARB_texture_rg"); - } - if (extensions.Contains("gl_ARB_texture_rgb10_a2ui")) - { - ARB_texture_rgb10_a2ui = true; - extensions.Remove("glARB_texture_rgb10_a2ui"); - } - if (extensions.Contains("gl_ARB_texture_stencil8")) - { - ARB_texture_stencil8 = true; - extensions.Remove("glARB_texture_stencil8"); - } - if (extensions.Contains("gl_ARB_texture_storage")) - { - ARB_texture_storage = true; - extensions.Remove("glARB_texture_storage"); - } - if (extensions.Contains("gl_ARB_texture_storage_multisample")) - { - ARB_texture_storage_multisample = true; - extensions.Remove("glARB_texture_storage_multisample"); - } - if (extensions.Contains("gl_ARB_texture_swizzle")) - { - ARB_texture_swizzle = true; - extensions.Remove("glARB_texture_swizzle"); - } - if (extensions.Contains("gl_ARB_texture_view")) - { - ARB_texture_view = true; - extensions.Remove("glARB_texture_view"); - } - if (extensions.Contains("gl_ARB_timer_query")) - { - ARB_timer_query = true; - extensions.Remove("glARB_timer_query"); - } - if (extensions.Contains("gl_ARB_transform_feedback2")) - { - ARB_transform_feedback2 = true; - extensions.Remove("glARB_transform_feedback2"); - } - if (extensions.Contains("gl_ARB_transform_feedback3")) - { - ARB_transform_feedback3 = true; - extensions.Remove("glARB_transform_feedback3"); - } - if (extensions.Contains("gl_ARB_transform_feedback_instanced")) - { - ARB_transform_feedback_instanced = true; - extensions.Remove("glARB_transform_feedback_instanced"); - } - if (extensions.Contains("gl_ARB_transform_feedback_overflow_query")) - { - ARB_transform_feedback_overflow_query = true; - extensions.Remove("glARB_transform_feedback_overflow_query"); - } - if (extensions.Contains("gl_ARB_transpose_matrix")) - { - ARB_transpose_matrix = true; - extensions.Remove("glARB_transpose_matrix"); - } - if (extensions.Contains("gl_ARB_uniform_buffer_object")) - { - ARB_uniform_buffer_object = true; - extensions.Remove("glARB_uniform_buffer_object"); - } - if (extensions.Contains("gl_ARB_vertex_array_bgra")) - { - ARB_vertex_array_bgra = true; - extensions.Remove("glARB_vertex_array_bgra"); - } - if (extensions.Contains("gl_ARB_vertex_array_object")) - { - ARB_vertex_array_object = true; - extensions.Remove("glARB_vertex_array_object"); - } - if (extensions.Contains("gl_ARB_vertex_attrib_64bit")) - { - ARB_vertex_attrib_64bit = true; - extensions.Remove("glARB_vertex_attrib_64bit"); - } - if (extensions.Contains("gl_ARB_vertex_attrib_binding")) - { - ARB_vertex_attrib_binding = true; - extensions.Remove("glARB_vertex_attrib_binding"); - } - if (extensions.Contains("gl_ARB_vertex_blend")) - { - ARB_vertex_blend = true; - extensions.Remove("glARB_vertex_blend"); - } - if (extensions.Contains("gl_ARB_vertex_buffer_object")) - { - ARB_vertex_buffer_object = true; - extensions.Remove("glARB_vertex_buffer_object"); - } - if (extensions.Contains("gl_ARB_vertex_program")) - { - ARB_vertex_program = true; - extensions.Remove("glARB_vertex_program"); - } - if (extensions.Contains("gl_ARB_vertex_shader")) - { - ARB_vertex_shader = true; - extensions.Remove("glARB_vertex_shader"); - } - if (extensions.Contains("gl_ARB_vertex_type_10f_11f_11f_rev")) - { - ARB_vertex_type_10f_11f_11f_rev = true; - extensions.Remove("glARB_vertex_type_10f_11f_11f_rev"); - } - if (extensions.Contains("gl_ARB_vertex_type_2_10_10_10_rev")) - { - ARB_vertex_type_2_10_10_10_rev = true; - extensions.Remove("glARB_vertex_type_2_10_10_10_rev"); - } - if (extensions.Contains("gl_ARB_viewport_array")) - { - ARB_viewport_array = true; - extensions.Remove("glARB_viewport_array"); - } - if (extensions.Contains("gl_ARB_window_pos")) - { - ARB_window_pos = true; - extensions.Remove("glARB_window_pos"); - } - if (extensions.Contains("gl_ATI_draw_buffers")) - { - ATI_draw_buffers = true; - extensions.Remove("glATI_draw_buffers"); - } - if (extensions.Contains("gl_ATI_element_array")) - { - ATI_element_array = true; - extensions.Remove("glATI_element_array"); - } - if (extensions.Contains("gl_ATI_envmap_bumpmap")) - { - ATI_envmap_bumpmap = true; - extensions.Remove("glATI_envmap_bumpmap"); - } - if (extensions.Contains("gl_ATI_fragment_shader")) - { - ATI_fragment_shader = true; - extensions.Remove("glATI_fragment_shader"); - } - if (extensions.Contains("gl_ATI_map_object_buffer")) - { - ATI_map_object_buffer = true; - extensions.Remove("glATI_map_object_buffer"); - } - if (extensions.Contains("gl_ATI_meminfo")) - { - ATI_meminfo = true; - extensions.Remove("glATI_meminfo"); - } - if (extensions.Contains("gl_ATI_pixel_format_float")) - { - ATI_pixel_format_float = true; - extensions.Remove("glATI_pixel_format_float"); - } - if (extensions.Contains("gl_ATI_pn_triangles")) - { - ATI_pn_triangles = true; - extensions.Remove("glATI_pn_triangles"); - } - if (extensions.Contains("gl_ATI_separate_stencil")) - { - ATI_separate_stencil = true; - extensions.Remove("glATI_separate_stencil"); - } - if (extensions.Contains("gl_ATI_text_fragment_shader")) - { - ATI_text_fragment_shader = true; - extensions.Remove("glATI_text_fragment_shader"); - } - if (extensions.Contains("gl_ATI_texture_env_combine3")) - { - ATI_texture_env_combine3 = true; - extensions.Remove("glATI_texture_env_combine3"); - } - if (extensions.Contains("gl_ATI_texture_float")) - { - ATI_texture_float = true; - extensions.Remove("glATI_texture_float"); - } - if (extensions.Contains("gl_ATI_texture_mirror_once")) - { - ATI_texture_mirror_once = true; - extensions.Remove("glATI_texture_mirror_once"); - } - if (extensions.Contains("gl_ATI_vertex_array_object")) - { - ATI_vertex_array_object = true; - extensions.Remove("glATI_vertex_array_object"); - } - if (extensions.Contains("gl_ATI_vertex_attrib_array_object")) - { - ATI_vertex_attrib_array_object = true; - extensions.Remove("glATI_vertex_attrib_array_object"); - } - if (extensions.Contains("gl_ATI_vertex_streams")) - { - ATI_vertex_streams = true; - extensions.Remove("glATI_vertex_streams"); - } - if (extensions.Contains("gl_EXT_422_pixels")) - { - EXT_422_pixels = true; - extensions.Remove("glEXT_422_pixels"); - } - if (extensions.Contains("gl_EXT_EGL_image_storage")) - { - EXT_EGL_image_storage = true; - extensions.Remove("glEXT_EGL_image_storage"); - } - if (extensions.Contains("gl_EXT_EGL_sync")) - { - EXT_EGL_sync = true; - extensions.Remove("glEXT_EGL_sync"); - } - if (extensions.Contains("gl_EXT_abgr")) - { - EXT_abgr = true; - extensions.Remove("glEXT_abgr"); - } - if (extensions.Contains("gl_EXT_bgra")) - { - EXT_bgra = true; - extensions.Remove("glEXT_bgra"); - } - if (extensions.Contains("gl_EXT_bindable_uniform")) - { - EXT_bindable_uniform = true; - extensions.Remove("glEXT_bindable_uniform"); - } - if (extensions.Contains("gl_EXT_blend_color")) - { - EXT_blend_color = true; - extensions.Remove("glEXT_blend_color"); - } - if (extensions.Contains("gl_EXT_blend_equation_separate")) - { - EXT_blend_equation_separate = true; - extensions.Remove("glEXT_blend_equation_separate"); - } - if (extensions.Contains("gl_EXT_blend_func_separate")) - { - EXT_blend_func_separate = true; - extensions.Remove("glEXT_blend_func_separate"); - } - if (extensions.Contains("gl_EXT_blend_logic_op")) - { - EXT_blend_logic_op = true; - extensions.Remove("glEXT_blend_logic_op"); - } - if (extensions.Contains("gl_EXT_blend_minmax")) - { - EXT_blend_minmax = true; - extensions.Remove("glEXT_blend_minmax"); - } - if (extensions.Contains("gl_EXT_blend_subtract")) - { - EXT_blend_subtract = true; - extensions.Remove("glEXT_blend_subtract"); - } - if (extensions.Contains("gl_EXT_clip_volume_hint")) - { - EXT_clip_volume_hint = true; - extensions.Remove("glEXT_clip_volume_hint"); - } - if (extensions.Contains("gl_EXT_cmyka")) - { - EXT_cmyka = true; - extensions.Remove("glEXT_cmyka"); - } - if (extensions.Contains("gl_EXT_color_subtable")) - { - EXT_color_subtable = true; - extensions.Remove("glEXT_color_subtable"); - } - if (extensions.Contains("gl_EXT_compiled_vertex_array")) - { - EXT_compiled_vertex_array = true; - extensions.Remove("glEXT_compiled_vertex_array"); - } - if (extensions.Contains("gl_EXT_convolution")) - { - EXT_convolution = true; - extensions.Remove("glEXT_convolution"); - } - if (extensions.Contains("gl_EXT_coordinate_frame")) - { - EXT_coordinate_frame = true; - extensions.Remove("glEXT_coordinate_frame"); - } - if (extensions.Contains("gl_EXT_copy_texture")) - { - EXT_copy_texture = true; - extensions.Remove("glEXT_copy_texture"); - } - if (extensions.Contains("gl_EXT_cull_vertex")) - { - EXT_cull_vertex = true; - extensions.Remove("glEXT_cull_vertex"); - } - if (extensions.Contains("gl_EXT_debug_label")) - { - EXT_debug_label = true; - extensions.Remove("glEXT_debug_label"); - } - if (extensions.Contains("gl_EXT_debug_marker")) - { - EXT_debug_marker = true; - extensions.Remove("glEXT_debug_marker"); - } - if (extensions.Contains("gl_EXT_depth_bounds_test")) - { - EXT_depth_bounds_test = true; - extensions.Remove("glEXT_depth_bounds_test"); - } - if (extensions.Contains("gl_EXT_direct_state_access")) - { - EXT_direct_state_access = true; - extensions.Remove("glEXT_direct_state_access"); - } - if (extensions.Contains("gl_EXT_draw_buffers2")) - { - EXT_draw_buffers2 = true; - extensions.Remove("glEXT_draw_buffers2"); - } - if (extensions.Contains("gl_EXT_draw_instanced")) - { - EXT_draw_instanced = true; - extensions.Remove("glEXT_draw_instanced"); - } - if (extensions.Contains("gl_EXT_draw_range_elements")) - { - EXT_draw_range_elements = true; - extensions.Remove("glEXT_draw_range_elements"); - } - if (extensions.Contains("gl_EXT_external_buffer")) - { - EXT_external_buffer = true; - extensions.Remove("glEXT_external_buffer"); - } - if (extensions.Contains("gl_EXT_fog_coord")) - { - EXT_fog_coord = true; - extensions.Remove("glEXT_fog_coord"); - } - if (extensions.Contains("gl_EXT_framebuffer_blit")) - { - EXT_framebuffer_blit = true; - extensions.Remove("glEXT_framebuffer_blit"); - } - if (extensions.Contains("gl_EXT_framebuffer_blit_layers")) - { - EXT_framebuffer_blit_layers = true; - extensions.Remove("glEXT_framebuffer_blit_layers"); - } - if (extensions.Contains("gl_EXT_framebuffer_multisample")) - { - EXT_framebuffer_multisample = true; - extensions.Remove("glEXT_framebuffer_multisample"); - } - if (extensions.Contains("gl_EXT_framebuffer_multisample_blit_scaled")) - { - EXT_framebuffer_multisample_blit_scaled = true; - extensions.Remove("glEXT_framebuffer_multisample_blit_scaled"); - } - if (extensions.Contains("gl_EXT_framebuffer_object")) - { - EXT_framebuffer_object = true; - extensions.Remove("glEXT_framebuffer_object"); - } - if (extensions.Contains("gl_EXT_framebuffer_sRGB")) - { - EXT_framebuffer_sRGB = true; - extensions.Remove("glEXT_framebuffer_sRGB"); - } - if (extensions.Contains("gl_EXT_geometry_shader4")) - { - EXT_geometry_shader4 = true; - extensions.Remove("glEXT_geometry_shader4"); - } - if (extensions.Contains("gl_EXT_gpu_program_parameters")) - { - EXT_gpu_program_parameters = true; - extensions.Remove("glEXT_gpu_program_parameters"); - } - if (extensions.Contains("gl_EXT_gpu_shader4")) - { - EXT_gpu_shader4 = true; - extensions.Remove("glEXT_gpu_shader4"); - } - if (extensions.Contains("gl_EXT_histogram")) - { - EXT_histogram = true; - extensions.Remove("glEXT_histogram"); - } - if (extensions.Contains("gl_EXT_index_array_formats")) - { - EXT_index_array_formats = true; - extensions.Remove("glEXT_index_array_formats"); - } - if (extensions.Contains("gl_EXT_index_func")) - { - EXT_index_func = true; - extensions.Remove("glEXT_index_func"); - } - if (extensions.Contains("gl_EXT_index_material")) - { - EXT_index_material = true; - extensions.Remove("glEXT_index_material"); - } - if (extensions.Contains("gl_EXT_index_texture")) - { - EXT_index_texture = true; - extensions.Remove("glEXT_index_texture"); - } - if (extensions.Contains("gl_EXT_light_texture")) - { - EXT_light_texture = true; - extensions.Remove("glEXT_light_texture"); - } - if (extensions.Contains("gl_EXT_memory_object")) - { - EXT_memory_object = true; - extensions.Remove("glEXT_memory_object"); - } - if (extensions.Contains("gl_EXT_memory_object_fd")) - { - EXT_memory_object_fd = true; - extensions.Remove("glEXT_memory_object_fd"); - } - if (extensions.Contains("gl_EXT_memory_object_win32")) - { - EXT_memory_object_win32 = true; - extensions.Remove("glEXT_memory_object_win32"); - } - if (extensions.Contains("gl_EXT_misc_attribute")) - { - EXT_misc_attribute = true; - extensions.Remove("glEXT_misc_attribute"); - } - if (extensions.Contains("gl_EXT_multi_draw_arrays")) - { - EXT_multi_draw_arrays = true; - extensions.Remove("glEXT_multi_draw_arrays"); - } - if (extensions.Contains("gl_EXT_multisample")) - { - EXT_multisample = true; - extensions.Remove("glEXT_multisample"); - } - if (extensions.Contains("gl_EXT_multiview_tessellation_geometry_shader")) - { - EXT_multiview_tessellation_geometry_shader = true; - extensions.Remove("glEXT_multiview_tessellation_geometry_shader"); - } - if (extensions.Contains("gl_EXT_multiview_texture_multisample")) - { - EXT_multiview_texture_multisample = true; - extensions.Remove("glEXT_multiview_texture_multisample"); - } - if (extensions.Contains("gl_EXT_multiview_timer_query")) - { - EXT_multiview_timer_query = true; - extensions.Remove("glEXT_multiview_timer_query"); - } - if (extensions.Contains("gl_EXT_packed_depth_stencil")) - { - EXT_packed_depth_stencil = true; - extensions.Remove("glEXT_packed_depth_stencil"); - } - if (extensions.Contains("gl_EXT_packed_float")) - { - EXT_packed_float = true; - extensions.Remove("glEXT_packed_float"); - } - if (extensions.Contains("gl_EXT_packed_pixels")) - { - EXT_packed_pixels = true; - extensions.Remove("glEXT_packed_pixels"); - } - if (extensions.Contains("gl_EXT_paletted_texture")) - { - EXT_paletted_texture = true; - extensions.Remove("glEXT_paletted_texture"); - } - if (extensions.Contains("gl_EXT_pixel_buffer_object")) - { - EXT_pixel_buffer_object = true; - extensions.Remove("glEXT_pixel_buffer_object"); - } - if (extensions.Contains("gl_EXT_pixel_transform")) - { - EXT_pixel_transform = true; - extensions.Remove("glEXT_pixel_transform"); - } - if (extensions.Contains("gl_EXT_pixel_transform_color_table")) - { - EXT_pixel_transform_color_table = true; - extensions.Remove("glEXT_pixel_transform_color_table"); - } - if (extensions.Contains("gl_EXT_point_parameters")) - { - EXT_point_parameters = true; - extensions.Remove("glEXT_point_parameters"); - } - if (extensions.Contains("gl_EXT_polygon_offset")) - { - EXT_polygon_offset = true; - extensions.Remove("glEXT_polygon_offset"); - } - if (extensions.Contains("gl_EXT_polygon_offset_clamp")) - { - EXT_polygon_offset_clamp = true; - extensions.Remove("glEXT_polygon_offset_clamp"); - } - if (extensions.Contains("gl_EXT_post_depth_coverage")) - { - EXT_post_depth_coverage = true; - extensions.Remove("glEXT_post_depth_coverage"); - } - if (extensions.Contains("gl_EXT_provoking_vertex")) - { - EXT_provoking_vertex = true; - extensions.Remove("glEXT_provoking_vertex"); - } - if (extensions.Contains("gl_EXT_raster_multisample")) - { - EXT_raster_multisample = true; - extensions.Remove("glEXT_raster_multisample"); - } - if (extensions.Contains("gl_EXT_rescale_normal")) - { - EXT_rescale_normal = true; - extensions.Remove("glEXT_rescale_normal"); - } - if (extensions.Contains("gl_EXT_secondary_color")) - { - EXT_secondary_color = true; - extensions.Remove("glEXT_secondary_color"); - } - if (extensions.Contains("gl_EXT_semaphore")) - { - EXT_semaphore = true; - extensions.Remove("glEXT_semaphore"); - } - if (extensions.Contains("gl_EXT_semaphore_fd")) - { - EXT_semaphore_fd = true; - extensions.Remove("glEXT_semaphore_fd"); - } - if (extensions.Contains("gl_EXT_semaphore_win32")) - { - EXT_semaphore_win32 = true; - extensions.Remove("glEXT_semaphore_win32"); - } - if (extensions.Contains("gl_EXT_separate_shader_objects")) - { - EXT_separate_shader_objects = true; - extensions.Remove("glEXT_separate_shader_objects"); - } - if (extensions.Contains("gl_EXT_separate_specular_color")) - { - EXT_separate_specular_color = true; - extensions.Remove("glEXT_separate_specular_color"); - } - if (extensions.Contains("gl_EXT_shader_framebuffer_fetch")) - { - EXT_shader_framebuffer_fetch = true; - extensions.Remove("glEXT_shader_framebuffer_fetch"); - } - if (extensions.Contains("gl_EXT_shader_framebuffer_fetch_non_coherent")) - { - EXT_shader_framebuffer_fetch_non_coherent = true; - extensions.Remove("glEXT_shader_framebuffer_fetch_non_coherent"); - } - if (extensions.Contains("gl_EXT_shader_image_load_formatted")) - { - EXT_shader_image_load_formatted = true; - extensions.Remove("glEXT_shader_image_load_formatted"); - } - if (extensions.Contains("gl_EXT_shader_image_load_store")) - { - EXT_shader_image_load_store = true; - extensions.Remove("glEXT_shader_image_load_store"); - } - if (extensions.Contains("gl_EXT_shader_integer_mix")) - { - EXT_shader_integer_mix = true; - extensions.Remove("glEXT_shader_integer_mix"); - } - if (extensions.Contains("gl_EXT_shader_samples_identical")) - { - EXT_shader_samples_identical = true; - extensions.Remove("glEXT_shader_samples_identical"); - } - if (extensions.Contains("gl_EXT_shadow_funcs")) - { - EXT_shadow_funcs = true; - extensions.Remove("glEXT_shadow_funcs"); - } - if (extensions.Contains("gl_EXT_shared_texture_palette")) - { - EXT_shared_texture_palette = true; - extensions.Remove("glEXT_shared_texture_palette"); - } - if (extensions.Contains("gl_EXT_sparse_texture2")) - { - EXT_sparse_texture2 = true; - extensions.Remove("glEXT_sparse_texture2"); - } - if (extensions.Contains("gl_EXT_stencil_clear_tag")) - { - EXT_stencil_clear_tag = true; - extensions.Remove("glEXT_stencil_clear_tag"); - } - if (extensions.Contains("gl_EXT_stencil_two_side")) - { - EXT_stencil_two_side = true; - extensions.Remove("glEXT_stencil_two_side"); - } - if (extensions.Contains("gl_EXT_stencil_wrap")) - { - EXT_stencil_wrap = true; - extensions.Remove("glEXT_stencil_wrap"); - } - if (extensions.Contains("gl_EXT_subtexture")) - { - EXT_subtexture = true; - extensions.Remove("glEXT_subtexture"); - } - if (extensions.Contains("gl_EXT_texture")) - { - EXT_texture = true; - extensions.Remove("glEXT_texture"); - } - if (extensions.Contains("gl_EXT_texture3D")) - { - EXT_texture3D = true; - extensions.Remove("glEXT_texture3D"); - } - if (extensions.Contains("gl_EXT_texture_array")) - { - EXT_texture_array = true; - extensions.Remove("glEXT_texture_array"); - } - if (extensions.Contains("gl_EXT_texture_buffer_object")) - { - EXT_texture_buffer_object = true; - extensions.Remove("glEXT_texture_buffer_object"); - } - if (extensions.Contains("gl_EXT_texture_compression_latc")) - { - EXT_texture_compression_latc = true; - extensions.Remove("glEXT_texture_compression_latc"); - } - if (extensions.Contains("gl_EXT_texture_compression_rgtc")) - { - EXT_texture_compression_rgtc = true; - extensions.Remove("glEXT_texture_compression_rgtc"); - } - if (extensions.Contains("gl_EXT_texture_compression_s3tc")) - { - EXT_texture_compression_s3tc = true; - extensions.Remove("glEXT_texture_compression_s3tc"); - } - if (extensions.Contains("gl_EXT_texture_cube_map")) - { - EXT_texture_cube_map = true; - extensions.Remove("glEXT_texture_cube_map"); - } - if (extensions.Contains("gl_EXT_texture_env_add")) - { - EXT_texture_env_add = true; - extensions.Remove("glEXT_texture_env_add"); - } - if (extensions.Contains("gl_EXT_texture_env_combine")) - { - EXT_texture_env_combine = true; - extensions.Remove("glEXT_texture_env_combine"); - } - if (extensions.Contains("gl_EXT_texture_env_dot3")) - { - EXT_texture_env_dot3 = true; - extensions.Remove("glEXT_texture_env_dot3"); - } - if (extensions.Contains("gl_EXT_texture_filter_anisotropic")) - { - EXT_texture_filter_anisotropic = true; - extensions.Remove("glEXT_texture_filter_anisotropic"); - } - if (extensions.Contains("gl_EXT_texture_filter_minmax")) - { - EXT_texture_filter_minmax = true; - extensions.Remove("glEXT_texture_filter_minmax"); - } - if (extensions.Contains("gl_EXT_texture_integer")) - { - EXT_texture_integer = true; - extensions.Remove("glEXT_texture_integer"); - } - if (extensions.Contains("gl_EXT_texture_lod_bias")) - { - EXT_texture_lod_bias = true; - extensions.Remove("glEXT_texture_lod_bias"); - } - if (extensions.Contains("gl_EXT_texture_mirror_clamp")) - { - EXT_texture_mirror_clamp = true; - extensions.Remove("glEXT_texture_mirror_clamp"); - } - if (extensions.Contains("gl_EXT_texture_object")) - { - EXT_texture_object = true; - extensions.Remove("glEXT_texture_object"); - } - if (extensions.Contains("gl_EXT_texture_perturb_normal")) - { - EXT_texture_perturb_normal = true; - extensions.Remove("glEXT_texture_perturb_normal"); - } - if (extensions.Contains("gl_EXT_texture_sRGB")) - { - EXT_texture_sRGB = true; - extensions.Remove("glEXT_texture_sRGB"); - } - if (extensions.Contains("gl_EXT_texture_sRGB_R8")) - { - EXT_texture_sRGB_R8 = true; - extensions.Remove("glEXT_texture_sRGB_R8"); - } - if (extensions.Contains("gl_EXT_texture_sRGB_RG8")) - { - EXT_texture_sRGB_RG8 = true; - extensions.Remove("glEXT_texture_sRGB_RG8"); - } - if (extensions.Contains("gl_EXT_texture_sRGB_decode")) - { - EXT_texture_sRGB_decode = true; - extensions.Remove("glEXT_texture_sRGB_decode"); - } - if (extensions.Contains("gl_EXT_texture_shadow_lod")) - { - EXT_texture_shadow_lod = true; - extensions.Remove("glEXT_texture_shadow_lod"); - } - if (extensions.Contains("gl_EXT_texture_shared_exponent")) - { - EXT_texture_shared_exponent = true; - extensions.Remove("glEXT_texture_shared_exponent"); - } - if (extensions.Contains("gl_EXT_texture_snorm")) - { - EXT_texture_snorm = true; - extensions.Remove("glEXT_texture_snorm"); - } - if (extensions.Contains("gl_EXT_texture_storage")) - { - EXT_texture_storage = true; - extensions.Remove("glEXT_texture_storage"); - } - if (extensions.Contains("gl_EXT_texture_swizzle")) - { - EXT_texture_swizzle = true; - extensions.Remove("glEXT_texture_swizzle"); - } - if (extensions.Contains("gl_EXT_timer_query")) - { - EXT_timer_query = true; - extensions.Remove("glEXT_timer_query"); - } - if (extensions.Contains("gl_EXT_transform_feedback")) - { - EXT_transform_feedback = true; - extensions.Remove("glEXT_transform_feedback"); - } - if (extensions.Contains("gl_EXT_vertex_array")) - { - EXT_vertex_array = true; - extensions.Remove("glEXT_vertex_array"); - } - if (extensions.Contains("gl_EXT_vertex_array_bgra")) - { - EXT_vertex_array_bgra = true; - extensions.Remove("glEXT_vertex_array_bgra"); - } - if (extensions.Contains("gl_EXT_vertex_attrib_64bit")) - { - EXT_vertex_attrib_64bit = true; - extensions.Remove("glEXT_vertex_attrib_64bit"); - } - if (extensions.Contains("gl_EXT_vertex_shader")) - { - EXT_vertex_shader = true; - extensions.Remove("glEXT_vertex_shader"); - } - if (extensions.Contains("gl_EXT_vertex_weighting")) - { - EXT_vertex_weighting = true; - extensions.Remove("glEXT_vertex_weighting"); - } - if (extensions.Contains("gl_EXT_win32_keyed_mutex")) - { - EXT_win32_keyed_mutex = true; - extensions.Remove("glEXT_win32_keyed_mutex"); - } - if (extensions.Contains("gl_EXT_window_rectangles")) - { - EXT_window_rectangles = true; - extensions.Remove("glEXT_window_rectangles"); - } - if (extensions.Contains("gl_EXT_x11_sync_object")) - { - EXT_x11_sync_object = true; - extensions.Remove("glEXT_x11_sync_object"); - } - if (extensions.Contains("gl_GREMEDY_frame_terminator")) - { - GREMEDY_frame_terminator = true; - extensions.Remove("glGREMEDY_frame_terminator"); - } - if (extensions.Contains("gl_GREMEDY_string_marker")) - { - GREMEDY_string_marker = true; - extensions.Remove("glGREMEDY_string_marker"); - } - if (extensions.Contains("gl_HP_convolution_border_modes")) - { - HP_convolution_border_modes = true; - extensions.Remove("glHP_convolution_border_modes"); - } - if (extensions.Contains("gl_HP_image_transform")) - { - HP_image_transform = true; - extensions.Remove("glHP_image_transform"); - } - if (extensions.Contains("gl_HP_occlusion_test")) - { - HP_occlusion_test = true; - extensions.Remove("glHP_occlusion_test"); - } - if (extensions.Contains("gl_HP_texture_lighting")) - { - HP_texture_lighting = true; - extensions.Remove("glHP_texture_lighting"); - } - if (extensions.Contains("gl_IBM_cull_vertex")) - { - IBM_cull_vertex = true; - extensions.Remove("glIBM_cull_vertex"); - } - if (extensions.Contains("gl_IBM_multimode_draw_arrays")) - { - IBM_multimode_draw_arrays = true; - extensions.Remove("glIBM_multimode_draw_arrays"); - } - if (extensions.Contains("gl_IBM_rasterpos_clip")) - { - IBM_rasterpos_clip = true; - extensions.Remove("glIBM_rasterpos_clip"); - } - if (extensions.Contains("gl_IBM_static_data")) - { - IBM_static_data = true; - extensions.Remove("glIBM_static_data"); - } - if (extensions.Contains("gl_IBM_texture_mirrored_repeat")) - { - IBM_texture_mirrored_repeat = true; - extensions.Remove("glIBM_texture_mirrored_repeat"); - } - if (extensions.Contains("gl_IBM_vertex_array_lists")) - { - IBM_vertex_array_lists = true; - extensions.Remove("glIBM_vertex_array_lists"); - } - if (extensions.Contains("gl_INGR_blend_func_separate")) - { - INGR_blend_func_separate = true; - extensions.Remove("glINGR_blend_func_separate"); - } - if (extensions.Contains("gl_INGR_color_clamp")) - { - INGR_color_clamp = true; - extensions.Remove("glINGR_color_clamp"); - } - if (extensions.Contains("gl_INGR_interlace_read")) - { - INGR_interlace_read = true; - extensions.Remove("glINGR_interlace_read"); - } - if (extensions.Contains("gl_INTEL_blackhole_render")) - { - INTEL_blackhole_render = true; - extensions.Remove("glINTEL_blackhole_render"); - } - if (extensions.Contains("gl_INTEL_conservative_rasterization")) - { - INTEL_conservative_rasterization = true; - extensions.Remove("glINTEL_conservative_rasterization"); - } - if (extensions.Contains("gl_INTEL_fragment_shader_ordering")) - { - INTEL_fragment_shader_ordering = true; - extensions.Remove("glINTEL_fragment_shader_ordering"); - } - if (extensions.Contains("gl_INTEL_framebuffer_CMAA")) - { - INTEL_framebuffer_CMAA = true; - extensions.Remove("glINTEL_framebuffer_CMAA"); - } - if (extensions.Contains("gl_INTEL_map_texture")) - { - INTEL_map_texture = true; - extensions.Remove("glINTEL_map_texture"); - } - if (extensions.Contains("gl_INTEL_parallel_arrays")) - { - INTEL_parallel_arrays = true; - extensions.Remove("glINTEL_parallel_arrays"); - } - if (extensions.Contains("gl_INTEL_performance_query")) - { - INTEL_performance_query = true; - extensions.Remove("glINTEL_performance_query"); - } - if (extensions.Contains("gl_KHR_blend_equation_advanced")) - { - KHR_blend_equation_advanced = true; - extensions.Remove("glKHR_blend_equation_advanced"); - } - if (extensions.Contains("gl_KHR_blend_equation_advanced_coherent")) - { - KHR_blend_equation_advanced_coherent = true; - extensions.Remove("glKHR_blend_equation_advanced_coherent"); - } - if (extensions.Contains("gl_KHR_context_flush_control")) - { - KHR_context_flush_control = true; - extensions.Remove("glKHR_context_flush_control"); - } - if (extensions.Contains("gl_KHR_debug")) - { - KHR_debug = true; - extensions.Remove("glKHR_debug"); - } - if (extensions.Contains("gl_KHR_no_error")) - { - KHR_no_error = true; - extensions.Remove("glKHR_no_error"); - } - if (extensions.Contains("gl_KHR_parallel_shader_compile")) - { - KHR_parallel_shader_compile = true; - extensions.Remove("glKHR_parallel_shader_compile"); - } - if (extensions.Contains("gl_KHR_robust_buffer_access_behavior")) - { - KHR_robust_buffer_access_behavior = true; - extensions.Remove("glKHR_robust_buffer_access_behavior"); - } - if (extensions.Contains("gl_KHR_robustness")) - { - KHR_robustness = true; - extensions.Remove("glKHR_robustness"); - } - if (extensions.Contains("gl_KHR_shader_subgroup")) - { - KHR_shader_subgroup = true; - extensions.Remove("glKHR_shader_subgroup"); - } - if (extensions.Contains("gl_KHR_texture_compression_astc_hdr")) - { - KHR_texture_compression_astc_hdr = true; - extensions.Remove("glKHR_texture_compression_astc_hdr"); - } - if (extensions.Contains("gl_KHR_texture_compression_astc_ldr")) - { - KHR_texture_compression_astc_ldr = true; - extensions.Remove("glKHR_texture_compression_astc_ldr"); - } - if (extensions.Contains("gl_KHR_texture_compression_astc_sliced_3d")) - { - KHR_texture_compression_astc_sliced_3d = true; - extensions.Remove("glKHR_texture_compression_astc_sliced_3d"); - } - if (extensions.Contains("gl_MESAX_texture_stack")) - { - MESAX_texture_stack = true; - extensions.Remove("glMESAX_texture_stack"); - } - if (extensions.Contains("gl_MESA_framebuffer_flip_x")) - { - MESA_framebuffer_flip_x = true; - extensions.Remove("glMESA_framebuffer_flip_x"); - } - if (extensions.Contains("gl_MESA_framebuffer_flip_y")) - { - MESA_framebuffer_flip_y = true; - extensions.Remove("glMESA_framebuffer_flip_y"); - } - if (extensions.Contains("gl_MESA_framebuffer_swap_xy")) - { - MESA_framebuffer_swap_xy = true; - extensions.Remove("glMESA_framebuffer_swap_xy"); - } - if (extensions.Contains("gl_MESA_pack_invert")) - { - MESA_pack_invert = true; - extensions.Remove("glMESA_pack_invert"); - } - if (extensions.Contains("gl_MESA_program_binary_formats")) - { - MESA_program_binary_formats = true; - extensions.Remove("glMESA_program_binary_formats"); - } - if (extensions.Contains("gl_MESA_resize_buffers")) - { - MESA_resize_buffers = true; - extensions.Remove("glMESA_resize_buffers"); - } - if (extensions.Contains("gl_MESA_shader_integer_functions")) - { - MESA_shader_integer_functions = true; - extensions.Remove("glMESA_shader_integer_functions"); - } - if (extensions.Contains("gl_MESA_tile_raster_order")) - { - MESA_tile_raster_order = true; - extensions.Remove("glMESA_tile_raster_order"); - } - if (extensions.Contains("gl_MESA_window_pos")) - { - MESA_window_pos = true; - extensions.Remove("glMESA_window_pos"); - } - if (extensions.Contains("gl_MESA_ycbcr_texture")) - { - MESA_ycbcr_texture = true; - extensions.Remove("glMESA_ycbcr_texture"); - } - if (extensions.Contains("gl_NVX_blend_equation_advanced_multi_draw_buffers")) - { - NVX_blend_equation_advanced_multi_draw_buffers = true; - extensions.Remove("glNVX_blend_equation_advanced_multi_draw_buffers"); - } - if (extensions.Contains("gl_NVX_conditional_render")) - { - NVX_conditional_render = true; - extensions.Remove("glNVX_conditional_render"); - } - if (extensions.Contains("gl_NVX_gpu_memory_info")) - { - NVX_gpu_memory_info = true; - extensions.Remove("glNVX_gpu_memory_info"); - } - if (extensions.Contains("gl_NVX_gpu_multicast2")) - { - NVX_gpu_multicast2 = true; - extensions.Remove("glNVX_gpu_multicast2"); - } - if (extensions.Contains("gl_NVX_linked_gpu_multicast")) - { - NVX_linked_gpu_multicast = true; - extensions.Remove("glNVX_linked_gpu_multicast"); - } - if (extensions.Contains("gl_NVX_progress_fence")) - { - NVX_progress_fence = true; - extensions.Remove("glNVX_progress_fence"); - } - if (extensions.Contains("gl_NV_alpha_to_coverage_dither_control")) - { - NV_alpha_to_coverage_dither_control = true; - extensions.Remove("glNV_alpha_to_coverage_dither_control"); - } - if (extensions.Contains("gl_NV_bindless_multi_draw_indirect")) - { - NV_bindless_multi_draw_indirect = true; - extensions.Remove("glNV_bindless_multi_draw_indirect"); - } - if (extensions.Contains("gl_NV_bindless_multi_draw_indirect_count")) - { - NV_bindless_multi_draw_indirect_count = true; - extensions.Remove("glNV_bindless_multi_draw_indirect_count"); - } - if (extensions.Contains("gl_NV_bindless_texture")) - { - NV_bindless_texture = true; - extensions.Remove("glNV_bindless_texture"); - } - if (extensions.Contains("gl_NV_blend_equation_advanced")) - { - NV_blend_equation_advanced = true; - extensions.Remove("glNV_blend_equation_advanced"); - } - if (extensions.Contains("gl_NV_blend_equation_advanced_coherent")) - { - NV_blend_equation_advanced_coherent = true; - extensions.Remove("glNV_blend_equation_advanced_coherent"); - } - if (extensions.Contains("gl_NV_blend_minmax_factor")) - { - NV_blend_minmax_factor = true; - extensions.Remove("glNV_blend_minmax_factor"); - } - if (extensions.Contains("gl_NV_blend_square")) - { - NV_blend_square = true; - extensions.Remove("glNV_blend_square"); - } - if (extensions.Contains("gl_NV_clip_space_w_scaling")) - { - NV_clip_space_w_scaling = true; - extensions.Remove("glNV_clip_space_w_scaling"); - } - if (extensions.Contains("gl_NV_command_list")) - { - NV_command_list = true; - extensions.Remove("glNV_command_list"); - } - if (extensions.Contains("gl_NV_compute_program5")) - { - NV_compute_program5 = true; - extensions.Remove("glNV_compute_program5"); - } - if (extensions.Contains("gl_NV_compute_shader_derivatives")) - { - NV_compute_shader_derivatives = true; - extensions.Remove("glNV_compute_shader_derivatives"); - } - if (extensions.Contains("gl_NV_conditional_render")) - { - NV_conditional_render = true; - extensions.Remove("glNV_conditional_render"); - } - if (extensions.Contains("gl_NV_conservative_raster")) - { - NV_conservative_raster = true; - extensions.Remove("glNV_conservative_raster"); - } - if (extensions.Contains("gl_NV_conservative_raster_dilate")) - { - NV_conservative_raster_dilate = true; - extensions.Remove("glNV_conservative_raster_dilate"); - } - if (extensions.Contains("gl_NV_conservative_raster_pre_snap")) - { - NV_conservative_raster_pre_snap = true; - extensions.Remove("glNV_conservative_raster_pre_snap"); - } - if (extensions.Contains("gl_NV_conservative_raster_pre_snap_triangles")) - { - NV_conservative_raster_pre_snap_triangles = true; - extensions.Remove("glNV_conservative_raster_pre_snap_triangles"); - } - if (extensions.Contains("gl_NV_conservative_raster_underestimation")) - { - NV_conservative_raster_underestimation = true; - extensions.Remove("glNV_conservative_raster_underestimation"); - } - if (extensions.Contains("gl_NV_copy_depth_to_color")) - { - NV_copy_depth_to_color = true; - extensions.Remove("glNV_copy_depth_to_color"); - } - if (extensions.Contains("gl_NV_copy_image")) - { - NV_copy_image = true; - extensions.Remove("glNV_copy_image"); - } - if (extensions.Contains("gl_NV_deep_texture3D")) - { - NV_deep_texture3D = true; - extensions.Remove("glNV_deep_texture3D"); - } - if (extensions.Contains("gl_NV_depth_buffer_float")) - { - NV_depth_buffer_float = true; - extensions.Remove("glNV_depth_buffer_float"); - } - if (extensions.Contains("gl_NV_depth_clamp")) - { - NV_depth_clamp = true; - extensions.Remove("glNV_depth_clamp"); - } - if (extensions.Contains("gl_NV_draw_texture")) - { - NV_draw_texture = true; - extensions.Remove("glNV_draw_texture"); - } - if (extensions.Contains("gl_NV_draw_vulkan_image")) - { - NV_draw_vulkan_image = true; - extensions.Remove("glNV_draw_vulkan_image"); - } - if (extensions.Contains("gl_NV_evaluators")) - { - NV_evaluators = true; - extensions.Remove("glNV_evaluators"); - } - if (extensions.Contains("gl_NV_explicit_multisample")) - { - NV_explicit_multisample = true; - extensions.Remove("glNV_explicit_multisample"); - } - if (extensions.Contains("gl_NV_fence")) - { - NV_fence = true; - extensions.Remove("glNV_fence"); - } - if (extensions.Contains("gl_NV_fill_rectangle")) - { - NV_fill_rectangle = true; - extensions.Remove("glNV_fill_rectangle"); - } - if (extensions.Contains("gl_NV_float_buffer")) - { - NV_float_buffer = true; - extensions.Remove("glNV_float_buffer"); - } - if (extensions.Contains("gl_NV_fog_distance")) - { - NV_fog_distance = true; - extensions.Remove("glNV_fog_distance"); - } - if (extensions.Contains("gl_NV_fragment_coverage_to_color")) - { - NV_fragment_coverage_to_color = true; - extensions.Remove("glNV_fragment_coverage_to_color"); - } - if (extensions.Contains("gl_NV_fragment_program")) - { - NV_fragment_program = true; - extensions.Remove("glNV_fragment_program"); - } - if (extensions.Contains("gl_NV_fragment_program2")) - { - NV_fragment_program2 = true; - extensions.Remove("glNV_fragment_program2"); - } - if (extensions.Contains("gl_NV_fragment_program4")) - { - NV_fragment_program4 = true; - extensions.Remove("glNV_fragment_program4"); - } - if (extensions.Contains("gl_NV_fragment_program_option")) - { - NV_fragment_program_option = true; - extensions.Remove("glNV_fragment_program_option"); - } - if (extensions.Contains("gl_NV_fragment_shader_barycentric")) - { - NV_fragment_shader_barycentric = true; - extensions.Remove("glNV_fragment_shader_barycentric"); - } - if (extensions.Contains("gl_NV_fragment_shader_interlock")) - { - NV_fragment_shader_interlock = true; - extensions.Remove("glNV_fragment_shader_interlock"); - } - if (extensions.Contains("gl_NV_framebuffer_mixed_samples")) - { - NV_framebuffer_mixed_samples = true; - extensions.Remove("glNV_framebuffer_mixed_samples"); - } - if (extensions.Contains("gl_NV_framebuffer_multisample_coverage")) - { - NV_framebuffer_multisample_coverage = true; - extensions.Remove("glNV_framebuffer_multisample_coverage"); - } - if (extensions.Contains("gl_NV_geometry_program4")) - { - NV_geometry_program4 = true; - extensions.Remove("glNV_geometry_program4"); - } - if (extensions.Contains("gl_NV_geometry_shader4")) - { - NV_geometry_shader4 = true; - extensions.Remove("glNV_geometry_shader4"); - } - if (extensions.Contains("gl_NV_geometry_shader_passthrough")) - { - NV_geometry_shader_passthrough = true; - extensions.Remove("glNV_geometry_shader_passthrough"); - } - if (extensions.Contains("gl_NV_gpu_multicast")) - { - NV_gpu_multicast = true; - extensions.Remove("glNV_gpu_multicast"); - } - if (extensions.Contains("gl_NV_gpu_program4")) - { - NV_gpu_program4 = true; - extensions.Remove("glNV_gpu_program4"); - } - if (extensions.Contains("gl_NV_gpu_program5")) - { - NV_gpu_program5 = true; - extensions.Remove("glNV_gpu_program5"); - } - if (extensions.Contains("gl_NV_gpu_program5_mem_extended")) - { - NV_gpu_program5_mem_extended = true; - extensions.Remove("glNV_gpu_program5_mem_extended"); - } - if (extensions.Contains("gl_NV_gpu_shader5")) - { - NV_gpu_shader5 = true; - extensions.Remove("glNV_gpu_shader5"); - } - if (extensions.Contains("gl_NV_half_float")) - { - NV_half_float = true; - extensions.Remove("glNV_half_float"); - } - if (extensions.Contains("gl_NV_internalformat_sample_query")) - { - NV_internalformat_sample_query = true; - extensions.Remove("glNV_internalformat_sample_query"); - } - if (extensions.Contains("gl_NV_light_max_exponent")) - { - NV_light_max_exponent = true; - extensions.Remove("glNV_light_max_exponent"); - } - if (extensions.Contains("gl_NV_memory_attachment")) - { - NV_memory_attachment = true; - extensions.Remove("glNV_memory_attachment"); - } - if (extensions.Contains("gl_NV_memory_object_sparse")) - { - NV_memory_object_sparse = true; - extensions.Remove("glNV_memory_object_sparse"); - } - if (extensions.Contains("gl_NV_mesh_shader")) - { - NV_mesh_shader = true; - extensions.Remove("glNV_mesh_shader"); - } - if (extensions.Contains("gl_NV_multisample_coverage")) - { - NV_multisample_coverage = true; - extensions.Remove("glNV_multisample_coverage"); - } - if (extensions.Contains("gl_NV_multisample_filter_hint")) - { - NV_multisample_filter_hint = true; - extensions.Remove("glNV_multisample_filter_hint"); - } - if (extensions.Contains("gl_NV_occlusion_query")) - { - NV_occlusion_query = true; - extensions.Remove("glNV_occlusion_query"); - } - if (extensions.Contains("gl_NV_packed_depth_stencil")) - { - NV_packed_depth_stencil = true; - extensions.Remove("glNV_packed_depth_stencil"); - } - if (extensions.Contains("gl_NV_parameter_buffer_object")) - { - NV_parameter_buffer_object = true; - extensions.Remove("glNV_parameter_buffer_object"); - } - if (extensions.Contains("gl_NV_parameter_buffer_object2")) - { - NV_parameter_buffer_object2 = true; - extensions.Remove("glNV_parameter_buffer_object2"); - } - if (extensions.Contains("gl_NV_path_rendering")) - { - NV_path_rendering = true; - extensions.Remove("glNV_path_rendering"); - } - if (extensions.Contains("gl_NV_path_rendering_shared_edge")) - { - NV_path_rendering_shared_edge = true; - extensions.Remove("glNV_path_rendering_shared_edge"); - } - if (extensions.Contains("gl_NV_pixel_data_range")) - { - NV_pixel_data_range = true; - extensions.Remove("glNV_pixel_data_range"); - } - if (extensions.Contains("gl_NV_point_sprite")) - { - NV_point_sprite = true; - extensions.Remove("glNV_point_sprite"); - } - if (extensions.Contains("gl_NV_present_video")) - { - NV_present_video = true; - extensions.Remove("glNV_present_video"); - } - if (extensions.Contains("gl_NV_primitive_restart")) - { - NV_primitive_restart = true; - extensions.Remove("glNV_primitive_restart"); - } - if (extensions.Contains("gl_NV_primitive_shading_rate")) - { - NV_primitive_shading_rate = true; - extensions.Remove("glNV_primitive_shading_rate"); - } - if (extensions.Contains("gl_NV_query_resource")) - { - NV_query_resource = true; - extensions.Remove("glNV_query_resource"); - } - if (extensions.Contains("gl_NV_query_resource_tag")) - { - NV_query_resource_tag = true; - extensions.Remove("glNV_query_resource_tag"); - } - if (extensions.Contains("gl_NV_register_combiners")) - { - NV_register_combiners = true; - extensions.Remove("glNV_register_combiners"); - } - if (extensions.Contains("gl_NV_register_combiners2")) - { - NV_register_combiners2 = true; - extensions.Remove("glNV_register_combiners2"); - } - if (extensions.Contains("gl_NV_representative_fragment_test")) - { - NV_representative_fragment_test = true; - extensions.Remove("glNV_representative_fragment_test"); - } - if (extensions.Contains("gl_NV_robustness_video_memory_purge")) - { - NV_robustness_video_memory_purge = true; - extensions.Remove("glNV_robustness_video_memory_purge"); - } - if (extensions.Contains("gl_NV_sample_locations")) - { - NV_sample_locations = true; - extensions.Remove("glNV_sample_locations"); - } - if (extensions.Contains("gl_NV_sample_mask_override_coverage")) - { - NV_sample_mask_override_coverage = true; - extensions.Remove("glNV_sample_mask_override_coverage"); - } - if (extensions.Contains("gl_NV_scissor_exclusive")) - { - NV_scissor_exclusive = true; - extensions.Remove("glNV_scissor_exclusive"); - } - if (extensions.Contains("gl_NV_shader_atomic_counters")) - { - NV_shader_atomic_counters = true; - extensions.Remove("glNV_shader_atomic_counters"); - } - if (extensions.Contains("gl_NV_shader_atomic_float")) - { - NV_shader_atomic_float = true; - extensions.Remove("glNV_shader_atomic_float"); - } - if (extensions.Contains("gl_NV_shader_atomic_float64")) - { - NV_shader_atomic_float64 = true; - extensions.Remove("glNV_shader_atomic_float64"); - } - if (extensions.Contains("gl_NV_shader_atomic_fp16_vector")) - { - NV_shader_atomic_fp16_vector = true; - extensions.Remove("glNV_shader_atomic_fp16_vector"); - } - if (extensions.Contains("gl_NV_shader_atomic_int64")) - { - NV_shader_atomic_int64 = true; - extensions.Remove("glNV_shader_atomic_int64"); - } - if (extensions.Contains("gl_NV_shader_buffer_load")) - { - NV_shader_buffer_load = true; - extensions.Remove("glNV_shader_buffer_load"); - } - if (extensions.Contains("gl_NV_shader_buffer_store")) - { - NV_shader_buffer_store = true; - extensions.Remove("glNV_shader_buffer_store"); - } - if (extensions.Contains("gl_NV_shader_storage_buffer_object")) - { - NV_shader_storage_buffer_object = true; - extensions.Remove("glNV_shader_storage_buffer_object"); - } - if (extensions.Contains("gl_NV_shader_subgroup_partitioned")) - { - NV_shader_subgroup_partitioned = true; - extensions.Remove("glNV_shader_subgroup_partitioned"); - } - if (extensions.Contains("gl_NV_shader_texture_footprint")) - { - NV_shader_texture_footprint = true; - extensions.Remove("glNV_shader_texture_footprint"); - } - if (extensions.Contains("gl_NV_shader_thread_group")) - { - NV_shader_thread_group = true; - extensions.Remove("glNV_shader_thread_group"); - } - if (extensions.Contains("gl_NV_shader_thread_shuffle")) - { - NV_shader_thread_shuffle = true; - extensions.Remove("glNV_shader_thread_shuffle"); - } - if (extensions.Contains("gl_NV_shading_rate_image")) - { - NV_shading_rate_image = true; - extensions.Remove("glNV_shading_rate_image"); - } - if (extensions.Contains("gl_NV_stereo_view_rendering")) - { - NV_stereo_view_rendering = true; - extensions.Remove("glNV_stereo_view_rendering"); - } - if (extensions.Contains("gl_NV_tessellation_program5")) - { - NV_tessellation_program5 = true; - extensions.Remove("glNV_tessellation_program5"); - } - if (extensions.Contains("gl_NV_texgen_emboss")) - { - NV_texgen_emboss = true; - extensions.Remove("glNV_texgen_emboss"); - } - if (extensions.Contains("gl_NV_texgen_reflection")) - { - NV_texgen_reflection = true; - extensions.Remove("glNV_texgen_reflection"); - } - if (extensions.Contains("gl_NV_texture_barrier")) - { - NV_texture_barrier = true; - extensions.Remove("glNV_texture_barrier"); - } - if (extensions.Contains("gl_NV_texture_compression_vtc")) - { - NV_texture_compression_vtc = true; - extensions.Remove("glNV_texture_compression_vtc"); - } - if (extensions.Contains("gl_NV_texture_env_combine4")) - { - NV_texture_env_combine4 = true; - extensions.Remove("glNV_texture_env_combine4"); - } - if (extensions.Contains("gl_NV_texture_expand_normal")) - { - NV_texture_expand_normal = true; - extensions.Remove("glNV_texture_expand_normal"); - } - if (extensions.Contains("gl_NV_texture_multisample")) - { - NV_texture_multisample = true; - extensions.Remove("glNV_texture_multisample"); - } - if (extensions.Contains("gl_NV_texture_rectangle")) - { - NV_texture_rectangle = true; - extensions.Remove("glNV_texture_rectangle"); - } - if (extensions.Contains("gl_NV_texture_rectangle_compressed")) - { - NV_texture_rectangle_compressed = true; - extensions.Remove("glNV_texture_rectangle_compressed"); - } - if (extensions.Contains("gl_NV_texture_shader")) - { - NV_texture_shader = true; - extensions.Remove("glNV_texture_shader"); - } - if (extensions.Contains("gl_NV_texture_shader2")) - { - NV_texture_shader2 = true; - extensions.Remove("glNV_texture_shader2"); - } - if (extensions.Contains("gl_NV_texture_shader3")) - { - NV_texture_shader3 = true; - extensions.Remove("glNV_texture_shader3"); - } - if (extensions.Contains("gl_NV_timeline_semaphore")) - { - NV_timeline_semaphore = true; - extensions.Remove("glNV_timeline_semaphore"); - } - if (extensions.Contains("gl_NV_transform_feedback")) - { - NV_transform_feedback = true; - extensions.Remove("glNV_transform_feedback"); - } - if (extensions.Contains("gl_NV_transform_feedback2")) - { - NV_transform_feedback2 = true; - extensions.Remove("glNV_transform_feedback2"); - } - if (extensions.Contains("gl_NV_uniform_buffer_std430_layout")) - { - NV_uniform_buffer_std430_layout = true; - extensions.Remove("glNV_uniform_buffer_std430_layout"); - } - if (extensions.Contains("gl_NV_uniform_buffer_unified_memory")) - { - NV_uniform_buffer_unified_memory = true; - extensions.Remove("glNV_uniform_buffer_unified_memory"); - } - if (extensions.Contains("gl_NV_vdpau_interop")) - { - NV_vdpau_interop = true; - extensions.Remove("glNV_vdpau_interop"); - } - if (extensions.Contains("gl_NV_vdpau_interop2")) - { - NV_vdpau_interop2 = true; - extensions.Remove("glNV_vdpau_interop2"); - } - if (extensions.Contains("gl_NV_vertex_array_range")) - { - NV_vertex_array_range = true; - extensions.Remove("glNV_vertex_array_range"); - } - if (extensions.Contains("gl_NV_vertex_array_range2")) - { - NV_vertex_array_range2 = true; - extensions.Remove("glNV_vertex_array_range2"); - } - if (extensions.Contains("gl_NV_vertex_attrib_integer_64bit")) - { - NV_vertex_attrib_integer_64bit = true; - extensions.Remove("glNV_vertex_attrib_integer_64bit"); - } - if (extensions.Contains("gl_NV_vertex_buffer_unified_memory")) - { - NV_vertex_buffer_unified_memory = true; - extensions.Remove("glNV_vertex_buffer_unified_memory"); - } - if (extensions.Contains("gl_NV_vertex_program")) - { - NV_vertex_program = true; - extensions.Remove("glNV_vertex_program"); - } - if (extensions.Contains("gl_NV_vertex_program1_1")) - { - NV_vertex_program1_1 = true; - extensions.Remove("glNV_vertex_program1_1"); - } - if (extensions.Contains("gl_NV_vertex_program2")) - { - NV_vertex_program2 = true; - extensions.Remove("glNV_vertex_program2"); - } - if (extensions.Contains("gl_NV_vertex_program2_option")) - { - NV_vertex_program2_option = true; - extensions.Remove("glNV_vertex_program2_option"); - } - if (extensions.Contains("gl_NV_vertex_program3")) - { - NV_vertex_program3 = true; - extensions.Remove("glNV_vertex_program3"); - } - if (extensions.Contains("gl_NV_vertex_program4")) - { - NV_vertex_program4 = true; - extensions.Remove("glNV_vertex_program4"); - } - if (extensions.Contains("gl_NV_video_capture")) - { - NV_video_capture = true; - extensions.Remove("glNV_video_capture"); - } - if (extensions.Contains("gl_NV_viewport_array2")) - { - NV_viewport_array2 = true; - extensions.Remove("glNV_viewport_array2"); - } - if (extensions.Contains("gl_NV_viewport_swizzle")) - { - NV_viewport_swizzle = true; - extensions.Remove("glNV_viewport_swizzle"); - } - if (extensions.Contains("gl_OES_byte_coordinates")) - { - OES_byte_coordinates = true; - extensions.Remove("glOES_byte_coordinates"); - } - if (extensions.Contains("gl_OES_compressed_paletted_texture")) - { - OES_compressed_paletted_texture = true; - extensions.Remove("glOES_compressed_paletted_texture"); - } - if (extensions.Contains("gl_OES_fixed_point")) - { - OES_fixed_point = true; - extensions.Remove("glOES_fixed_point"); - } - if (extensions.Contains("gl_OES_query_matrix")) - { - OES_query_matrix = true; - extensions.Remove("glOES_query_matrix"); - } - if (extensions.Contains("gl_OES_read_format")) - { - OES_read_format = true; - extensions.Remove("glOES_read_format"); - } - if (extensions.Contains("gl_OES_single_precision")) - { - OES_single_precision = true; - extensions.Remove("glOES_single_precision"); - } - if (extensions.Contains("gl_OML_interlace")) - { - OML_interlace = true; - extensions.Remove("glOML_interlace"); - } - if (extensions.Contains("gl_OML_resample")) - { - OML_resample = true; - extensions.Remove("glOML_resample"); - } - if (extensions.Contains("gl_OML_subsample")) - { - OML_subsample = true; - extensions.Remove("glOML_subsample"); - } - if (extensions.Contains("gl_OVR_multiview")) - { - OVR_multiview = true; - extensions.Remove("glOVR_multiview"); - } - if (extensions.Contains("gl_OVR_multiview2")) - { - OVR_multiview2 = true; - extensions.Remove("glOVR_multiview2"); - } - if (extensions.Contains("gl_PGI_misc_hints")) - { - PGI_misc_hints = true; - extensions.Remove("glPGI_misc_hints"); - } - if (extensions.Contains("gl_PGI_vertex_hints")) - { - PGI_vertex_hints = true; - extensions.Remove("glPGI_vertex_hints"); - } - if (extensions.Contains("gl_REND_screen_coordinates")) - { - REND_screen_coordinates = true; - extensions.Remove("glREND_screen_coordinates"); - } - if (extensions.Contains("gl_S3_s3tc")) - { - S3_s3tc = true; - extensions.Remove("glS3_s3tc"); - } - if (extensions.Contains("gl_SGIS_detail_texture")) - { - SGIS_detail_texture = true; - extensions.Remove("glSGIS_detail_texture"); - } - if (extensions.Contains("gl_SGIS_fog_function")) - { - SGIS_fog_function = true; - extensions.Remove("glSGIS_fog_function"); - } - if (extensions.Contains("gl_SGIS_generate_mipmap")) - { - SGIS_generate_mipmap = true; - extensions.Remove("glSGIS_generate_mipmap"); - } - if (extensions.Contains("gl_SGIS_multisample")) - { - SGIS_multisample = true; - extensions.Remove("glSGIS_multisample"); - } - if (extensions.Contains("gl_SGIS_pixel_texture")) - { - SGIS_pixel_texture = true; - extensions.Remove("glSGIS_pixel_texture"); - } - if (extensions.Contains("gl_SGIS_point_line_texgen")) - { - SGIS_point_line_texgen = true; - extensions.Remove("glSGIS_point_line_texgen"); - } - if (extensions.Contains("gl_SGIS_point_parameters")) - { - SGIS_point_parameters = true; - extensions.Remove("glSGIS_point_parameters"); - } - if (extensions.Contains("gl_SGIS_sharpen_texture")) - { - SGIS_sharpen_texture = true; - extensions.Remove("glSGIS_sharpen_texture"); - } - if (extensions.Contains("gl_SGIS_texture4D")) - { - SGIS_texture4D = true; - extensions.Remove("glSGIS_texture4D"); - } - if (extensions.Contains("gl_SGIS_texture_border_clamp")) - { - SGIS_texture_border_clamp = true; - extensions.Remove("glSGIS_texture_border_clamp"); - } - if (extensions.Contains("gl_SGIS_texture_color_mask")) - { - SGIS_texture_color_mask = true; - extensions.Remove("glSGIS_texture_color_mask"); - } - if (extensions.Contains("gl_SGIS_texture_edge_clamp")) - { - SGIS_texture_edge_clamp = true; - extensions.Remove("glSGIS_texture_edge_clamp"); - } - if (extensions.Contains("gl_SGIS_texture_filter4")) - { - SGIS_texture_filter4 = true; - extensions.Remove("glSGIS_texture_filter4"); - } - if (extensions.Contains("gl_SGIS_texture_lod")) - { - SGIS_texture_lod = true; - extensions.Remove("glSGIS_texture_lod"); - } - if (extensions.Contains("gl_SGIS_texture_select")) - { - SGIS_texture_select = true; - extensions.Remove("glSGIS_texture_select"); - } - if (extensions.Contains("gl_SGIX_async")) - { - SGIX_async = true; - extensions.Remove("glSGIX_async"); - } - if (extensions.Contains("gl_SGIX_async_histogram")) - { - SGIX_async_histogram = true; - extensions.Remove("glSGIX_async_histogram"); - } - if (extensions.Contains("gl_SGIX_async_pixel")) - { - SGIX_async_pixel = true; - extensions.Remove("glSGIX_async_pixel"); - } - if (extensions.Contains("gl_SGIX_blend_alpha_minmax")) - { - SGIX_blend_alpha_minmax = true; - extensions.Remove("glSGIX_blend_alpha_minmax"); - } - if (extensions.Contains("gl_SGIX_calligraphic_fragment")) - { - SGIX_calligraphic_fragment = true; - extensions.Remove("glSGIX_calligraphic_fragment"); - } - if (extensions.Contains("gl_SGIX_clipmap")) - { - SGIX_clipmap = true; - extensions.Remove("glSGIX_clipmap"); - } - if (extensions.Contains("gl_SGIX_convolution_accuracy")) - { - SGIX_convolution_accuracy = true; - extensions.Remove("glSGIX_convolution_accuracy"); - } - if (extensions.Contains("gl_SGIX_depth_pass_instrument")) - { - SGIX_depth_pass_instrument = true; - extensions.Remove("glSGIX_depth_pass_instrument"); - } - if (extensions.Contains("gl_SGIX_depth_texture")) - { - SGIX_depth_texture = true; - extensions.Remove("glSGIX_depth_texture"); - } - if (extensions.Contains("gl_SGIX_flush_raster")) - { - SGIX_flush_raster = true; - extensions.Remove("glSGIX_flush_raster"); - } - if (extensions.Contains("gl_SGIX_fog_offset")) - { - SGIX_fog_offset = true; - extensions.Remove("glSGIX_fog_offset"); - } - if (extensions.Contains("gl_SGIX_fragment_lighting")) - { - SGIX_fragment_lighting = true; - extensions.Remove("glSGIX_fragment_lighting"); - } - if (extensions.Contains("gl_SGIX_framezoom")) - { - SGIX_framezoom = true; - extensions.Remove("glSGIX_framezoom"); - } - if (extensions.Contains("gl_SGIX_igloo_interface")) - { - SGIX_igloo_interface = true; - extensions.Remove("glSGIX_igloo_interface"); - } - if (extensions.Contains("gl_SGIX_instruments")) - { - SGIX_instruments = true; - extensions.Remove("glSGIX_instruments"); - } - if (extensions.Contains("gl_SGIX_interlace")) - { - SGIX_interlace = true; - extensions.Remove("glSGIX_interlace"); - } - if (extensions.Contains("gl_SGIX_ir_instrument1")) - { - SGIX_ir_instrument1 = true; - extensions.Remove("glSGIX_ir_instrument1"); - } - if (extensions.Contains("gl_SGIX_list_priority")) - { - SGIX_list_priority = true; - extensions.Remove("glSGIX_list_priority"); - } - if (extensions.Contains("gl_SGIX_pixel_texture")) - { - SGIX_pixel_texture = true; - extensions.Remove("glSGIX_pixel_texture"); - } - if (extensions.Contains("gl_SGIX_pixel_tiles")) - { - SGIX_pixel_tiles = true; - extensions.Remove("glSGIX_pixel_tiles"); - } - if (extensions.Contains("gl_SGIX_polynomial_ffd")) - { - SGIX_polynomial_ffd = true; - extensions.Remove("glSGIX_polynomial_ffd"); - } - if (extensions.Contains("gl_SGIX_reference_plane")) - { - SGIX_reference_plane = true; - extensions.Remove("glSGIX_reference_plane"); - } - if (extensions.Contains("gl_SGIX_resample")) - { - SGIX_resample = true; - extensions.Remove("glSGIX_resample"); - } - if (extensions.Contains("gl_SGIX_scalebias_hint")) - { - SGIX_scalebias_hint = true; - extensions.Remove("glSGIX_scalebias_hint"); - } - if (extensions.Contains("gl_SGIX_shadow")) - { - SGIX_shadow = true; - extensions.Remove("glSGIX_shadow"); - } - if (extensions.Contains("gl_SGIX_shadow_ambient")) - { - SGIX_shadow_ambient = true; - extensions.Remove("glSGIX_shadow_ambient"); - } - if (extensions.Contains("gl_SGIX_sprite")) - { - SGIX_sprite = true; - extensions.Remove("glSGIX_sprite"); - } - if (extensions.Contains("gl_SGIX_subsample")) - { - SGIX_subsample = true; - extensions.Remove("glSGIX_subsample"); - } - if (extensions.Contains("gl_SGIX_tag_sample_buffer")) - { - SGIX_tag_sample_buffer = true; - extensions.Remove("glSGIX_tag_sample_buffer"); - } - if (extensions.Contains("gl_SGIX_texture_add_env")) - { - SGIX_texture_add_env = true; - extensions.Remove("glSGIX_texture_add_env"); - } - if (extensions.Contains("gl_SGIX_texture_coordinate_clamp")) - { - SGIX_texture_coordinate_clamp = true; - extensions.Remove("glSGIX_texture_coordinate_clamp"); - } - if (extensions.Contains("gl_SGIX_texture_lod_bias")) - { - SGIX_texture_lod_bias = true; - extensions.Remove("glSGIX_texture_lod_bias"); - } - if (extensions.Contains("gl_SGIX_texture_multi_buffer")) - { - SGIX_texture_multi_buffer = true; - extensions.Remove("glSGIX_texture_multi_buffer"); - } - if (extensions.Contains("gl_SGIX_texture_scale_bias")) - { - SGIX_texture_scale_bias = true; - extensions.Remove("glSGIX_texture_scale_bias"); - } - if (extensions.Contains("gl_SGIX_vertex_preclip")) - { - SGIX_vertex_preclip = true; - extensions.Remove("glSGIX_vertex_preclip"); - } - if (extensions.Contains("gl_SGIX_ycrcb")) - { - SGIX_ycrcb = true; - extensions.Remove("glSGIX_ycrcb"); - } - if (extensions.Contains("gl_SGIX_ycrcb_subsample")) - { - SGIX_ycrcb_subsample = true; - extensions.Remove("glSGIX_ycrcb_subsample"); - } - if (extensions.Contains("gl_SGIX_ycrcba")) - { - SGIX_ycrcba = true; - extensions.Remove("glSGIX_ycrcba"); - } - if (extensions.Contains("gl_SGI_color_matrix")) - { - SGI_color_matrix = true; - extensions.Remove("glSGI_color_matrix"); - } - if (extensions.Contains("gl_SGI_color_table")) - { - SGI_color_table = true; - extensions.Remove("glSGI_color_table"); - } - if (extensions.Contains("gl_SGI_texture_color_table")) - { - SGI_texture_color_table = true; - extensions.Remove("glSGI_texture_color_table"); - } - if (extensions.Contains("gl_SUNX_constant_data")) - { - SUNX_constant_data = true; - extensions.Remove("glSUNX_constant_data"); - } - if (extensions.Contains("gl_SUN_convolution_border_modes")) - { - SUN_convolution_border_modes = true; - extensions.Remove("glSUN_convolution_border_modes"); - } - if (extensions.Contains("gl_SUN_global_alpha")) - { - SUN_global_alpha = true; - extensions.Remove("glSUN_global_alpha"); - } - if (extensions.Contains("gl_SUN_mesh_array")) - { - SUN_mesh_array = true; - extensions.Remove("glSUN_mesh_array"); - } - if (extensions.Contains("gl_SUN_slice_accum")) - { - SUN_slice_accum = true; - extensions.Remove("glSUN_slice_accum"); - } - if (extensions.Contains("gl_SUN_triangle_list")) - { - SUN_triangle_list = true; - extensions.Remove("glSUN_triangle_list"); - } - if (extensions.Contains("gl_SUN_vertex")) - { - SUN_vertex = true; - extensions.Remove("glSUN_vertex"); - } - if (extensions.Contains("gl_WIN_phong_shading")) - { - WIN_phong_shading = true; - extensions.Remove("glWIN_phong_shading"); - } - if (extensions.Contains("gl_WIN_specular_fog")) - { - WIN_specular_fog = true; - extensions.Remove("glWIN_specular_fog"); + if (extensions.Contains("gl_4DFX_multisample")) + { + _4DFX_multisample = true; + extensions.Remove("gl_4DFX_multisample"); + } + if (extensions.Contains("gl_3DFX_tbuffer")) + { + _3DFX_tbuffer = true; + extensions.Remove("gl_3DFX_tbuffer"); + } + if (extensions.Contains("gl_3DFX_texture_compression_FXT1")) + { + _3DFX_texture_compression_FXT1 = true; + extensions.Remove("gl_3DFX_texture_compression_FXT1"); + } + if (extensions.Contains("gl_AMD_blend_minmax_factor")) + { + AMD_blend_minmax_factor = true; + extensions.Remove("glAMD_blend_minmax_factor"); + } + if (extensions.Contains("gl_AMD_conservative_depth")) + { + AMD_conservative_depth = true; + extensions.Remove("glAMD_conservative_depth"); + } + if (extensions.Contains("gl_AMD_debug_output")) + { + AMD_debug_output = true; + extensions.Remove("glAMD_debug_output"); + } + if (extensions.Contains("gl_AMD_depth_clamp_separate")) + { + AMD_depth_clamp_separate = true; + extensions.Remove("glAMD_depth_clamp_separate"); + } + if (extensions.Contains("gl_AMD_draw_buffers_blend")) + { + AMD_draw_buffers_blend = true; + extensions.Remove("glAMD_draw_buffers_blend"); + } + if (extensions.Contains("gl_AMD_framebuffer_multisample_advanced")) + { + AMD_framebuffer_multisample_advanced = true; + extensions.Remove("glAMD_framebuffer_multisample_advanced"); + } + if (extensions.Contains("gl_AMD_framebuffer_sample_positions")) + { + AMD_framebuffer_sample_positions = true; + extensions.Remove("glAMD_framebuffer_sample_positions"); + } + if (extensions.Contains("gl_AMD_gcn_shader")) + { + AMD_gcn_shader = true; + extensions.Remove("glAMD_gcn_shader"); + } + if (extensions.Contains("gl_AMD_gpu_shader_half_float")) + { + AMD_gpu_shader_half_float = true; + extensions.Remove("glAMD_gpu_shader_half_float"); + } + if (extensions.Contains("gl_AMD_gpu_shader_int16")) + { + AMD_gpu_shader_int16 = true; + extensions.Remove("glAMD_gpu_shader_int16"); + } + if (extensions.Contains("gl_AMD_gpu_shader_int64")) + { + AMD_gpu_shader_int64 = true; + extensions.Remove("glAMD_gpu_shader_int64"); + } + if (extensions.Contains("gl_AMD_interleaved_elements")) + { + AMD_interleaved_elements = true; + extensions.Remove("glAMD_interleaved_elements"); + } + if (extensions.Contains("gl_AMD_multi_draw_indirect")) + { + AMD_multi_draw_indirect = true; + extensions.Remove("glAMD_multi_draw_indirect"); + } + if (extensions.Contains("gl_AMD_name_gen_delete")) + { + AMD_name_gen_delete = true; + extensions.Remove("glAMD_name_gen_delete"); + } + if (extensions.Contains("gl_AMD_occlusion_query_event")) + { + AMD_occlusion_query_event = true; + extensions.Remove("glAMD_occlusion_query_event"); + } + if (extensions.Contains("gl_AMD_performance_monitor")) + { + AMD_performance_monitor = true; + extensions.Remove("glAMD_performance_monitor"); + } + if (extensions.Contains("gl_AMD_pinned_memory")) + { + AMD_pinned_memory = true; + extensions.Remove("glAMD_pinned_memory"); + } + if (extensions.Contains("gl_AMD_query_buffer_object")) + { + AMD_query_buffer_object = true; + extensions.Remove("glAMD_query_buffer_object"); + } + if (extensions.Contains("gl_AMD_sample_positions")) + { + AMD_sample_positions = true; + extensions.Remove("glAMD_sample_positions"); + } + if (extensions.Contains("gl_AMD_seamless_cubemap_per_texture")) + { + AMD_seamless_cubemap_per_texture = true; + extensions.Remove("glAMD_seamless_cubemap_per_texture"); + } + if (extensions.Contains("gl_AMD_shader_atomic_counter_ops")) + { + AMD_shader_atomic_counter_ops = true; + extensions.Remove("glAMD_shader_atomic_counter_ops"); + } + if (extensions.Contains("gl_AMD_shader_ballot")) + { + AMD_shader_ballot = true; + extensions.Remove("glAMD_shader_ballot"); + } + if (extensions.Contains("gl_AMD_shader_explicit_vertex_parameter")) + { + AMD_shader_explicit_vertex_parameter = true; + extensions.Remove("glAMD_shader_explicit_vertex_parameter"); + } + if (extensions.Contains("gl_AMD_shader_gpu_shader_half_float_fetch")) + { + AMD_shader_gpu_shader_half_float_fetch = true; + extensions.Remove("glAMD_shader_gpu_shader_half_float_fetch"); + } + if (extensions.Contains("gl_AMD_shader_image_load_store_lod")) + { + AMD_shader_image_load_store_lod = true; + extensions.Remove("glAMD_shader_image_load_store_lod"); + } + if (extensions.Contains("gl_AMD_shader_stencil_export")) + { + AMD_shader_stencil_export = true; + extensions.Remove("glAMD_shader_stencil_export"); + } + if (extensions.Contains("gl_AMD_shader_trinary_minmax")) + { + AMD_shader_trinary_minmax = true; + extensions.Remove("glAMD_shader_trinary_minmax"); + } + if (extensions.Contains("gl_AMD_sparse_texture")) + { + AMD_sparse_texture = true; + extensions.Remove("glAMD_sparse_texture"); + } + if (extensions.Contains("gl_AMD_stencil_operation_extended")) + { + AMD_stencil_operation_extended = true; + extensions.Remove("glAMD_stencil_operation_extended"); + } + if (extensions.Contains("gl_AMD_texture_gather_bias_lod")) + { + AMD_texture_gather_bias_lod = true; + extensions.Remove("glAMD_texture_gather_bias_lod"); + } + if (extensions.Contains("gl_AMD_texture_texture4")) + { + AMD_texture_texture4 = true; + extensions.Remove("glAMD_texture_texture4"); + } + if (extensions.Contains("gl_AMD_transform_feedback3_lines_triangles")) + { + AMD_transform_feedback3_lines_triangles = true; + extensions.Remove("glAMD_transform_feedback3_lines_triangles"); + } + if (extensions.Contains("gl_AMD_transform_feedback4")) + { + AMD_transform_feedback4 = true; + extensions.Remove("glAMD_transform_feedback4"); + } + if (extensions.Contains("gl_AMD_vertex_shader_layer")) + { + AMD_vertex_shader_layer = true; + extensions.Remove("glAMD_vertex_shader_layer"); + } + if (extensions.Contains("gl_AMD_vertex_shader_tessellator")) + { + AMD_vertex_shader_tessellator = true; + extensions.Remove("glAMD_vertex_shader_tessellator"); + } + if (extensions.Contains("gl_AMD_vertex_shader_viewport_index")) + { + AMD_vertex_shader_viewport_index = true; + extensions.Remove("glAMD_vertex_shader_viewport_index"); + } + if (extensions.Contains("gl_APPLE_aux_depth_stencil")) + { + APPLE_aux_depth_stencil = true; + extensions.Remove("glAPPLE_aux_depth_stencil"); + } + if (extensions.Contains("gl_APPLE_client_storage")) + { + APPLE_client_storage = true; + extensions.Remove("glAPPLE_client_storage"); + } + if (extensions.Contains("gl_APPLE_element_array")) + { + APPLE_element_array = true; + extensions.Remove("glAPPLE_element_array"); + } + if (extensions.Contains("gl_APPLE_fence")) + { + APPLE_fence = true; + extensions.Remove("glAPPLE_fence"); + } + if (extensions.Contains("gl_APPLE_float_pixels")) + { + APPLE_float_pixels = true; + extensions.Remove("glAPPLE_float_pixels"); + } + if (extensions.Contains("gl_APPLE_flush_buffer_range")) + { + APPLE_flush_buffer_range = true; + extensions.Remove("glAPPLE_flush_buffer_range"); + } + if (extensions.Contains("gl_APPLE_object_purgeable")) + { + APPLE_object_purgeable = true; + extensions.Remove("glAPPLE_object_purgeable"); + } + if (extensions.Contains("gl_APPLE_rgb_422")) + { + APPLE_rgb_422 = true; + extensions.Remove("glAPPLE_rgb_422"); + } + if (extensions.Contains("gl_APPLE_row_bytes")) + { + APPLE_row_bytes = true; + extensions.Remove("glAPPLE_row_bytes"); + } + if (extensions.Contains("gl_APPLE_specular_vector")) + { + APPLE_specular_vector = true; + extensions.Remove("glAPPLE_specular_vector"); + } + if (extensions.Contains("gl_APPLE_texture_range")) + { + APPLE_texture_range = true; + extensions.Remove("glAPPLE_texture_range"); + } + if (extensions.Contains("gl_APPLE_transform_hint")) + { + APPLE_transform_hint = true; + extensions.Remove("glAPPLE_transform_hint"); + } + if (extensions.Contains("gl_APPLE_vertex_array_object")) + { + APPLE_vertex_array_object = true; + extensions.Remove("glAPPLE_vertex_array_object"); + } + if (extensions.Contains("gl_APPLE_vertex_array_range")) + { + APPLE_vertex_array_range = true; + extensions.Remove("glAPPLE_vertex_array_range"); + } + if (extensions.Contains("gl_APPLE_vertex_program_evaluators")) + { + APPLE_vertex_program_evaluators = true; + extensions.Remove("glAPPLE_vertex_program_evaluators"); + } + if (extensions.Contains("gl_APPLE_ycbcr_422")) + { + APPLE_ycbcr_422 = true; + extensions.Remove("glAPPLE_ycbcr_422"); + } + if (extensions.Contains("gl_ARB_ES2_compatibility")) + { + ARB_ES2_compatibility = true; + extensions.Remove("glARB_ES2_compatibility"); + } + if (extensions.Contains("gl_ARB_ES3_1_compatibility")) + { + ARB_ES3_1_compatibility = true; + extensions.Remove("glARB_ES3_1_compatibility"); + } + if (extensions.Contains("gl_ARB_ES3_2_compatibility")) + { + ARB_ES3_2_compatibility = true; + extensions.Remove("glARB_ES3_2_compatibility"); + } + if (extensions.Contains("gl_ARB_ES3_compatibility")) + { + ARB_ES3_compatibility = true; + extensions.Remove("glARB_ES3_compatibility"); + } + if (extensions.Contains("gl_ARB_arrays_of_arrays")) + { + ARB_arrays_of_arrays = true; + extensions.Remove("glARB_arrays_of_arrays"); + } + if (extensions.Contains("gl_ARB_base_instance")) + { + ARB_base_instance = true; + extensions.Remove("glARB_base_instance"); + } + if (extensions.Contains("gl_ARB_bindless_texture")) + { + ARB_bindless_texture = true; + extensions.Remove("glARB_bindless_texture"); + } + if (extensions.Contains("gl_ARB_blend_func_extended")) + { + ARB_blend_func_extended = true; + extensions.Remove("glARB_blend_func_extended"); + } + if (extensions.Contains("gl_ARB_buffer_storage")) + { + ARB_buffer_storage = true; + extensions.Remove("glARB_buffer_storage"); + } + if (extensions.Contains("gl_ARB_cl_event")) + { + ARB_cl_event = true; + extensions.Remove("glARB_cl_event"); + } + if (extensions.Contains("gl_ARB_clear_buffer_object")) + { + ARB_clear_buffer_object = true; + extensions.Remove("glARB_clear_buffer_object"); + } + if (extensions.Contains("gl_ARB_clear_texture")) + { + ARB_clear_texture = true; + extensions.Remove("glARB_clear_texture"); + } + if (extensions.Contains("gl_ARB_clip_control")) + { + ARB_clip_control = true; + extensions.Remove("glARB_clip_control"); + } + if (extensions.Contains("gl_ARB_color_buffer_float")) + { + ARB_color_buffer_float = true; + extensions.Remove("glARB_color_buffer_float"); + } + if (extensions.Contains("gl_ARB_compatibility")) + { + ARB_compatibility = true; + extensions.Remove("glARB_compatibility"); + } + if (extensions.Contains("gl_ARB_compressed_texture_pixel_storage")) + { + ARB_compressed_texture_pixel_storage = true; + extensions.Remove("glARB_compressed_texture_pixel_storage"); + } + if (extensions.Contains("gl_ARB_compute_shader")) + { + ARB_compute_shader = true; + extensions.Remove("glARB_compute_shader"); + } + if (extensions.Contains("gl_ARB_compute_variable_group_size")) + { + ARB_compute_variable_group_size = true; + extensions.Remove("glARB_compute_variable_group_size"); + } + if (extensions.Contains("gl_ARB_conditional_render_inverted")) + { + ARB_conditional_render_inverted = true; + extensions.Remove("glARB_conditional_render_inverted"); + } + if (extensions.Contains("gl_ARB_conservative_depth")) + { + ARB_conservative_depth = true; + extensions.Remove("glARB_conservative_depth"); + } + if (extensions.Contains("gl_ARB_copy_buffer")) + { + ARB_copy_buffer = true; + extensions.Remove("glARB_copy_buffer"); + } + if (extensions.Contains("gl_ARB_copy_image")) + { + ARB_copy_image = true; + extensions.Remove("glARB_copy_image"); + } + if (extensions.Contains("gl_ARB_cull_distance")) + { + ARB_cull_distance = true; + extensions.Remove("glARB_cull_distance"); + } + if (extensions.Contains("gl_ARB_debug_output")) + { + ARB_debug_output = true; + extensions.Remove("glARB_debug_output"); + } + if (extensions.Contains("gl_ARB_depth_buffer_float")) + { + ARB_depth_buffer_float = true; + extensions.Remove("glARB_depth_buffer_float"); + } + if (extensions.Contains("gl_ARB_depth_clamp")) + { + ARB_depth_clamp = true; + extensions.Remove("glARB_depth_clamp"); + } + if (extensions.Contains("gl_ARB_depth_texture")) + { + ARB_depth_texture = true; + extensions.Remove("glARB_depth_texture"); + } + if (extensions.Contains("gl_ARB_derivative_control")) + { + ARB_derivative_control = true; + extensions.Remove("glARB_derivative_control"); + } + if (extensions.Contains("gl_ARB_direct_state_access")) + { + ARB_direct_state_access = true; + extensions.Remove("glARB_direct_state_access"); + } + if (extensions.Contains("gl_ARB_draw_buffers")) + { + ARB_draw_buffers = true; + extensions.Remove("glARB_draw_buffers"); + } + if (extensions.Contains("gl_ARB_draw_buffers_blend")) + { + ARB_draw_buffers_blend = true; + extensions.Remove("glARB_draw_buffers_blend"); + } + if (extensions.Contains("gl_ARB_draw_elements_base_vertex")) + { + ARB_draw_elements_base_vertex = true; + extensions.Remove("glARB_draw_elements_base_vertex"); + } + if (extensions.Contains("gl_ARB_draw_indirect")) + { + ARB_draw_indirect = true; + extensions.Remove("glARB_draw_indirect"); + } + if (extensions.Contains("gl_ARB_draw_instanced")) + { + ARB_draw_instanced = true; + extensions.Remove("glARB_draw_instanced"); + } + if (extensions.Contains("gl_ARB_enhanced_layouts")) + { + ARB_enhanced_layouts = true; + extensions.Remove("glARB_enhanced_layouts"); + } + if (extensions.Contains("gl_ARB_explicit_attrib_location")) + { + ARB_explicit_attrib_location = true; + extensions.Remove("glARB_explicit_attrib_location"); + } + if (extensions.Contains("gl_ARB_explicit_uniform_location")) + { + ARB_explicit_uniform_location = true; + extensions.Remove("glARB_explicit_uniform_location"); + } + if (extensions.Contains("gl_ARB_fragment_coord_conventions")) + { + ARB_fragment_coord_conventions = true; + extensions.Remove("glARB_fragment_coord_conventions"); + } + if (extensions.Contains("gl_ARB_fragment_layer_viewport")) + { + ARB_fragment_layer_viewport = true; + extensions.Remove("glARB_fragment_layer_viewport"); + } + if (extensions.Contains("gl_ARB_fragment_program")) + { + ARB_fragment_program = true; + extensions.Remove("glARB_fragment_program"); + } + if (extensions.Contains("gl_ARB_fragment_program_shadow")) + { + ARB_fragment_program_shadow = true; + extensions.Remove("glARB_fragment_program_shadow"); + } + if (extensions.Contains("gl_ARB_fragment_shader")) + { + ARB_fragment_shader = true; + extensions.Remove("glARB_fragment_shader"); + } + if (extensions.Contains("gl_ARB_fragment_shader_interlock")) + { + ARB_fragment_shader_interlock = true; + extensions.Remove("glARB_fragment_shader_interlock"); + } + if (extensions.Contains("gl_ARB_framebuffer_no_attachments")) + { + ARB_framebuffer_no_attachments = true; + extensions.Remove("glARB_framebuffer_no_attachments"); + } + if (extensions.Contains("gl_ARB_framebuffer_object")) + { + ARB_framebuffer_object = true; + extensions.Remove("glARB_framebuffer_object"); + } + if (extensions.Contains("gl_ARB_framebuffer_sRGB")) + { + ARB_framebuffer_sRGB = true; + extensions.Remove("glARB_framebuffer_sRGB"); + } + if (extensions.Contains("gl_ARB_geometry_shader4")) + { + ARB_geometry_shader4 = true; + extensions.Remove("glARB_geometry_shader4"); + } + if (extensions.Contains("gl_ARB_get_program_binary")) + { + ARB_get_program_binary = true; + extensions.Remove("glARB_get_program_binary"); + } + if (extensions.Contains("gl_ARB_get_texture_sub_image")) + { + ARB_get_texture_sub_image = true; + extensions.Remove("glARB_get_texture_sub_image"); + } + if (extensions.Contains("gl_ARB_gl_spirv")) + { + ARB_gl_spirv = true; + extensions.Remove("glARB_gl_spirv"); + } + if (extensions.Contains("gl_ARB_gpu_shader5")) + { + ARB_gpu_shader5 = true; + extensions.Remove("glARB_gpu_shader5"); + } + if (extensions.Contains("gl_ARB_gpu_shader_fp64")) + { + ARB_gpu_shader_fp64 = true; + extensions.Remove("glARB_gpu_shader_fp64"); + } + if (extensions.Contains("gl_ARB_gpu_shader_int64")) + { + ARB_gpu_shader_int64 = true; + extensions.Remove("glARB_gpu_shader_int64"); + } + if (extensions.Contains("gl_ARB_half_float_pixel")) + { + ARB_half_float_pixel = true; + extensions.Remove("glARB_half_float_pixel"); + } + if (extensions.Contains("gl_ARB_half_float_vertex")) + { + ARB_half_float_vertex = true; + extensions.Remove("glARB_half_float_vertex"); + } + if (extensions.Contains("gl_ARB_imaging")) + { + ARB_imaging = true; + extensions.Remove("glARB_imaging"); + } + if (extensions.Contains("gl_ARB_indirect_parameters")) + { + ARB_indirect_parameters = true; + extensions.Remove("glARB_indirect_parameters"); + } + if (extensions.Contains("gl_ARB_instanced_arrays")) + { + ARB_instanced_arrays = true; + extensions.Remove("glARB_instanced_arrays"); + } + if (extensions.Contains("gl_ARB_internalformat_query")) + { + ARB_internalformat_query = true; + extensions.Remove("glARB_internalformat_query"); + } + if (extensions.Contains("gl_ARB_internalformat_query2")) + { + ARB_internalformat_query2 = true; + extensions.Remove("glARB_internalformat_query2"); + } + if (extensions.Contains("gl_ARB_invalidate_subdata")) + { + ARB_invalidate_subdata = true; + extensions.Remove("glARB_invalidate_subdata"); + } + if (extensions.Contains("gl_ARB_map_buffer_alignment")) + { + ARB_map_buffer_alignment = true; + extensions.Remove("glARB_map_buffer_alignment"); + } + if (extensions.Contains("gl_ARB_map_buffer_range")) + { + ARB_map_buffer_range = true; + extensions.Remove("glARB_map_buffer_range"); + } + if (extensions.Contains("gl_ARB_matrix_palette")) + { + ARB_matrix_palette = true; + extensions.Remove("glARB_matrix_palette"); + } + if (extensions.Contains("gl_ARB_multi_bind")) + { + ARB_multi_bind = true; + extensions.Remove("glARB_multi_bind"); + } + if (extensions.Contains("gl_ARB_multi_draw_indirect")) + { + ARB_multi_draw_indirect = true; + extensions.Remove("glARB_multi_draw_indirect"); + } + if (extensions.Contains("gl_ARB_multisample")) + { + ARB_multisample = true; + extensions.Remove("glARB_multisample"); + } + if (extensions.Contains("gl_ARB_multitexture")) + { + ARB_multitexture = true; + extensions.Remove("glARB_multitexture"); + } + if (extensions.Contains("gl_ARB_occlusion_query")) + { + ARB_occlusion_query = true; + extensions.Remove("glARB_occlusion_query"); + } + if (extensions.Contains("gl_ARB_occlusion_query2")) + { + ARB_occlusion_query2 = true; + extensions.Remove("glARB_occlusion_query2"); + } + if (extensions.Contains("gl_ARB_parallel_shader_compile")) + { + ARB_parallel_shader_compile = true; + extensions.Remove("glARB_parallel_shader_compile"); + } + if (extensions.Contains("gl_ARB_pipeline_statistics_query")) + { + ARB_pipeline_statistics_query = true; + extensions.Remove("glARB_pipeline_statistics_query"); + } + if (extensions.Contains("gl_ARB_pixel_buffer_object")) + { + ARB_pixel_buffer_object = true; + extensions.Remove("glARB_pixel_buffer_object"); + } + if (extensions.Contains("gl_ARB_point_parameters")) + { + ARB_point_parameters = true; + extensions.Remove("glARB_point_parameters"); + } + if (extensions.Contains("gl_ARB_point_sprite")) + { + ARB_point_sprite = true; + extensions.Remove("glARB_point_sprite"); + } + if (extensions.Contains("gl_ARB_polygon_offset_clamp")) + { + ARB_polygon_offset_clamp = true; + extensions.Remove("glARB_polygon_offset_clamp"); + } + if (extensions.Contains("gl_ARB_post_depth_coverage")) + { + ARB_post_depth_coverage = true; + extensions.Remove("glARB_post_depth_coverage"); + } + if (extensions.Contains("gl_ARB_program_interface_query")) + { + ARB_program_interface_query = true; + extensions.Remove("glARB_program_interface_query"); + } + if (extensions.Contains("gl_ARB_provoking_vertex")) + { + ARB_provoking_vertex = true; + extensions.Remove("glARB_provoking_vertex"); + } + if (extensions.Contains("gl_ARB_query_buffer_object")) + { + ARB_query_buffer_object = true; + extensions.Remove("glARB_query_buffer_object"); + } + if (extensions.Contains("gl_ARB_robust_buffer_access_behavior")) + { + ARB_robust_buffer_access_behavior = true; + extensions.Remove("glARB_robust_buffer_access_behavior"); + } + if (extensions.Contains("gl_ARB_robustness")) + { + ARB_robustness = true; + extensions.Remove("glARB_robustness"); + } + if (extensions.Contains("gl_ARB_robustness_isolation")) + { + ARB_robustness_isolation = true; + extensions.Remove("glARB_robustness_isolation"); + } + if (extensions.Contains("gl_ARB_sample_locations")) + { + ARB_sample_locations = true; + extensions.Remove("glARB_sample_locations"); + } + if (extensions.Contains("gl_ARB_sample_shading")) + { + ARB_sample_shading = true; + extensions.Remove("glARB_sample_shading"); + } + if (extensions.Contains("gl_ARB_sampler_objects")) + { + ARB_sampler_objects = true; + extensions.Remove("glARB_sampler_objects"); + } + if (extensions.Contains("gl_ARB_seamless_cube_map")) + { + ARB_seamless_cube_map = true; + extensions.Remove("glARB_seamless_cube_map"); + } + if (extensions.Contains("gl_ARB_seamless_cubemap_per_texture")) + { + ARB_seamless_cubemap_per_texture = true; + extensions.Remove("glARB_seamless_cubemap_per_texture"); + } + if (extensions.Contains("gl_ARB_separate_shader_objects")) + { + ARB_separate_shader_objects = true; + extensions.Remove("glARB_separate_shader_objects"); + } + if (extensions.Contains("gl_ARB_shader_atomic_counter_ops")) + { + ARB_shader_atomic_counter_ops = true; + extensions.Remove("glARB_shader_atomic_counter_ops"); + } + if (extensions.Contains("gl_ARB_shader_atomic_counters")) + { + ARB_shader_atomic_counters = true; + extensions.Remove("glARB_shader_atomic_counters"); + } + if (extensions.Contains("gl_ARB_shader_ballot")) + { + ARB_shader_ballot = true; + extensions.Remove("glARB_shader_ballot"); + } + if (extensions.Contains("gl_ARB_shader_bit_encoding")) + { + ARB_shader_bit_encoding = true; + extensions.Remove("glARB_shader_bit_encoding"); + } + if (extensions.Contains("gl_ARB_shader_clock")) + { + ARB_shader_clock = true; + extensions.Remove("glARB_shader_clock"); + } + if (extensions.Contains("gl_ARB_shader_draw_parameters")) + { + ARB_shader_draw_parameters = true; + extensions.Remove("glARB_shader_draw_parameters"); + } + if (extensions.Contains("gl_ARB_shader_group_vote")) + { + ARB_shader_group_vote = true; + extensions.Remove("glARB_shader_group_vote"); + } + if (extensions.Contains("gl_ARB_shader_image_load_store")) + { + ARB_shader_image_load_store = true; + extensions.Remove("glARB_shader_image_load_store"); + } + if (extensions.Contains("gl_ARB_shader_image_size")) + { + ARB_shader_image_size = true; + extensions.Remove("glARB_shader_image_size"); + } + if (extensions.Contains("gl_ARB_shader_objects")) + { + ARB_shader_objects = true; + extensions.Remove("glARB_shader_objects"); + } + if (extensions.Contains("gl_ARB_shader_precision")) + { + ARB_shader_precision = true; + extensions.Remove("glARB_shader_precision"); + } + if (extensions.Contains("gl_ARB_shader_stencil_export")) + { + ARB_shader_stencil_export = true; + extensions.Remove("glARB_shader_stencil_export"); + } + if (extensions.Contains("gl_ARB_shader_storage_buffer_object")) + { + ARB_shader_storage_buffer_object = true; + extensions.Remove("glARB_shader_storage_buffer_object"); + } + if (extensions.Contains("gl_ARB_shader_subroutine")) + { + ARB_shader_subroutine = true; + extensions.Remove("glARB_shader_subroutine"); + } + if (extensions.Contains("gl_ARB_shader_texture_image_samples")) + { + ARB_shader_texture_image_samples = true; + extensions.Remove("glARB_shader_texture_image_samples"); + } + if (extensions.Contains("gl_ARB_shader_texture_lod")) + { + ARB_shader_texture_lod = true; + extensions.Remove("glARB_shader_texture_lod"); + } + if (extensions.Contains("gl_ARB_shader_viewport_layer_array")) + { + ARB_shader_viewport_layer_array = true; + extensions.Remove("glARB_shader_viewport_layer_array"); + } + if (extensions.Contains("gl_ARB_shading_language_100")) + { + ARB_shading_language_100 = true; + extensions.Remove("glARB_shading_language_100"); + } + if (extensions.Contains("gl_ARB_shading_language_420pack")) + { + ARB_shading_language_420pack = true; + extensions.Remove("glARB_shading_language_420pack"); + } + if (extensions.Contains("gl_ARB_shading_language_include")) + { + ARB_shading_language_include = true; + extensions.Remove("glARB_shading_language_include"); + } + if (extensions.Contains("gl_ARB_shading_language_packing")) + { + ARB_shading_language_packing = true; + extensions.Remove("glARB_shading_language_packing"); + } + if (extensions.Contains("gl_ARB_shadow")) + { + ARB_shadow = true; + extensions.Remove("glARB_shadow"); + } + if (extensions.Contains("gl_ARB_shadow_ambient")) + { + ARB_shadow_ambient = true; + extensions.Remove("glARB_shadow_ambient"); + } + if (extensions.Contains("gl_ARB_sparse_buffer")) + { + ARB_sparse_buffer = true; + extensions.Remove("glARB_sparse_buffer"); + } + if (extensions.Contains("gl_ARB_sparse_texture")) + { + ARB_sparse_texture = true; + extensions.Remove("glARB_sparse_texture"); + } + if (extensions.Contains("gl_ARB_sparse_texture2")) + { + ARB_sparse_texture2 = true; + extensions.Remove("glARB_sparse_texture2"); + } + if (extensions.Contains("gl_ARB_sparse_texture_clamp")) + { + ARB_sparse_texture_clamp = true; + extensions.Remove("glARB_sparse_texture_clamp"); + } + if (extensions.Contains("gl_ARB_spirv_extensions")) + { + ARB_spirv_extensions = true; + extensions.Remove("glARB_spirv_extensions"); + } + if (extensions.Contains("gl_ARB_stencil_texturing")) + { + ARB_stencil_texturing = true; + extensions.Remove("glARB_stencil_texturing"); + } + if (extensions.Contains("gl_ARB_sync")) + { + ARB_sync = true; + extensions.Remove("glARB_sync"); + } + if (extensions.Contains("gl_ARB_tessellation_shader")) + { + ARB_tessellation_shader = true; + extensions.Remove("glARB_tessellation_shader"); + } + if (extensions.Contains("gl_ARB_texture_barrier")) + { + ARB_texture_barrier = true; + extensions.Remove("glARB_texture_barrier"); + } + if (extensions.Contains("gl_ARB_texture_border_clamp")) + { + ARB_texture_border_clamp = true; + extensions.Remove("glARB_texture_border_clamp"); + } + if (extensions.Contains("gl_ARB_texture_buffer_object")) + { + ARB_texture_buffer_object = true; + extensions.Remove("glARB_texture_buffer_object"); + } + if (extensions.Contains("gl_ARB_texture_buffer_object_rgb32")) + { + ARB_texture_buffer_object_rgb32 = true; + extensions.Remove("glARB_texture_buffer_object_rgb32"); + } + if (extensions.Contains("gl_ARB_texture_buffer_range")) + { + ARB_texture_buffer_range = true; + extensions.Remove("glARB_texture_buffer_range"); + } + if (extensions.Contains("gl_ARB_texture_compression")) + { + ARB_texture_compression = true; + extensions.Remove("glARB_texture_compression"); + } + if (extensions.Contains("gl_ARB_texture_compression_bptc")) + { + ARB_texture_compression_bptc = true; + extensions.Remove("glARB_texture_compression_bptc"); + } + if (extensions.Contains("gl_ARB_texture_compression_rgtc")) + { + ARB_texture_compression_rgtc = true; + extensions.Remove("glARB_texture_compression_rgtc"); + } + if (extensions.Contains("gl_ARB_texture_cube_map")) + { + ARB_texture_cube_map = true; + extensions.Remove("glARB_texture_cube_map"); + } + if (extensions.Contains("gl_ARB_texture_cube_map_array")) + { + ARB_texture_cube_map_array = true; + extensions.Remove("glARB_texture_cube_map_array"); + } + if (extensions.Contains("gl_ARB_texture_env_add")) + { + ARB_texture_env_add = true; + extensions.Remove("glARB_texture_env_add"); + } + if (extensions.Contains("gl_ARB_texture_env_combine")) + { + ARB_texture_env_combine = true; + extensions.Remove("glARB_texture_env_combine"); + } + if (extensions.Contains("gl_ARB_texture_env_crossbar")) + { + ARB_texture_env_crossbar = true; + extensions.Remove("glARB_texture_env_crossbar"); + } + if (extensions.Contains("gl_ARB_texture_env_dot3")) + { + ARB_texture_env_dot3 = true; + extensions.Remove("glARB_texture_env_dot3"); + } + if (extensions.Contains("gl_ARB_texture_filter_anisotropic")) + { + ARB_texture_filter_anisotropic = true; + extensions.Remove("glARB_texture_filter_anisotropic"); + } + if (extensions.Contains("gl_ARB_texture_filter_minmax")) + { + ARB_texture_filter_minmax = true; + extensions.Remove("glARB_texture_filter_minmax"); + } + if (extensions.Contains("gl_ARB_texture_float")) + { + ARB_texture_float = true; + extensions.Remove("glARB_texture_float"); + } + if (extensions.Contains("gl_ARB_texture_gather")) + { + ARB_texture_gather = true; + extensions.Remove("glARB_texture_gather"); + } + if (extensions.Contains("gl_ARB_texture_mirror_clamp_to_edge")) + { + ARB_texture_mirror_clamp_to_edge = true; + extensions.Remove("glARB_texture_mirror_clamp_to_edge"); + } + if (extensions.Contains("gl_ARB_texture_mirrored_repeat")) + { + ARB_texture_mirrored_repeat = true; + extensions.Remove("glARB_texture_mirrored_repeat"); + } + if (extensions.Contains("gl_ARB_texture_multisample")) + { + ARB_texture_multisample = true; + extensions.Remove("glARB_texture_multisample"); + } + if (extensions.Contains("gl_ARB_texture_non_power_of_two")) + { + ARB_texture_non_power_of_two = true; + extensions.Remove("glARB_texture_non_power_of_two"); + } + if (extensions.Contains("gl_ARB_texture_query_levels")) + { + ARB_texture_query_levels = true; + extensions.Remove("glARB_texture_query_levels"); + } + if (extensions.Contains("gl_ARB_texture_query_lod")) + { + ARB_texture_query_lod = true; + extensions.Remove("glARB_texture_query_lod"); + } + if (extensions.Contains("gl_ARB_texture_rectangle")) + { + ARB_texture_rectangle = true; + extensions.Remove("glARB_texture_rectangle"); + } + if (extensions.Contains("gl_ARB_texture_rg")) + { + ARB_texture_rg = true; + extensions.Remove("glARB_texture_rg"); + } + if (extensions.Contains("gl_ARB_texture_rgb10_a2ui")) + { + ARB_texture_rgb10_a2ui = true; + extensions.Remove("glARB_texture_rgb10_a2ui"); + } + if (extensions.Contains("gl_ARB_texture_stencil8")) + { + ARB_texture_stencil8 = true; + extensions.Remove("glARB_texture_stencil8"); + } + if (extensions.Contains("gl_ARB_texture_storage")) + { + ARB_texture_storage = true; + extensions.Remove("glARB_texture_storage"); + } + if (extensions.Contains("gl_ARB_texture_storage_multisample")) + { + ARB_texture_storage_multisample = true; + extensions.Remove("glARB_texture_storage_multisample"); + } + if (extensions.Contains("gl_ARB_texture_swizzle")) + { + ARB_texture_swizzle = true; + extensions.Remove("glARB_texture_swizzle"); + } + if (extensions.Contains("gl_ARB_texture_view")) + { + ARB_texture_view = true; + extensions.Remove("glARB_texture_view"); + } + if (extensions.Contains("gl_ARB_timer_query")) + { + ARB_timer_query = true; + extensions.Remove("glARB_timer_query"); + } + if (extensions.Contains("gl_ARB_transform_feedback2")) + { + ARB_transform_feedback2 = true; + extensions.Remove("glARB_transform_feedback2"); + } + if (extensions.Contains("gl_ARB_transform_feedback3")) + { + ARB_transform_feedback3 = true; + extensions.Remove("glARB_transform_feedback3"); + } + if (extensions.Contains("gl_ARB_transform_feedback_instanced")) + { + ARB_transform_feedback_instanced = true; + extensions.Remove("glARB_transform_feedback_instanced"); + } + if (extensions.Contains("gl_ARB_transform_feedback_overflow_query")) + { + ARB_transform_feedback_overflow_query = true; + extensions.Remove("glARB_transform_feedback_overflow_query"); + } + if (extensions.Contains("gl_ARB_transpose_matrix")) + { + ARB_transpose_matrix = true; + extensions.Remove("glARB_transpose_matrix"); + } + if (extensions.Contains("gl_ARB_uniform_buffer_object")) + { + ARB_uniform_buffer_object = true; + extensions.Remove("glARB_uniform_buffer_object"); + } + if (extensions.Contains("gl_ARB_vertex_array_bgra")) + { + ARB_vertex_array_bgra = true; + extensions.Remove("glARB_vertex_array_bgra"); + } + if (extensions.Contains("gl_ARB_vertex_array_object")) + { + ARB_vertex_array_object = true; + extensions.Remove("glARB_vertex_array_object"); + } + if (extensions.Contains("gl_ARB_vertex_attrib_64bit")) + { + ARB_vertex_attrib_64bit = true; + extensions.Remove("glARB_vertex_attrib_64bit"); + } + if (extensions.Contains("gl_ARB_vertex_attrib_binding")) + { + ARB_vertex_attrib_binding = true; + extensions.Remove("glARB_vertex_attrib_binding"); + } + if (extensions.Contains("gl_ARB_vertex_blend")) + { + ARB_vertex_blend = true; + extensions.Remove("glARB_vertex_blend"); + } + if (extensions.Contains("gl_ARB_vertex_buffer_object")) + { + ARB_vertex_buffer_object = true; + extensions.Remove("glARB_vertex_buffer_object"); + } + if (extensions.Contains("gl_ARB_vertex_program")) + { + ARB_vertex_program = true; + extensions.Remove("glARB_vertex_program"); + } + if (extensions.Contains("gl_ARB_vertex_shader")) + { + ARB_vertex_shader = true; + extensions.Remove("glARB_vertex_shader"); + } + if (extensions.Contains("gl_ARB_vertex_type_10f_11f_11f_rev")) + { + ARB_vertex_type_10f_11f_11f_rev = true; + extensions.Remove("glARB_vertex_type_10f_11f_11f_rev"); + } + if (extensions.Contains("gl_ARB_vertex_type_2_10_10_10_rev")) + { + ARB_vertex_type_2_10_10_10_rev = true; + extensions.Remove("glARB_vertex_type_2_10_10_10_rev"); + } + if (extensions.Contains("gl_ARB_viewport_array")) + { + ARB_viewport_array = true; + extensions.Remove("glARB_viewport_array"); + } + if (extensions.Contains("gl_ARB_window_pos")) + { + ARB_window_pos = true; + extensions.Remove("glARB_window_pos"); + } + if (extensions.Contains("gl_ATI_draw_buffers")) + { + ATI_draw_buffers = true; + extensions.Remove("glATI_draw_buffers"); + } + if (extensions.Contains("gl_ATI_element_array")) + { + ATI_element_array = true; + extensions.Remove("glATI_element_array"); + } + if (extensions.Contains("gl_ATI_envmap_bumpmap")) + { + ATI_envmap_bumpmap = true; + extensions.Remove("glATI_envmap_bumpmap"); + } + if (extensions.Contains("gl_ATI_fragment_shader")) + { + ATI_fragment_shader = true; + extensions.Remove("glATI_fragment_shader"); + } + if (extensions.Contains("gl_ATI_map_object_buffer")) + { + ATI_map_object_buffer = true; + extensions.Remove("glATI_map_object_buffer"); + } + if (extensions.Contains("gl_ATI_meminfo")) + { + ATI_meminfo = true; + extensions.Remove("glATI_meminfo"); + } + if (extensions.Contains("gl_ATI_pixel_format_float")) + { + ATI_pixel_format_float = true; + extensions.Remove("glATI_pixel_format_float"); + } + if (extensions.Contains("gl_ATI_pn_triangles")) + { + ATI_pn_triangles = true; + extensions.Remove("glATI_pn_triangles"); + } + if (extensions.Contains("gl_ATI_separate_stencil")) + { + ATI_separate_stencil = true; + extensions.Remove("glATI_separate_stencil"); + } + if (extensions.Contains("gl_ATI_text_fragment_shader")) + { + ATI_text_fragment_shader = true; + extensions.Remove("glATI_text_fragment_shader"); + } + if (extensions.Contains("gl_ATI_texture_env_combine3")) + { + ATI_texture_env_combine3 = true; + extensions.Remove("glATI_texture_env_combine3"); + } + if (extensions.Contains("gl_ATI_texture_float")) + { + ATI_texture_float = true; + extensions.Remove("glATI_texture_float"); + } + if (extensions.Contains("gl_ATI_texture_mirror_once")) + { + ATI_texture_mirror_once = true; + extensions.Remove("glATI_texture_mirror_once"); + } + if (extensions.Contains("gl_ATI_vertex_array_object")) + { + ATI_vertex_array_object = true; + extensions.Remove("glATI_vertex_array_object"); + } + if (extensions.Contains("gl_ATI_vertex_attrib_array_object")) + { + ATI_vertex_attrib_array_object = true; + extensions.Remove("glATI_vertex_attrib_array_object"); + } + if (extensions.Contains("gl_ATI_vertex_streams")) + { + ATI_vertex_streams = true; + extensions.Remove("glATI_vertex_streams"); + } + if (extensions.Contains("gl_EXT_422_pixels")) + { + EXT_422_pixels = true; + extensions.Remove("glEXT_422_pixels"); + } + if (extensions.Contains("gl_EXT_EGL_image_storage")) + { + EXT_EGL_image_storage = true; + extensions.Remove("glEXT_EGL_image_storage"); + } + if (extensions.Contains("gl_EXT_EGL_sync")) + { + EXT_EGL_sync = true; + extensions.Remove("glEXT_EGL_sync"); + } + if (extensions.Contains("gl_EXT_abgr")) + { + EXT_abgr = true; + extensions.Remove("glEXT_abgr"); + } + if (extensions.Contains("gl_EXT_bgra")) + { + EXT_bgra = true; + extensions.Remove("glEXT_bgra"); + } + if (extensions.Contains("gl_EXT_bindable_uniform")) + { + EXT_bindable_uniform = true; + extensions.Remove("glEXT_bindable_uniform"); + } + if (extensions.Contains("gl_EXT_blend_color")) + { + EXT_blend_color = true; + extensions.Remove("glEXT_blend_color"); + } + if (extensions.Contains("gl_EXT_blend_equation_separate")) + { + EXT_blend_equation_separate = true; + extensions.Remove("glEXT_blend_equation_separate"); + } + if (extensions.Contains("gl_EXT_blend_func_separate")) + { + EXT_blend_func_separate = true; + extensions.Remove("glEXT_blend_func_separate"); + } + if (extensions.Contains("gl_EXT_blend_logic_op")) + { + EXT_blend_logic_op = true; + extensions.Remove("glEXT_blend_logic_op"); + } + if (extensions.Contains("gl_EXT_blend_minmax")) + { + EXT_blend_minmax = true; + extensions.Remove("glEXT_blend_minmax"); + } + if (extensions.Contains("gl_EXT_blend_subtract")) + { + EXT_blend_subtract = true; + extensions.Remove("glEXT_blend_subtract"); + } + if (extensions.Contains("gl_EXT_clip_volume_hint")) + { + EXT_clip_volume_hint = true; + extensions.Remove("glEXT_clip_volume_hint"); + } + if (extensions.Contains("gl_EXT_cmyka")) + { + EXT_cmyka = true; + extensions.Remove("glEXT_cmyka"); + } + if (extensions.Contains("gl_EXT_color_subtable")) + { + EXT_color_subtable = true; + extensions.Remove("glEXT_color_subtable"); + } + if (extensions.Contains("gl_EXT_compiled_vertex_array")) + { + EXT_compiled_vertex_array = true; + extensions.Remove("glEXT_compiled_vertex_array"); + } + if (extensions.Contains("gl_EXT_convolution")) + { + EXT_convolution = true; + extensions.Remove("glEXT_convolution"); + } + if (extensions.Contains("gl_EXT_coordinate_frame")) + { + EXT_coordinate_frame = true; + extensions.Remove("glEXT_coordinate_frame"); + } + if (extensions.Contains("gl_EXT_copy_texture")) + { + EXT_copy_texture = true; + extensions.Remove("glEXT_copy_texture"); + } + if (extensions.Contains("gl_EXT_cull_vertex")) + { + EXT_cull_vertex = true; + extensions.Remove("glEXT_cull_vertex"); + } + if (extensions.Contains("gl_EXT_debug_label")) + { + EXT_debug_label = true; + extensions.Remove("glEXT_debug_label"); + } + if (extensions.Contains("gl_EXT_debug_marker")) + { + EXT_debug_marker = true; + extensions.Remove("glEXT_debug_marker"); + } + if (extensions.Contains("gl_EXT_depth_bounds_test")) + { + EXT_depth_bounds_test = true; + extensions.Remove("glEXT_depth_bounds_test"); + } + if (extensions.Contains("gl_EXT_direct_state_access")) + { + EXT_direct_state_access = true; + extensions.Remove("glEXT_direct_state_access"); + } + if (extensions.Contains("gl_EXT_draw_buffers2")) + { + EXT_draw_buffers2 = true; + extensions.Remove("glEXT_draw_buffers2"); + } + if (extensions.Contains("gl_EXT_draw_instanced")) + { + EXT_draw_instanced = true; + extensions.Remove("glEXT_draw_instanced"); + } + if (extensions.Contains("gl_EXT_draw_range_elements")) + { + EXT_draw_range_elements = true; + extensions.Remove("glEXT_draw_range_elements"); + } + if (extensions.Contains("gl_EXT_external_buffer")) + { + EXT_external_buffer = true; + extensions.Remove("glEXT_external_buffer"); + } + if (extensions.Contains("gl_EXT_fog_coord")) + { + EXT_fog_coord = true; + extensions.Remove("glEXT_fog_coord"); + } + if (extensions.Contains("gl_EXT_framebuffer_blit")) + { + EXT_framebuffer_blit = true; + extensions.Remove("glEXT_framebuffer_blit"); + } + if (extensions.Contains("gl_EXT_framebuffer_blit_layers")) + { + EXT_framebuffer_blit_layers = true; + extensions.Remove("glEXT_framebuffer_blit_layers"); + } + if (extensions.Contains("gl_EXT_framebuffer_multisample")) + { + EXT_framebuffer_multisample = true; + extensions.Remove("glEXT_framebuffer_multisample"); + } + if (extensions.Contains("gl_EXT_framebuffer_multisample_blit_scaled")) + { + EXT_framebuffer_multisample_blit_scaled = true; + extensions.Remove("glEXT_framebuffer_multisample_blit_scaled"); + } + if (extensions.Contains("gl_EXT_framebuffer_object")) + { + EXT_framebuffer_object = true; + extensions.Remove("glEXT_framebuffer_object"); + } + if (extensions.Contains("gl_EXT_framebuffer_sRGB")) + { + EXT_framebuffer_sRGB = true; + extensions.Remove("glEXT_framebuffer_sRGB"); + } + if (extensions.Contains("gl_EXT_geometry_shader4")) + { + EXT_geometry_shader4 = true; + extensions.Remove("glEXT_geometry_shader4"); + } + if (extensions.Contains("gl_EXT_gpu_program_parameters")) + { + EXT_gpu_program_parameters = true; + extensions.Remove("glEXT_gpu_program_parameters"); + } + if (extensions.Contains("gl_EXT_gpu_shader4")) + { + EXT_gpu_shader4 = true; + extensions.Remove("glEXT_gpu_shader4"); + } + if (extensions.Contains("gl_EXT_histogram")) + { + EXT_histogram = true; + extensions.Remove("glEXT_histogram"); + } + if (extensions.Contains("gl_EXT_index_array_formats")) + { + EXT_index_array_formats = true; + extensions.Remove("glEXT_index_array_formats"); + } + if (extensions.Contains("gl_EXT_index_func")) + { + EXT_index_func = true; + extensions.Remove("glEXT_index_func"); + } + if (extensions.Contains("gl_EXT_index_material")) + { + EXT_index_material = true; + extensions.Remove("glEXT_index_material"); + } + if (extensions.Contains("gl_EXT_index_texture")) + { + EXT_index_texture = true; + extensions.Remove("glEXT_index_texture"); + } + if (extensions.Contains("gl_EXT_light_texture")) + { + EXT_light_texture = true; + extensions.Remove("glEXT_light_texture"); + } + if (extensions.Contains("gl_EXT_memory_object")) + { + EXT_memory_object = true; + extensions.Remove("glEXT_memory_object"); + } + if (extensions.Contains("gl_EXT_memory_object_fd")) + { + EXT_memory_object_fd = true; + extensions.Remove("glEXT_memory_object_fd"); + } + if (extensions.Contains("gl_EXT_memory_object_win32")) + { + EXT_memory_object_win32 = true; + extensions.Remove("glEXT_memory_object_win32"); + } + if (extensions.Contains("gl_EXT_misc_attribute")) + { + EXT_misc_attribute = true; + extensions.Remove("glEXT_misc_attribute"); + } + if (extensions.Contains("gl_EXT_multi_draw_arrays")) + { + EXT_multi_draw_arrays = true; + extensions.Remove("glEXT_multi_draw_arrays"); + } + if (extensions.Contains("gl_EXT_multisample")) + { + EXT_multisample = true; + extensions.Remove("glEXT_multisample"); + } + if (extensions.Contains("gl_EXT_multiview_tessellation_geometry_shader")) + { + EXT_multiview_tessellation_geometry_shader = true; + extensions.Remove("glEXT_multiview_tessellation_geometry_shader"); + } + if (extensions.Contains("gl_EXT_multiview_texture_multisample")) + { + EXT_multiview_texture_multisample = true; + extensions.Remove("glEXT_multiview_texture_multisample"); + } + if (extensions.Contains("gl_EXT_multiview_timer_query")) + { + EXT_multiview_timer_query = true; + extensions.Remove("glEXT_multiview_timer_query"); + } + if (extensions.Contains("gl_EXT_packed_depth_stencil")) + { + EXT_packed_depth_stencil = true; + extensions.Remove("glEXT_packed_depth_stencil"); + } + if (extensions.Contains("gl_EXT_packed_float")) + { + EXT_packed_float = true; + extensions.Remove("glEXT_packed_float"); + } + if (extensions.Contains("gl_EXT_packed_pixels")) + { + EXT_packed_pixels = true; + extensions.Remove("glEXT_packed_pixels"); + } + if (extensions.Contains("gl_EXT_paletted_texture")) + { + EXT_paletted_texture = true; + extensions.Remove("glEXT_paletted_texture"); + } + if (extensions.Contains("gl_EXT_pixel_buffer_object")) + { + EXT_pixel_buffer_object = true; + extensions.Remove("glEXT_pixel_buffer_object"); + } + if (extensions.Contains("gl_EXT_pixel_transform")) + { + EXT_pixel_transform = true; + extensions.Remove("glEXT_pixel_transform"); + } + if (extensions.Contains("gl_EXT_pixel_transform_color_table")) + { + EXT_pixel_transform_color_table = true; + extensions.Remove("glEXT_pixel_transform_color_table"); + } + if (extensions.Contains("gl_EXT_point_parameters")) + { + EXT_point_parameters = true; + extensions.Remove("glEXT_point_parameters"); + } + if (extensions.Contains("gl_EXT_polygon_offset")) + { + EXT_polygon_offset = true; + extensions.Remove("glEXT_polygon_offset"); + } + if (extensions.Contains("gl_EXT_polygon_offset_clamp")) + { + EXT_polygon_offset_clamp = true; + extensions.Remove("glEXT_polygon_offset_clamp"); + } + if (extensions.Contains("gl_EXT_post_depth_coverage")) + { + EXT_post_depth_coverage = true; + extensions.Remove("glEXT_post_depth_coverage"); + } + if (extensions.Contains("gl_EXT_provoking_vertex")) + { + EXT_provoking_vertex = true; + extensions.Remove("glEXT_provoking_vertex"); + } + if (extensions.Contains("gl_EXT_raster_multisample")) + { + EXT_raster_multisample = true; + extensions.Remove("glEXT_raster_multisample"); + } + if (extensions.Contains("gl_EXT_rescale_normal")) + { + EXT_rescale_normal = true; + extensions.Remove("glEXT_rescale_normal"); + } + if (extensions.Contains("gl_EXT_secondary_color")) + { + EXT_secondary_color = true; + extensions.Remove("glEXT_secondary_color"); + } + if (extensions.Contains("gl_EXT_semaphore")) + { + EXT_semaphore = true; + extensions.Remove("glEXT_semaphore"); + } + if (extensions.Contains("gl_EXT_semaphore_fd")) + { + EXT_semaphore_fd = true; + extensions.Remove("glEXT_semaphore_fd"); + } + if (extensions.Contains("gl_EXT_semaphore_win32")) + { + EXT_semaphore_win32 = true; + extensions.Remove("glEXT_semaphore_win32"); + } + if (extensions.Contains("gl_EXT_separate_shader_objects")) + { + EXT_separate_shader_objects = true; + extensions.Remove("glEXT_separate_shader_objects"); + } + if (extensions.Contains("gl_EXT_separate_specular_color")) + { + EXT_separate_specular_color = true; + extensions.Remove("glEXT_separate_specular_color"); + } + if (extensions.Contains("gl_EXT_shader_framebuffer_fetch")) + { + EXT_shader_framebuffer_fetch = true; + extensions.Remove("glEXT_shader_framebuffer_fetch"); + } + if (extensions.Contains("gl_EXT_shader_framebuffer_fetch_non_coherent")) + { + EXT_shader_framebuffer_fetch_non_coherent = true; + extensions.Remove("glEXT_shader_framebuffer_fetch_non_coherent"); + } + if (extensions.Contains("gl_EXT_shader_image_load_formatted")) + { + EXT_shader_image_load_formatted = true; + extensions.Remove("glEXT_shader_image_load_formatted"); + } + if (extensions.Contains("gl_EXT_shader_image_load_store")) + { + EXT_shader_image_load_store = true; + extensions.Remove("glEXT_shader_image_load_store"); + } + if (extensions.Contains("gl_EXT_shader_integer_mix")) + { + EXT_shader_integer_mix = true; + extensions.Remove("glEXT_shader_integer_mix"); + } + if (extensions.Contains("gl_EXT_shader_samples_identical")) + { + EXT_shader_samples_identical = true; + extensions.Remove("glEXT_shader_samples_identical"); + } + if (extensions.Contains("gl_EXT_shadow_funcs")) + { + EXT_shadow_funcs = true; + extensions.Remove("glEXT_shadow_funcs"); + } + if (extensions.Contains("gl_EXT_shared_texture_palette")) + { + EXT_shared_texture_palette = true; + extensions.Remove("glEXT_shared_texture_palette"); + } + if (extensions.Contains("gl_EXT_sparse_texture2")) + { + EXT_sparse_texture2 = true; + extensions.Remove("glEXT_sparse_texture2"); + } + if (extensions.Contains("gl_EXT_stencil_clear_tag")) + { + EXT_stencil_clear_tag = true; + extensions.Remove("glEXT_stencil_clear_tag"); + } + if (extensions.Contains("gl_EXT_stencil_two_side")) + { + EXT_stencil_two_side = true; + extensions.Remove("glEXT_stencil_two_side"); + } + if (extensions.Contains("gl_EXT_stencil_wrap")) + { + EXT_stencil_wrap = true; + extensions.Remove("glEXT_stencil_wrap"); + } + if (extensions.Contains("gl_EXT_subtexture")) + { + EXT_subtexture = true; + extensions.Remove("glEXT_subtexture"); + } + if (extensions.Contains("gl_EXT_texture")) + { + EXT_texture = true; + extensions.Remove("glEXT_texture"); + } + if (extensions.Contains("gl_EXT_texture3D")) + { + EXT_texture3D = true; + extensions.Remove("glEXT_texture3D"); + } + if (extensions.Contains("gl_EXT_texture_array")) + { + EXT_texture_array = true; + extensions.Remove("glEXT_texture_array"); + } + if (extensions.Contains("gl_EXT_texture_buffer_object")) + { + EXT_texture_buffer_object = true; + extensions.Remove("glEXT_texture_buffer_object"); + } + if (extensions.Contains("gl_EXT_texture_compression_latc")) + { + EXT_texture_compression_latc = true; + extensions.Remove("glEXT_texture_compression_latc"); + } + if (extensions.Contains("gl_EXT_texture_compression_rgtc")) + { + EXT_texture_compression_rgtc = true; + extensions.Remove("glEXT_texture_compression_rgtc"); + } + if (extensions.Contains("gl_EXT_texture_compression_s3tc")) + { + EXT_texture_compression_s3tc = true; + extensions.Remove("glEXT_texture_compression_s3tc"); + } + if (extensions.Contains("gl_EXT_texture_cube_map")) + { + EXT_texture_cube_map = true; + extensions.Remove("glEXT_texture_cube_map"); + } + if (extensions.Contains("gl_EXT_texture_env_add")) + { + EXT_texture_env_add = true; + extensions.Remove("glEXT_texture_env_add"); + } + if (extensions.Contains("gl_EXT_texture_env_combine")) + { + EXT_texture_env_combine = true; + extensions.Remove("glEXT_texture_env_combine"); + } + if (extensions.Contains("gl_EXT_texture_env_dot3")) + { + EXT_texture_env_dot3 = true; + extensions.Remove("glEXT_texture_env_dot3"); + } + if (extensions.Contains("gl_EXT_texture_filter_anisotropic")) + { + EXT_texture_filter_anisotropic = true; + extensions.Remove("glEXT_texture_filter_anisotropic"); + } + if (extensions.Contains("gl_EXT_texture_filter_minmax")) + { + EXT_texture_filter_minmax = true; + extensions.Remove("glEXT_texture_filter_minmax"); + } + if (extensions.Contains("gl_EXT_texture_integer")) + { + EXT_texture_integer = true; + extensions.Remove("glEXT_texture_integer"); + } + if (extensions.Contains("gl_EXT_texture_lod_bias")) + { + EXT_texture_lod_bias = true; + extensions.Remove("glEXT_texture_lod_bias"); + } + if (extensions.Contains("gl_EXT_texture_mirror_clamp")) + { + EXT_texture_mirror_clamp = true; + extensions.Remove("glEXT_texture_mirror_clamp"); + } + if (extensions.Contains("gl_EXT_texture_object")) + { + EXT_texture_object = true; + extensions.Remove("glEXT_texture_object"); + } + if (extensions.Contains("gl_EXT_texture_perturb_normal")) + { + EXT_texture_perturb_normal = true; + extensions.Remove("glEXT_texture_perturb_normal"); + } + if (extensions.Contains("gl_EXT_texture_sRGB")) + { + EXT_texture_sRGB = true; + extensions.Remove("glEXT_texture_sRGB"); + } + if (extensions.Contains("gl_EXT_texture_sRGB_R8")) + { + EXT_texture_sRGB_R8 = true; + extensions.Remove("glEXT_texture_sRGB_R8"); + } + if (extensions.Contains("gl_EXT_texture_sRGB_RG8")) + { + EXT_texture_sRGB_RG8 = true; + extensions.Remove("glEXT_texture_sRGB_RG8"); + } + if (extensions.Contains("gl_EXT_texture_sRGB_decode")) + { + EXT_texture_sRGB_decode = true; + extensions.Remove("glEXT_texture_sRGB_decode"); + } + if (extensions.Contains("gl_EXT_texture_shadow_lod")) + { + EXT_texture_shadow_lod = true; + extensions.Remove("glEXT_texture_shadow_lod"); + } + if (extensions.Contains("gl_EXT_texture_shared_exponent")) + { + EXT_texture_shared_exponent = true; + extensions.Remove("glEXT_texture_shared_exponent"); + } + if (extensions.Contains("gl_EXT_texture_snorm")) + { + EXT_texture_snorm = true; + extensions.Remove("glEXT_texture_snorm"); + } + if (extensions.Contains("gl_EXT_texture_storage")) + { + EXT_texture_storage = true; + extensions.Remove("glEXT_texture_storage"); + } + if (extensions.Contains("gl_EXT_texture_swizzle")) + { + EXT_texture_swizzle = true; + extensions.Remove("glEXT_texture_swizzle"); + } + if (extensions.Contains("gl_EXT_timer_query")) + { + EXT_timer_query = true; + extensions.Remove("glEXT_timer_query"); + } + if (extensions.Contains("gl_EXT_transform_feedback")) + { + EXT_transform_feedback = true; + extensions.Remove("glEXT_transform_feedback"); + } + if (extensions.Contains("gl_EXT_vertex_array")) + { + EXT_vertex_array = true; + extensions.Remove("glEXT_vertex_array"); + } + if (extensions.Contains("gl_EXT_vertex_array_bgra")) + { + EXT_vertex_array_bgra = true; + extensions.Remove("glEXT_vertex_array_bgra"); + } + if (extensions.Contains("gl_EXT_vertex_attrib_64bit")) + { + EXT_vertex_attrib_64bit = true; + extensions.Remove("glEXT_vertex_attrib_64bit"); + } + if (extensions.Contains("gl_EXT_vertex_shader")) + { + EXT_vertex_shader = true; + extensions.Remove("glEXT_vertex_shader"); + } + if (extensions.Contains("gl_EXT_vertex_weighting")) + { + EXT_vertex_weighting = true; + extensions.Remove("glEXT_vertex_weighting"); + } + if (extensions.Contains("gl_EXT_win32_keyed_mutex")) + { + EXT_win32_keyed_mutex = true; + extensions.Remove("glEXT_win32_keyed_mutex"); + } + if (extensions.Contains("gl_EXT_window_rectangles")) + { + EXT_window_rectangles = true; + extensions.Remove("glEXT_window_rectangles"); + } + if (extensions.Contains("gl_EXT_x11_sync_object")) + { + EXT_x11_sync_object = true; + extensions.Remove("glEXT_x11_sync_object"); + } + if (extensions.Contains("gl_GREMEDY_frame_terminator")) + { + GREMEDY_frame_terminator = true; + extensions.Remove("glGREMEDY_frame_terminator"); + } + if (extensions.Contains("gl_GREMEDY_string_marker")) + { + GREMEDY_string_marker = true; + extensions.Remove("glGREMEDY_string_marker"); + } + if (extensions.Contains("gl_HP_convolution_border_modes")) + { + HP_convolution_border_modes = true; + extensions.Remove("glHP_convolution_border_modes"); + } + if (extensions.Contains("gl_HP_image_transform")) + { + HP_image_transform = true; + extensions.Remove("glHP_image_transform"); + } + if (extensions.Contains("gl_HP_occlusion_test")) + { + HP_occlusion_test = true; + extensions.Remove("glHP_occlusion_test"); + } + if (extensions.Contains("gl_HP_texture_lighting")) + { + HP_texture_lighting = true; + extensions.Remove("glHP_texture_lighting"); + } + if (extensions.Contains("gl_IBM_cull_vertex")) + { + IBM_cull_vertex = true; + extensions.Remove("glIBM_cull_vertex"); + } + if (extensions.Contains("gl_IBM_multimode_draw_arrays")) + { + IBM_multimode_draw_arrays = true; + extensions.Remove("glIBM_multimode_draw_arrays"); + } + if (extensions.Contains("gl_IBM_rasterpos_clip")) + { + IBM_rasterpos_clip = true; + extensions.Remove("glIBM_rasterpos_clip"); + } + if (extensions.Contains("gl_IBM_static_data")) + { + IBM_static_data = true; + extensions.Remove("glIBM_static_data"); + } + if (extensions.Contains("gl_IBM_texture_mirrored_repeat")) + { + IBM_texture_mirrored_repeat = true; + extensions.Remove("glIBM_texture_mirrored_repeat"); + } + if (extensions.Contains("gl_IBM_vertex_array_lists")) + { + IBM_vertex_array_lists = true; + extensions.Remove("glIBM_vertex_array_lists"); + } + if (extensions.Contains("gl_INGR_blend_func_separate")) + { + INGR_blend_func_separate = true; + extensions.Remove("glINGR_blend_func_separate"); + } + if (extensions.Contains("gl_INGR_color_clamp")) + { + INGR_color_clamp = true; + extensions.Remove("glINGR_color_clamp"); + } + if (extensions.Contains("gl_INGR_interlace_read")) + { + INGR_interlace_read = true; + extensions.Remove("glINGR_interlace_read"); + } + if (extensions.Contains("gl_INTEL_blackhole_render")) + { + INTEL_blackhole_render = true; + extensions.Remove("glINTEL_blackhole_render"); + } + if (extensions.Contains("gl_INTEL_conservative_rasterization")) + { + INTEL_conservative_rasterization = true; + extensions.Remove("glINTEL_conservative_rasterization"); + } + if (extensions.Contains("gl_INTEL_fragment_shader_ordering")) + { + INTEL_fragment_shader_ordering = true; + extensions.Remove("glINTEL_fragment_shader_ordering"); + } + if (extensions.Contains("gl_INTEL_framebuffer_CMAA")) + { + INTEL_framebuffer_CMAA = true; + extensions.Remove("glINTEL_framebuffer_CMAA"); + } + if (extensions.Contains("gl_INTEL_map_texture")) + { + INTEL_map_texture = true; + extensions.Remove("glINTEL_map_texture"); + } + if (extensions.Contains("gl_INTEL_parallel_arrays")) + { + INTEL_parallel_arrays = true; + extensions.Remove("glINTEL_parallel_arrays"); + } + if (extensions.Contains("gl_INTEL_performance_query")) + { + INTEL_performance_query = true; + extensions.Remove("glINTEL_performance_query"); + } + if (extensions.Contains("gl_KHR_blend_equation_advanced")) + { + KHR_blend_equation_advanced = true; + extensions.Remove("glKHR_blend_equation_advanced"); + } + if (extensions.Contains("gl_KHR_blend_equation_advanced_coherent")) + { + KHR_blend_equation_advanced_coherent = true; + extensions.Remove("glKHR_blend_equation_advanced_coherent"); + } + if (extensions.Contains("gl_KHR_context_flush_control")) + { + KHR_context_flush_control = true; + extensions.Remove("glKHR_context_flush_control"); + } + if (extensions.Contains("gl_KHR_debug")) + { + KHR_debug = true; + extensions.Remove("glKHR_debug"); + } + if (extensions.Contains("gl_KHR_no_error")) + { + KHR_no_error = true; + extensions.Remove("glKHR_no_error"); + } + if (extensions.Contains("gl_KHR_parallel_shader_compile")) + { + KHR_parallel_shader_compile = true; + extensions.Remove("glKHR_parallel_shader_compile"); + } + if (extensions.Contains("gl_KHR_robust_buffer_access_behavior")) + { + KHR_robust_buffer_access_behavior = true; + extensions.Remove("glKHR_robust_buffer_access_behavior"); + } + if (extensions.Contains("gl_KHR_robustness")) + { + KHR_robustness = true; + extensions.Remove("glKHR_robustness"); + } + if (extensions.Contains("gl_KHR_shader_subgroup")) + { + KHR_shader_subgroup = true; + extensions.Remove("glKHR_shader_subgroup"); + } + if (extensions.Contains("gl_KHR_texture_compression_astc_hdr")) + { + KHR_texture_compression_astc_hdr = true; + extensions.Remove("glKHR_texture_compression_astc_hdr"); + } + if (extensions.Contains("gl_KHR_texture_compression_astc_ldr")) + { + KHR_texture_compression_astc_ldr = true; + extensions.Remove("glKHR_texture_compression_astc_ldr"); + } + if (extensions.Contains("gl_KHR_texture_compression_astc_sliced_3d")) + { + KHR_texture_compression_astc_sliced_3d = true; + extensions.Remove("glKHR_texture_compression_astc_sliced_3d"); + } + if (extensions.Contains("gl_MESAX_texture_stack")) + { + MESAX_texture_stack = true; + extensions.Remove("glMESAX_texture_stack"); + } + if (extensions.Contains("gl_MESA_framebuffer_flip_x")) + { + MESA_framebuffer_flip_x = true; + extensions.Remove("glMESA_framebuffer_flip_x"); + } + if (extensions.Contains("gl_MESA_framebuffer_flip_y")) + { + MESA_framebuffer_flip_y = true; + extensions.Remove("glMESA_framebuffer_flip_y"); + } + if (extensions.Contains("gl_MESA_framebuffer_swap_xy")) + { + MESA_framebuffer_swap_xy = true; + extensions.Remove("glMESA_framebuffer_swap_xy"); + } + if (extensions.Contains("gl_MESA_pack_invert")) + { + MESA_pack_invert = true; + extensions.Remove("glMESA_pack_invert"); + } + if (extensions.Contains("gl_MESA_program_binary_formats")) + { + MESA_program_binary_formats = true; + extensions.Remove("glMESA_program_binary_formats"); + } + if (extensions.Contains("gl_MESA_resize_buffers")) + { + MESA_resize_buffers = true; + extensions.Remove("glMESA_resize_buffers"); + } + if (extensions.Contains("gl_MESA_shader_integer_functions")) + { + MESA_shader_integer_functions = true; + extensions.Remove("glMESA_shader_integer_functions"); + } + if (extensions.Contains("gl_MESA_tile_raster_order")) + { + MESA_tile_raster_order = true; + extensions.Remove("glMESA_tile_raster_order"); + } + if (extensions.Contains("gl_MESA_window_pos")) + { + MESA_window_pos = true; + extensions.Remove("glMESA_window_pos"); + } + if (extensions.Contains("gl_MESA_ycbcr_texture")) + { + MESA_ycbcr_texture = true; + extensions.Remove("glMESA_ycbcr_texture"); + } + if (extensions.Contains("gl_NVX_blend_equation_advanced_multi_draw_buffers")) + { + NVX_blend_equation_advanced_multi_draw_buffers = true; + extensions.Remove("glNVX_blend_equation_advanced_multi_draw_buffers"); + } + if (extensions.Contains("gl_NVX_conditional_render")) + { + NVX_conditional_render = true; + extensions.Remove("glNVX_conditional_render"); + } + if (extensions.Contains("gl_NVX_gpu_memory_info")) + { + NVX_gpu_memory_info = true; + extensions.Remove("glNVX_gpu_memory_info"); + } + if (extensions.Contains("gl_NVX_gpu_multicast2")) + { + NVX_gpu_multicast2 = true; + extensions.Remove("glNVX_gpu_multicast2"); + } + if (extensions.Contains("gl_NVX_linked_gpu_multicast")) + { + NVX_linked_gpu_multicast = true; + extensions.Remove("glNVX_linked_gpu_multicast"); + } + if (extensions.Contains("gl_NVX_progress_fence")) + { + NVX_progress_fence = true; + extensions.Remove("glNVX_progress_fence"); + } + if (extensions.Contains("gl_NV_alpha_to_coverage_dither_control")) + { + NV_alpha_to_coverage_dither_control = true; + extensions.Remove("glNV_alpha_to_coverage_dither_control"); + } + if (extensions.Contains("gl_NV_bindless_multi_draw_indirect")) + { + NV_bindless_multi_draw_indirect = true; + extensions.Remove("glNV_bindless_multi_draw_indirect"); + } + if (extensions.Contains("gl_NV_bindless_multi_draw_indirect_count")) + { + NV_bindless_multi_draw_indirect_count = true; + extensions.Remove("glNV_bindless_multi_draw_indirect_count"); + } + if (extensions.Contains("gl_NV_bindless_texture")) + { + NV_bindless_texture = true; + extensions.Remove("glNV_bindless_texture"); + } + if (extensions.Contains("gl_NV_blend_equation_advanced")) + { + NV_blend_equation_advanced = true; + extensions.Remove("glNV_blend_equation_advanced"); + } + if (extensions.Contains("gl_NV_blend_equation_advanced_coherent")) + { + NV_blend_equation_advanced_coherent = true; + extensions.Remove("glNV_blend_equation_advanced_coherent"); + } + if (extensions.Contains("gl_NV_blend_minmax_factor")) + { + NV_blend_minmax_factor = true; + extensions.Remove("glNV_blend_minmax_factor"); + } + if (extensions.Contains("gl_NV_blend_square")) + { + NV_blend_square = true; + extensions.Remove("glNV_blend_square"); + } + if (extensions.Contains("gl_NV_clip_space_w_scaling")) + { + NV_clip_space_w_scaling = true; + extensions.Remove("glNV_clip_space_w_scaling"); + } + if (extensions.Contains("gl_NV_command_list")) + { + NV_command_list = true; + extensions.Remove("glNV_command_list"); + } + if (extensions.Contains("gl_NV_compute_program5")) + { + NV_compute_program5 = true; + extensions.Remove("glNV_compute_program5"); + } + if (extensions.Contains("gl_NV_compute_shader_derivatives")) + { + NV_compute_shader_derivatives = true; + extensions.Remove("glNV_compute_shader_derivatives"); + } + if (extensions.Contains("gl_NV_conditional_render")) + { + NV_conditional_render = true; + extensions.Remove("glNV_conditional_render"); + } + if (extensions.Contains("gl_NV_conservative_raster")) + { + NV_conservative_raster = true; + extensions.Remove("glNV_conservative_raster"); + } + if (extensions.Contains("gl_NV_conservative_raster_dilate")) + { + NV_conservative_raster_dilate = true; + extensions.Remove("glNV_conservative_raster_dilate"); + } + if (extensions.Contains("gl_NV_conservative_raster_pre_snap")) + { + NV_conservative_raster_pre_snap = true; + extensions.Remove("glNV_conservative_raster_pre_snap"); + } + if (extensions.Contains("gl_NV_conservative_raster_pre_snap_triangles")) + { + NV_conservative_raster_pre_snap_triangles = true; + extensions.Remove("glNV_conservative_raster_pre_snap_triangles"); + } + if (extensions.Contains("gl_NV_conservative_raster_underestimation")) + { + NV_conservative_raster_underestimation = true; + extensions.Remove("glNV_conservative_raster_underestimation"); + } + if (extensions.Contains("gl_NV_copy_depth_to_color")) + { + NV_copy_depth_to_color = true; + extensions.Remove("glNV_copy_depth_to_color"); + } + if (extensions.Contains("gl_NV_copy_image")) + { + NV_copy_image = true; + extensions.Remove("glNV_copy_image"); + } + if (extensions.Contains("gl_NV_deep_texture3D")) + { + NV_deep_texture3D = true; + extensions.Remove("glNV_deep_texture3D"); + } + if (extensions.Contains("gl_NV_depth_buffer_float")) + { + NV_depth_buffer_float = true; + extensions.Remove("glNV_depth_buffer_float"); + } + if (extensions.Contains("gl_NV_depth_clamp")) + { + NV_depth_clamp = true; + extensions.Remove("glNV_depth_clamp"); + } + if (extensions.Contains("gl_NV_draw_texture")) + { + NV_draw_texture = true; + extensions.Remove("glNV_draw_texture"); + } + if (extensions.Contains("gl_NV_draw_vulkan_image")) + { + NV_draw_vulkan_image = true; + extensions.Remove("glNV_draw_vulkan_image"); + } + if (extensions.Contains("gl_NV_evaluators")) + { + NV_evaluators = true; + extensions.Remove("glNV_evaluators"); + } + if (extensions.Contains("gl_NV_explicit_multisample")) + { + NV_explicit_multisample = true; + extensions.Remove("glNV_explicit_multisample"); + } + if (extensions.Contains("gl_NV_fence")) + { + NV_fence = true; + extensions.Remove("glNV_fence"); + } + if (extensions.Contains("gl_NV_fill_rectangle")) + { + NV_fill_rectangle = true; + extensions.Remove("glNV_fill_rectangle"); + } + if (extensions.Contains("gl_NV_float_buffer")) + { + NV_float_buffer = true; + extensions.Remove("glNV_float_buffer"); + } + if (extensions.Contains("gl_NV_fog_distance")) + { + NV_fog_distance = true; + extensions.Remove("glNV_fog_distance"); + } + if (extensions.Contains("gl_NV_fragment_coverage_to_color")) + { + NV_fragment_coverage_to_color = true; + extensions.Remove("glNV_fragment_coverage_to_color"); + } + if (extensions.Contains("gl_NV_fragment_program")) + { + NV_fragment_program = true; + extensions.Remove("glNV_fragment_program"); + } + if (extensions.Contains("gl_NV_fragment_program2")) + { + NV_fragment_program2 = true; + extensions.Remove("glNV_fragment_program2"); + } + if (extensions.Contains("gl_NV_fragment_program4")) + { + NV_fragment_program4 = true; + extensions.Remove("glNV_fragment_program4"); + } + if (extensions.Contains("gl_NV_fragment_program_option")) + { + NV_fragment_program_option = true; + extensions.Remove("glNV_fragment_program_option"); + } + if (extensions.Contains("gl_NV_fragment_shader_barycentric")) + { + NV_fragment_shader_barycentric = true; + extensions.Remove("glNV_fragment_shader_barycentric"); + } + if (extensions.Contains("gl_NV_fragment_shader_interlock")) + { + NV_fragment_shader_interlock = true; + extensions.Remove("glNV_fragment_shader_interlock"); + } + if (extensions.Contains("gl_NV_framebuffer_mixed_samples")) + { + NV_framebuffer_mixed_samples = true; + extensions.Remove("glNV_framebuffer_mixed_samples"); + } + if (extensions.Contains("gl_NV_framebuffer_multisample_coverage")) + { + NV_framebuffer_multisample_coverage = true; + extensions.Remove("glNV_framebuffer_multisample_coverage"); + } + if (extensions.Contains("gl_NV_geometry_program4")) + { + NV_geometry_program4 = true; + extensions.Remove("glNV_geometry_program4"); + } + if (extensions.Contains("gl_NV_geometry_shader4")) + { + NV_geometry_shader4 = true; + extensions.Remove("glNV_geometry_shader4"); + } + if (extensions.Contains("gl_NV_geometry_shader_passthrough")) + { + NV_geometry_shader_passthrough = true; + extensions.Remove("glNV_geometry_shader_passthrough"); + } + if (extensions.Contains("gl_NV_gpu_multicast")) + { + NV_gpu_multicast = true; + extensions.Remove("glNV_gpu_multicast"); + } + if (extensions.Contains("gl_NV_gpu_program4")) + { + NV_gpu_program4 = true; + extensions.Remove("glNV_gpu_program4"); + } + if (extensions.Contains("gl_NV_gpu_program5")) + { + NV_gpu_program5 = true; + extensions.Remove("glNV_gpu_program5"); + } + if (extensions.Contains("gl_NV_gpu_program5_mem_extended")) + { + NV_gpu_program5_mem_extended = true; + extensions.Remove("glNV_gpu_program5_mem_extended"); + } + if (extensions.Contains("gl_NV_gpu_shader5")) + { + NV_gpu_shader5 = true; + extensions.Remove("glNV_gpu_shader5"); + } + if (extensions.Contains("gl_NV_half_float")) + { + NV_half_float = true; + extensions.Remove("glNV_half_float"); + } + if (extensions.Contains("gl_NV_internalformat_sample_query")) + { + NV_internalformat_sample_query = true; + extensions.Remove("glNV_internalformat_sample_query"); + } + if (extensions.Contains("gl_NV_light_max_exponent")) + { + NV_light_max_exponent = true; + extensions.Remove("glNV_light_max_exponent"); + } + if (extensions.Contains("gl_NV_memory_attachment")) + { + NV_memory_attachment = true; + extensions.Remove("glNV_memory_attachment"); + } + if (extensions.Contains("gl_NV_memory_object_sparse")) + { + NV_memory_object_sparse = true; + extensions.Remove("glNV_memory_object_sparse"); + } + if (extensions.Contains("gl_NV_mesh_shader")) + { + NV_mesh_shader = true; + extensions.Remove("glNV_mesh_shader"); + } + if (extensions.Contains("gl_NV_multisample_coverage")) + { + NV_multisample_coverage = true; + extensions.Remove("glNV_multisample_coverage"); + } + if (extensions.Contains("gl_NV_multisample_filter_hint")) + { + NV_multisample_filter_hint = true; + extensions.Remove("glNV_multisample_filter_hint"); + } + if (extensions.Contains("gl_NV_occlusion_query")) + { + NV_occlusion_query = true; + extensions.Remove("glNV_occlusion_query"); + } + if (extensions.Contains("gl_NV_packed_depth_stencil")) + { + NV_packed_depth_stencil = true; + extensions.Remove("glNV_packed_depth_stencil"); + } + if (extensions.Contains("gl_NV_parameter_buffer_object")) + { + NV_parameter_buffer_object = true; + extensions.Remove("glNV_parameter_buffer_object"); + } + if (extensions.Contains("gl_NV_parameter_buffer_object2")) + { + NV_parameter_buffer_object2 = true; + extensions.Remove("glNV_parameter_buffer_object2"); + } + if (extensions.Contains("gl_NV_path_rendering")) + { + NV_path_rendering = true; + extensions.Remove("glNV_path_rendering"); + } + if (extensions.Contains("gl_NV_path_rendering_shared_edge")) + { + NV_path_rendering_shared_edge = true; + extensions.Remove("glNV_path_rendering_shared_edge"); + } + if (extensions.Contains("gl_NV_pixel_data_range")) + { + NV_pixel_data_range = true; + extensions.Remove("glNV_pixel_data_range"); + } + if (extensions.Contains("gl_NV_point_sprite")) + { + NV_point_sprite = true; + extensions.Remove("glNV_point_sprite"); + } + if (extensions.Contains("gl_NV_present_video")) + { + NV_present_video = true; + extensions.Remove("glNV_present_video"); + } + if (extensions.Contains("gl_NV_primitive_restart")) + { + NV_primitive_restart = true; + extensions.Remove("glNV_primitive_restart"); + } + if (extensions.Contains("gl_NV_primitive_shading_rate")) + { + NV_primitive_shading_rate = true; + extensions.Remove("glNV_primitive_shading_rate"); + } + if (extensions.Contains("gl_NV_query_resource")) + { + NV_query_resource = true; + extensions.Remove("glNV_query_resource"); + } + if (extensions.Contains("gl_NV_query_resource_tag")) + { + NV_query_resource_tag = true; + extensions.Remove("glNV_query_resource_tag"); + } + if (extensions.Contains("gl_NV_register_combiners")) + { + NV_register_combiners = true; + extensions.Remove("glNV_register_combiners"); + } + if (extensions.Contains("gl_NV_register_combiners2")) + { + NV_register_combiners2 = true; + extensions.Remove("glNV_register_combiners2"); + } + if (extensions.Contains("gl_NV_representative_fragment_test")) + { + NV_representative_fragment_test = true; + extensions.Remove("glNV_representative_fragment_test"); + } + if (extensions.Contains("gl_NV_robustness_video_memory_purge")) + { + NV_robustness_video_memory_purge = true; + extensions.Remove("glNV_robustness_video_memory_purge"); + } + if (extensions.Contains("gl_NV_sample_locations")) + { + NV_sample_locations = true; + extensions.Remove("glNV_sample_locations"); + } + if (extensions.Contains("gl_NV_sample_mask_override_coverage")) + { + NV_sample_mask_override_coverage = true; + extensions.Remove("glNV_sample_mask_override_coverage"); + } + if (extensions.Contains("gl_NV_scissor_exclusive")) + { + NV_scissor_exclusive = true; + extensions.Remove("glNV_scissor_exclusive"); + } + if (extensions.Contains("gl_NV_shader_atomic_counters")) + { + NV_shader_atomic_counters = true; + extensions.Remove("glNV_shader_atomic_counters"); + } + if (extensions.Contains("gl_NV_shader_atomic_float")) + { + NV_shader_atomic_float = true; + extensions.Remove("glNV_shader_atomic_float"); + } + if (extensions.Contains("gl_NV_shader_atomic_float64")) + { + NV_shader_atomic_float64 = true; + extensions.Remove("glNV_shader_atomic_float64"); + } + if (extensions.Contains("gl_NV_shader_atomic_fp16_vector")) + { + NV_shader_atomic_fp16_vector = true; + extensions.Remove("glNV_shader_atomic_fp16_vector"); + } + if (extensions.Contains("gl_NV_shader_atomic_int64")) + { + NV_shader_atomic_int64 = true; + extensions.Remove("glNV_shader_atomic_int64"); + } + if (extensions.Contains("gl_NV_shader_buffer_load")) + { + NV_shader_buffer_load = true; + extensions.Remove("glNV_shader_buffer_load"); + } + if (extensions.Contains("gl_NV_shader_buffer_store")) + { + NV_shader_buffer_store = true; + extensions.Remove("glNV_shader_buffer_store"); + } + if (extensions.Contains("gl_NV_shader_storage_buffer_object")) + { + NV_shader_storage_buffer_object = true; + extensions.Remove("glNV_shader_storage_buffer_object"); + } + if (extensions.Contains("gl_NV_shader_subgroup_partitioned")) + { + NV_shader_subgroup_partitioned = true; + extensions.Remove("glNV_shader_subgroup_partitioned"); + } + if (extensions.Contains("gl_NV_shader_texture_footprint")) + { + NV_shader_texture_footprint = true; + extensions.Remove("glNV_shader_texture_footprint"); + } + if (extensions.Contains("gl_NV_shader_thread_group")) + { + NV_shader_thread_group = true; + extensions.Remove("glNV_shader_thread_group"); + } + if (extensions.Contains("gl_NV_shader_thread_shuffle")) + { + NV_shader_thread_shuffle = true; + extensions.Remove("glNV_shader_thread_shuffle"); + } + if (extensions.Contains("gl_NV_shading_rate_image")) + { + NV_shading_rate_image = true; + extensions.Remove("glNV_shading_rate_image"); + } + if (extensions.Contains("gl_NV_stereo_view_rendering")) + { + NV_stereo_view_rendering = true; + extensions.Remove("glNV_stereo_view_rendering"); + } + if (extensions.Contains("gl_NV_tessellation_program5")) + { + NV_tessellation_program5 = true; + extensions.Remove("glNV_tessellation_program5"); + } + if (extensions.Contains("gl_NV_texgen_emboss")) + { + NV_texgen_emboss = true; + extensions.Remove("glNV_texgen_emboss"); + } + if (extensions.Contains("gl_NV_texgen_reflection")) + { + NV_texgen_reflection = true; + extensions.Remove("glNV_texgen_reflection"); + } + if (extensions.Contains("gl_NV_texture_barrier")) + { + NV_texture_barrier = true; + extensions.Remove("glNV_texture_barrier"); + } + if (extensions.Contains("gl_NV_texture_compression_vtc")) + { + NV_texture_compression_vtc = true; + extensions.Remove("glNV_texture_compression_vtc"); + } + if (extensions.Contains("gl_NV_texture_env_combine4")) + { + NV_texture_env_combine4 = true; + extensions.Remove("glNV_texture_env_combine4"); + } + if (extensions.Contains("gl_NV_texture_expand_normal")) + { + NV_texture_expand_normal = true; + extensions.Remove("glNV_texture_expand_normal"); + } + if (extensions.Contains("gl_NV_texture_multisample")) + { + NV_texture_multisample = true; + extensions.Remove("glNV_texture_multisample"); + } + if (extensions.Contains("gl_NV_texture_rectangle")) + { + NV_texture_rectangle = true; + extensions.Remove("glNV_texture_rectangle"); + } + if (extensions.Contains("gl_NV_texture_rectangle_compressed")) + { + NV_texture_rectangle_compressed = true; + extensions.Remove("glNV_texture_rectangle_compressed"); + } + if (extensions.Contains("gl_NV_texture_shader")) + { + NV_texture_shader = true; + extensions.Remove("glNV_texture_shader"); + } + if (extensions.Contains("gl_NV_texture_shader2")) + { + NV_texture_shader2 = true; + extensions.Remove("glNV_texture_shader2"); + } + if (extensions.Contains("gl_NV_texture_shader3")) + { + NV_texture_shader3 = true; + extensions.Remove("glNV_texture_shader3"); + } + if (extensions.Contains("gl_NV_timeline_semaphore")) + { + NV_timeline_semaphore = true; + extensions.Remove("glNV_timeline_semaphore"); + } + if (extensions.Contains("gl_NV_transform_feedback")) + { + NV_transform_feedback = true; + extensions.Remove("glNV_transform_feedback"); + } + if (extensions.Contains("gl_NV_transform_feedback2")) + { + NV_transform_feedback2 = true; + extensions.Remove("glNV_transform_feedback2"); + } + if (extensions.Contains("gl_NV_uniform_buffer_std430_layout")) + { + NV_uniform_buffer_std430_layout = true; + extensions.Remove("glNV_uniform_buffer_std430_layout"); + } + if (extensions.Contains("gl_NV_uniform_buffer_unified_memory")) + { + NV_uniform_buffer_unified_memory = true; + extensions.Remove("glNV_uniform_buffer_unified_memory"); + } + if (extensions.Contains("gl_NV_vdpau_interop")) + { + NV_vdpau_interop = true; + extensions.Remove("glNV_vdpau_interop"); + } + if (extensions.Contains("gl_NV_vdpau_interop2")) + { + NV_vdpau_interop2 = true; + extensions.Remove("glNV_vdpau_interop2"); + } + if (extensions.Contains("gl_NV_vertex_array_range")) + { + NV_vertex_array_range = true; + extensions.Remove("glNV_vertex_array_range"); + } + if (extensions.Contains("gl_NV_vertex_array_range2")) + { + NV_vertex_array_range2 = true; + extensions.Remove("glNV_vertex_array_range2"); + } + if (extensions.Contains("gl_NV_vertex_attrib_integer_64bit")) + { + NV_vertex_attrib_integer_64bit = true; + extensions.Remove("glNV_vertex_attrib_integer_64bit"); + } + if (extensions.Contains("gl_NV_vertex_buffer_unified_memory")) + { + NV_vertex_buffer_unified_memory = true; + extensions.Remove("glNV_vertex_buffer_unified_memory"); + } + if (extensions.Contains("gl_NV_vertex_program")) + { + NV_vertex_program = true; + extensions.Remove("glNV_vertex_program"); + } + if (extensions.Contains("gl_NV_vertex_program1_1")) + { + NV_vertex_program1_1 = true; + extensions.Remove("glNV_vertex_program1_1"); + } + if (extensions.Contains("gl_NV_vertex_program2")) + { + NV_vertex_program2 = true; + extensions.Remove("glNV_vertex_program2"); + } + if (extensions.Contains("gl_NV_vertex_program2_option")) + { + NV_vertex_program2_option = true; + extensions.Remove("glNV_vertex_program2_option"); + } + if (extensions.Contains("gl_NV_vertex_program3")) + { + NV_vertex_program3 = true; + extensions.Remove("glNV_vertex_program3"); + } + if (extensions.Contains("gl_NV_vertex_program4")) + { + NV_vertex_program4 = true; + extensions.Remove("glNV_vertex_program4"); + } + if (extensions.Contains("gl_NV_video_capture")) + { + NV_video_capture = true; + extensions.Remove("glNV_video_capture"); + } + if (extensions.Contains("gl_NV_viewport_array2")) + { + NV_viewport_array2 = true; + extensions.Remove("glNV_viewport_array2"); + } + if (extensions.Contains("gl_NV_viewport_swizzle")) + { + NV_viewport_swizzle = true; + extensions.Remove("glNV_viewport_swizzle"); + } + if (extensions.Contains("gl_OES_byte_coordinates")) + { + OES_byte_coordinates = true; + extensions.Remove("glOES_byte_coordinates"); + } + if (extensions.Contains("gl_OES_compressed_paletted_texture")) + { + OES_compressed_paletted_texture = true; + extensions.Remove("glOES_compressed_paletted_texture"); + } + if (extensions.Contains("gl_OES_fixed_point")) + { + OES_fixed_point = true; + extensions.Remove("glOES_fixed_point"); + } + if (extensions.Contains("gl_OES_query_matrix")) + { + OES_query_matrix = true; + extensions.Remove("glOES_query_matrix"); + } + if (extensions.Contains("gl_OES_read_format")) + { + OES_read_format = true; + extensions.Remove("glOES_read_format"); + } + if (extensions.Contains("gl_OES_single_precision")) + { + OES_single_precision = true; + extensions.Remove("glOES_single_precision"); + } + if (extensions.Contains("gl_OML_interlace")) + { + OML_interlace = true; + extensions.Remove("glOML_interlace"); + } + if (extensions.Contains("gl_OML_resample")) + { + OML_resample = true; + extensions.Remove("glOML_resample"); + } + if (extensions.Contains("gl_OML_subsample")) + { + OML_subsample = true; + extensions.Remove("glOML_subsample"); + } + if (extensions.Contains("gl_OVR_multiview")) + { + OVR_multiview = true; + extensions.Remove("glOVR_multiview"); + } + if (extensions.Contains("gl_OVR_multiview2")) + { + OVR_multiview2 = true; + extensions.Remove("glOVR_multiview2"); + } + if (extensions.Contains("gl_PGI_misc_hints")) + { + PGI_misc_hints = true; + extensions.Remove("glPGI_misc_hints"); + } + if (extensions.Contains("gl_PGI_vertex_hints")) + { + PGI_vertex_hints = true; + extensions.Remove("glPGI_vertex_hints"); + } + if (extensions.Contains("gl_REND_screen_coordinates")) + { + REND_screen_coordinates = true; + extensions.Remove("glREND_screen_coordinates"); + } + if (extensions.Contains("gl_S3_s3tc")) + { + S3_s3tc = true; + extensions.Remove("glS3_s3tc"); + } + if (extensions.Contains("gl_SGIS_detail_texture")) + { + SGIS_detail_texture = true; + extensions.Remove("glSGIS_detail_texture"); + } + if (extensions.Contains("gl_SGIS_fog_function")) + { + SGIS_fog_function = true; + extensions.Remove("glSGIS_fog_function"); + } + if (extensions.Contains("gl_SGIS_generate_mipmap")) + { + SGIS_generate_mipmap = true; + extensions.Remove("glSGIS_generate_mipmap"); + } + if (extensions.Contains("gl_SGIS_multisample")) + { + SGIS_multisample = true; + extensions.Remove("glSGIS_multisample"); + } + if (extensions.Contains("gl_SGIS_pixel_texture")) + { + SGIS_pixel_texture = true; + extensions.Remove("glSGIS_pixel_texture"); + } + if (extensions.Contains("gl_SGIS_point_line_texgen")) + { + SGIS_point_line_texgen = true; + extensions.Remove("glSGIS_point_line_texgen"); + } + if (extensions.Contains("gl_SGIS_point_parameters")) + { + SGIS_point_parameters = true; + extensions.Remove("glSGIS_point_parameters"); + } + if (extensions.Contains("gl_SGIS_sharpen_texture")) + { + SGIS_sharpen_texture = true; + extensions.Remove("glSGIS_sharpen_texture"); + } + if (extensions.Contains("gl_SGIS_texture4D")) + { + SGIS_texture4D = true; + extensions.Remove("glSGIS_texture4D"); + } + if (extensions.Contains("gl_SGIS_texture_border_clamp")) + { + SGIS_texture_border_clamp = true; + extensions.Remove("glSGIS_texture_border_clamp"); + } + if (extensions.Contains("gl_SGIS_texture_color_mask")) + { + SGIS_texture_color_mask = true; + extensions.Remove("glSGIS_texture_color_mask"); + } + if (extensions.Contains("gl_SGIS_texture_edge_clamp")) + { + SGIS_texture_edge_clamp = true; + extensions.Remove("glSGIS_texture_edge_clamp"); + } + if (extensions.Contains("gl_SGIS_texture_filter4")) + { + SGIS_texture_filter4 = true; + extensions.Remove("glSGIS_texture_filter4"); + } + if (extensions.Contains("gl_SGIS_texture_lod")) + { + SGIS_texture_lod = true; + extensions.Remove("glSGIS_texture_lod"); + } + if (extensions.Contains("gl_SGIS_texture_select")) + { + SGIS_texture_select = true; + extensions.Remove("glSGIS_texture_select"); + } + if (extensions.Contains("gl_SGIX_async")) + { + SGIX_async = true; + extensions.Remove("glSGIX_async"); + } + if (extensions.Contains("gl_SGIX_async_histogram")) + { + SGIX_async_histogram = true; + extensions.Remove("glSGIX_async_histogram"); + } + if (extensions.Contains("gl_SGIX_async_pixel")) + { + SGIX_async_pixel = true; + extensions.Remove("glSGIX_async_pixel"); + } + if (extensions.Contains("gl_SGIX_blend_alpha_minmax")) + { + SGIX_blend_alpha_minmax = true; + extensions.Remove("glSGIX_blend_alpha_minmax"); + } + if (extensions.Contains("gl_SGIX_calligraphic_fragment")) + { + SGIX_calligraphic_fragment = true; + extensions.Remove("glSGIX_calligraphic_fragment"); + } + if (extensions.Contains("gl_SGIX_clipmap")) + { + SGIX_clipmap = true; + extensions.Remove("glSGIX_clipmap"); + } + if (extensions.Contains("gl_SGIX_convolution_accuracy")) + { + SGIX_convolution_accuracy = true; + extensions.Remove("glSGIX_convolution_accuracy"); + } + if (extensions.Contains("gl_SGIX_depth_pass_instrument")) + { + SGIX_depth_pass_instrument = true; + extensions.Remove("glSGIX_depth_pass_instrument"); + } + if (extensions.Contains("gl_SGIX_depth_texture")) + { + SGIX_depth_texture = true; + extensions.Remove("glSGIX_depth_texture"); + } + if (extensions.Contains("gl_SGIX_flush_raster")) + { + SGIX_flush_raster = true; + extensions.Remove("glSGIX_flush_raster"); + } + if (extensions.Contains("gl_SGIX_fog_offset")) + { + SGIX_fog_offset = true; + extensions.Remove("glSGIX_fog_offset"); + } + if (extensions.Contains("gl_SGIX_fragment_lighting")) + { + SGIX_fragment_lighting = true; + extensions.Remove("glSGIX_fragment_lighting"); + } + if (extensions.Contains("gl_SGIX_framezoom")) + { + SGIX_framezoom = true; + extensions.Remove("glSGIX_framezoom"); + } + if (extensions.Contains("gl_SGIX_igloo_interface")) + { + SGIX_igloo_interface = true; + extensions.Remove("glSGIX_igloo_interface"); + } + if (extensions.Contains("gl_SGIX_instruments")) + { + SGIX_instruments = true; + extensions.Remove("glSGIX_instruments"); + } + if (extensions.Contains("gl_SGIX_interlace")) + { + SGIX_interlace = true; + extensions.Remove("glSGIX_interlace"); + } + if (extensions.Contains("gl_SGIX_ir_instrument1")) + { + SGIX_ir_instrument1 = true; + extensions.Remove("glSGIX_ir_instrument1"); + } + if (extensions.Contains("gl_SGIX_list_priority")) + { + SGIX_list_priority = true; + extensions.Remove("glSGIX_list_priority"); + } + if (extensions.Contains("gl_SGIX_pixel_texture")) + { + SGIX_pixel_texture = true; + extensions.Remove("glSGIX_pixel_texture"); + } + if (extensions.Contains("gl_SGIX_pixel_tiles")) + { + SGIX_pixel_tiles = true; + extensions.Remove("glSGIX_pixel_tiles"); + } + if (extensions.Contains("gl_SGIX_polynomial_ffd")) + { + SGIX_polynomial_ffd = true; + extensions.Remove("glSGIX_polynomial_ffd"); + } + if (extensions.Contains("gl_SGIX_reference_plane")) + { + SGIX_reference_plane = true; + extensions.Remove("glSGIX_reference_plane"); + } + if (extensions.Contains("gl_SGIX_resample")) + { + SGIX_resample = true; + extensions.Remove("glSGIX_resample"); + } + if (extensions.Contains("gl_SGIX_scalebias_hint")) + { + SGIX_scalebias_hint = true; + extensions.Remove("glSGIX_scalebias_hint"); + } + if (extensions.Contains("gl_SGIX_shadow")) + { + SGIX_shadow = true; + extensions.Remove("glSGIX_shadow"); + } + if (extensions.Contains("gl_SGIX_shadow_ambient")) + { + SGIX_shadow_ambient = true; + extensions.Remove("glSGIX_shadow_ambient"); + } + if (extensions.Contains("gl_SGIX_sprite")) + { + SGIX_sprite = true; + extensions.Remove("glSGIX_sprite"); + } + if (extensions.Contains("gl_SGIX_subsample")) + { + SGIX_subsample = true; + extensions.Remove("glSGIX_subsample"); + } + if (extensions.Contains("gl_SGIX_tag_sample_buffer")) + { + SGIX_tag_sample_buffer = true; + extensions.Remove("glSGIX_tag_sample_buffer"); + } + if (extensions.Contains("gl_SGIX_texture_add_env")) + { + SGIX_texture_add_env = true; + extensions.Remove("glSGIX_texture_add_env"); + } + if (extensions.Contains("gl_SGIX_texture_coordinate_clamp")) + { + SGIX_texture_coordinate_clamp = true; + extensions.Remove("glSGIX_texture_coordinate_clamp"); + } + if (extensions.Contains("gl_SGIX_texture_lod_bias")) + { + SGIX_texture_lod_bias = true; + extensions.Remove("glSGIX_texture_lod_bias"); + } + if (extensions.Contains("gl_SGIX_texture_multi_buffer")) + { + SGIX_texture_multi_buffer = true; + extensions.Remove("glSGIX_texture_multi_buffer"); + } + if (extensions.Contains("gl_SGIX_texture_scale_bias")) + { + SGIX_texture_scale_bias = true; + extensions.Remove("glSGIX_texture_scale_bias"); + } + if (extensions.Contains("gl_SGIX_vertex_preclip")) + { + SGIX_vertex_preclip = true; + extensions.Remove("glSGIX_vertex_preclip"); + } + if (extensions.Contains("gl_SGIX_ycrcb")) + { + SGIX_ycrcb = true; + extensions.Remove("glSGIX_ycrcb"); + } + if (extensions.Contains("gl_SGIX_ycrcb_subsample")) + { + SGIX_ycrcb_subsample = true; + extensions.Remove("glSGIX_ycrcb_subsample"); + } + if (extensions.Contains("gl_SGIX_ycrcba")) + { + SGIX_ycrcba = true; + extensions.Remove("glSGIX_ycrcba"); + } + if (extensions.Contains("gl_SGI_color_matrix")) + { + SGI_color_matrix = true; + extensions.Remove("glSGI_color_matrix"); + } + if (extensions.Contains("gl_SGI_color_table")) + { + SGI_color_table = true; + extensions.Remove("glSGI_color_table"); + } + if (extensions.Contains("gl_SGI_texture_color_table")) + { + SGI_texture_color_table = true; + extensions.Remove("glSGI_texture_color_table"); + } + if (extensions.Contains("gl_SUNX_constant_data")) + { + SUNX_constant_data = true; + extensions.Remove("glSUNX_constant_data"); + } + if (extensions.Contains("gl_SUN_convolution_border_modes")) + { + SUN_convolution_border_modes = true; + extensions.Remove("glSUN_convolution_border_modes"); + } + if (extensions.Contains("gl_SUN_global_alpha")) + { + SUN_global_alpha = true; + extensions.Remove("glSUN_global_alpha"); + } + if (extensions.Contains("gl_SUN_mesh_array")) + { + SUN_mesh_array = true; + extensions.Remove("glSUN_mesh_array"); + } + if (extensions.Contains("gl_SUN_slice_accum")) + { + SUN_slice_accum = true; + extensions.Remove("glSUN_slice_accum"); + } + if (extensions.Contains("gl_SUN_triangle_list")) + { + SUN_triangle_list = true; + extensions.Remove("glSUN_triangle_list"); + } + if (extensions.Contains("gl_SUN_vertex")) + { + SUN_vertex = true; + extensions.Remove("glSUN_vertex"); + } + if (extensions.Contains("gl_WIN_phong_shading")) + { + WIN_phong_shading = true; + extensions.Remove("glWIN_phong_shading"); + } + if (extensions.Contains("gl_WIN_specular_fog")) + { + WIN_specular_fog = true; + extensions.Remove("glWIN_specular_fog"); } #endregion checkGLextensions - } - - internal static void CheckCoreVersion( - int majorVersion, - int minorVersion - ) - { - if (majorVersion < 3) { + } + + internal static void CheckCoreVersion(int majorVersion, int minorVersion) + { + if (majorVersion < 3) { throw new InvalidOperationException( - "StgSharp does not support OpenGL immediate mode."); + "StgSharp does not support OpenGL immediate mode."); } - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 0))) - { - core10 = true; - } else - { - goto log; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 0))) + { + core10 = true; + } else + { + goto log; } - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 1))) - { - core11 = true; - } else - { - goto log; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 1))) + { + core11 = true; + } else + { + goto log; } - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 2))) - { - core12 = true; - } else - { - goto log; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 2))) + { + core12 = true; + } else + { + goto log; } - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 3))) - { - core13 = true; - } else - { - goto log; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 3))) + { + core13 = true; + } else + { + goto log; } - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 4))) - { - core14 = true; - } else - { - goto log; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 4))) + { + core14 = true; + } else + { + goto log; } - if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 5))) - { - core15 = true; - } else - { - goto log; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 5))) + { + core15 = true; + } else + { + goto log; } - if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 0))) - { - core20 = true; - } else - { - goto log; + if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 0))) + { + core20 = true; + } else + { + goto log; } - if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 1))) - { - core21 = true; - } else - { - goto log; + if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 1))) + { + core21 = true; + } else + { + goto log; } - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 0))) - { - core30 = true; - } else - { - goto log; + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 0))) + { + core30 = true; + } else + { + goto log; } - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 1))) - { - core31 = true; - } else - { - goto log; + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 1))) + { + core31 = true; + } else + { + goto log; } - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 2))) - { - core32 = true; - } else - { - goto log; + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 2))) + { + core32 = true; + } else + { + goto log; } - if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 3))) - { - core33 = true; - } else - { - goto log; + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 3))) + { + core33 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 0))) - { - core40 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 0))) + { + core40 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 1))) - { - core41 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 1))) + { + core41 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 2))) - { - core42 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 2))) + { + core42 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 3))) - { - core43 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 3))) + { + core43 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 4))) - { - core44 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 4))) + { + core44 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 5))) - { - core45 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 5))) + { + core45 = true; + } else + { + goto log; } - if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 6))) - { - core46 = true; - } else - { - goto log; + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 6))) + { + core46 = true; + } else + { + goto log; } log: - { - DefaultLog.InternalWriteLog("Find core OpenGL version.", LogType.Info); + { + DefaultLog.InternalWriteLog("Find core OpenGL version.", LogType.Info); return; - } - } - - internal static unsafe string GetExtensions( - this OpenglContext context - ) - { - if (context.glGetString == null) { - return string.Empty; - } - return Marshal.PtrToStringAnsi((nint)context.glGetString(glExtension))!; - } - - } + } + } + + internal static unsafe string GetExtensions(this OpenglContext context) + { + if (context.glGetString == null) { + return string.Empty; + } + return Marshal.PtrToStringAnsi((nint)context.glGetString(glExtension))!; + } + + } } \ No newline at end of file diff --git a/StgSharp.Mathematics/Geometries/SpaceGeometry/TriangulatedSurface.cs b/StgSharp.Mathematics/Geometries/SpaceGeometry/TriangulatedSurface.cs index 63775487..51ed97f8 100644 --- a/StgSharp.Mathematics/Geometries/SpaceGeometry/TriangulatedSurface.cs +++ b/StgSharp.Mathematics/Geometries/SpaceGeometry/TriangulatedSurface.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="TriangulatedSurface" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance; +using StgSharp.Mathematics; using StgSharp.Mathematics; using StgSharp.Mathematics.Graphics; diff --git a/StgSharp.Mathematics/Internal/ColumnSet2.cs b/StgSharp.Mathematics/Internal/ColumnSet2.cs index f5ebc582..44553ed8 100644 --- a/StgSharp.Mathematics/Internal/ColumnSet2.cs +++ b/StgSharp.Mathematics/Internal/ColumnSet2.cs @@ -1,99 +1,87 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="ColumnSet2" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp; - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Mathematics.Internal -{ - [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] - internal struct ColumnSet2 : IEquatable - { - - [FieldOffset(0 * sizeof(float))] internal float m00; - [FieldOffset(4 * sizeof(float))] internal float m01; - [FieldOffset(1 * sizeof(float))] internal float m10; - [FieldOffset(5 * sizeof(float))] internal float m11; - [FieldOffset(2 * sizeof(float))] internal float m20; - [FieldOffset(6 * sizeof(float))] internal float m21; - [FieldOffset(3 * sizeof(float))] internal float m30; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ColumnSet2.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Mathematics.Internal +{ + [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] + internal struct ColumnSet2 : IEquatable + { + + [FieldOffset(0 * sizeof(float))] internal float m00; + [FieldOffset(4 * sizeof(float))] internal float m01; + [FieldOffset(1 * sizeof(float))] internal float m10; + [FieldOffset(5 * sizeof(float))] internal float m11; + [FieldOffset(2 * sizeof(float))] internal float m20; + [FieldOffset(6 * sizeof(float))] internal float m21; + [FieldOffset(3 * sizeof(float))] internal float m30; [FieldOffset(7 * sizeof(float))] internal float m31; - [FieldOffset(0)] internal Vector4 colum0; - [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; - - internal ColumnSet2( - Vector4 c0, - Vector4 c1 - ) - { - Unsafe.SkipInit(out this); - colum0 = c0; - colum1 = c1; + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; + + internal ColumnSet2(Vector4 c0, Vector4 c1) + { + Unsafe.SkipInit(out this); + colum0 = c0; + colum1 = c1; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object? obj) + { + return (obj is ColumnSet2 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ColumnSet2 other) + { + return colum0.Equals(other.colum0) && colum1.Equals(other.colum1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ColumnSet2 left, ColumnSet2 right) + { + return !(left == right); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override bool Equals( - object? obj - ) - { - return (obj is ColumnSet2 mat) && Equals(mat); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals( - ColumnSet2 other - ) - { - return colum0.Equals(other.colum0) && colum1.Equals(other.colum1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=( - ColumnSet2 left, - ColumnSet2 right - ) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==( - ColumnSet2 left, - ColumnSet2 right - ) - { - return left.Equals(right); - } - - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ColumnSet2 left, ColumnSet2 right) + { + return left.Equals(right); + } + + } } diff --git a/StgSharp.Common/HighPerformance/MatrixKernel.cs b/StgSharp.Mathematics/Internal/MatrixKernel.cs similarity index 83% rename from StgSharp.Common/HighPerformance/MatrixKernel.cs rename to StgSharp.Mathematics/Internal/MatrixKernel.cs index 6ee66d5f..4263cf72 100644 --- a/StgSharp.Common/HighPerformance/MatrixKernel.cs +++ b/StgSharp.Mathematics/Internal/MatrixKernel.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="MatrixKernel" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -30,7 +30,7 @@ using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { public unsafe struct MatrixKernel { @@ -41,7 +41,7 @@ namespace StgSharp.HighPerformance [StructLayout(LayoutKind.Sequential)] [InlineArray(16)] - public unsafe struct MatrixKernel where T : unmanaged, INumber + public unsafe struct MatrixKernel where T: unmanaged, INumber { public static readonly int Size = 16 * sizeof(T); @@ -53,19 +53,14 @@ namespace StgSharp.HighPerformance Unsafe.SkipInit(out this); } - public MatrixKernel( - bool clear - ) + public MatrixKernel(bool clear) { if (!clear) { Unsafe.SkipInit(out this); } } - public ref T this[ - int x, - int y - ] + public ref T this[int x, int y] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => ref Unsafe.Add(ref c0r0, (x * 4) + y); diff --git a/StgSharp.Common/HighPerformance/MatrixPanel.cs b/StgSharp.Mathematics/Internal/MatrixPanel.cs similarity index 95% rename from StgSharp.Common/HighPerformance/MatrixPanel.cs rename to StgSharp.Mathematics/Internal/MatrixPanel.cs index 1b172cb1..84ad9286 100644 --- a/StgSharp.Common/HighPerformance/MatrixPanel.cs +++ b/StgSharp.Mathematics/Internal/MatrixPanel.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="MatrixPanel" // Project: StgSharp @@ -31,7 +31,7 @@ using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { public unsafe struct MatrixPanel { diff --git a/StgSharp.Common/HighPerformance/ScalarPacket.cs b/StgSharp.Mathematics/Internal/ScalarPacket.cs similarity index 90% rename from StgSharp.Common/HighPerformance/ScalarPacket.cs rename to StgSharp.Mathematics/Internal/ScalarPacket.cs index 41b1e22e..2fe6fe6a 100644 --- a/StgSharp.Common/HighPerformance/ScalarPacket.cs +++ b/StgSharp.Mathematics/Internal/ScalarPacket.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="ScalarPacket" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -33,7 +33,7 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; -namespace StgSharp.HighPerformance +namespace StgSharp.Mathematics { public unsafe struct ScalarPacket { diff --git a/StgSharp.Mathematics/Internal/UnsafeCompute.cs b/StgSharp.Mathematics/Internal/UnsafeCompute.cs new file mode 100644 index 00000000..2264bec6 --- /dev/null +++ b/StgSharp.Mathematics/Internal/UnsafeCompute.cs @@ -0,0 +1,57 @@ +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="UnsafeCompute.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics.Internal +{ + public static class UnsafeCompute + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int CityHashSimplify(char* span, int length) + { + return NativeIntrinsic.Context.city_hash_simplify(span, length); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int CityHashSimplify(char* span, int begin, int length) + { + return NativeIntrinsic.Context.city_hash_simplify(span + begin, length); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int IndexOfCharPair(char* source, int pairValue, int length) + { + return NativeIntrinsic.Context.index_pair(source, pairValue, length); + } + + } +} diff --git a/StgSharp.Mathematics/Internal/intrinsicContextProvider.cs b/StgSharp.Mathematics/Internal/intrinsicContextProvider.cs index ad28d2b0..67009abd 100644 --- a/StgSharp.Mathematics/Internal/intrinsicContextProvider.cs +++ b/StgSharp.Mathematics/Internal/intrinsicContextProvider.cs @@ -1,50 +1,50 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="intrinsicContextProvider" -// 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. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="intrinsicContextProvider" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Mathematics.Internal; -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Internal -{ - internal static unsafe partial class NativeIntrinsic - { - - private static readonly IntrinsicContext _intrinsicContext = new(); - - public static SIMDID IntrinsicMask { get; set; } - - internal static IntrinsicContext Context - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _intrinsicContext; +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Internal +{ + internal static unsafe partial class NativeIntrinsic + { + + private static readonly IntrinsicContext _intrinsicContext = new(); + + public static SIMDID IntrinsicMask { get; set; } + + internal static IntrinsicContext Context + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _intrinsicContext; } /* @@ -74,6 +74,6 @@ namespace StgSharp.Mathematics.Internal [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] private static partial void LoadIntrinsicFunction(IntrinsicContext* context, ulong id); - /**/ - } + /**/ + } } \ No newline at end of file diff --git a/StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs b/StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs index 4eae1b2e..0b8625c3 100644 --- a/StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Matrix44.cs @@ -1,263 +1,228 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Matrix44" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Internal; -using StgSharp.Mathematics.Numeric; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphics -{ - [StructLayout(LayoutKind.Explicit, Size = (16 * sizeof(float)), Pack = 16)] - public unsafe struct Matrix44 : IEquatable - { - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Matrix44" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Intrinsic; +using StgSharp.Mathematics.Numeric; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + [StructLayout(LayoutKind.Explicit, Size = (16 * sizeof(float)), Pack = 16)] + public unsafe struct Matrix44 : IEquatable + { + [FieldOffset(0 * sizeof(float))] internal Column column; - [FieldOffset(0)] internal ColumnSet4 mat; - [FieldOffset(0)] internal MatrixKernel kernel; - - internal Matrix44( - ColumnSet4 mat - ) - { - Unsafe.SkipInit(out this); - this.mat = mat; - } - - internal Matrix44( - Vector4 vec0, - Vector4 vec1, - Vector4 vec2, - Vector4 vec3 - ) - { - Unsafe.SkipInit(out this); - mat.colum0 = vec0; - mat.colum1 = vec1; - mat.colum2 = vec2; - mat.colum3 = vec3; - } - - public Matrix44() - { - Unsafe.SkipInit(out this); - } - - public unsafe Matrix44( - float a00, - float a01, - float a02, - float a03, - float a10, - float a11, - float a12, - float a13, - float a20, - float a21, - float a22, - float a23, - float a30, - float a31, - float a32, - float a33 - ) - { - Unsafe.SkipInit(out this); - mat.colum0 = new Vector4(a00, a10, a20, a30); - mat.colum1 = new Vector4(a01, a11, a21, a31); - mat.colum2 = new Vector4(a02, a12, a22, a32); - mat.colum3 = new Vector4(a03, a13, a23, a33); - } - - public unsafe float this[ - int rowNum, - int columNum - ] - { - get + [FieldOffset(0)] internal ColumnSet4 mat; + [FieldOffset(0)] internal MatrixKernel kernel; + + internal Matrix44(ColumnSet4 mat) + { + Unsafe.SkipInit(out this); + this.mat = mat; + } + + internal Matrix44(Vector4 vec0, Vector4 vec1, Vector4 vec2, Vector4 vec3) + { + Unsafe.SkipInit(out this); + mat.colum0 = vec0; + mat.colum1 = vec1; + mat.colum2 = vec2; + mat.colum3 = vec3; + } + + public Matrix44() + { + Unsafe.SkipInit(out this); + } + + public unsafe Matrix44( + float a00, + float a01, + float a02, + float a03, + float a10, + float a11, + float a12, + float a13, + float a20, + float a21, + float a22, + float a23, + float a30, + float a31, + float a32, + float a33) + { + Unsafe.SkipInit(out this); + mat.colum0 = new Vector4(a00, a10, a20, a30); + mat.colum1 = new Vector4(a01, a11, a21, a31); + mat.colum2 = new Vector4(a02, a12, a22, a32); + mat.colum3 = new Vector4(a03, a13, a23, a33); + } + + public unsafe float this[int rowNum, int columNum] + { + get { #if DEBUG - if (rowNum is > 3 or < 0) - { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } - if (columNum is > 3 or < 0) { - throw new ArgumentOutOfRangeException(nameof(columNum)); + if (rowNum is > 3 or < 0) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if (columNum is > 3 or < 0) { + throw new ArgumentOutOfRangeException(nameof(columNum)); } #endif - return kernel[rowNum + 4 * columNum]; - } - set + return kernel[rowNum + 4 * columNum]; + } + set { #if DEBUG - if (rowNum is > 3 or < 0) - { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } - if (columNum is > 3 or < 0) { - throw new ArgumentOutOfRangeException(nameof(columNum)); + if (rowNum is > 3 or < 0) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if (columNum is > 3 or < 0) { + throw new ArgumentOutOfRangeException(nameof(columNum)); } #endif - kernel[rowNum + 4 * columNum] = value; - } + kernel[rowNum + 4 * columNum] = value; + } + } + + public Matrix44 Transpose + { + get + { + Matrix44 transpose = new(); + InternalTranspose(ref transpose); + return transpose; + } + } + + public static Matrix44 Unit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + public static Matrix44 WNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1); + + public static Matrix44 XNegativeUnit => new Matrix44(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + public static Matrix44 YNegativeUnit => new Matrix44(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + public static Matrix44 ZNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1); + + public ReadOnlySpan AsSpan() + { + return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref mat), 16); + } + + public override bool Equals(object? obj) + { + return obj is Matrix44 x && Equals(x); + } + + public bool Equals(Matrix44 other) + { + return mat.Equals(other.mat); + } + + public override int GetHashCode() + { + return HashCode.Combine(mat.colum0.GetHashCode(), mat.colum1.GetHashCode(), mat.colum2.GetHashCode(), + mat.colum3.GetHashCode()); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose(ref Matrix44 transpose) + { + const int f32 = 0; + fixed (MatrixKernel* source = &this.kernel, target = &transpose.kernel) { + NativeIntrinsic.Context.mat[f32].buffer_transpose(source, target); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator -(Matrix44 left, Matrix44 right) + { + Matrix44 ret = new(); + const int f32 = 0; + NativeIntrinsic.Context.mat[f32].buffer_sub(&left, &right, &ret, 1); + return ret; } - public Matrix44 Transpose - { - get - { - Matrix44 transpose = new(); - InternalTranspose(ref transpose); - return transpose; - } + public static bool operator !=(Matrix44 left, Matrix44 right) + { + return !(left == right); } - public static Matrix44 Unit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - public static Matrix44 WNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1); - - public static Matrix44 XNegativeUnit => new Matrix44(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - public static Matrix44 YNegativeUnit => new Matrix44(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - - public static Matrix44 ZNegativeUnit => new Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1); - - public ReadOnlySpan AsSpan() - { - return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As(ref mat), 16); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator *(Matrix44 mat, float value) + { + return new Matrix44(mat.mat.colum0 * value, mat.mat.colum1 * value, mat.mat.colum2 * value, + mat.mat.colum3 * value); } - public override bool Equals( - object? obj - ) - { - return obj is Matrix44 x && Equals(x); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix44 operator *(Matrix44 left, Matrix44 right) + { + Matrix44 ret = new(); + int f32 = (int)MatrixElementType.F32; + NativeIntrinsic.Context.mat[f32].kernel_fma(&left, &right, &ret); + return ret; } - public bool Equals( - Matrix44 other - ) - { - return mat.Equals(other.mat); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator +(Matrix44 left, Matrix44 right) + { + Matrix44 ret = new(); + const int f32 = 0; + NativeIntrinsic.Context.mat[f32].buffer_add(&left, &right, &ret, 1); + return ret; } - public override int GetHashCode() - { - return HashCode.Combine(mat.colum0.GetHashCode(), mat.colum1.GetHashCode(), - mat.colum2.GetHashCode(), mat.colum3.GetHashCode()); + public static bool operator ==(Matrix44 left, Matrix44 right) + { + return left.Equals(right); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe void InternalTranspose( - ref Matrix44 transpose - ) - { - const int f32 = 0; - fixed (MatrixKernel* source = &this.kernel, target = &transpose.kernel) { - NativeIntrinsic.Context.mat[f32].buffer_transpose(source, target); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix44 operator -( - Matrix44 left, - Matrix44 right - ) - { - Matrix44 ret = new(); - const int f32 = 0; - NativeIntrinsic.Context.mat[f32].buffer_sub(&left, &right, &ret, 1); - return ret; - } - - public static bool operator !=( - Matrix44 left, - Matrix44 right - ) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix44 operator *( - Matrix44 mat, - float value - ) - { - return new Matrix44(mat.mat.colum0 * value, mat.mat.colum1 * value, - mat.mat.colum2 * value, mat.mat.colum3 * value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix44 operator *( - Matrix44 left, - Matrix44 right - ) - { - Matrix44 ret = new(); - int f32 = (int)MatrixElementType.F32; - NativeIntrinsic.Context.mat[f32].kernel_fma(&left, &right, &ret); - return ret; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix44 operator +( - Matrix44 left, - Matrix44 right - ) - { - Matrix44 ret = new(); - const int f32 = 0; - NativeIntrinsic.Context.mat[f32].buffer_add(&left, &right, &ret, 1); - return ret; - } - - public static bool operator ==( - Matrix44 left, - Matrix44 right - ) - { - return left.Equals(right); - } - - [InlineArray(4)] - internal struct Column - { - - private Vec4 value; - - } - - } + [InlineArray(4)] + internal struct Column + { + + private Vec4 value; + + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Graphics/Vec2.cs b/StgSharp.Mathematics/Numeric/Graphics/Vec2.cs index f580aefa..f555e9ba 100644 --- a/StgSharp.Mathematics/Numeric/Graphics/Vec2.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vec2.cs @@ -1,162 +1,162 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vec2" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System.Net.Http.Headers; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphics +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vec2" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Numeric; +using System.Net.Http.Headers; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics { - /// - /// A two dimension vector defined by two elements. Vec2 in World are default used as colum - /// vector. + /// + /// A two dimension vector defined by two elements. Vec2 in World are default used as colum + /// vector. /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] - public struct Vec2 : IUnmanagedVector - { - + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct Vec2 : IUnmanagedVector + { + [FieldOffset(0)] internal unsafe fixed float num[2]; - [FieldOffset(0)] + [FieldOffset(0)] internal M128 reg; - [FieldOffset(0)] + [FieldOffset(0)] internal Vector2 v; - [FieldOffset(0)] - public float X; - [FieldOffset(4)] - public float Y; - - internal Vec2(Vector2 vec) - { - Unsafe.SkipInit(out reg); - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - v = vec; + [FieldOffset(0)] + public float X; + [FieldOffset(4)] + public float Y; + + internal Vec2(Vector2 vec) + { + Unsafe.SkipInit(out reg); + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + v = vec; + } + + internal Vec2(M128 vec) + { + Unsafe.SkipInit(out reg); + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + reg = vec; + reg.Member(1) = 0; + } + + public Vec2(float x, float y) + { + v = new Vector2(x, y); + } + + public static Vec2 Unit => new Vec2(1, 1); + + public static Vec2 Zero => new Vec2(0, 0); + + public static Vec2 One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Vec2(1, 1); + } + + public Vec2 XY + { + readonly get => this; + set => this = value; + } + + public Vec3 XYZ + { + readonly get => new(reg); + set + { + reg = value.reg; + reg.Member(1) = 0; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Cross(Vec2 right) + { + return X * right.Y - Y * right.X; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Dot(Vec2 vec) + { + return Vector2.Dot(v, vec.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec2 operator -(Vec2 left, Vec2 right) + { + return new Vec2(left.v - right.v); } - internal Vec2(M128 vec) - { - Unsafe.SkipInit(out reg); - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - reg = vec; - reg.Member(1) = 0; + public static bool operator !=(Vec2 left, Vec2 right) + { + return !(left == right); } - public Vec2(float x, float y) - { - v = new Vector2(x, y); + public static Vec2 operator *(Vec2 vec, float value) + { + return new Vec2(vec.v * value); + } + public static Vec2 operator *(float value, Vec2 vec) + { + return new Vec2(vec.v * value); } - public static Vec2 Unit => new Vec2(1, 1); - - public static Vec2 Zero => new Vec2(0, 0); - - public static Vec2 One - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Vec2(1, 1); + public static Vec2 operator /(Vec2 vec, float value) + { + return new Vec2(vec.v / value); } - public Vec2 XY - { - readonly get => this; - set => this = value; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec2 operator +(Vec2 left, Vec2 right) + { + return new Vec2(left.v + right.v); } - public Vec3 XYZ - { - readonly get => new(reg); - set - { - reg = value.reg; - reg.Member(1) = 0; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vec2 left, Vec2 right) + { + return left.v == right.v; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float Cross(Vec2 right) - { - return X * right.Y - Y * right.X; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float Dot(Vec2 vec) - { - return Vector2.Dot(v, vec.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2 operator -(Vec2 left, Vec2 right) - { - return new Vec2(left.v - right.v); - } - - public static bool operator !=(Vec2 left, Vec2 right) - { - return !(left == right); - } - - public static Vec2 operator *(Vec2 vec, float value) - { - return new Vec2(vec.v * value); - } - public static Vec2 operator *(float value, Vec2 vec) - { - return new Vec2(vec.v * value); - } - - public static Vec2 operator /(Vec2 vec, float value) - { - return new Vec2(vec.v / value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2 operator +(Vec2 left, Vec2 right) - { - return new Vec2(left.v + right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Vec2 left, Vec2 right) - { - return left.v == right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator Vec2((float, float) tuple) - { - return new Vec2(tuple.Item1, tuple.Item2); - } - - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator Vec2((float, float) tuple) + { + return new Vec2(tuple.Item1, tuple.Item2); + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Graphics/Vec3.cs b/StgSharp.Mathematics/Numeric/Graphics/Vec3.cs index 611ba524..b2eebc3c 100644 --- a/StgSharp.Mathematics/Numeric/Graphics/Vec3.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vec3.cs @@ -1,288 +1,236 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vec3" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphics -{ - [CollectionBuilder(typeof(Vec3), nameof(FromSpan))] - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] - public struct Vec3 : IEquatable, IUnmanagedVector, IEnumerable - { - - [FieldOffset(0)] internal unsafe fixed float num[3]; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vec3" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Numeric; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + [CollectionBuilder(typeof(Vec3), nameof(FromSpan))] + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct Vec3 : IEquatable, IUnmanagedVector, IEnumerable + { + + [FieldOffset(0)] internal unsafe fixed float num[3]; [FieldOffset(0)] internal M128 reg; [FieldOffset(0)] internal Vector3 v; - [FieldOffset(0)] public float X; - [FieldOffset(4)] public float Y; - [FieldOffset(8)] public float Z; - - internal Vec3( - M128 vector - ) - { - Unsafe.SkipInit(out this); - reg = vector; - reg.Member(3) = 0; + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + internal Vec3(M128 vector) + { + Unsafe.SkipInit(out this); + reg = vector; + reg.Member(3) = 0; + } + + internal Vec3(Vector3 vector) + { + v = vector; + } + + public Vec3() + { + Unsafe.SkipInit(out this); + } + + public Vec3(Vec2 xy, float z) + { + Unsafe.SkipInit(out this); + reg = xy.reg; + Z = z; + } + + public Vec3(float x, float y, float z) + { + Unsafe.SkipInit(out this); + v = new Vector3(x, y, z); + } + + public unsafe Vec2 XY + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => new(reg); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref v) = value.v; + } + + public Vec3 XYZ + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => new(v); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => this = value; + } + + public static Vec3 Zero => new(0, 0, 0); + + public static Vec3 One => new(1, 1, 1); + + public static Vec3 UnitX => new(1, 0, 0); + + public static Vec3 UnitY => new(0, 1, 0); + + public static Vec3 UnitZ => new(0, 0, 1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 Cross(Vec3 left, Vec3 right) + { + return Linear.Cross(left, right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly float Dot(Vec3 right) + { + return Vector3.Dot(v, right.v); + } + + public readonly bool Equals(Vec3 other) + { + return reg == other.reg; + } + + public override readonly bool Equals(object obj) + { + return obj is not null && obj is Vec3 vec && this == vec; + } + + public static Vec3 FromSpan(ReadOnlySpan span) + { + Vec3 v = new(); + span.CopyTo(MemoryMarshal.CreateSpan(ref v.X, 3)); + return v; + } + + public unsafe IEnumerator GetEnumerator() + { + for (int i = 0; i < 3; i++) { + yield return reg.Member(i); + } + } + + public override unsafe int GetHashCode() + { + fixed (float* add = &X) { + return HashCode.Combine(X, Y, Z, (ulong)add); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly float GetMaxValue() + { + float ret = X; + ret = ret > Y ? ret : Y; + ret = ret > Z ? ret : Z; + return ret; + } + + public static bool IsParallel(Vec3 left, Vec3 right) + { + return Cross(left, right) == Zero; + } + + public override readonly string ToString() + { + return $"[{X},{Y},{Z}]"; + } + + public readonly string ToString(string sample) + { + return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator -(Vec3 vec) + { + return new Vec3(-vec.v); } - internal Vec3( - Vector3 vector - ) - { - v = vector; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator -(Vec3 left, Vec3 right) + { + return new Vec3(left.v - right.v); } - public Vec3() - { - Unsafe.SkipInit(out this); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Vec3 left, Vec3 right) + { + return left.v != right.v; } - public Vec3( - Vec2 xy, - float z - ) - { - Unsafe.SkipInit(out this); - reg = xy.reg; - Z = z; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator *(Vec3 vec, float value) + { + return new Vec3(vec.v * value); } - public Vec3( - float x, - float y, - float z - ) - { - Unsafe.SkipInit(out this); - v = new Vector3(x, y, z); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float operator *(Vec3 left, Vec3 right) + { + return Vector3.Dot(left.v, right.v); } - public unsafe Vec2 XY - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => new(reg); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref v) = value.v; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator /(Vec3 vec, float value) + { + return new Vec3(vec.v / value); } - public Vec3 XYZ - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => new(v); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => this = value; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec3 operator +(Vec3 left, Vec3 right) + { + return new Vec3(left.v + right.v); } - public static Vec3 Zero => new(0, 0, 0); - - public static Vec3 One => new(1, 1, 1); - - public static Vec3 UnitX => new(1, 0, 0); - - public static Vec3 UnitY => new(0, 1, 0); - - public static Vec3 UnitZ => new(0, 0, 1); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 Cross( - Vec3 left, - Vec3 right - ) - { - return Linear.Cross(left, right); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vec3 left, Vec3 right) + { + return left.v == right.v; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float Dot( - Vec3 right - ) - { - return Vector3.Dot(v, right.v); - } - - public readonly bool Equals( - Vec3 other - ) - { - return reg == other.reg; - } - - public override readonly bool Equals( - object obj - ) - { - return obj is not null && obj is Vec3 vec && this == vec; - } - - public static Vec3 FromSpan( - ReadOnlySpan span - ) - { - Vec3 v = new(); - span.CopyTo(MemoryMarshal.CreateSpan(ref v.X, 3)); - return v; - } - - public unsafe IEnumerator GetEnumerator() - { - for (int i = 0; i < 3; i++) { - yield return reg.Member(i); - } - } - - public override unsafe int GetHashCode() - { - fixed (float* add = &X) { - return HashCode.Combine(X, Y, Z, (ulong)add); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly float GetMaxValue() - { - float ret = X; - ret = ret > Y ? ret : Y; - ret = ret > Z ? ret : Z; - return ret; - } - - public static bool IsParallel( - Vec3 left, - Vec3 right - ) - { - return Cross(left, right) == Zero; - } - - public override readonly string ToString() - { - return $"[{X},{Y},{Z}]"; - } - - public readonly string ToString( - string sample - ) - { - return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator -( - Vec3 vec - ) - { - return new Vec3(-vec.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator -( - Vec3 left, - Vec3 right - ) - { - return new Vec3(left.v - right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=( - Vec3 left, - Vec3 right - ) - { - return left.v != right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator *( - Vec3 vec, - float value - ) - { - return new Vec3(vec.v * value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float operator *( - Vec3 left, - Vec3 right - ) - { - return Vector3.Dot(left.v, right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator /( - Vec3 vec, - float value - ) - { - return new Vec3(vec.v / value); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec3 operator +( - Vec3 left, - Vec3 right - ) - { - return new Vec3(left.v + right.v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==( - Vec3 left, - Vec3 right - ) - { - return left.v == right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe implicit operator Vec3( - (float, float, float) tuple - ) - { - return Unsafe.As<(float,float,float), Vec3>(ref tuple); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe implicit operator Vec3((float, float, float) tuple) + { + return Unsafe.As<(float,float,float), Vec3>(ref tuple); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Graphics/Vec4.cs b/StgSharp.Mathematics/Numeric/Graphics/Vec4.cs index 2c6ba1c1..39a26515 100644 --- a/StgSharp.Mathematics/Numeric/Graphics/Vec4.cs +++ b/StgSharp.Mathematics/Numeric/Graphics/Vec4.cs @@ -1,251 +1,210 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Vec4" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Internal; -using StgSharp.Mathematics.Numeric; -using System; -using System.Data.Common; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Graphics -{ - [CollectionBuilder(builderType:typeof(Vec4), methodName: nameof(Vec4.FromSpan))] - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] - public unsafe struct Vec4 : IEquatable, IUnmanagedVector - { - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Vec4" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Intrinsic; +using StgSharp.Mathematics.Numeric; +using System; +using System.Data.Common; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Graphics +{ + [CollectionBuilder(builderType:typeof(Vec4), methodName: nameof(Vec4.FromSpan))] + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public unsafe struct Vec4 : IEquatable, IUnmanagedVector + { + [FieldOffset(0)] internal unsafe fixed float num[4]; [FieldOffset(0)] internal M128 reg; - [FieldOffset(0)] internal Vector4 vec; + [FieldOffset(0)] internal Vector4 vec; [FieldOffset(12)] public float W; - [FieldOffset(0)] public float X; - [FieldOffset(4)] public float Y; - [FieldOffset(8)] public float Z; - - internal Vec4( - Vector4 v - ) - { - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - Unsafe.SkipInit(out Z); - Unsafe.SkipInit(out W); + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + internal Vec4(Vector4 v) + { + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + Unsafe.SkipInit(out Z); + Unsafe.SkipInit(out W); Unsafe.SkipInit(out reg); - vec = v; - } - - internal Vec4( - M128 v - ) - { - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - Unsafe.SkipInit(out Z); - Unsafe.SkipInit(out W); + vec = v; + } + + internal Vec4(M128 v) + { + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + Unsafe.SkipInit(out Z); + Unsafe.SkipInit(out W); Unsafe.SkipInit(out vec); - reg = v; - } - - public Vec4( - Vec3 v3, - float w - ) - { - Unsafe.SkipInit(out X); - Unsafe.SkipInit(out Y); - Unsafe.SkipInit(out Z); - Unsafe.SkipInit(out W); - reg = v3.reg; - W = w; - } - - public Vec4( - float x, - float y, - float z, - float w - ) - { - vec = new Vector4(x, y, z, w); - } - - public unsafe Vec2 XY - { - get => new Vec2(reg); - set - { - X = value.X; - Y = value.Y; - } - } - - public unsafe Vec3 XYZ - { - get => new Vec3(reg); - set - { - float w = W; - reg = value.reg; - W = w; - } - } - - public static Vec4 One - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Vec4(1, 1, 1, 1); - } - - public static Vec4 Zero - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new Vec4(0, 0, 0, 0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 Add( - Vec4 left, - Vec4 right - ) - { - return left + right; - } - - public ReadOnlySpan AsSpan() - { - return MemoryMarshal.CreateReadOnlySpan(ref reg.Member(0), 4); - } - - public override bool Equals( - object obj - ) - { - return obj is Vec4 v && v == this; - } - - public static Vec4 FromSpan( - ReadOnlySpan span - ) - { - if (span.Length < 4) { - throw new ArgumentException("Span length must be at least 4.", nameof(span)); + reg = v; + } + + public Vec4(Vec3 v3, float w) + { + Unsafe.SkipInit(out X); + Unsafe.SkipInit(out Y); + Unsafe.SkipInit(out Z); + Unsafe.SkipInit(out W); + reg = v3.reg; + W = w; + } + + public Vec4(float x, float y, float z, float w) + { + vec = new Vector4(x, y, z, w); + } + + public unsafe Vec2 XY + { + get => new Vec2(reg); + set + { + X = value.X; + Y = value.Y; + } + } + + public unsafe Vec3 XYZ + { + get => new Vec3(reg); + set + { + float w = W; + reg = value.reg; + W = w; + } + } + + public static Vec4 One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Vec4(1, 1, 1, 1); + } + + public static Vec4 Zero + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new Vec4(0, 0, 0, 0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 Add(Vec4 left, Vec4 right) + { + return left + right; + } + + public ReadOnlySpan AsSpan() + { + return MemoryMarshal.CreateReadOnlySpan(ref reg.Member(0), 4); + } + + public override bool Equals(object obj) + { + return obj is Vec4 v && v == this; + } + + public static Vec4 FromSpan(ReadOnlySpan span) + { + if (span.Length < 4) { + throw new ArgumentException("Span length must be at least 4.", nameof(span)); } // Read 4 floats as a Vector4 in one operation without per-element copy. - Vector4 v = MemoryMarshal.Read(MemoryMarshal.AsBytes(span)); - return new Vec4(v); + Vector4 v = MemoryMarshal.Read(MemoryMarshal.AsBytes(span)); + return new Vec4(v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ReadOnlySpan.Enumerator GetEnumerator() + { + return AsSpan().GetEnumerator(); + } + + public override int GetHashCode() + { + return vec.GetHashCode(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 Subtract(Vec4 left, Vec4 right) + { + return left - right; + } + + public override string ToString() + { + return vec.ToString(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 operator -(Vec4 left, Vec4 right) + { + return new Vec4(left.vec - right.vec); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ReadOnlySpan.Enumerator GetEnumerator() - { - return AsSpan().GetEnumerator(); + public static bool operator !=(Vec4 left, Vec4 right) + { + return !(left == right); } - public override int GetHashCode() - { - return vec.GetHashCode(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 operator *(Matrix44 mat, Vec4 vec) + { + Matrix44 transpose = mat.Transpose; + return new Vec4(Vector4.Dot(transpose.mat.colum0, vec.vec), Vector4.Dot(transpose.mat.colum1, vec.vec), + Vector4.Dot(transpose.mat.colum2, vec.vec), Vector4.Dot(transpose.mat.colum3, vec.vec)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 Subtract( - Vec4 left, - Vec4 right - ) - { - return left - right; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec4 operator +(Vec4 left, Vec4 right) + { + return new Vec4(left.vec + right.vec); } - public override string ToString() - { - return vec.ToString(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator -( - Vec4 left, - Vec4 right - ) - { - return new Vec4(left.vec - right.vec); - } - - public static bool operator !=( - Vec4 left, - Vec4 right - ) - { - return !(left == right); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator *( - Matrix44 mat, - Vec4 vec - ) - { - Matrix44 transpose = mat.Transpose; - return new Vec4(Vector4.Dot(transpose.mat.colum0, vec.vec), - Vector4.Dot(transpose.mat.colum1, vec.vec), - Vector4.Dot(transpose.mat.colum2, vec.vec), - Vector4.Dot(transpose.mat.colum3, vec.vec)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec4 operator +( - Vec4 left, - Vec4 right - ) - { - return new Vec4(left.vec + right.vec); - } - - public static bool operator ==( - Vec4 left, - Vec4 right - ) - { - return left.vec == right.vec; - } - - bool IEquatable.Equals( - Vec4 other - ) - { - return vec == other.vec; - } - - } + public static bool operator ==(Vec4 left, Vec4 right) + { + return left.vec == right.vec; + } + + bool IEquatable.Equals(Vec4 other) + { + return vec == other.vec; + } + + } } \ No newline at end of file diff --git a/StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs b/StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs index 6b7cdd65..2fc891f8 100644 --- a/StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs +++ b/StgSharp.Mathematics/Numeric/Linear/Matrix.Create.cs @@ -1,101 +1,101 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Matrix.Create" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public unsafe partial class Matrix - { - - private const int KernelSideLength = 4; - - public static Matrix Create( - int columnLength, - int rowLength, - MatrixLayout layout, - HybridLayerSegregatedFitAllocator allocator) - { +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Matrix.Create" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Memory; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public unsafe partial class Matrix + { + + private const int KernelSideLength = 4; + + public static Matrix Create( + int columnLength, + int rowLength, + MatrixLayout layout, + HybridLayerSegregatedFitAllocator allocator) + { ArgumentNullException.ThrowIfNull(allocator); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(columnLength); ArgumentOutOfRangeException.ThrowIfNegativeOrZero(rowLength); - int kernelColumns = DivideRoundUp(columnLength, KernelSideLength); + int kernelColumns = DivideRoundUp(columnLength, KernelSideLength); int kernelRows = DivideRoundUp(rowLength, KernelSideLength); - if (layout is MatrixLayout.UpperTriangle or MatrixLayout.LowerTriangle) - { - if (kernelColumns != kernelRows) { - throw new ArgumentException("Triangular layouts require square matrices."); - } + if (layout is MatrixLayout.UpperTriangle or MatrixLayout.LowerTriangle) + { + if (kernelColumns != kernelRows) { + throw new ArgumentException("Triangular layouts require square matrices."); + } } - long kernelCount = layout switch - { - MatrixLayout.DenseRectangle => (long)kernelColumns * kernelRows, - MatrixLayout.UpperTriangle => TriangularKernelCount(kernelColumns), - MatrixLayout.LowerTriangle => TriangularKernelCount(kernelRows), - _ => throw new ArgumentOutOfRangeException(nameof(layout)) + long kernelCount = layout switch + { + MatrixLayout.DenseRectangle => (long)kernelColumns * kernelRows, + MatrixLayout.UpperTriangle => TriangularKernelCount(kernelColumns), + MatrixLayout.LowerTriangle => TriangularKernelCount(kernelRows), + _ => throw new ArgumentOutOfRangeException(nameof(layout)) }; - long requiredBytes = kernelCount * MatrixKernel.Size; + long requiredBytes = kernelCount * MatrixKernel.Size; ArgumentOutOfRangeException.ThrowIfNegativeOrZero(requiredBytes, nameof(requiredBytes)); - HybridLayerSegregatedFitAllocationHandle handle = allocator.Alloc((uint)requiredBytes); + HybridLayerSegregatedFitAllocationHandle handle = allocator.Alloc((uint)requiredBytes); MatrixStorageHLSF storage = new MatrixStorageHLSF(allocator, handle); - Matrix matrix = new Matrix(MatrixKernelBoarder.Create(layout), new MatrixSize(columnLength, rowLength, - kernelColumns, + Matrix matrix = new Matrix(MatrixKernelBoarder.Create(layout), new MatrixSize(columnLength, rowLength, + kernelColumns, kernelRows), storage); - return matrix; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int DivideRoundUp(int value, int divisor) - { - return (value + (divisor - 1)) / divisor; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static long TriangularKernelCount(int order) - { - long n = order; - return (n * (n + 1L)) / 2L; - } - - } + return matrix; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static int DivideRoundUp(int value, int divisor) + { + return (value + (divisor - 1)) / divisor; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static long TriangularKernelCount(int order) + { + long n = order; + return (n * (n + 1L)) / 2L; + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Linear/Matrix.cs b/StgSharp.Mathematics/Numeric/Linear/Matrix.cs index 0271b9b8..d1f15040 100644 --- a/StgSharp.Mathematics/Numeric/Linear/Matrix.cs +++ b/StgSharp.Mathematics/Numeric/Linear/Matrix.cs @@ -1,204 +1,183 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="Matrix" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Numeric; -using System; -using System.Numerics; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="Matrix" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Numeric; +using System; +using System.Numerics; using System.Runtime.CompilerServices; // using hlsfHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; -namespace StgSharp.Mathematics.Numeric -{ - public unsafe partial class Matrix where T : unmanaged, INumber - { - +namespace StgSharp.Mathematics.Numeric +{ + public unsafe partial class Matrix where T: unmanaged, INumber + { + private protected static readonly int t_count = 16 / sizeof(T); - private protected static readonly int t_size = sizeof(T); - private readonly MatrixKernelBoarder _boarder; - private readonly MatrixSize _size; - private readonly MatrixStorage _buffer; - - private protected Matrix( - MatrixKernelBoarder boarder, - MatrixSize size, + private protected static readonly int t_size = sizeof(T); + private readonly MatrixKernelBoarder _boarder; + private readonly MatrixSize _size; + private readonly MatrixStorage _buffer; + + private protected Matrix( + MatrixKernelBoarder boarder, + MatrixSize size, MatrixStorage buffer - ) - { - _boarder = boarder; - _size = size; - _buffer = buffer; + ) + { + _boarder = boarder; + _size = size; + _buffer = buffer; + } + + public T this[int x, int y] + { + get + { + if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { + throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); + } + long offset = GetElementOffset(x, y); + if (offset < 0) { + return T.Zero; + } + return ((T*)Buffer)[offset]; + } + set + { + if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { + throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); + } + long offset = GetElementOffset(x, y); + if (offset < 0) { + return; + } + ((T*)Buffer)[offset] = value; + } } - public T this[ - int x, - int y - ] - { - get - { - if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { - throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); - } - long offset = GetElementOffset(x, y); - if (offset < 0) { - return T.Zero; - } - return ((T*)Buffer)[offset]; - } - set - { - if (y < 0 || y > _size.ElementColumnLength || x < 0 || x > _size.ElementRowLength) { - throw new ArgumentOutOfRangeException($"Index [{x},{y}] is out of matrix index range."); - } - long offset = GetElementOffset(x, y); - if (offset < 0) { - return; - } - ((T*)Buffer)[offset] = value; - } - } - - /// - /// Matlab style indexer to generate a new matrix + /// + /// Matlab style indexer to generate a new matrix /// - /// - /// + /// + /// /// - /// - /// + /// + /// /// - /// - /// + /// + /// /// - /// - /// + /// + /// /// - public unsafe Matrix this[ - ReadOnlySpan column, - ReadOnlySpan row - ] - { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } + public unsafe Matrix this[ReadOnlySpan column, ReadOnlySpan row] + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } } - /// - /// Length of the matrix in columns. + /// + /// Length of the matrix in columns. /// public int ColumnLength => _size.ElementColumnLength; - /// - /// Length of the matrix in rows. + /// + /// Length of the matrix in rows. /// - public int RowLength => _size.ElementRowLength; - - public MatrixLayout Layout { get; init; } - - internal MatrixKernel* Buffer - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => (MatrixKernel*)_buffer.BufferPointer; - } - - protected internal int KernelColumnLength => _size.KernelColumnLength; - - protected internal int KernelRowLength => _size.KernelRowLength; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe ref MatrixKernel GetMatrixKernel( - int x, - int y - ) - { - return ref _boarder.IsInBuffer(x, y, in _size) ? - ref _buffer[_boarder.GetIndexOffset(x, y, in _size)] : - ref Unsafe.NullRef>(); - } - - internal long GetElementOffset( - int x, - int y - ) - { + public int RowLength => _size.ElementRowLength; + + public MatrixLayout Layout { get; init; } + + internal MatrixKernel* Buffer + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (MatrixKernel*)_buffer.BufferPointer; + } + + protected internal int KernelColumnLength => _size.KernelColumnLength; + + protected internal int KernelRowLength => _size.KernelRowLength; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe ref MatrixKernel GetMatrixKernel(int x, int y) + { + return ref _boarder.IsInBuffer(x, y, in _size) ? + ref _buffer[_boarder.GetIndexOffset(x, y, in _size)] : + ref Unsafe.NullRef>(); + } + + internal long GetElementOffset(int x, int y) + { int k_c = y / 4, c = y % 4, k_r = x / 4, - r = x % 4; - if (!_boarder.IsInBuffer(k_r, k_c, in _size)) { - return -1; - } + r = x % 4; + if (!_boarder.IsInBuffer(k_r, k_c, in _size)) { + return -1; + } long kernelOffset = _boarder.GetIndexOffset(k_r, k_c, in _size); - return kernelOffset * 16 + 4 * r + c; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe ref T GetElementUnsafe( - int x, - int y - ) - { - // Caller guarantees: indices in range, layout is dense square. - int k_c = y / 4; - int k_r = x / 4; - int c = y % 4; + return kernelOffset * 16 + 4 * r + c; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe ref T GetElementUnsafe(int x, int y) + { + // Caller guarantees: indices in range, layout is dense square. + int k_c = y / 4; + int k_r = x / 4; + int c = y % 4; int r = x % 4; - ref MatrixKernel kernel = ref _buffer[_boarder.GetIndexOffset(k_r, k_c, in _size)]; - return ref kernel[c, r]; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe MatrixKernel* GetKernelAddressUnsafe( - int x, - int y - ) - { - return Buffer + _boarder.GetIndexOffset(x, y, in _size); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe ref MatrixKernel GetKernelUnsafe( - int x, - int y - ) - { - // Caller guarantees: indices in range, layout is dense square. - int k_c = y / 4; - int k_r = x / 4; - int c = y % 4; - int r = x % 4; - return ref _buffer[_boarder.GetIndexOffset(k_c, k_r, in _size)]; - } - - } + ref MatrixKernel kernel = ref _buffer[_boarder.GetIndexOffset(k_r, k_c, in _size)]; + return ref kernel[c, r]; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe MatrixKernel* GetKernelAddressUnsafe(int x, int y) + { + return Buffer + _boarder.GetIndexOffset(x, y, in _size); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe ref MatrixKernel GetKernelUnsafe(int x, int y) + { + // Caller guarantees: indices in range, layout is dense square. + int k_c = y / 4; + int k_r = x / 4; + int c = y % 4; + int r = x % 4; + return ref _buffer[_boarder.GetIndexOffset(k_c, k_r, in _size)]; + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs b/StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs index 6df883fd..9fa5e1b3 100644 --- a/StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs +++ b/StgSharp.Mathematics/Numeric/Linear/MatrixStorage.cs @@ -1,72 +1,72 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixStorage" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixStorage" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Memory; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; using System.Threading.Tasks; -using HLSFAllocator = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; -using HLSFHandle = global::StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocationHandle; - -namespace StgSharp.Mathematics.Numeric -{ - public abstract class MatrixStorage : IDisposable where T : unmanaged, INumber - { - - internal unsafe ref MatrixKernel this[long index] - { - get { return ref Unsafe.AsRef>(BufferPointer + MatrixKernel.Size * index); } - } - - protected internal abstract unsafe T* BufferPointer { get; } - - public abstract void Dispose(); - - } - - internal class MatrixStorageHLSF(HLSFAllocator allocator, HLSFHandle handle) : MatrixStorage - where T : unmanaged, INumber - { - - internal HLSFAllocator _allocator = allocator; - internal HLSFHandle _handle = handle; - - protected internal override unsafe T* BufferPointer => (T*)_handle.Pointer; - - public override void Dispose() - { - allocator.Free(_handle); - } - - } +using HLSFAllocator = global::StgSharp.Mathematics.Memory.HybridLayerSegregatedFitAllocator; +using HLSFHandle = global::StgSharp.Mathematics.Memory.HybridLayerSegregatedFitAllocationHandle; + +namespace StgSharp.Mathematics.Numeric +{ + public abstract class MatrixStorage : IDisposable where T: unmanaged, INumber + { + + internal unsafe ref MatrixKernel this[long index] + { + get { return ref Unsafe.AsRef>(BufferPointer + MatrixKernel.Size * index); } + } + + protected internal abstract unsafe T* BufferPointer { get; } + + public abstract void Dispose(); + + } + + internal class MatrixStorageHLSF(HLSFAllocator allocator, HLSFHandle handle) : MatrixStorage + where T: unmanaged, INumber + { + + internal HLSFAllocator _allocator = allocator; + internal HLSFHandle _handle = handle; + + protected internal override unsafe T* BufferPointer => (T*)_handle.Pointer; + + public override void Dispose() + { + allocator.Free(_handle); + } + + } } diff --git a/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs b/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs index 483b9b59..95bc69dd 100644 --- a/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs +++ b/StgSharp.Mathematics/Numeric/MatrixCompute.Float.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="MatrixCompute.Float" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -26,8 +26,8 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Collections; -using StgSharp.HighPerformance; using StgSharp.Internal; +using StgSharp.Mathematics; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; @@ -42,11 +42,7 @@ namespace StgSharp.Mathematics.Numeric public static partial class MatrixCompute { - public static unsafe void Add( - Matrix left, - Matrix right, - Matrix ans - ) + public static unsafe void Add(Matrix left, Matrix right, Matrix ans) { int f32 = (int)MatrixElementType.F32; if (left.ColumnLength != right.ColumnLength || @@ -92,10 +88,7 @@ namespace StgSharp.Mathematics.Numeric return; } - public static unsafe void Fill( - Matrix ans, - float value - ) + public static unsafe void Fill(Matrix ans, float value) { int f32 = (int)MatrixElementType.F32; long count = (long)ans.KernelColumnLength * ans.KernelRowLength; @@ -126,11 +119,7 @@ namespace StgSharp.Mathematics.Numeric taskGroup.Dispose(); } - public static unsafe void Mul( - Matrix left, - Matrix right, - Matrix ans - ) + public static unsafe void Mul(Matrix left, Matrix right, Matrix ans) { int f32 = (int)MatrixElementType.F32; @@ -168,8 +157,7 @@ namespace StgSharp.Mathematics.Numeric NativeIntrinsic.Context .mat[f32].kernel_tile_fma((MatrixKernel*)left.Buffer, (MatrixKernel*)right.Buffer, - (MatrixKernel*)ans.Buffer, - enumeration); + (MatrixKernel*)ans.Buffer, enumeration); } } @@ -196,18 +184,13 @@ namespace StgSharp.Mathematics.Numeric return; } - public static unsafe void Mul( - Matrix left, - float right, - Matrix ans - ) + public static unsafe void Mul(Matrix left, float right, Matrix ans) { int f32 = (int)MatrixElementType.F32; if (left.ColumnLength != ans.ColumnLength || left.RowLength != ans.RowLength) { throw new IndexOutOfRangeException("Matrix dimensions must agree."); } - if (left.Layout != MatrixLayout.DenseRectangle || - ans.Layout != MatrixLayout.DenseRectangle) { + if (left.Layout != MatrixLayout.DenseRectangle || ans.Layout != MatrixLayout.DenseRectangle) { throw new NotSupportedException("Only dense rectangle matrices are supported."); } long count = (long)left.KernelColumnLength * left.KernelRowLength; @@ -248,11 +231,7 @@ namespace StgSharp.Mathematics.Numeric return; } - public static unsafe void Sub( - Matrix left, - Matrix right, - Matrix ans - ) + public static unsafe void Sub(Matrix left, Matrix right, Matrix ans) { int f32 = (int)MatrixElementType.F32; if (left.ColumnLength != right.ColumnLength || diff --git a/StgSharp.Mathematics/Numeric/MatrixCompute.cs b/StgSharp.Mathematics/Numeric/MatrixCompute.cs index 0a3ecdfa..00beab9c 100644 --- a/StgSharp.Mathematics/Numeric/MatrixCompute.cs +++ b/StgSharp.Mathematics/Numeric/MatrixCompute.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="MatrixCompute" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,8 +25,8 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance; using StgSharp.Internal; +using StgSharp.Mathematics; using System; using System.Collections.Generic; using System.Linq; @@ -45,8 +45,8 @@ namespace StgSharp.Mathematics.Numeric MatrixKernel* buffer, int colLength, int x, - int y - ) where T : unmanaged, INumber + int y) + where T: unmanaged, INumber { return (MatrixKernel*)(buffer + (colLength * x + y)); } diff --git a/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs b/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs index 3a6be6dc..3b2e6a56 100644 --- a/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs +++ b/StgSharp.Mathematics/Numeric/MatrixCompute.double.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="MatrixCompute.double" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,8 +25,8 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance; using StgSharp.Internal; +using StgSharp.Mathematics; using System; using System.Collections.Generic; using System.Linq; @@ -38,11 +38,7 @@ namespace StgSharp.Mathematics.Numeric public partial class MatrixCompute { - public static unsafe void Add( - Matrix left, - Matrix right, - Matrix ans - ) + public static unsafe void Add(Matrix left, Matrix right, Matrix ans) { int f64 = (int)MatrixElementType.F64; if (left.ColumnLength != right.ColumnLength || @@ -88,10 +84,7 @@ namespace StgSharp.Mathematics.Numeric return; } - public static unsafe void Fill( - Matrix ans, - double value - ) + public static unsafe void Fill(Matrix ans, double value) { int f64 = (int)MatrixElementType.F64; long count = (long)ans.KernelColumnLength * ans.KernelRowLength; @@ -122,11 +115,7 @@ namespace StgSharp.Mathematics.Numeric taskGroup.Dispose(); } - public static unsafe void Mul( - Matrix left, - Matrix right, - Matrix ans - ) + public static unsafe void Mul(Matrix left, Matrix right, Matrix ans) { int f64 = (int)MatrixElementType.F64; @@ -158,8 +147,7 @@ namespace StgSharp.Mathematics.Numeric NativeIntrinsic.Context .mat[f64].kernel_tile_fma((MatrixKernel*)left.Buffer, (MatrixKernel*)right.Buffer, - (MatrixKernel*)ans.Buffer, - enumeration); + (MatrixKernel*)ans.Buffer, enumeration); } } if (count > 256) { @@ -185,18 +173,13 @@ namespace StgSharp.Mathematics.Numeric return; } - public static unsafe void Mul( - Matrix left, - double right, - Matrix ans - ) + public static unsafe void Mul(Matrix left, double right, Matrix ans) { int f64 = (int)MatrixElementType.F64; if (left.ColumnLength != ans.ColumnLength || left.RowLength != ans.RowLength) { throw new IndexOutOfRangeException("Matrix dimensions must agree."); } - if (left.Layout != MatrixLayout.DenseRectangle || - ans.Layout != MatrixLayout.DenseRectangle) { + if (left.Layout != MatrixLayout.DenseRectangle || ans.Layout != MatrixLayout.DenseRectangle) { throw new NotSupportedException("Only dense rectangle matrices are supported."); } long count = (long)left.KernelColumnLength * left.KernelRowLength; @@ -237,11 +220,7 @@ namespace StgSharp.Mathematics.Numeric return; } - public static unsafe void Sub( - Matrix left, - Matrix right, - Matrix ans - ) + public static unsafe void Sub(Matrix left, Matrix right, Matrix ans) { int f64 = (int)MatrixElementType.F64; if (left.ColumnLength != right.ColumnLength || diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs index d7fbb556..383274ad 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.Publish.cs @@ -1,80 +1,76 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallel.Publish" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Collections; -using StgSharp.HighPerformance; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallel.Publish" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Collections; +using StgSharp.Mathematics; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public static partial class MatrixParallel - { - - private const int MIN_TASK_PER_THREAD = 256; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public static partial class MatrixParallel + { + + private const int MIN_TASK_PER_THREAD = 256; private const int REC_TASK_PER_THREAD = 1024; [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe MatrixParallelWrap ScheduleTask( - MatrixParallelTask* package - ) - { - switch (package->ComputeMode.OperationStyle) - { - case MatrixIndexStyle.BUFFER_INDEX: - return ScheduleBufferTask(package); - default: - throw new InvalidOperationException($"Unknown mode {package->ComputeMode.OperationStyle}."); - } - } - - private static unsafe MatrixParallelWrap ScheduleBufferTask( - MatrixParallelTask* package - ) - { - int primCount = package->PrimCount; - int secCount = package->SecCount; + internal static unsafe MatrixParallelWrap ScheduleTask(MatrixParallelTask* package) + { + switch (package->ComputeMode.OperationStyle) + { + case MatrixIndexStyle.BUFFER_INDEX: + return ScheduleBufferTask(package); + default: + throw new InvalidOperationException($"Unknown mode {package->ComputeMode.OperationStyle}."); + } + } + + private static unsafe MatrixParallelWrap ScheduleBufferTask(MatrixParallelTask* package) + { + int primCount = package->PrimCount; + int secCount = package->SecCount; long count = (long)primCount * secCount; // Console.WriteLine($"amount of kernels is {count}"); - long recommendCount = count / 1024; - MatrixParallelThread[] pool = LeadParallel((int)recommendCount); - MatrixParallelWrap wrap = new MatrixParallelWrap(pool); - wrap.TaskQueue = MatrixParallelQueue.Rent(package); - return wrap; - } - - } + long recommendCount = count / 1024; + MatrixParallelThread[] pool = LeadParallel((int)recommendCount); + MatrixParallelWrap wrap = new MatrixParallelWrap(pool); + wrap.TaskQueue = MatrixParallelQueue.Rent(package); + return wrap; + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs index 742e3a4d..36844278 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallel.cs @@ -1,132 +1,124 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallel" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.Collections; -using StgSharp.HighPerformance.Memory; -using StgSharp.Internal; -using StgSharp.Mathematics.Internal; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public static partial class MatrixParallel - { - +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallel" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Collections; +using StgSharp.Internal; +using StgSharp.Mathematics.Intrinsic; +using StgSharp.Mathematics.Memory; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public static partial class MatrixParallel + { + private static bool _meaningful; private static CapacityFixedStack _threads; private static ConcurrentDictionary contextMap; - private static SlabAllocator contextAllocator; - - public static bool IsParallelSupported { get; } = Environment.ProcessorCount > 6; - - public static bool IsParallelMeaningful => Environment.ProcessorCount > 6 && IsInitialized; - - private static bool IsInitialized { get; set; } = false; - - internal static unsafe IntrinsicContext* GetContext( - SIMDID simd - ) - { - if (!IsParallelSupported) { - return null; - } - if (contextMap.TryGetValue(simd, out nint handle)) - { - return (IntrinsicContext*)handle; - } else - { + private static SlabAllocator contextAllocator; + + public static bool IsParallelSupported { get; } = Environment.ProcessorCount > 6; + + public static bool IsParallelMeaningful => Environment.ProcessorCount > 6 && IsInitialized; + + private static bool IsInitialized { get; set; } = false; + + internal static unsafe IntrinsicContext* GetContext(SIMDID simd) + { + if (!IsParallelSupported) { + return null; + } + if (contextMap.TryGetValue(simd, out nint handle)) + { + return (IntrinsicContext*)handle; + } else + { IntrinsicContext* context = (IntrinsicContext*)contextAllocator.Allocate(); - return context; - } - } - - internal static void Init() - { - if (IsInitialized) { - return; - } - if (!IsParallelSupported) - { - IsInitialized = true; - return; - } - MatrixParallelFactory.Init(); - contextAllocator = SlabAllocator.Create(4, SlabBufferLayout.Chunked, false); - contextMap = []; - int count = Environment.ProcessorCount; - _threads = new(count); - for (int i = 0; i < count; i++) - { - MatrixParallelThread thread = new MatrixParallelThread(i); - _threads.Push(thread); - SpinWait.SpinUntil(() => thread.State == MatrixThreadState.Ready); + return context; + } + } + + internal static void Init() + { + if (IsInitialized) { + return; + } + if (!IsParallelSupported) + { + IsInitialized = true; + return; + } + MatrixParallelFactory.Init(); + contextAllocator = SlabAllocator.Create(4, SlabBufferLayout.Chunked, false); + contextMap = []; + int count = Environment.ProcessorCount; + _threads = new(count); + for (int i = 0; i < count; i++) + { + MatrixParallelThread thread = new MatrixParallelThread(i); + _threads.Push(thread); + SpinWait.SpinUntil(() => thread.State == MatrixThreadState.Ready); } // TODO 构建全局的保底上下文 - foreach (MatrixParallelThread thread in _threads) { } - if (contextMap.Keys.Count == 1) - { - for (int i = 0; i < 4; i++) - { - MatrixParallelThread thread = _threads.Pop(); - thread.Dispose(); - } - } else - { - // TODO 排序并丢弃四个能力最弱线程 - } - _awaitingLeaderHandle = new AwaitingQueue(); - IsInitialized = true; - } - - [LibraryImport(Native.LibName, EntryPoint = "sn_compare_simd")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - private static unsafe partial ulong CompareSIMDID( - IntrinsicContext* context, - ulong id - ); - - [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - private static unsafe partial void LoadIntrinsicFunction( - IntrinsicContext* context, - ulong id - ); - - } + foreach (MatrixParallelThread thread in _threads) { } + if (contextMap.Keys.Count == 1) + { + for (int i = 0; i < 4; i++) + { + MatrixParallelThread thread = _threads.Pop(); + thread.Dispose(); + } + } else + { + // TODO 排序并丢弃四个能力最弱线程 + } + _awaitingLeaderHandle = new AwaitingQueue(); + IsInitialized = true; + } + + [LibraryImport(Native.LibName, EntryPoint = "sn_compare_simd")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + private static unsafe partial ulong CompareSIMDID(IntrinsicContext* context, ulong id); + + [LibraryImport(Native.LibName, EntryPoint = "load_intrinsic_function")] + [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + private static unsafe partial void LoadIntrinsicFunction(IntrinsicContext* context, ulong id); + + } } diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs index 60c25c86..4a32b2bb 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelTask.cs @@ -1,64 +1,60 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallelTask" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Mathematics.Internal; -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace StgSharp.Mathematics.Numeric -{ - [StructLayout(LayoutKind.Explicit)] - internal unsafe struct MatrixParallelTask - { - - [FieldOffset(0)]public MatrixKernel* Mat1; // 8 - [FieldOffset(8)] public MatrixKernel* Mat2; // 8 - [FieldOffset(16)] public MatrixKernel* Mat3; // 16 - [FieldOffset(32)] public int Common_i; - [FieldOffset(36)] public int Common_j; - [FieldOffset(40)] public int Common_k; - [FieldOffset(44)] public int i; - [FieldOffset(48)] public int j; - [FieldOffset(52)] public int k; - [FieldOffset(56)] public MatrixElementType ElementType; // 56 +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelTask" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Intrinsic; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Mathematics.Numeric +{ + [StructLayout(LayoutKind.Explicit)] + internal unsafe struct MatrixParallelTask + { + + [FieldOffset(0)]public MatrixKernel* Mat1; // 8 + [FieldOffset(8)] public MatrixKernel* Mat2; // 8 + [FieldOffset(16)] public MatrixKernel* Mat3; // 16 + [FieldOffset(32)] public int Common_i; + [FieldOffset(36)] public int Common_j; + [FieldOffset(40)] public int Common_k; + [FieldOffset(44)] public int i; + [FieldOffset(48)] public int j; + [FieldOffset(52)] public int k; + [FieldOffset(56)] public MatrixElementType ElementType; // 56 [FieldOffset(24)] public nint Span; // 24 - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Copy( - MatrixParallelTask* source, - MatrixParallelTask* target - ) - { - Buffer.MemoryCopy(source, target, sizeof(MatrixParallelTask), - sizeof(MatrixParallelTask)); - } - - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Copy(MatrixParallelTask* source, MatrixParallelTask* target) + { + Buffer.MemoryCopy(source, target, sizeof(MatrixParallelTask), sizeof(MatrixParallelTask)); + } + + } } \ No newline at end of file diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs index d0b22669..45c8b842 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Fma.cs @@ -1,105 +1,99 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallelThread.Fma" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.Internal; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Mathematics.Numeric -{ - public partial class MatrixParallelThread - { - - internal static unsafe void ComputeFmaPanelF32( - MatrixParallelTask* p - ) - { - int f32 = MatrixElementType.F32.IntrinsicNode; - MatrixKernel* leftBuffer = (MatrixKernel*)p->Left; - MatrixKernel* rightBuffer = (MatrixKernel*)p->Right; - MatrixKernel* ansBuffer = (MatrixKernel*)p->Answer; - ref long offsetRef = ref Unsafe.As(ref p->PrimTileOffset); - ref long lengthRef = ref Unsafe.As(ref p->PrimCount); - int ansWidth = p->AnsPrimOffset; - int ansHeight = p->AnsSecOffset; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelThread.Fma" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Internal; +using StgSharp.Mathematics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Mathematics.Numeric +{ + public partial class MatrixParallelThread + { + + internal static unsafe void ComputeFmaPanelF32(MatrixParallelTask* p) + { + int f32 = MatrixElementType.F32.IntrinsicNode; + MatrixKernel* leftBuffer = (MatrixKernel*)p->Left; + MatrixKernel* rightBuffer = (MatrixKernel*)p->Right; + MatrixKernel* ansBuffer = (MatrixKernel*)p->Answer; + ref long offsetRef = ref Unsafe.As(ref p->PrimTileOffset); + ref long lengthRef = ref Unsafe.As(ref p->PrimCount); + int ansWidth = p->AnsPrimOffset; + int ansHeight = p->AnsSecOffset; int commonK = p->LeftPrimOffset; - M128* enumeration = stackalloc M128[1]; - enumeration->Member(2) = commonK; + M128* enumeration = stackalloc M128[1]; + enumeration->Member(2) = commonK; enumeration->Member(3) = ansHeight; // in this occasion size must be 1 - for (long c = offsetRef; c < offsetRef + lengthRef; c++) - { - int i = (int)(c / ansHeight); - int j = (int)(c % ansHeight); - enumeration->Member(0) = i; - enumeration->Member(1) = j; - NativeIntrinsic.Context.mat[f32].kernel_tile_fma(leftBuffer, rightBuffer, ansBuffer, - enumeration); - } - } - - internal static unsafe void ComputeFmaPanelF64( - MatrixParallelTask* p - ) - { + for (long c = offsetRef; c < offsetRef + lengthRef; c++) + { + int i = (int)(c / ansHeight); + int j = (int)(c % ansHeight); + enumeration->Member(0) = i; + enumeration->Member(1) = j; + NativeIntrinsic.Context.mat[f32].kernel_tile_fma(leftBuffer, rightBuffer, ansBuffer, enumeration); + } + } + + internal static unsafe void ComputeFmaPanelF64(MatrixParallelTask* p) + { int f64 = MatrixElementType.F64.IntrinsicNode; // int size = 1; - MatrixKernel* leftBuffer = (MatrixKernel*)p->Left; - MatrixKernel* rightBuffer = (MatrixKernel*)p->Right; - MatrixKernel* ansBuffer = (MatrixKernel*)p->Answer; - ref long offsetRef = ref Unsafe.As(ref p->PrimTileOffset); - ref long lengthRef = ref Unsafe.As(ref p->PrimCount); - int ansWidth = p->AnsPrimOffset; - int ansHeight = p->AnsSecOffset; + MatrixKernel* leftBuffer = (MatrixKernel*)p->Left; + MatrixKernel* rightBuffer = (MatrixKernel*)p->Right; + MatrixKernel* ansBuffer = (MatrixKernel*)p->Answer; + ref long offsetRef = ref Unsafe.As(ref p->PrimTileOffset); + ref long lengthRef = ref Unsafe.As(ref p->PrimCount); + int ansWidth = p->AnsPrimOffset; + int ansHeight = p->AnsSecOffset; int commonK = p->LeftPrimOffset; - M128* enumeration = stackalloc M128[1]; - enumeration->Member(2) = commonK; + M128* enumeration = stackalloc M128[1]; + enumeration->Member(2) = commonK; enumeration->Member(3) = ansHeight; // in this occasion size must be 1 - for (long c = offsetRef; c < offsetRef + lengthRef; c++) - { - int i = (int)(c / ansHeight); - int j = (int)(c % ansHeight); - enumeration->Member(0) = i; - enumeration->Member(1) = j; - NativeIntrinsic.Context.mat[f64].kernel_tile_fma(leftBuffer, rightBuffer, ansBuffer, - enumeration); - } - } - - } + for (long c = offsetRef; c < offsetRef + lengthRef; c++) + { + int i = (int)(c / ansHeight); + int j = (int)(c % ansHeight); + enumeration->Member(0) = i; + enumeration->Member(1) = j; + NativeIntrinsic.Context.mat[f64].kernel_tile_fma(leftBuffer, rightBuffer, ansBuffer, enumeration); + } + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs index 492c4db6..e6a1592f 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.Model.cs @@ -1,75 +1,70 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixParallelThread.Model" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp.Mathematics.Numeric -{ - public partial class MatrixParallelThread - { - - private const int KernelStealCount = 64; - - internal unsafe void BufferCompute( - MatrixParallelTask* p - ) - { - // while () { } - int size = p->ElementSize * 16; - long count = Unsafe.As(ref p->PrimCount); - long offset = Unsafe.As(ref p->PrimTileOffset) * size; - ScalarPacket* scalar = p->Scalar; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixParallelThread.Model" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Mathematics.Numeric +{ + public partial class MatrixParallelThread + { + + private const int KernelStealCount = 64; + + internal unsafe void BufferCompute(MatrixParallelTask* p) + { + // while () { } + int size = p->ElementSize * 16; + long count = Unsafe.As(ref p->PrimCount); + long offset = Unsafe.As(ref p->PrimTileOffset) * size; + ScalarPacket* scalar = p->Scalar; IntPtr computeHandle = _context[p->ComputeHandle]; - ((delegate* unmanaged[Cdecl])computeHandle)((void*)(p->Left + offset), - (void*)(p->Right + offset), - (void*)(p->Answer + offset), - scalar, - count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe void SpecialBufferCompute( - MatrixParallelTask* p - ) - { - switch ((MatrixElementType)p->ElementSize) - { - case MatrixElementType.F64: - ComputeFmaPanelF64(p); - return; - case MatrixElementType.F32: - ComputeFmaPanelF32(p); - break; - default: - break; - } - } - - } + ((delegate* unmanaged[Cdecl])computeHandle)((void*)(p->Left + offset), + (void*)(p->Right + offset), + (void*)(p->Answer + offset), + scalar, count); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void SpecialBufferCompute(MatrixParallelTask* p) + { + switch ((MatrixElementType)p->ElementSize) + { + case MatrixElementType.F64: + ComputeFmaPanelF64(p); + return; + case MatrixElementType.F32: + ComputeFmaPanelF32(p); + break; + default: + break; + } + } + + } } diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs index 760a9389..79f16439 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixParallelThread.cs @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Internal; -using StgSharp.Mathematics.Internal; +using StgSharp.Mathematics.Intrinsic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs b/StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs index a218432c..dda54a69 100644 --- a/StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs +++ b/StgSharp.Mathematics/Numeric/Runtime/MatrixTaskFactory.cs @@ -1,48 +1,48 @@ -//----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// file="MatrixTaskFactory" -// Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="MatrixTaskFactory" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using StgSharp.Mathematics; +using StgSharp.Mathematics.Memory; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading; using System.Threading.Tasks; -using hlsfAllocator = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator; - -namespace StgSharp.Mathematics.Numeric -{ - internal static unsafe class MatrixParallelFactory - { - +using hlsfAllocator = StgSharp.Mathematics.Memory.HybridLayerSegregatedFitAllocator; + +namespace StgSharp.Mathematics.Numeric +{ + internal static unsafe class MatrixParallelFactory + { + private static hlsfAllocator _intermediateResult; private static @@ -57,63 +57,57 @@ namespace StgSharp.Mathematics.Numeric private static SlabAllocator _wrapAllocator; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static MatrixParallelTask* CreateBaseTask() - { - MatrixParallelTask* p = (MatrixParallelTask*)_wrapAllocator.Allocate(); - Span s = new Span((byte*)p, sizeof(MatrixParallelTask)); - s.Fill(0); - return p; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ScalarPacket* CreateScalarPacket() - { - ScalarPacket* p = (ScalarPacket*)_scalarAllocator.Allocate(); - return p; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe MatrixParallelTask* FromExistPackage( - MatrixParallelTask* exist - ) - { - MatrixParallelTask* ptr = (MatrixParallelTask*)_wrapAllocator.Allocate(); - MatrixParallelTask.Copy(exist, ptr); - return ptr; - } - + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MatrixParallelTask* CreateBaseTask() + { + MatrixParallelTask* p = (MatrixParallelTask*)_wrapAllocator.Allocate(); + Span s = new Span((byte*)p, sizeof(MatrixParallelTask)); + s.Fill(0); + return p; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ScalarPacket* CreateScalarPacket() + { + ScalarPacket* p = (ScalarPacket*)_scalarAllocator.Allocate(); + return p; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe MatrixParallelTask* FromExistPackage(MatrixParallelTask* exist) + { + MatrixParallelTask* ptr = (MatrixParallelTask*)_wrapAllocator.Allocate(); + MatrixParallelTask.Copy(exist, ptr); + return ptr; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Release( - ScalarPacket* source - ) - { - _scalarAllocator.Free((nuint)source); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Release( - MatrixParallelTask* source - ) - { - if (source->Scalar != null) { - _scalarAllocator.Free((nuint)source->Scalar); - } - _wrapAllocator.Free((nuint)source); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void Init() - { - if (_intermediateResult is null) - { - _intermediateResult = new hlsfAllocator(64 * 16 * 16); - _scalarAllocator = SlabAllocator.Create(64 * 1024, SlabBufferLayout.Chunked); + public static void Release(ScalarPacket* source) + { + _scalarAllocator.Free((nuint)source); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Release(MatrixParallelTask* source) + { + if (source->Scalar != null) { + _scalarAllocator.Free((nuint)source->Scalar); + } + _wrapAllocator.Free((nuint)source); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Init() + { + if (_intermediateResult is null) + { + _intermediateResult = new hlsfAllocator(64 * 16 * 16); + _scalarAllocator = SlabAllocator.Create(64 * 1024, SlabBufferLayout.Chunked); _wrapAllocator = SlabAllocator. - Create(128 * 1024, SlabBufferLayout.Chunked); - } - } - - } + Create(128 * 1024, SlabBufferLayout.Chunked); + } + } + + } } \ No newline at end of file diff --git a/StgSharp.Common/Data/RandomGenerator.cs b/StgSharp.Mathematics/Numeric/Scalar/RandomGenerator.cs similarity index 67% rename from StgSharp.Common/Data/RandomGenerator.cs rename to StgSharp.Mathematics/Numeric/Scalar/RandomGenerator.cs index c0b6e91f..3c4e4ded 100644 --- a/StgSharp.Common/Data/RandomGenerator.cs +++ b/StgSharp.Mathematics/Numeric/Scalar/RandomGenerator.cs @@ -1,31 +1,34 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="RandomGenerator" +// file="RandomGenerator.cs" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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. +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance; +using StgSharp.Mathematics.Internal; using System; using System.IO; @@ -33,7 +36,7 @@ using System.Runtime.CompilerServices; using System.Text; using System.Xml.Serialization; -namespace StgSharp.Data +namespace StgSharp.Mathematics.Numeric.Scalar { public unsafe class RandomGenerator { @@ -53,12 +56,7 @@ namespace StgSharp.Data string data = sw.ToString(); originKey = Encoding.Unicode.GetBytes(data); } - currentKey = [ - 0, - 0, - 0, - 0 - ]; + currentKey = [ 0, 0, 0, 0 ]; fixed (byte* o = originKey, c = currentKey) { *(int*)c = UnsafeCompute.CityHashSimplify((char*)o, 0, originKey.Length / 2); } diff --git a/StgSharp.Model/StgSharp.Model.csproj b/StgSharp.Model/StgSharp.Model.csproj index 1349cdc0..d72373c0 100644 --- a/StgSharp.Model/StgSharp.Model.csproj +++ b/StgSharp.Model/StgSharp.Model.csproj @@ -2,7 +2,6 @@ - diff --git a/StgSharpDebug/HlsfStressTest.cs b/StgSharpDebug/HlsfStressTest.cs index 103f44fd..aa297268 100644 --- a/StgSharpDebug/HlsfStressTest.cs +++ b/StgSharpDebug/HlsfStressTest.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="HlsfStressTest" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance.Memory; +using StgSharp.Mathematics.Memory; using System; using System.Collections.Generic; using System.Diagnostics; @@ -45,8 +45,36 @@ namespace StgSharp 3UL * 1024UL * 1024UL * 1024UL; // lower default to 512MB private static readonly uint[] SizeSweep = { - 64, 128, 192, 256, 512, 768, 1024, 2048, 3072, 4096, 8192, 12288, 16384, 32768, 49152, 65536, 131072, 196608, 262144, 524288, 786432, 1_048_576, 2_097_152, 3_145_728, 4_194_304, 8_388_608, 12_582_912, 16_777_216, 25_165_824, 33_554_432 - }; + 64, + 128, + 192, + 256, + 512, + 768, + 1024, + 2048, + 3072, + 4096, + 8192, + 12288, + 16384, + 32768, + 49152, + 65536, + 131072, + 196608, + 262144, + 524288, + 786432, + 1_048_576, + 2_097_152, + 3_145_728, + 4_194_304, + 8_388_608, + 12_582_912, + 16_777_216, + 25_165_824, + 33_554_432 }; public static unsafe void Run() { @@ -116,10 +144,7 @@ namespace StgSharp Console.WriteLine("=== Benchmark Complete ==="); } - private static void BenchAllocFreePairs( - HybridLayerSegregatedFitAllocator allocator, - int pairs, - uint blockSize) + private static void BenchAllocFreePairs(HybridLayerSegregatedFitAllocator allocator, int pairs, uint blockSize) { Stopwatch sw = Stopwatch.StartNew(); for (int i = 0; i < pairs; i++) @@ -176,9 +201,7 @@ namespace StgSharp Console.WriteLine($" size={Fmt(blockSize),-12} ops={ops,-12} alloc/s={allocOpsPerSec,-16:0.0} touch={touch,-5}"); } - private static void BenchFragmentationCycle( - HybridLayerSegregatedFitAllocator allocator, - int targetMiB) + private static void BenchFragmentationCycle(HybridLayerSegregatedFitAllocator allocator, int targetMiB) { int targetBytes = targetMiB * 1024 * 1024; Random rng = new Random(123); @@ -229,10 +252,7 @@ namespace StgSharp Console.WriteLine($" cleanup freed {live.Count} in {swD.Elapsed.TotalSeconds:0.00}s"); } - private static void BenchFreeThroughput( - HybridLayerSegregatedFitAllocator allocator, - int count, - uint blockSize) + private static void BenchFreeThroughput(HybridLayerSegregatedFitAllocator allocator, int count, uint blockSize) { List list = new List(count); for (int i = 0; i < count; i++) { diff --git a/StgSharpDebug/MatrixTest.cs b/StgSharpDebug/MatrixTest.cs index 088cc2b7..482562ae 100644 --- a/StgSharpDebug/MatrixTest.cs +++ b/StgSharpDebug/MatrixTest.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="MatrixTest" // Project: StgSharp @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using Microsoft.CodeAnalysis.CSharp.Syntax; -using StgSharp.HighPerformance.Memory; +using StgSharp.Mathematics.Memory; using StgSharp.Mathematics.Numeric; using System; using System.Collections.Generic; diff --git a/StgSharpDebug/Program.cs b/StgSharpDebug/Program.cs index e04a3e19..96682124 100644 --- a/StgSharpDebug/Program.cs +++ b/StgSharpDebug/Program.cs @@ -1,4 +1,4 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="Program" // Project: StgSharp @@ -26,9 +26,9 @@ // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- using StgSharp.Common.Timing; -using StgSharp.HighPerformance; -using StgSharp.HighPerformance.Memory; using StgSharp.Internal; +using StgSharp.Mathematics; +using StgSharp.Mathematics.Memory; using StgSharp.Mathematics.Numeric; using StgSharp.Timing; diff --git a/StgSharpDebug/SlabStressTest.cs b/StgSharpDebug/SlabStressTest.cs index 058eb6a0..39af0c55 100644 --- a/StgSharpDebug/SlabStressTest.cs +++ b/StgSharpDebug/SlabStressTest.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="SlabStressTest" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance.Memory; +using StgSharp.Mathematics.Memory; using System; using System.Diagnostics; diff --git a/StgSharpDebug/StgSharpDebug.csproj b/StgSharpDebug/StgSharpDebug.csproj index a803432f..563220e7 100644 --- a/StgSharpDebug/StgSharpDebug.csproj +++ b/StgSharpDebug/StgSharpDebug.csproj @@ -14,7 +14,6 @@ - diff --git a/StgSharpDebug/View/NewRender.cs b/StgSharpDebug/View/NewRender.cs index 32225bdd..585f7d5a 100644 --- a/StgSharpDebug/View/NewRender.cs +++ b/StgSharpDebug/View/NewRender.cs @@ -1,38 +1,35 @@ -//----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="NewRender.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="NewRender" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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: +// 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. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; -using StgSharp.HighPerformance; - using StgSharp.Internal; +using StgSharp.Mathematics; + using System; using System.Collections.Generic; using System.Linq; @@ -49,12 +46,12 @@ namespace StgSharp private class NewRender : ViewRender { - public NewRender( ViewMain view ) : base( view ) { } + public NewRender(ViewMain view) : base(view) { } public override void CustomizedInitialize() { Binding.Stream = CreateRenderStream(); - Render[ "only".AsLabel() ] = Binding.Stream; + Render["only".AsLabel()] = Binding.Stream; } public override bool ValidateInitializing() diff --git a/StgSharpDebug/hlsf-test.cs b/StgSharpDebug/hlsf-test.cs index 1b6e0e34..88785b00 100644 --- a/StgSharpDebug/hlsf-test.cs +++ b/StgSharpDebug/hlsf-test.cs @@ -1,9 +1,9 @@ -//----------------------------------------------------------------------- +//----------------------------------------------------------------------- // ----------------------------------------------------------------------- // file="hlsf-test" // Project: StgSharp -// AuthorGroup: Nitload -// Copyright (c) Nitload. All rights reserved. +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. 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 @@ -25,7 +25,7 @@ // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -using StgSharp.HighPerformance.Memory; +using StgSharp.Mathematics.Memory; using System; using System.Collections.Generic; using System.Diagnostics; @@ -50,8 +50,11 @@ namespace StgSharp int maxRounds = 10000; // 可调整 uint[] sizes = { - 64u, 128u, 256u, 512u, 1024u - }; + 64u, + 128u, + 256u, + 512u, + 1024u }; Random rnd = new Random(42); for (int round = 1; round <= maxRounds; round++) { diff --git a/StgSharpDevelop.sln b/StgSharpDevelop.sln index e8cb176e..f31b20af 100644 --- a/StgSharpDevelop.sln +++ b/StgSharpDevelop.sln @@ -1,6 +1,7 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.32825.248 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.3.11520.95 d18.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.Common", "StgSharp.Common\StgSharp.Common.csproj", "{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}" ProjectSection(ProjectDependencies) = postProject @@ -25,8 +26,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.TerminalDialogue", "StgSharp.TerminalDialogue\StgSharp.TerminalDialogue.csproj", "{10B5819F-2A62-41B6-980A-EB9E76A0E95C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.Script", "StgSharp.Script\StgSharp.Script.csproj", "{5B51F5EA-138C-46B5-B36F-1D389968B6CF}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.Model", "StgSharp.Model\StgSharp.Model.csproj", "{D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StgSharp.Mathematics", "StgSharp.Mathematics\StgSharp.Mathematics.csproj", "{9946599F-4D34-440F-840D-F9443D5AEFAA}" @@ -105,18 +104,6 @@ Global {10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|ARM64.Build.0 = Release|ARM64 {10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|x64.ActiveCfg = Release|x64 {10B5819F-2A62-41B6-980A-EB9E76A0E95C}.Release|x64.Build.0 = Release|x64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|ARM64.Build.0 = Debug|ARM64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|x64.ActiveCfg = Debug|x64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Debug|x64.Build.0 = Debug|x64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.PerformanceDebug|ARM64.ActiveCfg = PerformanceDebug|ARM64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.PerformanceDebug|ARM64.Build.0 = PerformanceDebug|ARM64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.PerformanceDebug|x64.ActiveCfg = PerformanceDebug|x64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.PerformanceDebug|x64.Build.0 = PerformanceDebug|x64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|ARM64.ActiveCfg = Release|ARM64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|ARM64.Build.0 = Release|ARM64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|x64.ActiveCfg = Release|x64 - {5B51F5EA-138C-46B5-B36F-1D389968B6CF}.Release|x64.Build.0 = Release|x64 {D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|ARM64.ActiveCfg = Debug|ARM64 {D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|ARM64.Build.0 = Debug|ARM64 {D9538DE0-EE4C-4183-86D6-7DFC08A7BDFB}.Debug|x64.ActiveCfg = Debug|x64 @@ -172,4 +159,4 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E13615C2-4C8D-4072-95A1-124440983818} EndGlobalSection -EndGlobal \ No newline at end of file +EndGlobal