From efa2f549cbf9ae38af090416f6014defb94568af Mon Sep 17 00:00:00 2001 From: kuba Date: Thu, 1 Oct 2026 13:00:10 +0200 Subject: [PATCH] [Tests] Initialize presenter state for GPU binding validation --- tests/SharpEmu.Libs.Tests/Gpu/Buffers/CacheHarness.cs | 2 +- tests/SharpEmu.Libs.Tests/VideoOut/PresenterUnderTest.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/SharpEmu.Libs.Tests/Gpu/Buffers/CacheHarness.cs b/tests/SharpEmu.Libs.Tests/Gpu/Buffers/CacheHarness.cs index 27d0455..dd90c09 100644 --- a/tests/SharpEmu.Libs.Tests/Gpu/Buffers/CacheHarness.cs +++ b/tests/SharpEmu.Libs.Tests/Gpu/Buffers/CacheHarness.cs @@ -71,7 +71,7 @@ internal sealed class CacheWorker : IDisposable done.Wait(); if (failure != null) { - throw failure; + System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(failure).Throw(); } } diff --git a/tests/SharpEmu.Libs.Tests/VideoOut/PresenterUnderTest.cs b/tests/SharpEmu.Libs.Tests/VideoOut/PresenterUnderTest.cs index fa8624b..b92f2ea 100644 --- a/tests/SharpEmu.Libs.Tests/VideoOut/PresenterUnderTest.cs +++ b/tests/SharpEmu.Libs.Tests/VideoOut/PresenterUnderTest.cs @@ -76,7 +76,9 @@ internal sealed class PresenterUnderTest : IDisposable { "_batchResources", "_batchRetireBuffers", "_pendingGuestSubmissions", "_deferredGuestImageVersionDestroys", - "_pipelineEntries", "_shaderModules", + "_pipelineEntries", "_shaderModules", "_shaderModuleSpirvBytes", + "_preparedTextures", "_barriersAfterRendering", "_feedbackSnapshotPool", + "_pipelineCacheShards", "_tracedBufferWriters", }) { var field = PresenterType.GetField(name, InstanceMembers)!; @@ -113,7 +115,8 @@ internal sealed class PresenterUnderTest : IDisposable } catch (TargetInvocationException exception) when (exception.InnerException is not null) { - throw exception.InnerException; + System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(exception.InnerException).Throw(); + throw; } }