From fd3974ed96e2df64f0ac67583c84aa602af29292 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Tue, 8 Oct 2024 00:35:13 -0700 Subject: [PATCH] Updates for EyePattern::Refresh signature changes --- lib | 2 +- src/ngscopeclient/Session.h | 3 +++ src/ngscopeclient/WaveformArea.cpp | 11 ++++++++++- src/ngscopeclient/WaveformArea.h | 3 +++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib b/lib index 27e09267..7f13107a 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 27e092677efef456e2f50acbcea7b60b74bf307f +Subproject commit 7f13107aaed51b1540c9595e18d9b4acce3736b6 diff --git a/src/ngscopeclient/Session.h b/src/ngscopeclient/Session.h index 3ed618dd..db08cded 100644 --- a/src/ngscopeclient/Session.h +++ b/src/ngscopeclient/Session.h @@ -136,6 +136,9 @@ class Session bool IsMultiScope() { return m_multiScope; } + MainWindow* GetMainWindow() + { return m_mainWindow; } + /** @brief Returns a pointer to the state for a BERT */ diff --git a/src/ngscopeclient/WaveformArea.cpp b/src/ngscopeclient/WaveformArea.cpp index a96d1544..680026a5 100644 --- a/src/ngscopeclient/WaveformArea.cpp +++ b/src/ngscopeclient/WaveformArea.cpp @@ -66,6 +66,15 @@ DisplayedChannel::DisplayedChannel(StreamDescriptor stream, Session& session) if(schan) schan->AddRef(); + vk::CommandPoolCreateInfo cmdPoolInfo( + vk::CommandPoolCreateFlagBits::eTransient | vk::CommandPoolCreateFlagBits::eResetCommandBuffer, + session.GetMainWindow()->GetRenderQueue()->m_family ); + m_utilCmdPool = std::make_unique(*g_vkComputeDevice, cmdPoolInfo); + vk::CommandBufferAllocateInfo bufinfo(**m_utilCmdPool, vk::CommandBufferLevel::ePrimary, 1); + + m_utilCmdBuffer = make_unique( + std::move(vk::raii::CommandBuffers(*g_vkComputeDevice, bufinfo).front())); + //Use GPU-side memory for rasterized waveform //TODO: instead of using CPU-side mirror, use a shader to memset it when clearing? m_rasterizedWaveform.SetCpuAccessHint(AcceleratorBuffer::HINT_LIKELY); @@ -168,7 +177,7 @@ bool DisplayedChannel::UpdateSize(ImVec2 newSize, MainWindow* top) { eye->SetWidth(roundedX); eye->SetHeight(roundedY); - eye->Refresh(); + eye->Refresh(*m_utilCmdBuffer, m_session.GetMainWindow()->GetRenderQueue()); } x = roundedX; diff --git a/src/ngscopeclient/WaveformArea.h b/src/ngscopeclient/WaveformArea.h index 3fad6cd7..685f320d 100644 --- a/src/ngscopeclient/WaveformArea.h +++ b/src/ngscopeclient/WaveformArea.h @@ -432,6 +432,9 @@ class DisplayedChannel ///@brief Y axis position of our button within the view float m_yButtonPos; + + std::unique_ptr m_utilCmdPool; + std::unique_ptr m_utilCmdBuffer; }; /**