summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-22C#: Begin move to .NET CoreIgnacio Roldán Etcheverry
We're targeting .NET 5 for now to make development easier while .NET 6 is not yet released. TEMPORARY REGRESSIONS --------------------- Assembly unloading is not implemented yet. As such, many Godot resources are leaked at exit. This will be re-implemented later together with assembly hot-reloading.
2022-08-22C#: Restructure code prior move to .NET CoreIgnacio Roldán Etcheverry
The main focus here was to remove the majority of code that relied on Mono's embedding APIs, specially the reflection APIs. The embedding APIs we still use are the bare minimum we need for things to work. A lot of code was moved to C#. We no longer deal with any managed objects (`MonoObject*`, and such) in native code, and all marshaling is done in C#. The reason for restructuring the code and move away from embedding APIs is that once we move to .NET Core, we will be limited by the much more minimal .NET hosting. PERFORMANCE REGRESSIONS ----------------------- Some parts of the code were written with little to no concern about performance. This includes code that calls into script methods and accesses script fields, properties and events. The reason for this is that all of that will be moved to source generators, so any work prior to that would be a waste of time. DISABLED FEATURES ----------------- Some code was removed as it no longer makes sense (or won't make sense in the future). Other parts were commented out with `#if 0`s and TODO warnings because it doesn't make much sense to work on them yet as those parts will change heavily when we switch to .NET Core but also when we start introducing source generators. As such, the following features were disabled temporarily: - Assembly-reloading (will be done with ALCs in .NET Core). - Properties/fields exports and script method listing (will be handled by source generators in the future). - Exception logging in the editor and stack info for errors. - Exporting games. - Building of C# projects. We no longer copy the Godot API assemblies to the project directory, so MSBuild won't be able to find them. The idea is to turn them into NuGet packages in the future, which could also be obtained from local NuGet sources during development.
2022-08-22C#: Re-write GD and some other icalls as P/InvokeIgnacio Roldán Etcheverry
2022-08-22C#: Re-write Array, Dictionary, NodePath, String icalls as P/InvokeIgnacio Roldán Etcheverry
2022-08-22C#: Remove DynamicGodotObject/Object.DynamicObjectIgnacio Roldán Etcheverry
We are moving in the direction of no dynamic code generation, so this is no longer desired. The feature can still be easily implemented by any project that still want it.
2022-08-22C#: Move marshaling logic and generated glue to C#Ignacio Roldán Etcheverry
We will be progressively moving most code to C#. The plan is to only use Mono's embedding APIs to set things at launch. This will make it much easier to later support CoreCLR too which doesn't have rich embedding APIs. Additionally the code in C# is more maintainable and makes it easier to implement new features, e.g.: runtime codegen which we could use to avoid using reflection for marshaling everytime a field, property or method is accessed. SOME NOTES ON INTEROP We make the same assumptions as GDNative about the size of the Godot structures we use. We take it a bit further by also assuming the layout of fields in some cases, which is riskier but let's us squeeze out some performance by avoiding unnecessary managed to native calls. Code that deals with native structs is less safe than before as there's no RAII and copy constructors in C#. It's like using the GDNative C API directly. One has to take special care to free values they own. Perhaps we could use roslyn analyzers to check this, but I don't know any that uses attributes to determine what's owned or borrowed. As to why we maily use pointers for native structs instead of ref/out: - AFAIK (and confirmed with a benchmark) ref/out are pinned during P/Invoke calls and that has a cost. - Native struct fields can't be ref/out in the first place. - A `using` local can't be passed as ref/out, only `in`. Calling a method or property on an `in` value makes a silent copy, so we want to avoid `in`. REGARDING THE BUILD SYSTEM There's no longer a `mono_glue=yes/no` SCons options. We no longer need to build with `mono_glue=no`, generate the glue and then build again with `mono_glue=yes`. We build only once and generate the glue (which is in C# now). However, SCons no longer builds the C# projects for us. Instead one must run `build_assemblies.py`, e.g.: ```sh %godot_src_root%/modules/mono/build_scripts/build_assemblies.py \ --godot-output-dir=%godot_src_root%/bin \ --godot-target=release_debug` ``` We could turn this into a custom build target, but I don't know how to do that with SCons (it's possible with Meson). OTHER NOTES Most of the moved code doesn't follow the C# naming convention and still has the word Mono in the names despite no longer dealing with Mono's embedding APIs. This is just temporary while transitioning, to make it easier to understand what was moved where.
2022-08-20Merge pull request #64110 from Geometror/fix-light-shadow-offHugo Locurcio
2022-08-20Merge pull request #64481 from jamie-pate/masterFabio Alessandrelli
Improve performance of screen_get_dpi() in Javascript
2022-08-20Merge pull request #64625 from Chaosus/shader_pp_definedYuri Rubinsky
2022-08-20Add `defined` keyword support to shader preprocessorYuri Rubinsky
2022-08-20Merge pull request #62046 from clayjohn/vertexless-drawMax Hilbrunner
Allow creating meshes without vertex positions
2022-08-20Fix OmniLight/SpotLight shadow opacity calculationHendrik Brucker
2022-08-20Merge pull request #64461 from bitsawer/fix_windows_list_dirMax Hilbrunner
Fix Windows list dir handle leak
2022-08-20Merge pull request #64170 from YuriSizov/docs-annotations-in-technicolorMax Hilbrunner
Add documentation for all annotations
2022-08-19Remove requirement to have vertex positions when creating a mesh. Meshes can ↵clayjohn
now be constructed from an index buffer alone
2022-08-19Merge pull request #63960 from bitsawer/fix-macro-expansionYuri Rubinsky
2022-08-19Merge pull request #64510 from KoBeWi/PR_packed_with_docs😎Max Hilbrunner
Complete documentation of packed arrays
2022-08-19Merge pull request #64167 from clayjohn/screen-texture-hintMax Hilbrunner
Add shader uniform hints for screen textures
2022-08-19Merge pull request #64342 from clayjohn/DOF-scaleMax Hilbrunner
Properly scale depth in bokeh_dof effect
2022-08-19Merge pull request #64612 from bruvzg/fix_shortcutsYuri Sizov
Fix MenuBar not processing shortcuts.
2022-08-19Merge pull request #64592 from mhilbrunner/move-fast-break-thingsYuri Sizov
Unexpose VelocityTracker3D
2022-08-19Merge pull request #64595 from mhilbrunner/ergo-proxyYuri Sizov
Unexpose ProxyTexture
2022-08-19Merge pull request #64334 from YuriSizov/core-bind-property-revert-methodsYuri Sizov
Make `property_*_revert` methods multilevel and expose them for scripting
2022-08-19Fix MenuBar not processing shortcuts.bruvzg
2022-08-19Add documentation for all annotationsYuri Sizov
2022-08-19Merge pull request #64459 from Chaosus/shader_elifYuri Rubinsky
2022-08-19Unexpose ProxyTextureMax Hilbrunner
2022-08-19Unexpose VelocityTracker3DMax Hilbrunner
2022-08-19Merge pull request #64580 from asmaloney/doc-grammar-lessMax Hilbrunner
[doc] Fix grammar in class docs: less vs. fewer/lower
2022-08-19Merge pull request #59045 from Calinou/editor-theme-popup-no-rounded-cornersYuri Sizov
Don't use rounded corners for PopupMenus in the editor theme
2022-08-19Merge pull request #59851 from Calinou/doc-object-meta-editor-onlyMax Hilbrunner
Document that Object metadata starting with `_` is editor-only
2022-08-19Merge pull request #63326 from MewPurPur/binary-highlighting-fixMax Hilbrunner
Fix highlighting of multiple operators
2022-08-19Merge pull request #63950 from bruvzg/menu_bar3Max Hilbrunner
Implement MenuBar control to wrap Popup menus or native menu, use native menu for editor.
2022-08-19Complete documentation of packed arrayskobewi
2022-08-19Merge pull request #63358 from YuriSizov/control-simplify-enhance-toolbarYuri Sizov
Improve editor toolbar for `Control` nodes
2022-08-18Merge pull request #64156 from bruvzg/sys_msdfClay John
Allow MSDF rendering for system fonts, fix crash on loading damaged / unsupported font files.
2022-08-18Merge pull request #64302 from neikeq/unreference-callback-regr-from-44691448Clay John
Fix instance binding unreference callback regression
2022-08-18Merge pull request #64315 from ↵Clay John
Daylily-Zeleen/fixed-GraphEdit-signal-argument-type Fixed GraphEdit signal argument type
2022-08-18Merge pull request #63999 from QbieShay/qbie/vs-qolClay John
Quality of life visual shaders updates
2022-08-18Merge pull request #64345 from Mickeon/docs-better-drawClay John
Improve documentation of `CanvasItem`'s draw logic
2022-08-18Merge pull request #55032 from Calinou/tweak-default-window-sizeYuri Sizov
Increase the default project window size for better usability
2022-08-18Merge pull request #64356 from Calinou/editor-hide-dummy-text-driverClay John
Hide Dummy text driver in the Project Settings as it makes editor unusable
2022-08-18Merge pull request #64449 from Calinou/label3d-hide-ineffective-propertiesClay John
Hide properties that have no effect in Label3D inspector
2022-08-18Don't use rounded corners for PopupMenus in the editor themeHugo Locurcio
PopupMenus use separate windows by default in the editor, and windows no longer support per-pixel transparency for now in 4.0. Even if per-pixel transparency was reimplemented, we can't assume that it'll always work in practice (e.g. when compositing is disabled).
2022-08-18Merge pull request #64468 from aaronfranke/editor-prop-visual-shader-modeClay John
Rename `EditorPropertyShaderMode` to `EditorPropertyVisualShaderMode`
2022-08-18Merge pull request #64470 from aaronfranke/shader-cd-st-enumClay John
Move `ShaderCreateDialog`'s `ShaderType` enum out of the header
2022-08-18Merge pull request #64581 from aaronfranke/aabbClay John
Use a const ref for the bone AABB in rendering code
2022-08-18Merge pull request #64357 from Mickeon/rename-plugin-containerYuri Sizov
Rename EditorPlugin.`*_PROPERTY_EDITOR_*` to `*_INSPECTOR_*`
2022-08-18Merge pull request #58059 from Calinou/tweak-default-project-icon-2Yuri Sizov
Tweak the default project icon
2022-08-18Implement `MenuBar` control to wrap `PopupMenu`s or native menu, use native ↵bruvzg
menu for editor.