diff --git a/.sdk-revision b/.sdk-revision index ec601f1..b371dcf 100644 --- a/.sdk-revision +++ b/.sdk-revision @@ -1 +1 @@ -efda89f3e1ad50fe4cac20124ad8a89f75b1c002 +4c8cd26a1b5f8003598463116960367ffa17418f diff --git a/Directory.Build.props b/Directory.Build.props index dcaa848..af7440c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ false false - 0.1.0-preview.315.1 + 0.1.0-preview.318.1 true net8.0 enable diff --git a/docs/nuget.md b/docs/nuget.md index 475a639..682c039 100644 --- a/docs/nuget.md +++ b/docs/nuget.md @@ -10,11 +10,25 @@ streaming adapters and depends on Core plus a specific published DolphinDotNet.GameCube version. The DolphinDotNet MSBuild SDK/compiler is a separate application requirement; it is not copied into an engine library nupkg. `Directory.Build.props` pins the package dependency version to -`DolphinDotNet.GameCube` **0.1.0-preview.305.1**. The matching compiler/Assets -preview includes indexed unlit vertex-color submission and shared mesh color -streams. `IndexedMeshCache` is included in this engine preview; ordered passes -retain the portable implementation unless explicitly built for the native backend. Source validation -continues to use the pinned SDK checkout from `.sdk-revision`. +`DolphinDotNet.GameCube` **0.1.0-preview.318.1**. The matching compiler/runtime +source is **4c8cd26a1b5f8003598463116960367ffa17418f**, also pinned in +`.sdk-revision` for source validation. Ordered passes retain their native SDK +backend by default; the portable comparison remains available through +`HypercubeNativePasses=false`. + +This upgrade accompanies [AnimalTown #47](https://github.com/capz/AnimalTown/pull/47). +SDK 318 exposes independent TEV alpha stages, two-reference GX comparisons and +`TevMaterialPresets.DualTextureGlints` for its two scrolling water samples. +Hypercube's scrolling helpers use these materials through the existing SDK API; +no separate effect format, shader wrapper or texture allocation is introduced. +The relocated package consumer builds/AOT-bundles this combination with a single +engine reference and no runtime override or NU1608 suppression. + +Once this engine preview has been verified and published, AnimalTown can pin +that published version in place of engine 28 and remove its temporary explicit +runtime-318 compatibility override. Engine previews are published only by the +existing release workflow after its publication trigger; this PR does not +reserve a future package number or publish an unverified package. ## Build and test without publishing @@ -27,10 +41,10 @@ The packer builds against the public SDK package, checks package IDs, versions, license/readme/PDB contents and dependency metadata, and emits packages.json with the source commit. It fails on an accidental source-checkout SDK dependency. The consumer relocates the nupkgs, uses an isolated NuGet cache outside the -repository, executes Core, then builds the Rendering sample through PackageReference +repository, executes Core, then builds the Rendering sample and water-material consumer through PackageReference and the published DolphinDotNet SDK. It verifies transitive dependencies, confirms the SDK packages match the reviewed source revision in `.sdk-revision`, and checks AOT bundling and, with --native, -actual DOL/ELF output. No SDK source checkout is +actual Rendering and water DOL/ELF output. No SDK source checkout is needed to consume the packages. ## Publish diff --git a/eng/package-readme.md b/eng/package-readme.md index 5660a91..f310653 100644 --- a/eng/package-readme.md +++ b/eng/package-readme.md @@ -14,7 +14,7 @@ dotnet add package Capz.Hypercube.GameCube --prerelease ``` GameCube depends on Core and DolphinDotNet.GameCube. Use a GameCube application -with `DolphinDotNet.Sdk/0.1.0-preview.245.1` and a matching +with `DolphinDotNet.Sdk/0.1.0-preview.318.1` and a matching `DolphinDotNet.GameCube` package. These engine packages contain managed libraries and PDBs, not the native compiler or a replacement SDK. Build the application with the DolphinDotNet SDK to produce a GameCube DOL. Do not execute graphics adapters diff --git a/tests/fixtures/sdk_water_consumer.cs b/tests/fixtures/sdk_water_consumer.cs new file mode 100644 index 0000000..de1502c --- /dev/null +++ b/tests/fixtures/sdk_water_consumer.cs @@ -0,0 +1,40 @@ +using System; +using Dolphin.Graphics; +using Hypercube.GameCube; + +// Consumed outside this repo via one engine PackageReference. Graphics calls +// execute on the console; host validation compiles and AOT-bundles this fixture. +// Use an explicit no-argument entry with SDK 318: the implicit Main(string[]) +// currently emits an undeclared argument reference during native compilation. +internal static class Program +{ + private static int Main() + { + var definition=TevMaterialPresets.DualTextureGlints( + new Color32(102,150,176),new Color32(215,248,244),33,235); + var program=definition.GetPackage(); + if(program[4]!=4||program[8]!=3||program[21]!=1|| + program[24]!=(byte)AlphaComparison.LessOrEqual||program[25]!=33|| + program[26]!=(byte)AlphaCompareOperation.Or|| + program[27]!=(byte)AlphaComparison.GreaterOrEqual||program[28]!=235) + throw new InvalidOperationException("Expected the SDK's independent alpha and OR cutout"); + using var texture=Texture2D.Create(4,4,new byte[64]); + using var water=definition.Create(texture,texture); + water.Material.Blend=BlendMode.Alpha;water.Material.DepthWrite=false; + water.Material.Color=Color32.White; // Keep the >=235 alpha branch reachable. + var primary=new ScrollingTextureLayer(new Vector2(.017f,.044f),new Vector2(1,1)); + var secondary=new ScrollingTextureLayer(new Vector2(0,-.067f),new Vector2(1,1)); + primary.Apply(water.Material,12);secondary.Apply(water.Material,12,true); + var vertices=new[]{ + new VertexPositionColorTexture(new Vector3(0,0,0),Color32.White,Vector2.Zero), + new VertexPositionColorTexture(new Vector3(1,0,0),Color32.White,Vector2.Zero), + new VertexPositionColorTexture(new Vector3(0,1,0),Color32.White,Vector2.Zero)}; + using var mesh=Mesh.Create(vertices); + var renderer=new Renderer();var camera=new Camera(60,4f/3,.1f,100);var transform=new Transform(); + var device=GraphicsDevice.Default; + device.BeginFrame(Color32.Black);renderer.Begin3D(camera); + renderer.DrawMesh(mesh,water.Material,transform); + renderer.End3D();device.EndFrame(); + return 0; + } +} diff --git a/tests/nuget_consumer.py b/tests/nuget_consumer.py index c885df7..4b1f943 100644 --- a/tests/nuget_consumer.py +++ b/tests/nuget_consumer.py @@ -71,8 +71,17 @@ class Program {static void Main(){var q=new OpaqueDrawQueue(2);q.TryAdd(1,2,0xff run('dotnet',str(compiler),'--bundle',str(ordered/'bin/Release/net8.0/Ordered.dll'),str(work/'native-ordered')) if 'dnd_mesh_draw_passes(' not in (work/'native-ordered/source/generated_program.c').read_text(): raise AssertionError('Published engine did not select SDK native ordered passes') + # Companion to AnimalTown #47: the engine's exact transitive SDK + # dependency must expose independent alpha and two-reference cutouts. + water=work/'Water';water.mkdir() + (water/'Water.csproj').write_text((app/'GameCube.csproj').read_text()) + shutil.copy2(ROOT/'tests/fixtures/sdk_water_consumer.cs',water/'Program.cs') + run('dotnet','build',str(water),'-c','Release','-p:DndBuildNative=false','-warnaserror:NU1608') + run('dotnet',str(compiler),'--bundle',str(water/'bin/Release/net8.0/Water.dll'),str(work/'native-water')) + if not (work/'native-water/source/generated_program.c').is_file():raise AssertionError('No water alpha AOT bundle') if args.native: - run('dotnet','build',str(app),'-c','Release','-p:DndBuildBackend=Docker') - if not list(app.rglob('*.dol')) or not list(app.rglob('*.elf')):raise AssertionError('No external native executable') + for project in (app,water): + run('dotnet','build',str(project),'-c','Release','-p:DndBuildBackend=Docker') + if not list(project.rglob('*.dol')) or not list(project.rglob('*.elf')):raise AssertionError('No external native executable: '+project.name) print('External NuGet restore, dependency closure and consumer checks passed') if __name__=='__main__':main()