Skip to content

Commit 82d2171

Browse files
GPU Testing Env: create some deferred contexts with IRenderDevice::CreateDeferredContext()
1 parent b07a92c commit 82d2171

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Tests/GPUTestFramework/src/GPUTestingEnvironment.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
267267

268268
EngineCI.AdapterId = FindAdapter(Adapters, EnvCI.AdapterType, EnvCI.AdapterId);
269269
NumDeferredCtx = EnvCI.NumDeferredContexts;
270-
EngineCI.NumDeferredContexts = NumDeferredCtx;
270+
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
271271
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
272272
pFactoryD3D11->CreateDeviceAndContextsD3D11(EngineCI, &m_pDevice, ppContexts.data());
273273
}
@@ -331,7 +331,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
331331
EngineCI.DynamicDescriptorAllocationChunkSize[1] = 8; // D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER
332332

333333
NumDeferredCtx = EnvCI.NumDeferredContexts;
334-
EngineCI.NumDeferredContexts = NumDeferredCtx;
334+
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
335335
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
336336
pFactoryD3D12->CreateDeviceAndContextsD3D12(EngineCI, &m_pDevice, ppContexts.data());
337337
}
@@ -431,7 +431,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
431431
EngineCI.ppIgnoreDebugMessageNames = IgnoreDebugMessages.data();
432432

433433
NumDeferredCtx = EnvCI.NumDeferredContexts;
434-
EngineCI.NumDeferredContexts = NumDeferredCtx;
434+
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
435435
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
436436
pFactoryVk->CreateDeviceAndContextsVk(EngineCI, &m_pDevice, ppContexts.data());
437437
}
@@ -465,7 +465,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
465465
EngineCI.SetValidationLevel(VALIDATION_LEVEL_1);
466466

467467
NumDeferredCtx = EnvCI.NumDeferredContexts;
468-
EngineCI.NumDeferredContexts = NumDeferredCtx;
468+
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
469469
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
470470
pFactoryMtl->CreateDeviceAndContextsMtl(EngineCI, &m_pDevice, ppContexts.data());
471471
}
@@ -497,6 +497,11 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
497497
break;
498498
}
499499

500+
for (Uint32 ctx = EnvCI.NumDeferredContexts / 2; ctx < EnvCI.NumDeferredContexts; ++ctx)
501+
{
502+
m_pDevice->CreateDeferredContext(&ppContexts[std::max(ContextCI.size(), size_t{1}) + ctx]);
503+
}
504+
500505
{
501506
const DeviceFeatures& ActualFeats = m_pDevice->GetDeviceInfo().Features;
502507
#define CHECK_FEATURE_STATE(Feature) \

0 commit comments

Comments
 (0)