Add Editor configs, refactor test core, DXC test

Added Debug_Editor/Release_Editor configs to all projects and solution. Refactored test utilities into Ghost.TestCore and updated references. Introduced DXCBindingTest for shader compilation. Updated conditional compilation to use GHOST_EDITOR. Improved platform mappings and performed minor code cleanup.
This commit is contained in:
2026-05-08 13:59:36 +09:00
parent b42398bbce
commit 80e820a858
42 changed files with 392 additions and 101 deletions

View File

@@ -86,15 +86,18 @@ internal class AssetHandlerRegistrationGenerator : IIncrementalGenerator
var registerTypeName = "g_assethandler_registeration";
var code = $@"// <auto-generated />
#if GHOST_EDITOR
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static partial class {registerTypeName}
{{
[global::System.Runtime.CompilerServices.ModuleInitializer]
internal static void RegisterAssetHandlers()
{{
{sb}
}}
}}";
}}
#endif";
context.AddSource($"{registerTypeName}.gen.cs", code);
}
@@ -156,6 +159,7 @@ internal class IAssetSettingsRegistrationGenerator : IIncrementalGenerator
var registerTypeName = "g_iassetsettings_registeration";
var code = $@"// <auto-generated />
#if GHOST_EDITOR
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static partial class {registerTypeName}
{{
@@ -164,7 +168,8 @@ internal static partial class {registerTypeName}
{{
{sb}
}}
}}";
}}
#endif";
context.AddSource($"{registerTypeName}.gen.cs", code);
}

View File

@@ -4,6 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>14.0</LangVersion>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<Configurations>Debug;Release;Debug_Editor;Release_Editor</Configurations>
</PropertyGroup>
<ItemGroup>

View File

@@ -176,7 +176,7 @@ namespace {info.TypeSymbol.ContainingNamespace.ToDisplayString()}
[global::System.Runtime.InteropServices.StructLayout(global::System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 4)]
{info.TypeSymbol.DeclaredAccessibility.ToString().ToLower()} partial struct {info.TypeSymbol.Name}
{{
#if DEBUG || GHOST_EDITOR
#if GHOST_EDITOR
public const string HLSL_SOURCE = @""
# ifndef {definedSymbol}
# define {definedSymbol}
@@ -199,17 +199,17 @@ struct {info.Name}
var registerTypeName = "g_shaderproperty_registeration";
var registerCode = $@"// <auto-generated/>
#if GHOST_EDITOR
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static partial class {registerTypeName}
{{
#if DEBUG || GHOST_EDITOR
[global::System.Runtime.CompilerServices.ModuleInitializer]
internal unsafe static void RegisterShaderProperties()
{{
{registerBuilder}
}}
#endif
}}";
}}
#endif";
context.AddSource($"{registerTypeName}.gen.cs", registerCode);
}