-
-
Notifications
You must be signed in to change notification settings - Fork 438
Add IsRunningSlowlyThreshold #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+380
−167
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove all "gets and sets" for consistency, remove defaults since those are in WindowOptions, and correct a few things that aren't true anymore.
What the proposal originally suggested isn't possible, since WindowOptions.Default isn't a compile-time constant.
Perksey
requested changes
Jul 5, 2019
src/Windowing/Silk.NET.Windowing.Common/Interfaces/ISilkPlatform.cs
Outdated
Show resolved
Hide resolved
Co-Authored-By: Dylan Perks <dylanperks23@gmail.com>
Co-Authored-By: Dylan Perks <dylanperks23@gmail.com>
Perksey
approved these changes
Jul 5, 2019
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…Ubuntu SMP Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…P Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…Ubuntu SMP Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…P Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…Ubuntu SMP Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…P Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…SMP Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…untu SMP Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…P Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
…P Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 8, 2023
… SMP Fri Oct 6 13:20:44 UTC 2023
silkdotnet
pushed a commit
that referenced
this pull request
Nov 24, 2025
* Add Vulkan-Docs submodule * Create Vulkan bindings project * Fix typo * Add base case for FindCommonPrefix for when names.Count is 0 * Add all mods up to and including MixKhronosData * Remove assert This code seems to look for "<feature api=" elements in vk.xml. However, one of the six total elements don't have a "depends" attribute. You can see this by opening https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/refs/heads/main/xml/vk.xml and searching for "<feature api=". This is the line that does not have the depends attribute, which causes the assert to fail: <feature api="vulkan,vulkansc" name="VK_VERSION_1_0" number="1.0" comment="Vulkan core API interface definitions"> The other relevant lines do have a depends attribute: <feature api="vulkan,vulkansc" name="VK_VERSION_1_1" number="1.1" depends="VK_VERSION_1_0" comment="Vulkan 1.1 core API interface definitions."> * Add another base case for FindCommonPrefix for when names.Count is 0 This commit fixes the allowLeadingDigits overload. The previous similarly named commit fixes the maxLen overload. * Add TransformFunctions and PrettifyNames mods to Vulkan generator config * Add DllImport VTable config to Vulkan This currently doesn't generate anything for some reason (only the enums generate, and that's because of a previous mod) * Add initial RSP files and empty vulkan-vulkan.h header * Remove vulkansc profile from AddApiProfiles I'm guessing we don't need this since we don't care about vulkansc. Let me know if we want to keep this defined. * Add Vulkan-Headers repo as submodule * Use Vulkan headers from Vulkan-Headers repo Nothing generates yet. Not sure why. * Add traverse argument for Vulkan generate.rsp * Add Vulkan specific header.txt * Also traverse vulkan_core * Remove BakeSourceSets mod since there is only 1 source set * Commit generated Vulkan bindings There are some file names that are incorrect (the enum name inside the file is fine), such as sources/Vulkan/Vulkan/Vulkan/VkBufferCreateFlagBits.gen.cs. They all seem to be enums. I did some light checking and it seems that these incorrectly named enums don't have equivalents in the Enums folder. Some enums have multiple versions, which is expected, but the newer versions tend to be in the Enums folder while the older versions are in the Vulkan folder: For example: sources/Vulkan/Vulkan/Vulkan/VkAccessFlagBits.gen.cs sources/Vulkan/Vulkan/Enums/AccessFlags2.gen.cs sources/Vulkan/Vulkan/Enums/AccessFlags3KHR.gen.cs Interestingly, as I was writing this commit message, I noticed that AccessFlags.gen.cs was named correctly before I added the traverse argument in my previous commits. * Generate on Linux (differs slightly from Windows) Will regenerate using Windows or whichever platform is preferred later for consistency. * Add remap-stdint.rsp for Vulkan Only uint64_t=ulong affects the generation, but the others are included to be slightly more complete. This does not fix the enum backing types though, which also differ between Linux/Windows. See this conversation in the Silk.NET Discord for more information: https://discord.com/channels/521092042781229087/1376331581198827520/1376628539536969949 Relevant ClangSharp issue: dotnet/ClangSharp#574 * Exclude VK_NULL_HANDLE from being generated This is related to dotnet/ClangSharp#601 * Add TransformHandles mod * Add TransformProperties mod * Add ExtractNestedTyping mod * Trim _T from _THandle types Technically this only removes the T, but the effect should be the same. Note the git diff looks a bit weird on this commit. Git seems to think that some of the files were renamed when they were not. * Rename FlagBits enums to Flags Not sure if doing it this way is correct * Slight optimization/simplication * Add mappings from FlagBits to Flags types * Remove code that Perksey said was obsolete This code was from Silk 2 See https://discordapp.com/channels/521092042781229087/1376331581198827520/1379174486913323169 * Add comments on how TransformHandle works at a high level * Add example to TransformHandle docs * Add comments to ExtractNestedTyping This also adds slightly refactors the code for better debuggability (extractedFunctionPointers). * Generate bindings on Windows No idea why the using statements change. Enum backing types also change between uint to int. This is fine for mosts cases since the bit width doesn't change, but nevertheless concerning. * Edit xml docs * Move TransformHandles mod's TypeDiscover into new Scraping namespace This is so that the ExtractNestedTypes mod can also make use of the logic without having to duplicate code. This also adds xml doc comments to all public facing members. Most of these new doc comments are inheritdoc tags. The notable doc comments to review are the comment on the class itself and on GetHandleTypes. * ExtractNestedTyping can now generate empty handle structs * Change MixKhronosData to only look for _T instead of _THandle * Copy NameUtils from curin's branch to get access to RenameAllAsync Exact commit is 2bfd641 * Disable all mods after ExtractNestedTyping and regenerate * Change MSBuildModContext to only remove project documents that are part of the output directory See Silk.NET discord conversion for context: https://discord.com/channels/521092042781229087/1376331581198827520/1381026216466845716 As a summary, this is to ensure that the global usings files are not removed from the project. * Implement symbol based handle type discoverer * Refactor code related to missing handle discovery * Remove temporary Linux-specific workaround * Add MissingHandleTypeGenerator class and implement handle type generation * Cleanup * Rename MissingHandleTypeGenerator and some other things to better represent what they actually do GenerateEmptyStructsForMissingHandleTypes is verbose, but I think it's more accurate than GenerateMissingHandleTypes and clearer than AssumeMissingTypesOpaque (I had to dig around the repo to figure out what this actually meant). * Reapply a few changes related to FindCommonPrefix I accidentally overwrote my previous commits when copying over the symbol-based renamer from curin's branch. These are the reapplied commits: 0b9d036 d7fc141 * Revert "Remove temporary Linux-specific workaround" This reverts commit b65b4b6. * Regenerate bindings on Linux This is because I'm back on Linux for development. Previously there were blockers that were preventing me from working on Linux, but I now have workarounds for these. This does make the commit log messier than I want, so I might squash a few of these at the end to clean up. * Prepare to rewrite TransformHandles; regenerate Vulkan bindings * Update SDL generator config to use ExtractNestedTyping.GenerateEmptyStructsForMissingHandleTypes * Remove old TransformsHandle code that won't be used by rewrite * Edit doc comment for ExtractNestedTyping * Implement symbol-based handle type discovery for TransformHandles * Add -Handle suffix to Handle documents * Remove handle document renaming for now; Reimplement handle struct member generation * Edit todo comments * NameUtils.RenameAllAsync now works alongside document renaming in TransformHandles * Change the gatherer/rewriter classes I wrote to be only designed to be used once Putting a cancellation token and the rest of the parameters in the constructor is a bit weird, but does simplify things. * Implement pointer dimension reduction * Fix PointerDimensionReducer accidentally overwriting its own changes * Cleanup * Add LocationTransformer class * Add parallelization * Reorder code * Attempt to implement renaming functionality with LocationTransformers * Fix IdentifierRenamingTransformer not working * Split LocationTransformer code into multiple files * Fix ArgumentOutOfRangeException and replace old renamer * Remove unused code * Add todos * Ignore AttributeSyntaxes when looking for handles because handles will never be attributes * Cleanup * Edit comment for clarity * Change ModCSharpSyntaxRewriter to exclude global usings * Fix typo * Fix Vulkan enum constants not being identified properly This meant that the enum constants were not being moved from Vulkan.gen.cs to their corresponding enum types. * Exclude deprecated Vulkan aliases that are causing compile errors * Add Vulkan Video to Vulkan bindings generation Can't generate bindings yet due to PrettifyNames crash. * Exclude vendors that only have disabled extensions * Generate bindings * Exclude a few more deprecated aliases that cause compile errors due to name conflicts * Manually fix bitshifts * Rename Vulkan class to Vk to match Silk 2 * Fix the bitshifts again * Add StaticWrapper VTable * Fix missing API constants * Remove manually added type mappings * Simplify code * Rename FlagBits enums using MixKhronosData instead of through INameTrimmer This also prepares the Rewriter class for a few other changes. * Globally replace FlagBits with Flags in identifier names Bit invasive, but since all FlagBits enums are already treated the same way, this ensures that everything is processed consistently. This also avoids the need to tell ClangSharp to remap these enums. * Add Flags attribute to "KnownBitmask" enums * Split MixKhronosData.Rewriter into two phases * Fix Flags types being typed as uint/ulong instead of the proper enum type * Fix Flags uint/ulong type replacement being too eager and replacing uint/ulongs with types that don't exist in the project * Edit doc comment * Add new TransformFlags mod This adds a "None = 0" member to Flags enums if they do not have an equivalent already * Attempt to find and add Clang include directory in UnixStdIncludeResolver * Fix AccessFlags3KHR.None being added even when it already has a member with value 0 * Remove MaxEnum members from enums Because the MaxEnum member got removed, some enum members had their trimming adjusted as a side effect. Case 1: Matches Silk 2: - SamplerYcbcrRange - SemaphoreImportFlags - DeviceDiagnosticsConfigFlagsNV - FenceImportFlags - VideoDecodeCapabilityFlagsKHR - VideoEncodeFeedbackFlagsKHR - ClusterAccelerationStructureAddressResolutionFlagsNV (Doesn't exist in Silk 2) Case 2: Unintended changes (need to fix): - IndirectStateFlagsNV - SemaphoreImportFlags - SemaphoreWaitFlags - SurfaceCounterFlagsEXT * Add early exit optimization * Check if string is length 0 and throw instead of stack overflowing * Reorder code Doesn't seem to affect OpenGL bindings generation This is to ensure all trimming code happens after rewinding, which is useful because I'm thinking of refactoring this code and want to ensure that I can treat all of the trimming code equally. * Change Vulkan _T suffix trimming to be more specific This is to avoid trimming things like GL_T from OpenGL * Improve MixKhronosData name trimming rewind condition This fixes a few cases where the trimmer fails to trim enum member names. Note that this affects both the Vulkan bindings and the OpenGL bindings. (cherry picked from commit 2df6cef) * Edit comment (cherry picked from commit 832c95b) * Add prefix overrides for manually identified cases where trimming has trimmed too much of the enum member names * Rename TransformFlags mod to TransformEnums; Move MaxEnum member removal logic to TransformEnums * Update vulkan-headers because apparently they are out-of-date enough that I'm getting confused * Remove debug code * Fix missing enum group data when the enum group is empty * Remove constants that are marked as deprecated aliases These only seem to exist for Vulkan currently. For Vulkan: These represent misnamed constants that have now been renamed to be consistent with the rest of the Vulkan spec. For Silk: These misnamed constants and their corrected variants cause name collisions when names are prettified (thus leading to compile errors) and cause common prefix determination for enum member names to be more pessimistic (thus leading to longer names). For users: Removing these aliases can induce more API breaks, but because these are aliases and always have an alternative, API breaks are simple to fix. Removing these aliases also makes it clearer which variant is the correct variant to use. * Add remapping for VkBool32 to MaybeBool<uint> * Add new Vulkan video headers * Edit doc comment * Use GetNativeElementTypeName in order to simplify code Apparently ModUtils already had this exact logic. * Implement most of TransformVulkan mod * Finish implementing TransformVulkan * Don't strip attributes for explicitly implemented interface methods * Finish implementing logic for wrapping the vkCreateInstance/Device methods * Fix missing private modifier * Add manual Vk file with Create and Clone methods * Fix typo in docs * Update location transformation code with the Microsoft job changes * Add DllImport vtable * Add UnmanagedCallersOnly ProcAddr methods * Fix edge case where Flags types were being output as uint instead of the actual enum type * Add alternative library names for Vulkan * Hack: Fix missing type cast * Add StaticWrapper vtable * Cleanup * Generate on Windows * Empty commit (to trigger CI build) * Generate again on Linux * Update Vulkan submodules * Add prefix override for VkPipelineCreateFlags2 to avoid issue where all members are prefixed with X2- due to 64BitIndexingEXT member starting with a number * Update Vulkan branch with changes from OpenAL branch (#15) * Update Silk.NET 2.X submodule for website * Start of OpenAL bindings * Use new al.xml * Generate OpenAL bindings using al.xml * Add missing EFX bindings * Add support for multiple global prefix hints * Enable data type trimming for the direct functions * Update OpenAL Soft * Add native binary build scripts * Fix build errors (1) * Adjust build scripts * Disable fail fast * Add missing packages (this isn't the only thing to fix) * Split dependency installation and building steps * Helps if I commit the workflow changes * Fix zig PATH issue * cry * Revert * Add sysroot parameters to Zig CMake toolchain * Use docker for the Linux builds * Add missing deps, fix CMake lib/include paths, etc * Give up on Zig, use the GCC cross-compilers from apt * Oops, add sudo back * Revert change that leads CI to build twice * Update native binaries for 784f7ff * Update native binaries for 747c966 * Fix GL-style type determination edge case, ALCEnum now generating * Implement Create and the contexts * Update native binaries for 52817a4 * Working OpenAL example! * Update native binaries for e6b4486 * Update native binaries for 0a98aaf * Update native binaries for a35b3a9 * Self-review fixes * Add native licenses * Update generator config with changes from OpenAL branch * Fix error related to modifying collection that is being enumerated over * Revert my change where I prevent documents outside of the project folder from being removed before generation * Regenerate * Rewrite MixKhronosData.TryGetSymbolMetadata since reading and debugging it is a pain * Fix information stored by SupportedApiProfile disappearing after merging * Rewrite and fix MetadataUtils.GetAllMetadata This now returns all matching child metadata first, then all matching parent metadata. --------- Co-authored-by: The Silk.NET Automaton <9011267+dotnet-bot@users.noreply.github.com> Co-authored-by: Dylan Perks <dylanperks23@gmail.com> * Update to .NET 10 and DISABLE TreatWarningsAsErrors in Silk.Net.Core.csproj Also, updated most packages except System.CommandLine since it had breaking changes I didn't want to fix (cherry picked from commit 25364af) * Regenerate Vulkan bindings (yay, the bitshifts are fixed) (cherry picked from commit b5715cd) * Remove now unnecessary hack (cherry picked from commit b2aa4044ddc2f47a0d061c1c18f803da155ec50e) * Remove handle struct handling code from ExtractNestedTyping and temporarily disable TransformHandles This is to prepare for the rewrite (cherry picked from commit 494c19e403351bd73c262297e009e2d5ddbdc7a3) * Update ExtractNestedTyping doc comment * Cleanup * Get TransformHandles working again * Allow callers of GetAllMetadata to filter by metadata source See conversation: https://discord.com/channels/521092042781229087/1376331581198827520/1438259532068290601 * Fix incorrect file name for OpenALException * Move PrettifyNames closer to end of mod order * Update Vulkan bindings to use InterceptNativeFunctions * Cleanup * Use null op if setting CurrentDevice with its current value * Add CurrentInstance/CurrentDevice/Clone to IVk interface and update Vulkan bindings to be more similar to OpenAL * Add context factory for Vulkan ThisThread VTable * Add my new renamer with Curin's modifications * Change RenameAllAsync to use new renamer (pure syntax rewriter instead of syntax rewriter + FindAllReferences) * Create a copy of the original LocationTransformation code for runtime comparison purposes * Work on new location transformer implementation * Edit documentation to match new expectations for LocationTransformer.GetNodeToModify * Use location transformer based renamer Uhh so we have renamer v4 now * Remove old location transformer * Improve IdentifierRenamingTransformer constructor API * Remove Renamer since it has been replaced * Implement working version of the non-FindReferencesAsync + SyntaxRewriter + LocationTransformer renamer * Cleanup * Remove the .stout files I committed * Use TryParse instead of Parse in UnixStdIncludeResolver * Cleanup using statements in NameUtils * Restore comment I removed when removing the handle struct functionality from ExtractNestedTyping * Cleanup use of ctx.SourceProject in ExtractNestedTyping * Remove unused GetCompilationAsync * Fix compile errors related to System.Linq.Async * Hack: Disable warnings as errors in Silk.NET.Maths * Fix incorrect comment * Add comment on ClangIncludeFolderRegex * Edit docs and cleanup * Update packages again The added "PrivateAssets="all" ExcludeAssets="runtime"" is to address the following error: Msbuild failed when processing the file '/home/exanite/exanite/repositories/Silk3.NET/tests/SilkTouch/SilkTouch/Silk.NET.SilkTouch.UnitTests.csproj' with message: A PackageReference to the package 'Microsoft.Build.Framework' at version '18.0.2' is present in this project without ExcludeAssets="runtime" set. This can cause errors at run-time due to MSBuild assembly-loading. Note that as of this commit, running `nuke DeclareApi` results in this error, which also occurred before updating these packages. [ERR] DeclareApi: Unhandled exception: System.NotSupportedException: Adding additional documents is not supported. [ERR] DeclareApi: at Microsoft.CodeAnalysis.Workspace.CheckAllowedProjectChanges(ProjectChanges projectChanges) [ERR] DeclareApi: at Microsoft.CodeAnalysis.Workspace.CheckAllowedSolutionChanges(SolutionChanges solutionChanges) * Fix "Adding additional documents is not supported" error and run `nuke DeclareAPI` See conversation in Silk.NET discord here: https://discord.com/channels/521092042781229087/587346162802229298/1441547006932947114 The fix was to explicitly specify the PublicAPI files in Silk.NET.Maths instead of using a wildcard (*). This pattern matches what is used in Silk.NET.Core. * Fix "comparing a span to null might be redundant" error Full error: Error CA2265 : Comparing a span to 'null' might be redundant, the 'null' literal will be implicitly converted to a 'Span<T>.Empty' * Fix ConfigurationErrorsException not being resolved Looks like the type is located in a different assembly now, as of the last package update that I did in c586b19. * Revert accidental changes to OpenAL shared libraries * Use compiled regexes in TransformEnums for better performance * Rename LocationTransformationRewriter from Rewriter and update docs * Specify VkBool32 as a TransformFunctions.BoolType and remove remapping We don't need to map to uint here since VkBool32 is already typedef'd to uint: typedef uint32_t VkBool32; * Add way to configure what base types for flags/bitmask enums are used * Add PInvokeGeneratorConfigWrapper to simplify overriding properties of PInvokeGeneratorConfiguration * Improve syntax when using PInvokeGeneratorConfigWrapper * Delete the temp header file after creating PInvokeGeneratorConfiguration * Update ChangeNamespace and IInputResolver to use PInvokeGeneratorConfigWrapper * Cleanup type name extraction code in MixKhronosData * Edit docs * Refactor and replace GetNativeElementTypeName with TryParseNativeTypeName * Replace FlagBits with Flags in document names during MixKhronosData to ensure that these documents are renamed properly by PrettifyNames * Update vulkan header.txt to use 2015-2025 as the copyright years * Coerce enum backing types to be signed instead of unsigned to ensure consistent cross-platform generation This generally forces the output on Linux to match the output on Windows (other than the NativeTypeName attribute). There are some quirks, such as with the VkFlags64 enums. VkFlags64 is typedef'd to uint64_t so the backing type should be ulong, but we change it to long anyway. This arguably isn't correct, but at least leads to consistent generation and simpler code (since we aren't manually excluding enums from being coerced). This also matches Silk 2, where VkFlags64 enums also used long as the backing type. * Add ReplaceNameAndPath to make it easier and safer to rename documents * Add hack to trim _T off of handle struct names * Move _T trimming in MixKhronosData earlier since _T is always at the very end of the name * Fix compile errors due to renamed handle structs * Simplify code * Add TransformEnums RewriteMemberValues option * Add PreferUnsigned option for TransformEnums.CoerceBackingTypes and use it for the Vulkan bindings * Fix edge case handling in PreferUnsigned case and update PreferSigned to be consistent * Use .NET 10 in Github Actions * Don't use preview .NETs yet --------- Co-authored-by: The Silk.NET Automaton <9011267+dotnet-bot@users.noreply.github.com> Co-authored-by: Dylan Perks <dylanperks23@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the PR
Add IsRunningSlowlyThreshold to IWindowProperties, giving the user the ability to control how many frames the window has to lag before IsRunningSlowly is set to true. Defaults to 5, the previously hard-coded value.