Pin and prove lazy provider asset delivery
This commit is contained in:
parent
3da246aba8
commit
6e19396f7f
5 changed files with 52 additions and 37 deletions
|
|
@ -16,6 +16,7 @@ using UnityEngine.Rendering;
|
|||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.TestTools;
|
||||
using UnityEngine.UIElements;
|
||||
using Stopwatch = System.Diagnostics.Stopwatch;
|
||||
|
||||
namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
||||
{
|
||||
|
|
@ -304,9 +305,8 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
|||
Assert.That(provider.Selection.VerseId, Is.Not.Empty);
|
||||
Assert.That(provider.Selection.ProviderId, Is.Not.Empty);
|
||||
Assert.That(provider.Selection.SurfaceId, Is.Not.Empty);
|
||||
Assert.That(provider.CurrentAssetBodyTransportKind,
|
||||
Is.EqualTo(CultMeshBodyTransportKind.SharedFileMapping),
|
||||
"The generic client did not negotiate its verified provider bundle as a mapped body.");
|
||||
Assert.That(provider.CurrentAssetBodyTransportKind, Is.Null,
|
||||
"Publishing the provider catalog eagerly transferred an asset bundle.");
|
||||
host = root.AddComponent<EveUnityPlayableWorldClientHost>();
|
||||
host.Configure(
|
||||
root.transform,
|
||||
|
|
@ -375,6 +375,9 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
|||
"provider-asset-ref"));
|
||||
Assert.That(playerPrefab, Is.Not.Null,
|
||||
$"Provider asset catalog did not resolve player AssetRef '{playerFact.AssetRef}'.");
|
||||
Assert.That(provider.CurrentAssetBodyTransportKind,
|
||||
Is.EqualTo(CultMeshBodyTransportKind.SharedFileMapping),
|
||||
"The first requested provider bundle was not negotiated as a mapped body.");
|
||||
var marker = FindMarker(root, playerId);
|
||||
Assert.That(
|
||||
marker.GetComponentsInChildren<Transform>(includeInactive: true).Length,
|
||||
|
|
@ -912,6 +915,7 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
|||
Assert.That(captureFieldVolume, Is.Not.Null,
|
||||
"The generic client did not install its Fields volume lowerer before temporal settling.");
|
||||
const int temporalSettlingFrames = 128;
|
||||
var temporalSettlingElapsed = Stopwatch.StartNew();
|
||||
var initialCompositeCount = captureFieldVolume.CompositeCount;
|
||||
var temporalSettlingDeadline = Time.realtimeSinceStartup + 20f;
|
||||
while (captureFieldVolume.CompositeCount - initialCompositeCount < temporalSettlingFrames &&
|
||||
|
|
@ -923,6 +927,8 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
|||
Assert.That(captureFieldVolume.CompositeCount - initialCompositeCount,
|
||||
Is.GreaterThanOrEqualTo(temporalSettlingFrames),
|
||||
"The pilot capture ran before the advertised temporal reconstruction had settled.");
|
||||
Debug.Log($"EveUnity witness phase temporal-settling-128-frames took {temporalSettlingElapsed.Elapsed.TotalMilliseconds:0.###}ms.");
|
||||
var pilotCaptureElapsed = Stopwatch.StartNew();
|
||||
yield return null;
|
||||
RenderTexture.active = target;
|
||||
pixels = new Texture2D(captureWidth, captureHeight, TextureFormat.RGB24, false);
|
||||
|
|
@ -950,7 +956,9 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
|||
"The provider-authored player prefab has no renderer on its advertised map channel.");
|
||||
Assert.That(playerMapRendererFacts.Sum(fact => fact.renderedPixelCount), Is.Zero,
|
||||
"A provider-prefab map-channel renderer leaked into the pilot camera.");
|
||||
Debug.Log($"EveUnity witness phase pilot-capture-and-renderer-probes took {pilotCaptureElapsed.Elapsed.TotalMilliseconds:0.###}ms.");
|
||||
|
||||
var mapCaptureElapsed = Stopwatch.StartNew();
|
||||
mapRenderers = mapRenderers.Where(renderer => renderer != null).ToList();
|
||||
Assert.That(mapRenderers, Is.Not.Empty,
|
||||
"All advertised map-channel renderers were destroyed before map capture.");
|
||||
|
|
@ -981,6 +989,7 @@ namespace GameCult.EveUnity.GenericClient.PlayModeTests
|
|||
Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(mapCapturePath)));
|
||||
File.WriteAllBytes(mapCapturePath, pixels.EncodeToPNG());
|
||||
Assert.That(new FileInfo(mapCapturePath).Length, Is.GreaterThan(1024));
|
||||
Debug.Log($"EveUnity witness phase map-capture took {mapCaptureElapsed.Elapsed.TotalMilliseconds:0.###}ms.");
|
||||
var tractorReleaseVersion = runtime.ActiveVersion;
|
||||
var tractorRelease = host.SubmitAdvertisedActionValueIntent(
|
||||
playerId,
|
||||
|
|
|
|||
Reference in a new issue