[dotnet6 branch] Move runtime_interop P/Invoke to function pointers #59588
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.
The purpose of moving to function pointers is being able to call these methods when Godot is compiled with
target=release_debug
.For convenience these are the files output by the source generator:
Godot.SourceGenerators.UnmanagedCallbacksGenerator.zip
TODO:
GodotTools.Internals.Internal
. I guess we'll want to use the source generator there too.Methods that have a parameter of typeThese methods are now generated using by-ref parameters or copying to the stack so no need to convert to pointer.DebuggingUtils.godot_stack_info_vector
can't be generated because it's not one of the GodotInteropStructs and it's aref struct
so I can't use Unsafe or CustomUnsafe to get the pointer.Godot.SourceGenerators
project for theGodotSharp
assembly since we only want to run this generator and not the others but I should probably move this generator to the originalGodot.SourceGenerators
assembly. Alternatively we can have separate source generators projects forGodotSharp
and for user projects that could share common code with a shared library.out
parameters are assigneddefault
, otherwise the compiler complains that they are not assigned before leaving the method. Can we really avoid this?