From 4c2df42601490e513578e038fa59d381313df1af Mon Sep 17 00:00:00 2001 From: David Rohr Date: Thu, 22 May 2025 13:43:20 +0200 Subject: [PATCH 1/5] GPU Display: Store pointer to GPUSettingsProcessing, so we do not need to copy debugLevel to GPUParam --- .../Base/GPUReconstructionTimeframe.cxx | 3 +-- .../Interface/GPUO2InterfaceDisplay.cxx | 2 +- GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx | 2 +- GPU/GPUTracking/display/GPUDisplay.cxx | 18 ++++++++++-------- GPU/GPUTracking/display/GPUDisplay.h | 8 +++++++- .../display/GPUDisplayInterface.cxx | 4 ++-- GPU/GPUTracking/display/GPUDisplayInterface.h | 14 ++++++++++++-- .../backend/GPUDisplayBackendOpenGL.cxx | 2 +- .../backend/GPUDisplayBackendVulkan.cxx | 8 ++++---- .../frontend/GPUDisplayFrontendWayland.cxx | 6 +++--- .../display/helpers/GPUDisplayLoader.cxx | 15 +++++++++++++-- .../display/render/GPUDisplayDraw.cxx | 2 +- GPU/GPUTracking/qa/GPUQA.cxx | 2 +- GPU/GPUTracking/qa/genEvents.cxx | 3 +-- 14 files changed, 58 insertions(+), 31 deletions(-) diff --git a/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx b/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx index b25b93e957b15..fefcd0ac925fe 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx @@ -25,14 +25,13 @@ #include "TPCFastTransform.h" #include "CorrectionMapsHelper.h" #include "GPUO2DataTypes.h" +#include "GPUSettings.h" #include #include #include #include -#include "utils/qconfig.h" - using namespace o2::gpu; namespace o2::gpu diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.cxx b/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.cxx index f84f29d826f1d..60d5eaf9ae162 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.cxx +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.cxx @@ -35,7 +35,7 @@ GPUO2InterfaceDisplay::GPUO2InterfaceDisplay(const GPUO2InterfaceConfiguration* mQA.reset(new GPUQA(nullptr, &config->configQA, mParam.get())); mQA->InitO2MCData(); } - mDisplay.reset(GPUDisplayInterface::getDisplay(mFrontend.get(), nullptr, mQA.get(), mParam.get(), &mConfig->configCalib, &mConfig->configDisplay)); + mDisplay.reset(GPUDisplayInterface::getDisplay(mFrontend.get(), nullptr, mQA.get(), mParam.get(), &mConfig->configCalib, &mConfig->configDisplay, &mConfig->configProcessing)); } GPUO2InterfaceDisplay::~GPUO2InterfaceDisplay() = default; diff --git a/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx b/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx index aed42e4f98f0c..9fb12432e763a 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx @@ -42,7 +42,7 @@ #include "GPUGetConstexpr.h" #ifdef GPUCA_CADEBUG_ENABLED -#include "../utils/qconfig.h" +#include "GPUSettings.h" #include "AliHLTTPCClusterMCData.h" #endif diff --git a/GPU/GPUTracking/display/GPUDisplay.cxx b/GPU/GPUTracking/display/GPUDisplay.cxx index 5b0960919da15..136b1947f60ee 100644 --- a/GPU/GPUTracking/display/GPUDisplay.cxx +++ b/GPU/GPUTracking/display/GPUDisplay.cxx @@ -34,7 +34,7 @@ #include "GPUTPCTracker.h" #include "GPUTPCGMMergedTrack.h" #include "GPUO2DataTypes.h" -#include "utils/qconfig.h" +#include "GPUSettings.h" #include "frontend/GPUDisplayFrontend.h" #include "backend/GPUDisplayBackend.h" @@ -44,17 +44,19 @@ constexpr hmm_mat4 MY_HMM_IDENTITY = {{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, using namespace o2::gpu; -static const GPUSettingsDisplay& GPUDisplay_GetConfig(GPUChainTracking* chain) +const GPUSettingsDisplay& GPUDisplay::GetConfig(GPUChainTracking* chain) { static GPUSettingsDisplay defaultConfig; - if (chain && chain->mConfigDisplay) { - return *chain->mConfigDisplay; - } else { - return defaultConfig; - } + return (chain && chain->mConfigDisplay) ? *chain->mConfigDisplay : defaultConfig; +} + +const GPUSettingsProcessing& GPUDisplay::GetProcessingConfig(GPUChainTracking* chain) +{ + static GPUSettingsProcessing defaultConfig; + return chain ? chain->GetProcessingSettings() : defaultConfig; } -GPUDisplay::GPUDisplay(GPUDisplayFrontend* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param, const GPUCalibObjectsConst* calib, const GPUSettingsDisplay* config) : GPUDisplayInterface(), mFrontend(frontend), mChain(chain), mConfig(config ? *config : GPUDisplay_GetConfig(chain)), mQA(qa) +GPUDisplay::GPUDisplay(GPUDisplayFrontend* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param, const GPUCalibObjectsConst* calib, const GPUSettingsDisplay* config, const GPUSettingsProcessing* proc) : GPUDisplayInterface(), mFrontend(frontend), mChain(chain), mConfig(config ? *config : GetConfig(chain)), mProcessingSettings(proc ? *proc : GetProcessingConfig(chain)), mQA(qa) { mParam = param ? param : &mChain->GetParam(); mCalib = calib; diff --git a/GPU/GPUTracking/display/GPUDisplay.h b/GPU/GPUTracking/display/GPUDisplay.h index dbd90020698b2..06977c26e0b63 100644 --- a/GPU/GPUTracking/display/GPUDisplay.h +++ b/GPU/GPUTracking/display/GPUDisplay.h @@ -18,6 +18,7 @@ #include "frontend/GPUDisplayFrontend.h" #include "backend/GPUDisplayBackend.h" #include "GPUDisplayInterface.h" +#include "GPUSettings.h" #include "../utils/vecpod.h" #include "../utils/qsem.h" @@ -37,7 +38,7 @@ class GPUTRDGeometry; class GPUDisplay : public GPUDisplayInterface { public: - GPUDisplay(GPUDisplayFrontend* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param = nullptr, const GPUCalibObjectsConst* calib = nullptr, const GPUSettingsDisplay* config = nullptr); + GPUDisplay(GPUDisplayFrontend* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param = nullptr, const GPUCalibObjectsConst* calib = nullptr, const GPUSettingsDisplay* config = nullptr, const GPUSettingsProcessing* proc = nullptr); GPUDisplay(const GPUDisplay&) = delete; ~GPUDisplay() override = default; @@ -71,6 +72,7 @@ class GPUDisplay : public GPUDisplayInterface }; vecpod* vertexBuffer() { return mVertexBuffer; } const GPUParam* param() { return mParam; } + const GPUSettingsProcessing& GetProcessingSettings() const { return mProcessingSettings; } GPUDisplayFrontend* frontend() { return mFrontend; } bool drawTextInCompatMode() const { return mDrawTextInCompatMode; } int32_t& drawTextFontSize() { return mDrawTextFontSize; } @@ -140,6 +142,9 @@ class GPUDisplay : public GPUDisplayInterface bool mVerbose = false; }; + static const GPUSettingsDisplay& GetConfig(GPUChainTracking* chain); + static const GPUSettingsProcessing& GetProcessingConfig(GPUChainTracking* chain); + void DrawGLScene_internal(float animateTime = -1.f, bool renderToMixBuffer = false); void DrawGLScene_updateEventData(); void DrawGLScene_cameraAndAnimation(float animateTime, float& mixSlaveImage, hmm_mat4& nextViewMatrix); @@ -214,6 +219,7 @@ class GPUDisplay : public GPUDisplayInterface GPUSettingsDisplayLight mCfgL; GPUSettingsDisplayHeavy mCfgH; GPUSettingsDisplayRenderer mCfgR; + const GPUSettingsProcessing& mProcessingSettings; GPUQA* mQA; qSem mSemLockDisplay; diff --git a/GPU/GPUTracking/display/GPUDisplayInterface.cxx b/GPU/GPUTracking/display/GPUDisplayInterface.cxx index 2f5cc9cbb5dd5..2eddef998fa8b 100644 --- a/GPU/GPUTracking/display/GPUDisplayInterface.cxx +++ b/GPU/GPUTracking/display/GPUDisplayInterface.cxx @@ -65,9 +65,9 @@ static void* loadUnloadLib(bool load) return nullptr; } -GPUDisplayInterface* GPUDisplayInterface::getDisplay(GPUDisplayFrontendInterface* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param, const GPUCalibObjectsConst* calib, const GPUSettingsDisplay* config) +GPUDisplayInterface* GPUDisplayInterface::getDisplay(GPUDisplayFrontendInterface* frontend, GPUChainTracking* chain, GPUQA* qa, const GPUParam* param, const GPUCalibObjectsConst* calib, const GPUSettingsDisplay* config, const GPUSettingsProcessing* proc) { - std::tuple args = {frontend, chain, qa, param, calib, config}; + std::tuple args = {frontend, chain, qa, param, calib, config, proc}; auto func = (GPUDisplayInterface * (*)(const char*, void*)) loadUnloadLib(true); return func ? func("display", &args) : nullptr; } diff --git a/GPU/GPUTracking/display/GPUDisplayInterface.h b/GPU/GPUTracking/display/GPUDisplayInterface.h index 3c6928c78e5a1..574a8cffc71f0 100644 --- a/GPU/GPUTracking/display/GPUDisplayInterface.h +++ b/GPU/GPUTracking/display/GPUDisplayInterface.h @@ -15,7 +15,7 @@ #ifndef GPUDISPLAYINTERFACE_H #define GPUDISPLAYINTERFACE_H -#include "GPUSettings.h" +#include namespace o2::gpu { @@ -23,6 +23,16 @@ namespace o2::gpu class GPUChainTracking; class GPUQA; struct GPUParam; +struct GPUTrackingInOutPointers; +template +struct ConstPtr; +template