Skip to content

Commit

Permalink
GPU Testing Env: create some deferred contexts with IRenderDevice::Cr…
Browse files Browse the repository at this point in the history
…eateDeferredContext()
  • Loading branch information
TheMostDiligent committed Feb 21, 2025
1 parent b07a92c commit 82d2171
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Tests/GPUTestFramework/src/GPUTestingEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap

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

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

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

NumDeferredCtx = EnvCI.NumDeferredContexts;
EngineCI.NumDeferredContexts = NumDeferredCtx;
EngineCI.NumDeferredContexts = NumDeferredCtx / 2;
ppContexts.resize(std::max(size_t{1}, ContextCI.size()) + NumDeferredCtx);
pFactoryMtl->CreateDeviceAndContextsMtl(EngineCI, &m_pDevice, ppContexts.data());
}
Expand Down Expand Up @@ -497,6 +497,11 @@ GPUTestingEnvironment::GPUTestingEnvironment(const CreateInfo& EnvCI, const Swap
break;
}

for (Uint32 ctx = EnvCI.NumDeferredContexts / 2; ctx < EnvCI.NumDeferredContexts; ++ctx)
{
m_pDevice->CreateDeferredContext(&ppContexts[std::max(ContextCI.size(), size_t{1}) + ctx]);
}

{
const DeviceFeatures& ActualFeats = m_pDevice->GetDeviceInfo().Features;
#define CHECK_FEATURE_STATE(Feature) \
Expand Down

0 comments on commit 82d2171

Please # to comment.