Skip to content

Commit 477c9e4

Browse files
Fix worker-thread auto-recycle test to flush queued copy before reusing upload buffer
1 parent 82ffd4f commit 477c9e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/DiligentCoreAPITest/src/TextureUploaderTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2025 Diligent Graphics LLC
2+
* Copyright 2019-2026 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -291,12 +291,14 @@ void TestAutoRecycle(bool IsRenderThread, TEXTURE_UPLOADER_MODE Mode)
291291
WorkerThread.join();
292292
}
293293

294+
// Flush queued copy
295+
pTexUploader->RenderThreadUpdate(pContext);
294296
pContext->WaitForIdle();
295297
pTexUploader->RenderThreadUpdate(pContext);
296298

297299
RefCntAutoPtr<IUploadBuffer> pUploadBuffer2;
298300
pTexUploader->AllocateUploadBuffer(pContext, UploadBuffDesc, &pUploadBuffer2);
299-
EXPECT_EQ(pUploadBuffer, pUploadBuffer2);
301+
ASSERT_EQ(pUploadBuffer, pUploadBuffer2);
300302

301303
MappedTextureSubresource MappedData = pUploadBuffer->GetMappedData(0, 0);
302304
Uint32 cnt = 0;

0 commit comments

Comments
 (0)